* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; margin: 0; color: #f5fff7; background: radial-gradient(ellipse at top, #187b50, #073e29); min-height: 100vh; min-height: 100svh; font: 16px/1.7 system-ui, sans-serif; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 24px; }
a { color: #ffe293; }
h1 { margin: 16px 0 4px; font-size: clamp(26px, 5vw, 38px); }
h2 { font-size: 21px; margin: 0 0 12px; }
h3 { font-size: 17px; }
p { margin: 10px 0; }
.panel { padding: 22px; margin: 20px 0; border: 1px solid #ffffff40; border-radius: 16px; background: #042d2290; }
label { display: block; margin-bottom: 12px; }
input:not([type=checkbox]), select { display: block; width: min(100%, 360px); border: 1px solid #b8d9c7; border-radius: 7px; background: #fff; color: #173b2a; padding: 10px; font: inherit; }
input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; }
#code { text-transform: uppercase; }
fieldset { margin: 18px 0; border: 1px solid #ffffff45; border-radius: 8px; }
.rule-description { display: block; margin: 3px 0 0 26px; color: #d2e9da; font-size: 13px; line-height: 1.6; }
button { min-height: 44px; border: 1px solid #f5d67e; background: #ffe293; color: #183a2a; border-radius: 8px; padding: 9px 15px; font: 700 15px/1.5 system-ui, sans-serif; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.secondary { background: transparent; color: #fff; border-color: #ffffff70; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #78c8ff; outline-offset: 3px; }
.join { margin-top: 24px; padding-top: 20px; border-top: 1px solid #ffffff40; }
.match-options { margin: 20px 0; padding: 14px; background: #ffffff0b; border: 1px solid #ffffff35; border-radius: 10px; }
#roomNotice:not(:empty) { padding: 10px 14px; background: #ffe29315; border-left: 3px solid #ffe293; }
.note { font-size: 13px; color: #d2e9da; }
#error { color: #fff; background: #923328; padding: 8px 12px; border-radius: 8px; }
#error:empty { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.toolbar h2 { margin: 0 auto 0 0; }
.players { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.player { padding: 12px; border: 1px solid #ffffff40; border-radius: 9px; overflow-wrap: anywhere; }
.player.active { border: 2px solid #ffe293; background: #ffe29315; }
.player small { display: block; }
.player button { margin-top: 8px; font-size: 12px; }
.cards { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin: 16px 0; }
.card { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; width: 64px; height: 92px; padding: 3px; color: #1f2933; background: #fffcf5; border: 2px solid #fff; border-radius: 7px; font-size: 24px; line-height: 1.25; box-shadow: 0 2px 5px #0004; flex-shrink: 0; }
.card.red { color: #bc263f; }
.card.back { background: var(--card-back-color, #254e70); color: white; font-size: 16px; }
.card.selected { border: 3px solid #ffbd28; transform: translateY(-6px); background: #fff4c9; }
.card:disabled { opacity: .55; }
.card.matched { visibility: hidden; }
.slot { text-align: center; font-size: 13px; }
.slot .card { margin: 4px auto; }
.suit-row { display: flex; gap: 3px; width: 100%; }
.suit-row .card { flex: 1; min-width: 0; max-width: 64px; width: auto; height: 76px; font-size: clamp(11px, 2.7vw, 23px); }
.card.empty { background: #ffffff0a; border-color: #ffffff25; color: #b2d1c1; box-shadow: none; }
body[data-cpu-game] #room > .panel > .note, body[data-cpu-game] main > .note { display: none; }
#board.memory { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; }
.memory .card { width: 100%; height: 76px; min-height: 0; font-size: 20px; }
#log { font-size: 14px; max-height: 300px; overflow: auto; }
#result { font-size: 18px; color: #ffe293; }
@media (max-width: 600px) { .panel { padding: 15px 10px; } .cards { gap: 5px; } .card { width: 54px; height: 80px; font-size: 21px; } #board.memory { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; } .memory .card { height: 66px; font-size: 18px; } .players { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
