@font-face { font-family: 'Archivo Black'; src: url(../fonts/archivo-black.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(../fonts/dm-sans-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(../fonts/dm-sans-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(../fonts/dm-sans-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- Skins ---------- */
:root, [data-skin="classic"] {
  --bg: #FBF6EC; --bg2: #F3EADA; --ink: #1C1F3D; --muted: #6B6658; --panel: #FFFDF8; --line: #E6DCC8;
  --tile: #F5ECDA; --tile-edge: #D4BF94; --tile-ink: #1C1F3D; --dark: #1C1F3D; --dark-ink: #FBF6EC;
  --accent: #DC4A20; --accent-edge: #9C2F12; --accent-ink: #FFF6EC; --good: #2E8B57; --bad: #C0392B; --gold: #E0A526;
  --cell: #FFFDF8; --cell-line: #E1D5BD; --sel: #FFE3B3; --sel2: #FFF1D6; --shadow: 0 6px 18px rgba(28,31,61,.10);
  --pattern: radial-gradient(circle at 1px 1px, rgba(28,31,61,.06) 1px, transparent 0) 0 0/22px 22px;
  color-scheme: light;
}
[data-skin="midnight"] {
  --bg: #12142B; --bg2: #1B1E3D; --ink: #F3ECDD; --muted: #A9A6C2; --panel: #1E2145; --line: #2D3160;
  --tile: #F5ECDA; --tile-edge: #B9A479; --tile-ink: #1C1F3D; --dark: #DC4A20; --dark-ink: #FFF6EC;
  --accent: #F0683A; --accent-edge: #A43A17; --accent-ink: #fff; --good: #49C285; --bad: #FF6B6B; --gold: #F5C04A;
  --cell: #262A55; --cell-line: #353A72; --sel: #4A3F7A; --sel2: #343868; --shadow: 0 8px 22px rgba(0,0,0,.35);
  --pattern: radial-gradient(circle at 20% 10%, rgba(240,104,58,.12), transparent 40%), radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0) 0 0/26px 26px;
  color-scheme: dark;
}
[data-skin="savanna"] {
  --bg: #F6E3C4; --bg2: #EDCFA0; --ink: #3A2412; --muted: #7A5A3C; --panel: #FFF4E2; --line: #E3C493;
  --tile: #FFF4E2; --tile-edge: #C99B5E; --tile-ink: #3A2412; --dark: #8A3B12; --dark-ink: #FFF4E2;
  --accent: #C8541E; --accent-edge: #7E2F0B; --accent-ink: #fff; --good: #4F7A28; --bad: #B23A1E; --gold: #D99A1E;
  --cell: #FFF9EE; --cell-line: #E5C79A; --sel: #FFD58A; --sel2: #FFE9C2; --shadow: 0 6px 18px rgba(58,36,18,.15);
  --pattern: linear-gradient(180deg, rgba(232,140,60,.25), transparent 45%), repeating-linear-gradient(135deg, rgba(58,36,18,.04) 0 2px, transparent 2px 14px);
  color-scheme: light;
}
[data-skin="ocean"] {
  --bg: #E3F1F5; --bg2: #CBE5EC; --ink: #0E2F44; --muted: #4F7083; --panel: #F7FCFD; --line: #BFDCE5;
  --tile: #F7FCFD; --tile-edge: #8CB9C8; --tile-ink: #0E2F44; --dark: #0E2F44; --dark-ink: #E3F1F5;
  --accent: #0E8C8C; --accent-edge: #075757; --accent-ink: #fff; --good: #1F8A5B; --bad: #C94B4B; --gold: #E7A93B;
  --cell: #FFFFFF; --cell-line: #C4DFE7; --sel: #A6E3E3; --sel2: #D5F2F2; --shadow: 0 6px 18px rgba(14,47,68,.12);
  --pattern: repeating-radial-gradient(circle at 50% 120%, rgba(14,140,140,.06) 0 6px, transparent 6px 24px);
  color-scheme: light;
}
[data-skin="neon"] {
  --bg: #0B0B14; --bg2: #151528; --ink: #F2F2FF; --muted: #9A9AC0; --panel: #16162A; --line: #2A2A4E;
  --tile: #1F1F3A; --tile-edge: #FF2E93; --tile-ink: #F2F2FF; --dark: #23E5DB; --dark-ink: #0B0B14;
  --accent: #FF2E93; --accent-edge: #9E0F55; --accent-ink: #fff; --good: #39FF9E; --bad: #FF5470; --gold: #FFE14D;
  --cell: #141428; --cell-line: #2E2E5C; --sel: #3B1B54; --sel2: #22223F; --shadow: 0 0 22px rgba(255,46,147,.25);
  --pattern: linear-gradient(rgba(35,229,219,.06) 1px, transparent 1px) 0 0/28px 28px, linear-gradient(90deg, rgba(255,46,147,.06) 1px, transparent 1px) 0 0/28px 28px;
  color-scheme: dark;
}
[data-skin="forest"] {
  --bg: #E8EFE3; --bg2: #D4E2CC; --ink: #1F3324; --muted: #5C7362; --panel: #F8FBF6; --line: #C9D9C0;
  --tile: #FBF8EE; --tile-edge: #A9B98F; --tile-ink: #1F3324; --dark: #1F3324; --dark-ink: #F0F5EC;
  --accent: #B5462A; --accent-edge: #73281A; --accent-ink: #fff; --good: #2F7D3A; --bad: #B03A2E; --gold: #C9971A;
  --cell: #FFFFFF; --cell-line: #CADBC2; --sel: #F4D8A6; --sel2: #E6F0DF; --shadow: 0 6px 18px rgba(31,51,36,.12);
  --pattern: radial-gradient(ellipse at 10% 0%, rgba(181,70,42,.10), transparent 40%), radial-gradient(circle at 1px 1px, rgba(31,51,36,.06) 1px, transparent 0) 0 0/20px 20px;
  color-scheme: light;
}
[data-skin="jacaranda"] {
  --bg: #F1EAF7; --bg2: #E2D3EF; --ink: #2E1F47; --muted: #6E5E86; --panel: #FCF9FF; --line: #D9C9EA;
  --tile: #FCF9FF; --tile-edge: #B49AD3; --tile-ink: #2E1F47; --dark: #5B3B8C; --dark-ink: #FCF9FF;
  --accent: #8E44AD; --accent-edge: #5A2370; --accent-ink: #fff; --good: #2E8B57; --bad: #C0392B; --gold: #D9A520;
  --cell: #FFFFFF; --cell-line: #DCCDEC; --sel: #E2C6F5; --sel2: #F2E7FB; --shadow: 0 6px 18px rgba(46,31,71,.12);
  --pattern: radial-gradient(circle at 85% 8%, rgba(142,68,173,.14) 0 30px, transparent 31px), radial-gradient(circle at 1px 1px, rgba(46,31,71,.06) 1px, transparent 0) 0 0/22px 22px;
  color-scheme: light;
}
[data-skin="chalk"] {
  --bg: #233229; --bg2: #2B3D32; --ink: #EDEDE4; --muted: #A6B3A9; --panel: #2C3E33; --line: #3D5446;
  --tile: #EDEDE4; --tile-edge: #9AA394; --tile-ink: #233229; --dark: #F1C75B; --dark-ink: #233229;
  --accent: #F1C75B; --accent-edge: #A88531; --accent-ink: #233229; --good: #8BE29B; --bad: #FF8B7B; --gold: #F1C75B;
  --cell: #2F4337; --cell-line: #4A6455; --sel: #4E6A3E; --sel2: #3A5243; --shadow: 0 6px 18px rgba(0,0,0,.25);
  --pattern: repeating-linear-gradient(8deg, rgba(255,255,255,.025) 0 1px, transparent 1px 9px);
  color-scheme: dark;
}
[data-skin="contrast"] {
  --bg: #FFFFFF; --bg2: #F0F0F0; --ink: #000000; --muted: #333; --panel: #FFFFFF; --line: #000;
  --tile: #FFFFFF; --tile-edge: #000; --tile-ink: #000; --dark: #000; --dark-ink: #FFF;
  --accent: #0047FF; --accent-edge: #001E70; --accent-ink: #fff; --good: #007A2E; --bad: #C40000; --gold: #B57A00;
  --cell: #FFFFFF; --cell-line: #000; --sel: #FFE45C; --sel2: #FFF5B8; --shadow: none; --pattern: none;
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); background-image: var(--pattern); color: var(--ink); font: 15px/1.4 'DM Sans', system-ui, sans-serif; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
h1, h2, h3, .display { font-family: 'Archivo Black', 'DM Sans', sans-serif; font-weight: 400; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 24px; } h3 { font-size: 16px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; } .col { display: flex; flex-direction: column; gap: 10px; }
.page { padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px 4px; }
.topbar h2 { flex: 1; font-size: 21px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--panel); border: 1.5px solid var(--line); position: relative; }
.iconbtn .badge { position: absolute; top: -5px; right: -5px; background: var(--accent); color: var(--accent-ink); font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; font-weight: 700; background: var(--tile); color: var(--tile-ink); box-shadow: 0 4px 0 var(--tile-edge); transition: transform .06s, box-shadow .06s; min-height: 48px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tile-edge); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-edge); }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-edge); }
.btn.dark { background: var(--dark); color: var(--dark-ink); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.btn.ghost { background: transparent; box-shadow: none; border: 1.5px solid var(--line); color: var(--ink); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 13.5px; border-radius: 11px; box-shadow: 0 3px 0 var(--tile-edge); }
.btn.sm.primary { box-shadow: 0 3px 0 var(--accent-edge); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }

.card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--cell); color: var(--ink); font: inherit; outline: none; }
.input:focus { border-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--cell); font-size: 13.5px; font-weight: 500; }
.seg button.on { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.seg.topics button { font-size: 12.5px; padding: 6px 10px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.toggle .sw { width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle.on .sw { background: var(--accent); } .toggle.on .sw::after { left: 21px; }
.hint { font-size: 12.5px; color: var(--muted); }
details.adv summary { cursor: pointer; font-weight: 700; padding: 6px 0; }

/* ---------- Home ---------- */
.hero { padding: 26px 18px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero img { width: 100%; max-width: 420px; border-radius: 18px; }
.hero .tag { font-size: 14px; color: var(--muted); }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 6px 16px; }
.mtile { background: var(--tile); color: var(--tile-ink); border-radius: 18px; padding: 14px; text-align: left; box-shadow: 0 5px 0 var(--tile-edge); min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.mtile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--tile-edge); }
.mtile .ic { font-size: 26px; }
.mtile b { font-family: 'Archivo Black'; font-weight: 400; font-size: 17px; display: block; }
.mtile span { font-size: 12px; opacity: .75; }
.mtile .pts { position: absolute; right: 10px; bottom: 6px; font-size: 11px; font-weight: 700; opacity: .6; }
.mtile.hot { background: var(--accent); color: var(--accent-ink); box-shadow: 0 5px 0 var(--accent-edge); }
.mtile.navy { background: var(--dark); color: var(--dark-ink); box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.mtile.wide { grid-column: span 2; min-height: 84px; }
.minor { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 16px 24px; }
.minor button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); font-size: 12px; font-weight: 700; }
.minor button i { font-style: normal; font-size: 22px; }
.who { display: flex; align-items: center; gap: 10px; margin: 0 16px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--bg2); flex: none; }

