:root {
  color-scheme: dark;
  --bg: #0b0a18;
  --panel: #19162c;
  --panel2: #24203d;
  --panel3: #121021;
  --line: #373151;
  --line-soft: rgba(255, 255, 255, .08);
  --text: #faf8ff;
  --muted: #aaa4c0;
  --purple: #a985ff;
  --pink: #ff73b9;
  --cyan: #58e4d8;
  --green: #64e69a;
  --yellow: #ffd06c;
  --red: #ff747d;
  --shadow: 0 22px 60px rgba(0, 0, 0, .34);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 8% -5%, rgba(169, 133, 255, .2), transparent 31rem),
    radial-gradient(circle at 92% 8%, rgba(255, 115, 185, .11), transparent 28rem),
    var(--bg);
}
button, input, textarea { font: inherit; }
button { min-height: 44px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(88, 228, 216, .45); outline-offset: 2px; }

.shell { width: min(1180px, 100%); margin: 0 auto; padding: 18px clamp(16px, 4vw, 44px) max(64px, env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(14, 12, 28, .82); backdrop-filter: blur(18px); box-shadow: var(--shadow-soft); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.account-chip { padding: 8px 11px; border-radius: 999px; color: var(--cyan); background: rgba(77,223,212,.08); border: 1px solid rgba(77,223,212,.28); font-size: .82rem; font-weight: 850; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -.02em; }
.logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(145deg, var(--purple), var(--pink)); box-shadow: 0 10px 30px rgba(156,120,255,.3); }
.status { color: var(--muted); font-size: .86rem; display: flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.status.off { color: #ffb0b5; }
.status.off::before { background: var(--red); box-shadow: 0 0 14px var(--red); }

.hero { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(28px, 6vw, 76px); }
.auth-layout { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(28px, 6vw, 72px); }
.auth-copy h1 { max-width: 720px; }
.auth-panel { max-width: 470px; width: 100%; justify-self: end; }
.eyebrow { color: var(--cyan); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
h1 { margin: 12px 0 18px; font-size: clamp(2.6rem, 7vw, 5.25rem); line-height: .96; letter-spacing: -.06em; }
.gradient { background: linear-gradient(100deg, #fff 5%, #bda8ff 48%, #ff91c7); -webkit-background-clip: text; color: transparent; }
.lead { max-width: 620px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.65; }
.mini-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.chip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #d9d3ec; font-size: .82rem; background: rgba(255,255,255,.025); }
.chip-button { font: inherit; cursor: pointer; }

.panel { background: linear-gradient(160deg, rgba(36,32,61,.97), rgba(22,19,40,.97)); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 30px); box-shadow: var(--shadow); }
.panel h2, .panel h3 { margin-top: 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(0,0,0,.2); padding: 5px; border-radius: 14px; margin-bottom: 20px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 10px; cursor: pointer; }
.tab.active { background: var(--panel2); color: var(--text); font-weight: 800; }
.stack { display: grid; gap: 13px; }
label { color: var(--muted); font-size: .86rem; font-weight: 700; }
input, textarea {
  width: 100%; min-height: 48px; margin-top: 7px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px;
  color: var(--text); background: var(--panel3); outline: none; transition: .2s border, .2s box-shadow;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(156,120,255,.14); }
.code-input { text-transform: uppercase; letter-spacing: .18em; font-size: 1.15rem; font-weight: 900; }
.btn { border: 0; border-radius: 13px; padding: 12px 17px; font-weight: 850; color: #171125; background: var(--text); cursor: pointer; transition: transform .15s, opacity .15s, border-color .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--purple), #c497ff); }
.btn.pink { background: linear-gradient(135deg, var(--pink), #ff9acb); }
.btn.green { background: var(--green); }
.btn.yellow { background: var(--yellow); }
.btn.red { background: var(--red); }
.btn.ghost { color: var(--text); background: transparent; border: 1px solid var(--line); }
.btn.small { padding: 8px 11px; border-radius: 10px; font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.member-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #15122c; }
.member-card small, .member-card strong { display: block; }
.member-card small { color: var(--muted); margin-bottom: 3px; }
.member-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #171125; background: linear-gradient(135deg, var(--cyan), var(--green)); font-weight: 950; }
.hint { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.error { color: #ff9ea4; }

.room-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; margin-bottom: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(25,22,44,.88); box-shadow: var(--shadow-soft); }
.room-code { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel); }
.room-code b { letter-spacing: .16em; color: var(--cyan); }
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.room-tools { display: grid; justify-items: end; gap: 10px; }
.player { padding: 8px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .86rem; }
.player.me { border-color: var(--purple); }
.player.host::after { content: " ★"; color: var(--yellow); }
.player.offline { opacity: .52; filter: grayscale(.6); }

.section-title { margin: 26px 0 14px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.section-title h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.invite-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; margin: 0 0 18px; padding: 18px; border-radius: 18px; border: 1px solid rgba(86,223,136,.35); background: rgba(86,223,136,.08); }
.invite-panel p { margin: 6px 0 10px; color: var(--muted); font-size: .88rem; }
.invite-panel code { display: inline-block; max-width: 100%; color: var(--cyan); overflow-wrap: anywhere; }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.game-card { position: relative; min-height: 168px; text-align: left; color: var(--text); background: linear-gradient(155deg, var(--panel), #151226); border: 1px solid var(--line); border-radius: 19px; padding: 19px; cursor: pointer; transition: transform .16s, border-color .16s, background .16s; }
.game-card:hover { transform: translateY(-2px); }
.game-card:hover { border-color: #655b96; }
.game-card.selected { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(156,120,255,.14); background: linear-gradient(150deg, #302657, #1d1937); }
.game-card .icon { font-size: 2rem; }
.game-card h3 { margin: 12px 0 7px; font-size: 1.05rem; }
.game-card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.game-card small { position: absolute; top: 17px; right: 17px; color: var(--cyan); font-weight: 800; }
.start-dock { position: sticky; bottom: 14px; margin-top: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: rgba(23, 19, 46, .9); backdrop-filter: blur(14px); display: flex; justify-content: space-between; align-items: center; gap: 15px; box-shadow: var(--shadow); }
.settings-panel { margin-top: 20px; padding: 19px; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(145deg, rgba(39,33,69,.9), rgba(24,20,47,.9)); display: grid; grid-template-columns: minmax(220px,.8fr) minmax(360px,1.2fr); align-items: end; gap: 24px; }
.settings-panel h3 { margin: 5px 0; font-size: 1.3rem; }
.settings-panel p { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.settings-grid input { margin-top: 6px; }
.setting-readonly { min-height: 70px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: #15122c; display: grid; align-content: center; }
.setting-readonly small { color: var(--muted); }
.setting-readonly strong { margin-top: 5px; }
.settings-summary { display: flex; justify-content: end; flex-wrap: wrap; gap: 10px; }
.settings-summary span, .goal-chip { padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(77,223,212,.28); color: var(--cyan); background: rgba(77,223,212,.07); font-size: .8rem; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.game-main, .side { background: linear-gradient(160deg, rgba(29,25,52,.98), rgba(20,17,36,.98)); border: 1px solid var(--line); border-radius: 22px; padding: clamp(18px, 4vw, 28px); box-shadow: var(--shadow-soft); }
.side { position: sticky; top: 16px; }
.game-title { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.game-title span { font-size: 2rem; }
.game-title h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: -.04em; }
.goal-chip { display: inline-block; margin-top: 7px; }
.early-confirm { margin-top: 20px; padding: 14px; border-radius: 16px; border: 1px solid rgba(255,200,92,.35); background: rgba(255,200,92,.07); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.early-confirm p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 10px; margin: 15px 0; }
.stat { background: #15122c; border: 1px solid var(--line); border-radius: 15px; padding: 14px; }
.stat small { display: block; color: var(--muted); margin-bottom: 6px; }
.stat strong { font-size: 1.2rem; }
.callout { padding: 16px; border-radius: 16px; background: rgba(77,223,212,.08); border: 1px solid rgba(77,223,212,.32); margin: 15px 0; }
.auction-item { display: grid; place-items: center; min-height: 190px; border: 1px dashed #5b507f; border-radius: 20px; background: radial-gradient(circle, rgba(156,120,255,.17), transparent 65%); text-align: center; }
.auction-item .emoji { font-size: 3rem; }
.auction-item h2 { margin: 8px 0; font-size: clamp(1.7rem, 5vw, 2.7rem); }
.bid-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; gap: 10px; margin-top: 15px; }
.bid-row input { margin: 0; }
.list { display: grid; gap: 9px; margin: 12px 0; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 12px; background: #15122c; border: 1px solid var(--line); border-radius: 13px; }
.row.correct { border-color: rgba(86,223,136,.55); }
.row.wrong { border-color: rgba(255,107,115,.42); }
.answer { display: inline-flex; gap: 6px; align-items: center; font-weight: 850; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.yes { background: var(--green); }.no { background: var(--red); }.maybe { background: var(--yellow); }
.team { padding: 13px; border-radius: 15px; border: 1px solid var(--line); background: #15122c; }
.team.active { border-color: var(--purple); }
.team h3 { margin: 0 0 8px; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 14px 0; }
.chain { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 16px 0; }
.word { padding: 9px 12px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); font-weight: 800; }
.arrow { color: var(--muted); }
.letter { display: grid; place-items: center; width: 112px; height: 112px; margin: 5px auto 20px; border-radius: 30px; font-size: 4.7rem; font-weight: 950; background: linear-gradient(145deg, var(--purple), var(--pink)); box-shadow: 0 18px 50px rgba(156,120,255,.25); }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.pattern { font: 900 clamp(1.45rem, 6vw, 2.4rem)/1 ui-monospace, monospace; letter-spacing: .17em; color: var(--cyan); }
.big-timer { display: grid; place-items: center; width: min(270px, 70vw); aspect-ratio: 1; margin: 20px auto; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #332a63, #17132f 65%); border: 8px solid var(--purple); box-shadow: 0 0 0 12px rgba(156,120,255,.12), var(--shadow); text-align: center; }
.big-timer strong { display: block; font-size: 3.5rem; }
.stop-button { width: 100%; min-height: 90px; font-size: 1.35rem; }
.word-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.word-slot { min-height: 64px; display: grid; place-items: center; padding: 9px; border-radius: 13px; border: 1px solid var(--line); background: #15122c; font-weight: 900; text-align: center; }
.word-slot.open { border-color: var(--cyan); color: var(--cyan); }
.question-box { min-height: 170px; display: grid; place-items: center; padding: 24px; margin: 15px 0; border-radius: 21px; text-align: center; background: linear-gradient(145deg, #302657, #17132f); border: 1px solid #594d86; }
.question-box h2 { margin: 0; font-size: clamp(1.5rem, 5vw, 2.5rem); }
.lives { color: var(--red); letter-spacing: .12em; }
.math-problem { display: grid; place-items: center; min-height: 190px; margin: 14px 0; border-radius: 22px; border: 1px solid var(--line); background: radial-gradient(circle, rgba(77,223,212,.13), transparent 70%); font: 950 clamp(2.6rem, 10vw, 5.5rem)/1 ui-monospace, monospace; }
.age-photo { width: 100%; max-height: 480px; object-fit: contain; border-radius: 20px; background: #0b0918; border: 1px solid var(--line); }
.memory-grid { display: grid; grid-template-columns: repeat(5, minmax(42px, 1fr)); gap: 7px; width: min(520px, 100%); margin: 18px auto; }
.memory-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #15122c; color: var(--text); font-size: clamp(1.2rem, 5vw, 2rem); font-weight: 900; }
button.memory-cell { cursor: pointer; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 15px 0; }
.match-card { min-height: 92px; padding: 9px; border-radius: 15px; border: 1px solid var(--line); color: var(--text); background: linear-gradient(145deg, #2d2554, #1a1633); font-weight: 900; cursor: pointer; overflow-wrap: anywhere; }
.match-card small { display: block; margin-bottom: 5px; color: var(--cyan); font-size: .64rem; line-height: 1.1; }
.match-card span { display: block; font-size: .82rem; line-height: 1.15; }
.match-card.closed { color: transparent; background: linear-gradient(135deg, var(--purple), #513e91); }
.match-card.closed::after { content: "?"; color: white; font-size: 1.8rem; }
.match-card.matched { border-color: var(--green); background: rgba(86,223,136,.12); }
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 18px 0; }
.color-room { min-height: 92px; padding: 10px; border: 2px solid transparent; border-radius: 16px; color: #111; font-weight: 950; cursor: pointer; }
.color-room.selected { border-color: white; box-shadow: 0 0 0 3px var(--purple); }
.score-table { width: 100%; border-collapse: collapse; }
.score-table th, .score-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.leader-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.leader-hero div { padding: 17px; border-radius: 17px; border: 1px solid var(--line); background: var(--panel); }
.leader-hero small, .leader-hero strong { display: block; }
.leader-hero small { color: var(--muted); margin-bottom: 6px; }
.leader-hero strong { color: var(--cyan); font-size: 1.7rem; }
.leaderboard-wrap { overflow-x: auto; }
.leader-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.leader-table th, .leader-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.leader-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.leader-table tr:last-child td { border-bottom: 0; }
.leader-table .leader-me td { background: rgba(77,223,212,.08); color: var(--cyan); }
.rank { counter-reset: rank; }
.rank .row::before { counter-increment: rank; content: counter(rank) "."; color: var(--yellow); font-weight: 900; }
.muted { color: var(--muted); }
.center { text-align: center; }
.empty { padding: 28px; border: 1px dashed var(--line); color: var(--muted); border-radius: 16px; text-align: center; }
#toast { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translate(-50%, 120px); opacity: 0; max-width: min(92vw, 520px); padding: 12px 17px; border-radius: 13px; color: white; background: #3b1830; border: 1px solid var(--pink); box-shadow: var(--shadow); transition: .25s; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

.full-button { width: 100%; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.room-identity { display: grid; justify-items: start; gap: 8px; }
.nav-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.side-section + .side-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.side-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-section h3 span { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; color: var(--cyan); background: rgba(88,228,216,.1); font-size: .78rem; }
.compact-empty { padding: 16px; }

.stay-together { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding: 17px; border: 1px solid rgba(100,230,154,.4); border-radius: 18px; background: linear-gradient(135deg, rgba(100,230,154,.12), rgba(88,228,216,.06)); }
.stay-together > div { display: flex; align-items: center; gap: 12px; }
.stay-together p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.stay-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #0d1a13; background: var(--green); font-weight: 950; }
.waiting-pill { padding: 9px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; white-space: nowrap; }

.course-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 14px 16px; border: 1px solid rgba(169,133,255,.42); border-radius: 16px; background: rgba(169,133,255,.1); }
.course-banner small, .course-banner strong { display: block; }
.course-banner small { margin-bottom: 4px; color: var(--muted); }
.course-banner strong { font-size: 1.12rem; }
.course-banner > span { padding: 8px 11px; border-radius: 999px; color: #181225; background: var(--purple); font-weight: 950; }
.course-pill { display: inline-flex; padding: 7px 10px; border: 1px solid rgba(88,228,216,.35); border-radius: 999px; color: var(--cyan); background: rgba(88,228,216,.08); font-size: .8rem; font-weight: 850; }
.auction-item p { max-width: 520px; margin: 8px auto 0; color: var(--muted); line-height: 1.5; }
.result-hero { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; padding: 20px; border: 1px solid rgba(255,208,108,.38); border-radius: 19px; background: linear-gradient(135deg, rgba(255,208,108,.12), rgba(255,115,185,.06)); }
.result-hero > span { font-size: 2.6rem; }
.result-hero h2 { margin: 3px 0 6px; }
.result-hero p { margin: 0; color: var(--muted); line-height: 1.5; }

.round-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.round-heading .letter { flex: 0 0 auto; width: 88px; height: 88px; margin: 0; border-radius: 24px; font-size: 3.4rem; }
.round-heading h2 { margin: 4px 0; }
.answer-review { display: grid; gap: 14px; margin-top: 18px; }
.answer-player { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(12,10,26,.28); }
.answer-player h3 { margin: 0 0 12px; }
.answer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.answer-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel3); }
.answer-card small, .answer-card strong, .answer-card span { display: block; overflow-wrap: anywhere; }
.answer-card small { color: var(--muted); }
.answer-card strong { margin: 6px 0; }
.answer-card span { font-size: .75rem; line-height: 1.35; }
.answer-card.valid { border-color: rgba(100,230,154,.42); }
.answer-card.valid span { color: var(--green); }
.answer-card.invalid { border-color: rgba(255,116,125,.3); }
.answer-card.invalid span { color: #ffabb1; }

.leaderboard-title .hint { margin: 6px 0 0; }
.leader-list { display: grid; gap: 9px; }
.leader-row { display: grid; grid-template-columns: 54px minmax(160px, 1fr) repeat(3, minmax(80px, .45fr)); align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel3); }
.leader-row.leader-me { border-color: rgba(88,228,216,.52); background: rgba(88,228,216,.08); }
.leader-rank { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--panel2); font-weight: 950; }
.leader-name strong, .leader-name small, .leader-metric small, .leader-metric strong { display: block; }
.leader-name small, .leader-metric small { color: var(--muted); font-size: .75rem; }
.leader-name small { margin-top: 4px; }
.leader-metric { text-align: right; }
.leader-metric strong { margin-top: 3px; color: var(--cyan); }

.setup-stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; padding: 8px; border: 1px solid var(--line); border-radius: 17px; background: rgba(18,16,33,.78); }
.setup-step { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 11px; border-radius: 12px; color: var(--muted); }
.setup-step span { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; font-weight: 950; }
.setup-step small { font-weight: 800; }
.setup-step.active { color: var(--text); background: var(--panel2); }
.setup-step.active span { color: #171125; border-color: var(--purple); background: var(--purple); }
.setup-step.done { color: var(--cyan); }
.setup-step.done span { color: #10201e; border-color: var(--cyan); background: var(--cyan); }
.setup-content { min-height: 420px; }
.setup-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 8px 0 18px; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--line); border-radius: 23px; background: linear-gradient(145deg, rgba(36,32,61,.94), rgba(19,17,35,.94)); }
.setup-hero h2 { margin: 7px 0; font-size: clamp(1.8rem, 5vw, 3rem); }
.setup-hero p { max-width: 630px; margin: 0; color: var(--muted); line-height: 1.55; }
.room-code-large { flex: 0 0 auto; padding: 16px 20px; border: 1px solid rgba(88,228,216,.38); border-radius: 17px; background: rgba(88,228,216,.08); text-align: center; }
.room-code-large small, .room-code-large strong { display: block; }
.room-code-large small { color: var(--muted); }
.room-code-large strong { margin-top: 6px; color: var(--cyan); font-size: 1.45rem; letter-spacing: .18em; }
.waiting-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.compact-panel { padding: 20px; }
.small-title { margin-top: 0; }
.member-list { display: grid; gap: 9px; }
.member-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel3); }
.member-row small, .member-row strong { display: block; }
.member-row small { margin-top: 3px; color: var(--muted); }
.online-pill, .player-count-pill { padding: 7px 10px; border: 1px solid rgba(100,230,154,.3); border-radius: 999px; color: var(--green); background: rgba(100,230,154,.08); font-size: .75rem; font-weight: 850; }
.setup-action { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.setup-action h3 { margin: 10px 0 6px; }
.setup-action p { margin: 0; color: var(--muted); line-height: 1.5; }
.setup-big-icon { font-size: 2.5rem; }
.waiting-card { margin-top: 14px; padding: 16px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.02); text-align: center; line-height: 1.5; }
.game-card .select-label { display: block; margin-top: 15px; color: var(--cyan); font-size: .78rem; font-weight: 850; }
.game-card.unavailable { opacity: .48; }
.game-card.unavailable .select-label { color: var(--muted); }
.settings-focus { display: grid; grid-template-columns: .85fr 1.15fr; gap: 16px; padding: clamp(18px,4vw,28px); border: 1px solid var(--line); border-radius: 23px; background: linear-gradient(150deg, var(--panel), #141124); box-shadow: var(--shadow-soft); }
.selected-game-summary { display: flex; align-items: flex-start; gap: 15px; padding: 19px; border: 1px solid rgba(169,133,255,.35); border-radius: 18px; background: rgba(169,133,255,.09); }
.selected-game-summary > span { font-size: 2.4rem; }
.selected-game-summary small { color: var(--cyan); font-weight: 850; }
.selected-game-summary h3 { margin: 5px 0 7px; font-size: 1.35rem; }
.selected-game-summary p { margin: 0; color: var(--muted); line-height: 1.5; }
.settings-form-focus { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-form-focus label small { display: block; margin-top: 6px; color: var(--muted); font-weight: 500; }
.settings-form-focus .setting-readonly span { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.setup-continue { grid-column: 1 / -1; }
.settings-wait { display: grid; align-content: center; }
.briefing-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.guide-summary { box-shadow: var(--shadow-soft); }
.guide-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; border-radius: 18px; background: linear-gradient(145deg, rgba(169,133,255,.23), rgba(255,115,185,.14)); font-size: 2rem; }
.guide-summary h2, .guide-modal h2 { margin: 8px 0 18px; font-size: clamp(1.55rem,4vw,2.3rem); line-height: 1.15; }
.guide-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: guide-step; }
.guide-steps li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; color: #ded9ee; line-height: 1.5; counter-increment: guide-step; }
.guide-steps li::before { content: counter(guide-step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #171125; background: var(--purple); font-weight: 950; }
.guide-score { margin-top: 18px; padding: 14px; border: 1px solid rgba(255,208,108,.32); border-radius: 14px; background: rgba(255,208,108,.07); }
.guide-score small, .guide-score strong { display: block; }
.guide-score small { margin-bottom: 5px; color: var(--yellow); text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.guide-score strong { line-height: 1.45; }
.ready-panel { position: sticky; top: 92px; padding: 20px; }
.ready-list { display: grid; gap: 8px; }
.ready-row { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel3); }
.ready-row > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--muted); background: var(--panel2); font-weight: 950; }
.ready-row.ready { border-color: rgba(100,230,154,.36); }
.ready-row.ready > span { color: #102018; background: var(--green); }
.ready-row small, .ready-row strong { display: block; }
.ready-row small { margin-top: 3px; color: var(--muted); }
.ready-progress { height: 8px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: var(--panel3); }
.ready-progress div { height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--cyan),var(--green)); transition: width .25s; }
.ready-panel > p { color: var(--muted); font-size: .82rem; text-align: center; }
.guide-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(5,4,12,.78); backdrop-filter: blur(10px); }
.guide-modal { width: min(620px,100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: clamp(22px,5vw,34px); border: 1px solid #544a76; border-radius: 25px; background: linear-gradient(160deg,#272143,#151226); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.guide-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.guide-actions .btn { min-width: 180px; }
.food-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0; }
.food-facts span { padding: 6px 10px; border: 1px solid #554a77; border-radius: 999px; background: rgba(255,255,255,.04); font-size: .86rem; }
.food-ingredients { margin-bottom: 8px; color: #ddd5f7; }
.result-pop-icon { margin-bottom: 8px; font-size: 3.8rem; line-height: 1; }
.round-result-overlay .guide-modal { width: min(540px,100%); }

.active-rooms { margin: 8px 0 32px; }
.active-room-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.active-room { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: var(--panel3); text-align: left; cursor: pointer; }
.active-room:hover { border-color: var(--cyan); transform: translateY(-1px); }
.active-room strong,.active-room small { display:block; }
.active-room small { margin-top:4px; color:var(--muted); }
.active-room b { color:var(--cyan); letter-spacing:.1em; }
.room-password { padding:5px 8px; border:1px solid rgba(255,208,108,.32); border-radius:9px; color:var(--yellow); font-size:.72rem; }
.room-shell { transition:width .2s ease, margin .2s ease; }
.room-chat { position:fixed; z-index:60; top:92px; right:18px; bottom:18px; width:62px; margin:0; overflow:hidden; border:1px solid var(--line); border-radius:20px; background:rgba(18,16,33,.96); box-shadow:0 18px 50px rgba(0,0,0,.32); backdrop-filter:blur(18px); transition:width .22s ease,border-color .2s ease,transform .2s ease; }
.room-chat[open] { width:320px; border-color:rgba(88,228,216,.38); box-shadow:0 24px 70px rgba(0,0,0,.48); }
.room-admin { margin:-10px 0 18px; border:1px solid rgba(255,208,108,.28); border-radius:16px; background:rgba(18,16,33,.9); }
.room-admin summary { padding:12px 15px; cursor:pointer; color:var(--yellow); font-weight:850; list-style:none; }
.room-admin summary::-webkit-details-marker { display:none; }
.room-admin-body { display:grid; grid-template-columns:minmax(260px,.8fr) 1.2fr; gap:16px; padding:0 14px 14px; }
.admin-password { display:flex; align-items:end; gap:8px; }
.admin-password label { flex:1; }
.admin-password input { margin:6px 0 0; }
.admin-players { display:flex; flex-direction:column; gap:7px; }
.admin-players>div { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border:1px solid var(--line); border-radius:11px; }
.admin-players .actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.btn.danger { border-color:rgba(255,116,125,.5); color:#ff969e; background:rgba(255,116,125,.08); }
.room-chat summary { display:flex; height:100%; align-items:center; flex-direction:column; justify-content:flex-start; gap:12px; padding:15px 10px; cursor:pointer; font-weight:850; list-style:none; }
.room-chat[open] summary { height:64px; flex-direction:row; gap:10px; padding:11px 13px; border-bottom:1px solid var(--line); }
.room-chat summary::-webkit-details-marker { display:none; }
.chat-icon { display:grid; flex:0 0 auto; place-items:center; width:40px; height:40px; border-radius:13px; background:linear-gradient(145deg,rgba(169,133,255,.32),rgba(88,228,216,.2)); font-size:1.1rem; }
.chat-heading { display:none; min-width:0; flex:1; }
.room-chat[open] .chat-heading { display:grid; gap:2px; }
.chat-heading strong { color:var(--text); font-size:.9rem; }
.chat-heading small { color:var(--muted); font-size:.68rem; font-weight:600; }
.chat-count { display:grid; place-items:center; min-width:26px; height:26px; padding:0 7px; border-radius:999px; color:#11101f; background:var(--cyan); font-size:.75rem; }
.room-chat:not([open]) .chat-count { min-width:22px; width:22px; height:22px; padding:0; font-size:.65rem; }
.chat-chevron { color:var(--muted); font-size:1.5rem; line-height:1; }
.room-chat[open] .chat-chevron { transform:rotate(180deg); }
.chat-body { display:flex; height:calc(100% - 64px); flex-direction:column; padding:10px; }
.room-chat[open] .chat-body { position:absolute; inset:64px 0 0; height:auto; }
.chat-messages { display:flex; min-height:0; flex:1; flex-direction:column; gap:8px; padding:10px; overflow-y:auto; border-radius:14px; background:rgba(5,4,12,.42); scrollbar-color:#4e466c transparent; }
.chat-message { align-self:flex-start; max-width:85%; padding:8px 11px; border:1px solid var(--line); border-radius:13px 13px 13px 4px; background:var(--panel2); overflow-wrap:anywhere; }
.chat-message.mine { align-self:flex-end; border-radius:13px 13px 4px 13px; background:rgba(169,133,255,.16); }
.chat-message small,.chat-message span { display:block; }
.chat-message small { margin-bottom:3px; color:var(--cyan); font-size:.68rem; }
.chat-welcome { display:grid; place-items:center; margin:auto; padding:20px; color:var(--muted); text-align:center; }
.chat-welcome>span { margin-bottom:8px; font-size:2rem; }
.chat-welcome strong { color:var(--text); }
.chat-welcome small { margin-top:4px; }
.chat-form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; margin-top:8px; padding-top:8px; border-top:1px solid var(--line-soft); }
.chat-form input { margin:0; }
.create-fields { display:grid; grid-template-columns:1.25fr .75fr; gap:12px; }
.create-fields small { display:block; margin-top:6px; color:var(--muted); font-weight:500; line-height:1.4; }
.room-preferences { align-items:end; }
.room-option-field > span:first-child { display:block; margin-bottom:7px; }
.select-shell { position:relative; display:flex; align-items:center; min-height:48px; border:1px solid var(--line); border-radius:13px; color:var(--text); background:var(--panel3); transition:.2s border-color,.2s box-shadow,.2s background; }
.select-shell:focus-within { border-color:var(--purple); box-shadow:0 0 0 3px rgba(156,120,255,.14); background:#171329; }
.select-shell select { width:100%; min-height:46px; padding:0 42px 0 46px; border:0; appearance:none; -webkit-appearance:none; color:var(--text); background:transparent; outline:0; font:inherit; font-weight:750; cursor:pointer; }
.select-shell select option { color:var(--text); background:var(--panel3); }
.option-icon { display:grid; place-items:center; width:31px; height:31px; border-radius:10px; color:#171125; background:linear-gradient(135deg,var(--cyan),var(--green)); font-size:.92rem; box-shadow:0 6px 18px rgba(88,228,216,.12); }
.select-shell .option-icon { position:absolute; left:8px; pointer-events:none; }
.select-chevron { position:absolute; right:14px; color:var(--purple); font-size:1.1rem; pointer-events:none; }
.late-join-card { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:72px; padding:13px 14px; border:1px solid var(--line); border-radius:16px; color:var(--text); background:linear-gradient(145deg,rgba(31,27,55,.96),rgba(18,16,33,.96)); cursor:pointer; transition:.2s border-color,.2s background,.2s box-shadow; }
.late-join-card:hover { border-color:rgba(169,133,255,.65); background:linear-gradient(145deg,rgba(40,33,71,.98),rgba(22,18,42,.98)); }
.late-join-card:has(.switch-input:checked) { border-color:rgba(88,228,216,.48); background:linear-gradient(145deg,rgba(25,55,62,.75),rgba(26,23,49,.98)); box-shadow:inset 0 0 0 1px rgba(88,228,216,.06); }
.late-join-copy { display:flex; align-items:center; gap:11px; min-width:0; }
.late-join-copy > span:last-child { display:grid; gap:3px; }
.late-join-copy strong { color:var(--text); font-size:.88rem; }
.late-join-copy small { color:var(--muted); font-size:.75rem; font-weight:500; line-height:1.35; }
.switch-input { position:absolute; width:1px; height:1px; margin:0; opacity:0; pointer-events:none; }
.switch-ui { position:relative; flex:0 0 48px; width:48px; height:28px; border:1px solid #544c70; border-radius:999px; background:#292440; box-shadow:inset 0 2px 6px rgba(0,0,0,.28); transition:.2s background,.2s border-color; }
.switch-ui::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#c9c3d9; box-shadow:0 3px 8px rgba(0,0,0,.32); transition:.2s transform,.2s background; }
.switch-input:focus-visible + .switch-ui { outline:3px solid rgba(88,228,216,.45); outline-offset:3px; }
.switch-input:checked + .switch-ui { border-color:var(--cyan); background:linear-gradient(135deg,var(--cyan),var(--green)); }
.switch-input:checked + .switch-ui::after { transform:translateX(20px); background:#101d22; }
.mine-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; width:min(520px,100%); margin:18px auto; }
.mine-cell { aspect-ratio:1; border:1px solid #574b78; border-radius:10px; color:var(--text); background:linear-gradient(145deg,#332d51,#1b1830); font-size:clamp(.9rem,4vw,1.45rem); cursor:pointer; }
.mine-cell:not(:disabled):hover { border-color:var(--cyan); }
.mine-cell.safe { color:var(--green); background:rgba(100,230,154,.09); }
.mine-cell.bomb { background:rgba(255,116,125,.15); }
.mine-cell.placing { border-color:var(--pink); background:linear-gradient(145deg,rgba(255,115,185,.34),rgba(169,133,255,.2)); box-shadow:inset 0 0 0 2px rgba(255,255,255,.08); }
.mine-turn-active { border-color:rgba(100,230,154,.46); background:rgba(100,230,154,.08); box-shadow:0 0 0 3px rgba(100,230,154,.08); }
.mine-grid.selectable .mine-cell:not(:disabled) { border-color:rgba(100,230,154,.42); box-shadow:inset 0 0 0 1px rgba(100,230,154,.08); }
.mine-grid.selectable .mine-cell:not(:disabled):hover { border-color:var(--green); background:linear-gradient(145deg,#3b4261,#202d3d); transform:translateY(-2px); }
.mine-grid.waiting .mine-cell:not(.safe):not(.bomb) { opacity:.58; }
.mine-cell.choosing { border-color:var(--cyan); background:rgba(88,228,216,.18); animation:mineChoosing .65s ease infinite alternate; }
@keyframes mineChoosing { to { box-shadow:0 0 18px rgba(88,228,216,.45); } }
.minesweeper-toolbar { display:flex; justify-content:center; gap:8px; margin:14px 0; }
.classic-mine-grid { display:grid; grid-template-columns:repeat(9,1fr); gap:3px; width:min(540px,100%); margin:16px auto; padding:7px; border:1px solid #574b78; border-radius:14px; background:#151326; touch-action:manipulation; }
.classic-mine-cell { display:grid; place-items:center; aspect-ratio:1; min-width:0; padding:0; border:1px solid #615781; border-radius:6px; color:#f5f1ff; background:linear-gradient(145deg,#3c355b,#211d38); font-size:clamp(.72rem,3.2vw,1.18rem); font-weight:950; cursor:pointer; }
.classic-mine-cell:not(:disabled):hover { border-color:var(--cyan); transform:translateY(-1px); }
.classic-mine-cell.open { border-color:#302b48; background:#d9d3e5; }
.classic-mine-cell.mine { background:rgba(255,116,125,.18); }
.classic-mine-cell.exploded { background:#d43d51; }
.classic-mine-cell.n1 { color:#245edb; }.classic-mine-cell.n2 { color:#218343; }.classic-mine-cell.n3 { color:#d03a3a; }.classic-mine-cell.n4 { color:#6242a3; }.classic-mine-cell.n5,.classic-mine-cell.n6,.classic-mine-cell.n7,.classic-mine-cell.n8 { color:#8d2e50; }
.pisti-table { display:flex; align-items:center; justify-content:center; gap:28px; min-height:190px; margin:18px 0; padding:20px; border:1px solid var(--line); border-radius:20px; background:radial-gradient(circle,#285841 0,#173629 45%,#101d19 100%); }
.deck-stack,.table-pile { display:grid; place-items:center; gap:5px; }
.deck-stack>span,.playing-card { display:flex; flex-direction:column; justify-content:space-between; width:76px; height:108px; padding:9px; border:2px solid #eee; border-radius:10px; color:#191522; background:#fff; box-shadow:0 7px 15px rgba(0,0,0,.28); font-style:normal; }
.deck-stack>span { place-items:center; color:#7260ad; background:repeating-linear-gradient(45deg,#241d40,#241d40 5px,#4c3d79 5px,#4c3d79 10px); font-size:2.4rem; }
.playing-card.red { color:#d72f47; }
.playing-card b { font-size:1.2rem; }
.playing-card i { align-self:flex-end; font-size:1.7rem; font-style:normal; }
.table-pile small,.deck-stack small { color:#fff; }
.empty-pile { display:grid; place-items:center; width:76px; height:108px; border:2px dashed rgba(255,255,255,.3); border-radius:10px; color:rgba(255,255,255,.65); }
.card-hand { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:14px 0; }
.card-hand button { padding:0; border:0; border-radius:10px; background:none; cursor:pointer; }
.card-hand button:not(:disabled):hover { transform:translateY(-8px); }
.card-hand button:disabled { opacity:.56; }
.dart-arena { position:relative; display:grid; place-items:center; min-height:420px; overflow:hidden; margin:16px 0; border:1px solid var(--line); border-radius:22px; background:radial-gradient(circle at 50% 50%,#272242,#11101f 68%); }
.dart-board { position:relative; width:min(230px,52vw); aspect-ratio:1; border:12px solid #24212b; border-radius:50%; background:repeating-conic-gradient(from -9deg,#eee 0 9deg,#222 9deg 18deg); box-shadow:inset 0 0 0 22px #d9c6a3,inset 0 0 0 30px #b12d3f,inset 0 0 0 48px #1d734f,inset 0 0 0 95px transparent,inset 0 0 0 105px #b12d3f,inset 0 0 0 117px #1d734f; cursor:crosshair; transition:transform 90ms cubic-bezier(.2,.9,.4,1); will-change:transform; }
.dart-board:disabled { opacity:.72; cursor:not-allowed; }
.dart-board .bull { position:absolute; inset:50% auto auto 50%; display:grid; place-items:center; width:38px; height:38px; transform:translate(-50%,-50%); border:7px solid #198052; border-radius:50%; color:white; background:#c73045; font-size:.68rem; font-weight:900; }

@media (max-width: 820px) {
  .hero, .auth-layout { grid-template-columns: 1fr; padding-top: 24px; }
  .auth-panel { justify-self: stretch; max-width: none; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .game-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .settings-panel { grid-template-columns: 1fr; }
  .answer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leader-row { grid-template-columns: 48px minmax(140px, 1fr) repeat(2, minmax(70px, .4fr)); }
  .leader-row .leader-metric:last-child { display: none; }
  .waiting-grid, .settings-focus, .briefing-layout { grid-template-columns: 1fr; }
  .ready-panel { position: static; }
  .active-room-list { grid-template-columns:1fr 1fr; }
  .room-admin-body { grid-template-columns:1fr; }
}
@media (min-width: 1001px) {
  body.in-room .room-shell { width:min(1180px,calc(100% - 104px)); }
  body.chat-panel-open .room-shell { width:min(1180px,calc(100% - 362px)); margin-left:max(16px,calc((100vw - 1540px)/2)); margin-right:344px; }
}
@media (max-width: 1000px) {
  body.chat-panel-open { overflow:hidden; }
  body.chat-panel-open::before { content:""; position:fixed; z-index:55; inset:0; background:rgba(4,3,12,.62); backdrop-filter:blur(3px); }
  .room-chat { top:auto; right:12px; bottom:max(12px,env(safe-area-inset-bottom)); width:58px; height:58px; border-radius:19px; }
  .room-chat[open] { right:10px; bottom:max(8px,env(safe-area-inset-bottom)); left:10px; width:auto; height:min(620px,76vh); border-radius:24px; }
  .room-chat summary { padding:9px; justify-content:center; }
  .room-chat[open] summary { justify-content:flex-start; }
  .room-chat:not([open]) .chat-count { position:absolute; top:2px; right:2px; border:2px solid #121021; }
  .room-chat:not([open]) .chat-chevron { display:none; }
  .chat-body { padding:10px 10px max(10px,env(safe-area-inset-bottom)); }
}
@media (max-width: 540px) {
  .shell { padding: 10px 10px max(50px, env(safe-area-inset-bottom)); }
  .topbar { top: 6px; margin-bottom: 12px; padding: 8px; border-radius: 15px; }
  .logo { width: 38px; height: 38px; border-radius: 12px; }
  .brand span:last-child { display: none; }
  .status { display: none; }
  .top-actions { gap: 5px; }
  .account-chip { display: none; }
  .nav-button span { display: none; }
  .room-head { grid-template-columns: 1fr; padding: 13px; border-radius: 17px; }
  .room-tools { justify-items: start; }
  .room-code { width: 100%; justify-content: space-between; }
  .room-tools, .players { width: 100%; }
  .players { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
  .player { flex: 0 0 auto; }
  .invite-panel { grid-template-columns: 1fr; }
  .invite-panel .btn { width: 100%; }
  .game-grid, .category-grid, .team-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 0; padding: 17px; }
  .game-card p { padding-right: 10px; }
  .start-dock { align-items: stretch; flex-direction: column; }
  .start-dock .btn { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .early-confirm { align-items: stretch; flex-direction: column; }
  .early-confirm .btn { width: 100%; }
  .word-board { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .match-card { min-height: 82px; padding: 7px; }
  .match-card span { font-size: .74rem; }
  .color-grid { grid-template-columns: repeat(2, 1fr); }
  .leader-hero { grid-template-columns: 1fr; }
  .stay-together, .result-hero, .round-heading { align-items: stretch; flex-direction: column; }
  .stay-together > div { align-items: flex-start; }
  .stay-together .btn, .waiting-pill { width: 100%; text-align: center; }
  .round-heading .letter { width: 78px; height: 78px; font-size: 3rem; }
  .answer-grid { grid-template-columns: 1fr; }
  .leaderboard-title { align-items: stretch; flex-direction: column; }
  .leaderboard-title .btn { width: 100%; }
  .leader-row { grid-template-columns: 42px minmax(0, 1fr) 72px; padding: 11px; }
  .leader-row .leader-metric { display: none; }
  .leader-row .leader-metric:nth-last-child(2) { display: block; }
  .leader-rank { width: 38px; height: 38px; }
  .bid-row { grid-template-columns: 1fr; }
  .bid-row .btn { width: 100%; }
  .course-banner { align-items: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-main, .side { border-radius: 18px; }
  .setup-stepper { gap: 3px; padding: 5px; }
  .setup-step { justify-content: center; padding: 8px 4px; }
  .setup-step span { width: 26px; height: 26px; }
  .setup-step small { display: none; }
  .setup-step.active small { display: block; font-size: .68rem; }
  .setup-hero { align-items: stretch; flex-direction: column; padding: 19px; }
  .room-code-large { width: 100%; }
  .settings-form-focus { grid-template-columns: 1fr; }
  .setup-continue { grid-column: auto; }
  .selected-game-summary { padding: 16px; }
  .guide-overlay { align-items: end; padding: 0; }
  .guide-modal { width: 100%; max-height: 92vh; padding: 22px 18px max(22px,env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .guide-actions .btn { width: 100%; }
  .briefing-layout .panel { padding: 18px; }
  .active-room-list { grid-template-columns:1fr; }
  .room-chat[open] { right:6px; left:6px; height:min(560px,82dvh); border-radius:22px; }
  .chat-form { grid-template-columns:minmax(0,1fr) auto; }
  .chat-form input { min-height:46px; }
  .chat-form .btn { width:auto; padding-inline:13px; }
  .create-fields { grid-template-columns:1fr; }
  .late-join-card { align-items:flex-start; padding:13px; }
  .late-join-copy { align-items:flex-start; }
  .late-join-copy .option-icon { flex:0 0 31px; }
  .switch-ui { margin-top:2px; }
  .mine-grid { gap:4px; }
  .mine-cell { border-radius:7px; }
  .classic-mine-grid { gap:2px; padding:5px; }
  .classic-mine-cell { border-radius:4px; }
  .dart-arena { min-height:330px; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .01ms !important;
}

:focus-visible {
  outline: 3px solid #62f7df;
  outline-offset: 3px;
}
/* Premium Aurora UI 2026-08-13 */
:root{--bg:#070711;--panel:rgba(19,18,39,.78);--line:rgba(255,255,255,.1);--text:#f7f4ff;--muted:#aaa4bd;--violet:#9b7bff;--pink:#ff6fbd;--cyan:#53e4dc;--shadow:0 24px 80px rgba(0,0,0,.38);--soft-shadow:0 12px 38px rgba(0,0,0,.24)}
html{background:#070711}body{min-height:100vh;background:radial-gradient(900px 600px at 8% -10%,rgba(123,88,255,.22),transparent 65%),radial-gradient(780px 580px at 98% 8%,rgba(255,80,180,.14),transparent 62%),linear-gradient(145deg,#070711 0%,#0c0a1b 46%,#10091a 100%);color:var(--text)}
body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.26;background-image:linear-gradient(rgba(255,255,255,.018) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px);background-size:46px 46px}
.shell{width:min(1220px,calc(100% - 42px));padding:24px 0 64px}.topbar{position:sticky;top:14px;z-index:20;padding:11px 14px;border:1px solid var(--line);border-radius:22px;background:rgba(10,9,23,.72);backdrop-filter:blur(22px) saturate(140%);box-shadow:0 15px 50px rgba(0,0,0,.22)}
.hero{min-height:590px;align-items:center;gap:76px;padding:72px 0 58px}.hero h1{font-size:clamp(54px,7vw,92px);line-height:.92;letter-spacing:-.065em;max-width:760px}.hero .lead{max-width:650px;font-size:18px;line-height:1.7;color:#b8b1cb}.eyebrow{letter-spacing:.16em;font-size:11px;color:var(--cyan)}.gradient{background:linear-gradient(110deg,#fff 8%,#cbb7ff 48%,#ff84c8 92%);background-clip:text;-webkit-background-clip:text;color:transparent}
.panel,.game-card,.active-room,.leader-row,.room-head,.room-admin,.room-chat{border:1px solid var(--line);background:linear-gradient(145deg,rgba(28,25,55,.86),rgba(13,12,29,.82));box-shadow:var(--soft-shadow);backdrop-filter:blur(18px)}.panel{border-radius:28px;padding:28px}.hero>.panel{position:relative;overflow:hidden;box-shadow:var(--shadow);border-color:rgba(174,135,255,.28)}
.tabs{padding:5px;border:1px solid rgba(255,255,255,.06);background:rgba(5,5,14,.44);border-radius:16px}.tab{border-radius:12px}.tab.active{background:linear-gradient(135deg,rgba(151,112,255,.28),rgba(255,107,190,.13))}
input,textarea,select{min-height:50px;border-radius:14px!important;border:1px solid rgba(255,255,255,.11)!important;background:rgba(5,5,14,.52)!important;transition:.2s}input:focus,textarea:focus,select:focus{border-color:rgba(162,126,255,.65)!important;box-shadow:0 0 0 4px rgba(149,108,255,.13)!important;outline:none}
.btn{min-height:43px;border-radius:13px;font-weight:750;transition:.2s}.btn:hover{transform:translateY(-2px)}.btn.primary,.btn.pink{background:linear-gradient(115deg,#8e6cf7,#bd78f9 52%,#f267b8);color:#100b1c;box-shadow:0 12px 28px rgba(157,103,246,.25)}.btn.ghost{background:rgba(255,255,255,.035);border-color:rgba(255,255,255,.12)}
.chip{border-color:rgba(255,255,255,.1);background:rgba(255,255,255,.035)}.active-rooms{margin-top:16px;padding:30px}.active-room-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.active-room{display:flex!important;padding:0!important;border-radius:19px!important;overflow:hidden;transition:.2s}.active-room:hover{transform:translateY(-3px);border-color:rgba(160,126,255,.4);box-shadow:0 20px 46px rgba(0,0,0,.28)}
.active-room-join{display:flex;align-items:center;justify-content:space-between;gap:14px;flex:1;padding:18px 19px;background:transparent;color:inherit;border:0;text-align:left;cursor:pointer}.active-room-join span{display:grid;gap:5px}.active-room-join small{color:var(--muted)}.active-room-join b{letter-spacing:.16em;color:var(--cyan)}.room-moderate-close{margin:10px;padding:0 14px;border:1px solid rgba(255,100,140,.3);border-radius:12px;background:rgba(255,70,115,.11);color:#ff9bb8;font-weight:800;cursor:pointer}
.member-card,.late-join-card{border-radius:17px;background:rgba(255,255,255,.035);border-color:rgba(255,255,255,.09)}.game-grid{gap:16px}.game-card{border-radius:22px;padding:23px;min-height:190px;transition:.22s}.game-card:hover{transform:translateY(-5px);border-color:rgba(158,121,255,.42);box-shadow:0 22px 52px rgba(0,0,0,.3)}
.game-title h1,.section-title h2{letter-spacing:-.04em}.room-head{border-radius:22px;padding:18px 20px}.player{background:rgba(255,255,255,.045);border-color:rgba(255,255,255,.1)}.room-chat{border-radius:22px}.chat-message span{border-radius:14px}.leader-row{border-radius:18px}.toast{border-radius:16px;box-shadow:var(--shadow)}
@media(max-width:900px){.shell{width:min(100% - 24px,760px);padding-top:12px}.topbar{top:8px}.hero{grid-template-columns:1fr!important;gap:30px;padding:45px 0 32px;min-height:auto}.hero h1{font-size:clamp(52px,15vw,76px)}.hero>.panel{width:100%}.active-room-list{grid-template-columns:1fr}.panel{padding:21px;border-radius:23px}}
@media(max-width:560px){.shell{width:calc(100% - 16px)}.topbar{border-radius:17px;padding:9px}.hero{padding-top:34px}.hero h1{font-size:50px}.hero .lead{font-size:16px}.panel{padding:17px}.active-rooms{padding:17px}.active-room-join{padding:15px}.room-moderate-close{font-size:11px;padding:0 9px}.game-card{min-height:160px;padding:19px}.create-fields{grid-template-columns:1fr!important}}@media(max-width:760px){.topbar{position:relative;top:auto;flex-wrap:wrap}.topbar .nav-actions,.topbar>div:last-child{gap:6px;flex-wrap:wrap;justify-content:flex-end}.account-name{display:none}.hero{display:grid!important;grid-template-columns:1fr!important}.hero h1{font-size:clamp(46px,15vw,68px)!important}.hero>.panel{max-width:none!important}.active-room-list{grid-template-columns:1fr!important}}.active-room-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;overflow:visible}
.active-room{position:relative;display:flex!important;align-items:stretch;min-width:0;min-height:104px;padding:8px!important;border-radius:18px!important;overflow:visible!important;background:linear-gradient(145deg,rgba(28,25,55,.9),rgba(12,11,27,.94))}
.active-room>button[data-room-code]{flex:1;min-width:0;width:auto;padding:16px 18px!important;border:0!important;border-radius:13px!important;background:rgba(255,255,255,.025)!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;text-align:left}
.active-room>button[data-room-code] span{min-width:0;display:grid;gap:7px}.active-room>button[data-room-code] strong{display:block;white-space:normal;overflow-wrap:anywhere;line-height:1.3}.active-room>button[data-room-code] small{display:block;white-space:normal;line-height:1.45;color:var(--muted)}
.active-room>button[data-room-code] b{flex:0 0 auto;align-self:center;padding:9px 11px;border-radius:10px;background:rgba(83,228,220,.08);color:var(--cyan);letter-spacing:.12em;white-space:nowrap}
.active-room>.room-moderate-close{flex:0 0 auto;align-self:stretch;margin:0 0 0 8px;min-width:86px;border-radius:13px}
@media(max-width:760px){.active-room-list{grid-template-columns:1fr}.active-room{min-height:94px}.active-room>button[data-room-code]{padding:14px!important;gap:10px}.active-room>.room-moderate-close{min-width:74px;font-size:10px}}
@media(max-width:420px){.active-room{display:grid!important}.active-room>.room-moderate-close{margin:7px 0 0;min-height:38px;width:100%}.active-room>button[data-room-code]{grid-template-columns:1fr}.active-room>button[data-room-code] b{justify-self:start}}.active-room-list>button.active-room{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;min-width:0;min-height:96px;padding:18px 20px!important;overflow:visible!important;border-radius:18px!important;text-align:left}.active-room-list>button.active-room span{min-width:0;display:grid;gap:7px}.active-room-list>button.active-room strong,.active-room-list>button.active-room small{display:block;white-space:normal;overflow-wrap:anywhere;line-height:1.4}.active-room-list>button.active-room b{white-space:nowrap;padding:8px 10px;border-radius:10px;background:rgba(83,228,220,.08);color:var(--cyan)}@media(max-width:430px){.active-room-list>button.active-room{grid-template-columns:1fr;gap:12px}.active-room-list>button.active-room b{justify-self:start}}
.game-request-banner{position:fixed;top:18px;left:50%;z-index:1200;width:min(520px,calc(100% - 24px));transform:translate(-50%,-150%);opacity:0;display:flex;align-items:center;gap:14px;padding:16px 18px;border:1px solid rgba(83,228,220,.38);border-radius:18px;background:linear-gradient(135deg,rgba(25,22,52,.98),rgba(48,18,55,.98));box-shadow:0 22px 70px rgba(0,0,0,.48),0 0 42px rgba(143,103,245,.2);backdrop-filter:blur(20px);transition:transform .38s cubic-bezier(.2,.8,.2,1),opacity .3s;pointer-events:none}
.game-request-banner.show{transform:translate(-50%,0);opacity:1}
.game-request-banner small{display:block;margin-bottom:3px;color:#53e4dc;font-size:.69rem;font-weight:900;letter-spacing:.13em}
.game-request-banner strong{display:inline-block;margin-right:5px;color:#fff;font-size:1.02rem}
.game-request-banner p{display:inline;margin:0;color:#ded9f6}
.request-bell{display:grid;flex:0 0 44px;width:44px;height:44px;place-items:center;border-radius:14px;background:linear-gradient(145deg,#8f67f5,#ed68bc);box-shadow:0 8px 24px rgba(143,103,245,.32);font-size:1.25rem}
@media(max-width:560px){.game-request-banner{top:10px;padding:13px 14px;border-radius:15px}.request-bell{flex-basis:38px;width:38px;height:38px;border-radius:12px}.game-request-banner p{display:block;font-size:.87rem}}
