/* Starline · AndrewNet. Dark AndrewNet chrome around a night-sky table. */
:root {
  --bg: #0d1020; --bg2: #151a33; --surface: rgba(255,255,255,.05); --surface-hi: rgba(255,255,255,.09);
  --text: #f2f3fa; --muted: #9aa0bf; --accent: #8fb0ff; --border: rgba(255,255,255,.10); --glow: rgba(110,120,255,.45);
  --sky: #090c1a; --star: #cfe0ff; --gold: #ffd45e; --amber: #ffb547;
  --em: #ff6b6b; --az: #5aa9ff; --so: #ffd45e; --au: #4ade80;
  --tw: 28px; --th: 38px; --rw: min(44px, calc((100vw - 34px) / 8)); --rh: 54px;
  --turnc: #8fb0ff;
}
html[data-size="s"] { --tw: 24px; --th: 34px; }
html[data-size="l"] { --tw: 34px; --th: 46px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.55; color: var(--text);
  background: radial-gradient(900px 500px at 15% -10%, rgba(47,111,228,.35), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(123,63,228,.30), transparent 60%), var(--bg);
  background-attachment: fixed; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.back { position: fixed; top: 10px; left: 12px; z-index: 5; color: var(--accent); text-decoration: none; font-size: .9rem; padding: 6px 10px; border-radius: 999px; background: rgba(13,16,32,.6); }
.back[hidden] { display: none; }

/* ---------- buttons ---------- */
.btn { min-height: 44px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover, .btn:focus-visible { background: var(--surface-hi); border-color: rgba(143,176,255,.45); }
.btn.primary { background: linear-gradient(135deg, #8fd8ff, #a98bff); color: #0d1020; border: 0; }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: 12px 26px; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; font-size: .92rem; }
.chip.on { background: rgba(143,176,255,.22); border-color: var(--accent); color: #fff; }
.chip.small { min-height: 34px; padding: 4px 10px; font-size: .82rem; }
.iconbtn { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.35rem; cursor: pointer; border-radius: 12px; }

/* ---------- home ---------- */
.home { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 60px 16px 30px; }
.home-sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.home-inner { position: relative; text-align: center; max-width: 520px; }
.home h1 { margin: 0 0 6px; font-weight: 800; }
.tag { color: var(--muted); margin: 0 auto 26px; max-width: 420px; }
.home-buttons { display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: 320px; margin: 0 auto; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 22px; }
.wordmark { position: relative; display: inline-block; font-weight: 800; letter-spacing: -.02em; font-size: clamp(1.7rem, 5vw, 2.2rem); }
.wordmark.big { font-size: clamp(2.8rem, 12vw, 4.2rem); }
.wm-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.wm-text { position: relative; background: linear-gradient(180deg, #fff, #cfe0ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 24px rgba(143,176,255,.25); }
.wm-i { position: relative; }
.wm-i svg { position: absolute; width: .42em; height: .42em; left: 50%; top: .02em; transform: translateX(-50%); filter: drop-shadow(0 0 4px #ffd45e); }

.page-center { min-height: 100dvh; display: grid; place-items: center; padding: 60px 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px; }
.join-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.join-card h2 { margin: 0; }
.join-card label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .9rem; }
.join-card input { min-height: 48px; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text); font-size: 1.15rem; padding: 8px 14px; }
.err { color: #ff9b9b; margin: 0; }

/* ---------- tiles ---------- */
.s-em { --sc: var(--em); } .s-az { --sc: var(--az); } .s-so { --sc: var(--so); } .s-au { --sc: var(--au); }
.tile {
  --w: var(--tw); --h: var(--th);
  position: relative; flex: none; width: var(--w); height: var(--h); border-radius: 6px; color: var(--sc, #fff);
  background: linear-gradient(180deg, #232b52, #171d3a); border: 1px solid rgba(207,224,255,.22);
  box-shadow: inset 0 0 10px rgba(143,176,255,.10), 0 2px 5px rgba(0,0,0,.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.tile .num { font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; font-weight: 900; font-size: calc(var(--h) * .47); line-height: .95; letter-spacing: -.04em;
  text-shadow: 0 0 calc(7px * var(--glow, .5)) var(--sc), 0 0 2px rgba(0,0,0,.6); }
.tile .pip { width: calc(var(--w) * .3); height: calc(var(--w) * .3); fill: var(--sc); filter: drop-shadow(0 0 2px var(--sc)); }
.tile.wild { background: linear-gradient(180deg, #23305a, #151b38); }
.tile .comet { width: calc(var(--w) * .82); height: calc(var(--w) * .82); filter: drop-shadow(0 0 3px #9ff3ff); }
.tile .cap { font-size: max(10px, calc(var(--h) * .24)); font-weight: 800; color: #dff7ff; line-height: 1; display: flex; align-items: center; gap: 1px; min-height: 1em; }
.cpip { width: .75em; height: .75em; fill: var(--sc); }
.tile.sel { transform: translateY(-4px); box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(207,224,255,.7); }
.waiting .table .tile.sel, .screen .tile.sel { box-shadow: 0 0 0 2px var(--turnc), 0 0 14px var(--turnc); }
.tile.new { border-color: var(--gold); box-shadow: inset 0 0 8px rgba(255,212,94,.25), 0 0 8px rgba(255,212,94,.45); }
.tile.new::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--turnc); box-shadow: 0 0 4px var(--turnc); }
.tile.drawn { border-color: var(--gold); animation: drawnGlow 1.6s ease-in-out infinite; }
.tile.press { transform: scale(.96); }
.tile.lifted { opacity: .35; }
.tile.mini { --w: 22px; --h: 30px; cursor: default; }
.tback { display: inline-grid; place-items: center; width: 14px; height: 19px; border-radius: 3px; background: linear-gradient(180deg, #2a2770, #1b1850); border: 1px solid rgba(207,224,255,.25); margin-right: -6px; }
.tback svg { width: 9px; height: 9px; }
@keyframes drawnGlow { 50% { box-shadow: 0 0 14px rgba(255,212,94,.8); } }

/* ---------- sets: constellations ---------- */
.sets { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 10px; padding: 10px; }
.set { --pad: 6px; --gap: 5px; position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; padding: var(--pad); border-radius: 12px; min-height: calc(var(--th) + 12px); cursor: pointer; max-width: 100%; transition: background .15s ease; }
.set .tiles { position: relative; display: flex; flex-wrap: wrap; gap: var(--gap); z-index: 1; }
/* A run is one straight line through its stars; a group's line closes into a loop. */
.set.run::before { content: ""; position: absolute; left: calc(var(--pad) + var(--tw) / 2); right: calc(var(--pad) + var(--tw) / 2); top: calc(var(--pad) + var(--th) * .66); height: 2px; margin-top: -1px; z-index: 2; pointer-events: none;
  background: var(--star); box-shadow: 0 0 6px var(--star), 0 0 12px rgba(207,224,255,.5); border-radius: 2px; opacity: .55; animation: drawLine .5s ease-out; transform-origin: left; }
.set.group::before { content: ""; position: absolute; inset: 2px; border: 1.5px solid var(--star); border-radius: 14px; box-shadow: 0 0 8px rgba(207,224,255,.55), inset 0 0 8px rgba(207,224,255,.25); opacity: .8; animation: fadeIn .5s ease-out; }
.set.changed::before { background-color: var(--turnc); border-color: var(--turnc); box-shadow: 0 0 8px var(--turnc), 0 0 16px var(--turnc); }
.set.changed.run::before { background: var(--turnc); }
.set.bad { outline: 1.5px dashed var(--amber); outline-offset: -2px; }
.set.bad .tile { opacity: .78; filter: saturate(.75); }
.set .label { position: relative; z-index: 1; font-size: .72rem; font-weight: 700; color: var(--amber); margin-top: 3px; line-height: 1.1; }
.set.locked .tile { opacity: .75; }
.set .lock { position: absolute; top: -6px; right: -4px; font-size: .7rem; z-index: 2; }
.set.ripple::before { animation: ripple .9s ease-out; }
.set.shake { animation: shake .45s ease; }
.set.over, .newset.over, .rack.over { background: rgba(143,176,255,.16); }
.slot { display: none; flex: none; width: var(--tw); height: var(--th); border: 1.5px dashed var(--accent); border-radius: 6px; color: var(--accent); align-items: center; justify-content: center; font-weight: 800; }
.has-sel .set:not(.locked) .slot { display: inline-flex; animation: pulse 1.2s ease-in-out infinite; }
.has-sel .set.run::before { right: calc(var(--pad) + var(--tw) * 1.5 + var(--gap)); }
.empty-sky { color: var(--muted); font-size: .9rem; margin: auto; padding: 30px 10px; text-align: center; width: 100%; }
@keyframes drawLine { from { transform: scaleX(0); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes ripple { 30% { box-shadow: 0 0 18px #fff, 0 0 30px var(--gold); opacity: 1; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- phone / desktop player ---------- */
.page-player { overflow: hidden; }
.game.player { display: grid; grid-template-rows: 46px auto minmax(120px, 1fr) auto auto 22px 60px; height: 100vh; height: 100dvh; max-width: 980px; margin: 0 auto; padding: 0 6px env(safe-area-inset-bottom); }
.topbar { display: flex; align-items: center; gap: 6px; }
.tb-mid { flex: 1; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.tb-pool { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.mini-neb { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, rgba(207,224,255,.9), rgba(169,139,255,.35) 45%, transparent 70%); }
.tb-turn { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; max-width: 48%; }
.tb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--pc, var(--accent)) calc(var(--frac, 1) * 360deg), rgba(255,255,255,.12) 0); }
.ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg); }
.ring-t { position: relative; z-index: 1; font-size: .72rem; font-weight: 800; }
.ring.hurry { --pc: var(--amber) !important; }
.opps { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 4px; scrollbar-width: none; }
.opp { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.opp .dot, .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 6px var(--pc); }
.opp.active { border-color: var(--pc); background: rgba(255,255,255,.1); }
.opp.last { animation: pulse 1s ease-in-out infinite; }
.opp.away { opacity: .5; }
.opp em { color: var(--muted); font-style: normal; }
.sky { position: relative; background: var(--sky); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.sky .stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky > .sets { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.shelf { display: flex; align-items: center; gap: 6px; min-height: 58px; padding: 4px 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.shelf .sets { flex-wrap: nowrap; padding: 0; gap: 6px; }
.shelf .set { flex: none; background: rgba(255,255,255,.03); }
.newset { flex: none; min-height: 48px; min-width: 96px; border-radius: 12px; border: 1.5px dashed rgba(143,176,255,.5); background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; }
.has-sel .newset { animation: pulse 1.2s ease-in-out infinite; background: rgba(143,176,255,.08); }
.waiting .newset { display: none; }
.shelf.shake { animation: shake .45s ease; }
.rackwrap { border-top: 1px solid var(--border); padding-top: 6px; }
.rack { --tw: var(--rw); --th: var(--rh); display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; max-height: calc(var(--rh) * 3 + 14px); overflow-y: auto; padding: 4px 2px 6px; border-radius: 12px; min-height: calc(var(--rh) + 10px); }
.rack .tile { --w: var(--rw); --h: var(--rh); }
.rack .slot { width: var(--rw); height: var(--rh); }
.can-rack .rack .rackslot { display: inline-flex; animation: pulse 1.2s ease-in-out infinite; }
.statusline { font-size: .8rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.flipbtn { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: .85rem; cursor: pointer; text-decoration: underline; padding: 0 6px; }
.actions { display: flex; gap: 6px; align-items: center; padding-bottom: 6px; }
.act { flex: none; width: 52px; height: 50px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 1.15rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 2px; }
.act small { font-size: .62rem; color: var(--muted); }
.act:disabled { opacity: .35; }
.mainbtn { flex: 1; min-width: 50%; height: 50px; border-radius: 999px; border: 0; font-weight: 800; font-size: 1rem; cursor: pointer;
  background: linear-gradient(135deg, #8fd8ff, #a98bff); color: #0d1020; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
.mainbtn.go { background: linear-gradient(135deg, #ffe48a, #ffd45e 45%, #a7f3c7); box-shadow: 0 0 18px rgba(255,212,94,.45); animation: goPulse 1.6s ease-in-out infinite; }
.mainbtn.dim { background: rgba(255,255,255,.12); color: var(--text); }
.mainbtn.wait { background: var(--surface); color: var(--muted); border: 1px solid var(--border); font-weight: 600; }
.mainbtn:disabled { cursor: default; }
@keyframes goPulse { 50% { box-shadow: 0 0 28px rgba(255,212,94,.7); } }
.ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; display: flex; gap: 3px; margin: -40px 0 0 -22px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)); }
.ghost .tile { --w: 44px; --h: 54px; transform: rotate(-3deg) scale(1.05); }
body.dragging { cursor: grabbing; }
@media (min-width: 760px) {
  :root { --tw: 34px; --th: 46px; --rw: 46px; --rh: 58px; }
  html[data-size="s"] { --tw: 28px; --th: 38px; }
  html[data-size="l"] { --tw: 40px; --th: 54px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .game.player { grid-template-columns: 2fr 1fr; grid-template-rows: 40px auto 1fr auto 20px 54px; }
  .topbar, .opps { grid-column: 1 / -1; }
  .table { grid-column: 1; grid-row: 3 / 7; margin-bottom: 6px; }
  .shelf { grid-column: 2; grid-row: 3; overflow-x: auto; }
  .rackwrap { grid-column: 2; grid-row: 4; }
  .statusline { grid-column: 2; grid-row: 5; }
  .actions { grid-column: 2; grid-row: 6; }
}

/* ---------- TV / big screen ---------- */
.page-screen { overflow: hidden; }
.game.screen { display: grid; grid-template-columns: 1fr 380px; grid-template-rows: 90px 1fr auto 60px; gap: 14px 26px; height: 100vh; padding: 40px 64px; }
html.tv .game.screen { padding: 54px 96px; }
.sc-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 30px; }
.sc-title .wordmark { font-size: 3rem; }
.sc-round { color: var(--muted); font-weight: 700; font-size: 1.5rem; flex: 1; }
.nebula { position: relative; display: flex; align-items: center; gap: 12px; font-size: 1.1rem; color: var(--muted); }
.nebula b { font-size: 2.2rem; color: var(--text); position: relative; }
.neb-cloud { width: 70px; height: 70px; border-radius: 50%; opacity: calc(.35 + var(--fill, 1) * .65);
  background: radial-gradient(circle at 45% 45%, rgba(255,255,255,.9), rgba(207,224,255,.55) 18%, rgba(169,139,255,.35) 42%, rgba(52,211,153,.12) 60%, transparent 72%); }
.screen .table { grid-column: 1; grid-row: 2; }
.screen .table .sets { gap: 14px 18px; padding: 18px; overflow: hidden; }
.screen .table[data-tv="l"] { --tw: 64px; --th: 84px; }
.screen .table[data-tv="m"] { --tw: 52px; --th: 68px; }
.screen .table[data-tv="s"] { --tw: 44px; --th: 58px; }
.screen .set { --pad: 9px; --gap: 7px; }
.screen .set .label { font-size: 1rem; }
.shelfstrip { grid-column: 1; grid-row: 3; display: flex; align-items: center; gap: 16px; min-height: 0; border-radius: 16px; padding: 0 14px; transition: background .2s; }
.shelfstrip.on { min-height: 92px; background: linear-gradient(90deg, rgba(143,176,255,.14), rgba(143,176,255,.03)); border: 1px solid rgba(143,176,255,.3); }
.shelfstrip .who { font-weight: 700; font-size: 1.2rem; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.shelfstrip .sets { --tw: 44px; --th: 58px; flex-wrap: nowrap; padding: 6px 0; overflow: hidden; }
.rail { grid-column: 2; grid-row: 2 / 4; display: flex; flex-direction: column; gap: 14px; }
.seat { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 14px 18px; transition: border-color .2s, background .2s; }
.seat.active { border-color: var(--pc); background: rgba(255,255,255,.08); box-shadow: 0 0 24px -8px var(--pc); }
.seat.last { animation: lastPulse 1.2s ease-in-out infinite; }
.seat.away { opacity: .55; }
.seat-top { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; font-weight: 700; }
.seat .ring { width: 40px; height: 40px; }
.seat:not(.active) .ring { background: var(--pc); }
.seat:not(.active) .ring .ring-t { display: none; }
.seat-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip { flex: 1; }
.lamp { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.15); }
.lamp.on { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.seat-mid { display: flex; align-items: center; gap: 14px; margin: 6px 0 2px; }
.seat-mid .count { font-size: 2.6rem; line-height: 1; min-width: 1.4em; }
.seat .backs { display: flex; flex-wrap: wrap; padding-right: 6px; }
.seat-score { color: var(--muted); font-size: 1.05rem; }
@keyframes lastPulse { 50% { box-shadow: 0 0 30px -4px var(--gold); border-color: var(--gold); } }
.ticker { grid-column: 1 / -1; display: flex; align-items: center; font-size: 1.5rem; color: var(--muted); font-weight: 600; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(5,7,16,.74); }
.overlay[hidden] { display: none; }
.ov-card { background: #151a33; border: 1px solid var(--border); border-radius: 22px; padding: 20px 20px 22px; width: 100%; max-width: 620px; max-height: 100%; overflow: auto; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.ov-card h2 { margin: 0 0 12px; font-size: 1.35rem; letter-spacing: -.01em; }
.ov-card h3 { margin: 16px 0 6px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.rl { width: 100%; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.note { color: var(--muted); font-size: .9rem; }
.seatlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.seatrow { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 14px; background: var(--surface); }
.seatrow span { flex: 1; }
.lvl { color: var(--muted); }
.joinbox { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.joinbox .qr { width: 150px; height: 150px; background: #fff; border-radius: 12px; padding: 6px; }
.joinbox p { margin: 0; color: var(--muted); }
.joinbox .url { color: var(--text); font-weight: 700; font-size: 1.1rem; }
.joinbox .code { font-size: 2rem; letter-spacing: .12em; color: var(--text); }
.rules p { color: var(--muted); font-size: .92rem; }
.flips { display: flex; justify-content: center; gap: 22px; margin: 18px 0; flex-wrap: wrap; }
.flip { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; }
.flip .tile { --w: 54px; --h: 70px; animation: flipIn .6s ease-out both; }
.flip.win .tile { box-shadow: 0 0 0 2px var(--gold), 0 0 18px var(--gold); }
.big-note { text-align: center; font-size: 1.3rem; font-weight: 800; margin: 6px 0 0; }
@keyframes flipIn { from { transform: rotateY(90deg); } }
.res-title { text-align: center; }
.res-head, .res-row { display: grid; grid-template-columns: minmax(70px, 1fr) 2.4fr 56px 56px; gap: 8px; align-items: center; }
.res-head { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.res-row { padding: 8px 0; border-top: 1px solid var(--border); animation: fadeIn .4s ease-out both; animation-delay: var(--d); }
.res-row.win .res-name { color: var(--gold); }
.res-name { font-weight: 700; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.res-rack { display: flex; flex-wrap: wrap; gap: 2px; }
.res-rack em { color: var(--muted); }
.res-pts, .res-tot { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.slider { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.slider input { flex: 1; accent-color: var(--accent); min-height: 32px; }
.countin { font-size: 4rem; font-weight: 800; text-align: center; margin: 10px 0; }
.how { display: grid; gap: 10px; }
.how-card { background: var(--surface); border-radius: 16px; padding: 10px 14px; }
.how-card h3 { margin: 0 0 4px; color: var(--text); letter-spacing: 0; text-transform: none; font-size: 1rem; }
.how-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.hpip { width: .8em; height: .8em; fill: var(--sc); vertical-align: -.05em; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); z-index: 70; background: #222a4d; border: 1px solid var(--border); padding: 10px 16px; border-radius: 999px; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 10px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-btn { border: 0; background: var(--accent); color: #0d1020; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 34px; }
.conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 80; background: #5a3b12; color: #ffe2b0; padding: 6px 14px; border-radius: 999px; font-size: .85rem; }
.conn[hidden] { display: none; }
.banner { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 45; pointer-events: none; text-align: center; animation: bannerIn 1.8s ease both; }
.banner b { display: block; font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 0 24px rgba(207,224,255,.8), 0 2px 10px rgba(0,0,0,.8); }
.banner small { display: block; font-size: 1.1rem; color: var(--gold); font-weight: 700; }
.screen .banner b { font-size: 5rem; }
.screen .banner small { font-size: 2rem; }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 15%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; } }
.shooting { position: fixed; top: 12%; left: -10%; width: 220px; height: 2px; z-index: 44; pointer-events: none; background: linear-gradient(90deg, transparent, #fff); box-shadow: 0 0 10px #fff; transform: rotate(18deg); animation: shoot 1.4s ease-in forwards; }
@keyframes shoot { to { left: 110%; top: 55%; opacity: 0; } }

/* ---------- TV scaling ---------- */
html.tv .ov-card { max-width: 980px; font-size: 1.35rem; padding: 34px 40px; }
html.tv .ov-card h2 { font-size: 2.2rem; }
html.tv .chip { min-height: 56px; font-size: 1.25rem; padding: 8px 22px; }
html.tv .btn { min-height: 60px; font-size: 1.3rem; }
html.tv .btn.big { min-height: 72px; font-size: 1.5rem; }
html.tv .joinbox .qr { width: 220px; height: 220px; }
html.tv .home .btn.big { min-height: 72px; }
html.tv .tag, html.tv .hint { font-size: 1.35rem; }
html.tv .home-buttons { max-width: 480px; }
html.tv .res-head, html.tv .res-row { grid-template-columns: 220px 1fr 100px 100px; }
html.tv .tile.mini { --w: 34px; --h: 46px; }
html.tv :focus-visible, html.tv button:focus { outline: 4px solid var(--accent); outline-offset: 4px; }

/* ---------- reduced motion ---------- */
html.reduce *, html.reduce *::before, html.reduce *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.soundhint { position: fixed; right: 96px; bottom: 30px; z-index: 30; background: rgba(143,176,255,.18); border: 1px solid var(--accent); padding: 8px 18px; border-radius: 999px; font-size: 1.2rem; }
.soundhint[hidden] { display: none; }