/* ---------- Game ---------- */
.game { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.ghead { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; }
.ghead .clock { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ghead .clock b { font-family: 'Archivo Black'; font-weight: 400; font-size: 20px; font-variant-numeric: tabular-nums; }
.ghead .clock small { font-size: 11px; color: var(--muted); }
.clock.warn b { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.scores { display: flex; gap: 8px; overflow-x: auto; padding: 4px 10px 8px; scrollbar-width: none; }
.scores::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); min-width: 112px; position: relative; transition: transform .2s; }
.chip.turn { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,74,32,.25); }
.chip.turn::after { content: 'TURN'; position: absolute; top: -8px; right: 8px; background: var(--accent); color: var(--accent-ink); font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 5px; letter-spacing: .08em; }
.chip.me .nm::after { content: ' (you)'; color: var(--muted); font-weight: 400; }
.chip .nm { font-size: 12px; font-weight: 700; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .sc { font-family: 'Archivo Black'; font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1; }
.chip .bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 3px; }
.chip .bar i { display: block; height: 100%; background: var(--good); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); position: absolute; left: 4px; top: 4px; }
.chip .dot.off { background: var(--bad); }
.chip .teamstripe { position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; }
.chip .members { font-size: 13px; letter-spacing: -2px; }

.gridwrap { flex: 1; overflow: auto; display: flex; padding: 6px 8px; min-height: 0; }
.grid { display: grid; gap: 2px; margin: auto; touch-action: manipulation; }
.cell { position: relative; aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; font-family: 'Archivo Black'; text-transform: uppercase; color: var(--tile-ink); }
.cell.blk { background: transparent; }
.cell.open { background: var(--cell); border: 1.5px solid var(--cell-line); color: var(--ink); }
.cell.open.inword { background: var(--sel2); }
.cell.open.cur { background: var(--sel); border-color: var(--accent); }
.cell.filled { background: var(--tile); box-shadow: 0 2px 0 var(--tile-edge); border: 0; color: var(--tile-ink); }
.cell.filled.mine { background: var(--tile); }
.cell.filled.rev { background: var(--bg2); color: var(--muted); box-shadow: 0 2px 0 var(--line); }
.cell.filled.inword { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell.staged { color: var(--accent); }
.cell .n { position: absolute; top: 1px; left: 2px; font: 700 8px/1 'DM Sans'; color: var(--muted); }
.cell .pm { position: absolute; bottom: 1px; right: 2px; font: 700 7px/1 'DM Sans'; padding: 1px 2px; border-radius: 3px; color: #fff; }
.pm.DL { background: #4A90C2; } .pm.TL { background: #2B5DA8; } .pm.DW { background: #E07A5F; } .pm.TW { background: #C0392B; }
.cell .own { position: absolute; bottom: 1px; left: 2px; width: 6px; height: 6px; border-radius: 50%; }
.cell.flashgood { animation: fg .7s; } .cell.flashbad { animation: fb .6s; }
@keyframes fg { 30% { transform: scale(1.18); background: var(--good); color: #fff; } }
@keyframes fb { 20%, 60% { transform: translateX(-3px); background: var(--bad); color: #fff; } 40%, 80% { transform: translateX(3px); } }
.cell.gold::before { content: ''; position: absolute; inset: -1px; border-radius: 5px; border: 1.5px dashed var(--gold); pointer-events: none; }

.cluebar { margin: 4px 10px 6px; padding: 9px 10px; border-radius: 14px; background: var(--dark); color: var(--dark-ink); display: flex; align-items: center; gap: 6px; min-height: 58px; }
.cluebar .txt { flex: 1; min-width: 0; }
.cluebar .meta { font-size: 11px; opacity: .8; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.cluebar .q { font-weight: 700; font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cluebar { min-height: 64px; }
.cluebar button { width: 34px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.1); font-size: 16px; color: inherit; }
.tier { font-size: 10px; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.t1 { background: #7f8c8d; color: #fff; } .t2 { background: #2E8B57; color: #fff; } .t3 { background: #2B5DA8; color: #fff; } .t4 { background: #8E44AD; color: #fff; } .t5 { background: linear-gradient(90deg,#E0A526,#DC4A20); color: #fff; }

.inputzone { padding: 4px 6px 8px; }
.kb { display: flex; flex-direction: column; gap: 6px; }
.kb .r { display: flex; gap: 5px; justify-content: center; }
.kb button { flex: 1; max-width: 42px; height: 46px; border-radius: 8px; background: var(--tile); color: var(--tile-ink); font-family: 'Archivo Black'; font-size: 16px; box-shadow: 0 3px 0 var(--tile-edge); }
.kb button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tile-edge); }
.kb button.wide { max-width: 68px; flex: 1.6; font: 700 13px 'DM Sans'; }
.kb button.go { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-edge); }
.rack { display: flex; gap: 6px; justify-content: center; padding: 4px 0 8px; flex-wrap: wrap; }
.rtile { width: 44px; height: 48px; border-radius: 9px; background: var(--tile); color: var(--tile-ink); box-shadow: 0 4px 0 var(--tile-edge); position: relative; font-family: 'Archivo Black'; font-size: 21px; display: grid; place-items: center; transition: transform .12s, opacity .12s; }
.rtile small { position: absolute; right: 4px; bottom: 2px; font: 700 9px 'DM Sans'; }
.rtile.used { opacity: .25; transform: translateY(4px); box-shadow: none; }
.rtile.blank { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-edge); }
.rtile.decoy { }
.rtile.sel { outline: 3px solid var(--accent); }
.actions { display: flex; gap: 6px; padding: 0 4px; }
.actions .btn { flex: 1; padding: 10px 6px; min-height: 42px; font-size: 13px; }
.waiting { text-align: center; padding: 14px 10px; font-weight: 700; }
.waiting .who { justify-content: center; border: 0; background: none; margin: 0; }
.powers { display: flex; gap: 6px; padding: 0 10px 4px; }
.power { flex: 1; padding: 6px 4px; border-radius: 10px; border: 1.5px dashed var(--line); font-size: 12px; font-weight: 700; display: flex; gap: 4px; align-items: center; justify-content: center; }
.power.armed { border-style: solid; border-color: var(--gold); background: rgba(224,165,38,.15); }
.power:disabled { opacity: .35; }

/* overlays */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,10,25,.45); z-index: 80; animation: fade .15s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 82vh; background: var(--panel); border-radius: 22px 22px 0 0; z-index: 81; display: flex; flex-direction: column; animation: up .2s ease-out; box-shadow: 0 -10px 30px rgba(0,0,0,.2); }
.sheet .sh { padding: 14px 16px 8px; display: flex; align-items: center; gap: 10px; border-bottom: 1.5px solid var(--line); }
.sheet .sh h3 { flex: 1; font-size: 18px; margin: 0; }
.sheet .sb { overflow: auto; padding: 10px 16px 18px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.cl { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.cl b { min-width: 30px; font-family: 'Archivo Black'; font-weight: 400; }
.cl.done { opacity: .45; text-decoration: line-through; }
.cl.cur { background: var(--sel2); border-radius: 10px; }
.chatlog { display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg .bub { background: var(--bg2); padding: 8px 11px; border-radius: 14px 14px 14px 4px; max-width: 78%; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bub { background: var(--accent); color: var(--accent-ink); border-radius: 14px 14px 4px 14px; }
.msg .nm { font-size: 11px; font-weight: 700; opacity: .7; }
.msg.sys { justify-content: center; } .msg.sys .bub { background: transparent; font-size: 12px; color: var(--muted); padding: 2px; }
.chatin { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1.5px solid var(--line); }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 0; }
.quick button { flex: none; padding: 6px 10px; border-radius: 16px; background: var(--bg2); font-size: 13px; }

.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90; background: var(--dark); color: var(--dark-ink); padding: 10px 16px; border-radius: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 92vw; text-align: center; animation: toast 2.4s forwards; pointer-events: none; }
.toast small { display: block; font-weight: 500; font-size: 11.5px; opacity: .8; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; } .toast.gold { background: linear-gradient(90deg, var(--gold), var(--accent)); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.float { position: fixed; z-index: 95; font-size: 34px; pointer-events: none; animation: floatup 2.2s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-260px) scale(1.4); opacity: 0; } }
.banner { margin: 0 10px 6px; padding: 9px 12px; border-radius: 12px; background: var(--gold); color: #1C1F3D; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.banner .grow { min-width: 0; }
.pauseov { position: fixed; inset: 0; z-index: 50; background: rgba(12,12,30,.82); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.pauseov h1 { font-size: 40px; }
.passov { position: fixed; inset: 0; z-index: 55; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.passov .big { font-size: 64px; }

/* results */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 10px 0; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30%; }
.podium .blk { width: 100%; border-radius: 12px 12px 4px 4px; background: var(--tile); box-shadow: 0 4px 0 var(--tile-edge); display: grid; place-items: center; font-family: 'Archivo Black'; font-size: 26px; color: var(--tile-ink); }
.podium .p1 .blk { height: 110px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-edge); }
.podium .p2 .blk { height: 80px; } .podium .p3 .blk { height: 60px; }
.podium .nm { font-weight: 700; font-size: 13px; text-align: center; }
.podium .av { font-size: 30px; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank td, table.rank th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.rank th { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.code { font-family: 'Archivo Black'; font-size: 22px; letter-spacing: .04em; padding: 10px 14px; border-radius: 12px; background: var(--bg2); text-align: center; user-select: text; -webkit-user-select: text; }
.mem { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.mem .nm { flex: 1; font-weight: 700; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg2); font-weight: 700; }
.pill.ok { background: var(--good); color: #fff; } .pill.host { background: var(--accent); color: var(--accent-ink); }
.teamcol { border-radius: 14px; padding: 10px; border: 2px solid var(--line); }
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.skin { border-radius: 16px; padding: 10px; border: 2.5px solid transparent; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; box-shadow: var(--shadow); }
.skin.on { border-color: var(--accent); }
.skin .sw { display: flex; gap: 4px; } .skin .sw i { width: 18px; height: 22px; border-radius: 4px; display: block; }
.skin b { font-size: 12.5px; }
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat div { background: var(--bg2); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: 'Archivo Black'; font-size: 20px; }
.stat span { font-size: 11px; color: var(--muted); }
.wbar { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.wbar i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.how p { margin: 6px 0; } .how h3 { margin-top: 12px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash { position: fixed; inset: 0; background: #FBF6EC; display: grid; place-items: center; z-index: 100; transition: opacity .4s; }
.splash img { width: 86vw; max-width: 460px; animation: pop .6s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

.legal h2 { font-size: 16px; margin: 16px 0 6px; } .legal p, .legal li { font-size: 13.5px; line-height: 1.55; } .legal a { color: var(--accent); }
.msg[data-a] { cursor: pointer; }
