:root {
  color-scheme: dark;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  background: #090d18;
  color: #f8fafc;
  --amber: #f5a524;
  --violet: #8b5cf6;
  --neutral: #64748b;
  --danger: #171717;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 15% 0%, #26365d 0, transparent 38%), radial-gradient(circle at 90% 25%, #412a69 0, transparent 35%), #090d18; }
button, input, select { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #fde68a; outline-offset: 2px; }
.shell { width: min(100%, 980px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom)); }
.panel, .status-card { background: rgba(17, 24, 39, .9); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 18px 60px rgba(0,0,0,.28); border-radius: 24px; }
.intro { max-width: 520px; margin: 5vh auto 0; padding: 28px; }
.logo { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--amber), var(--violet)); font-weight: 900; color: #111827; }
h1 { margin: 3px 0 8px; font-size: clamp(30px, 8vw, 48px); letter-spacing: -.04em; }
.eyebrow { margin: 18px 0 0; color: #a8b4cb; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.brand-subtitle { margin: -3px 0 13px; color: #a8b4cb; font-size: clamp(14px, 4vw, 17px); font-weight: 700; line-height: 1.35; }
.lead { color: #cbd5e1; font-size: 17px; line-height: 1.5; }
.how-to { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; color: #dbe4f0; font-size: 14px; }
.how-to li { display: flex; align-items: center; gap: 10px; }
.how-to span { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #27334a; color: #fde68a; font-weight: 900; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin: 24px 0 18px; background: #0b1120; border-radius: 14px; }
.tab { border: 0; padding: 11px; color: #94a3b8; background: transparent; border-radius: 11px; font-weight: 800; }
.tab.active { color: white; background: #263248; }
.form { display: grid; gap: 14px; }
label { display: grid; min-width: 0; gap: 7px; color: #cbd5e1; font-size: 14px; font-weight: 700; }
input, select { width: 100%; min-width: 0; border: 1px solid #3a465e; border-radius: 13px; background: #0b1120; color: white; padding: 13px; min-height: 48px; }
.role-help { margin: -4px 0 0; color: #aebcd0; font-size: 13px; line-height: 1.45; }
.choice-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.primary, .secondary, .end-turn { min-height: 50px; border: 0; border-radius: 14px; padding: 12px 18px; color: #111827; background: linear-gradient(135deg, #ffbd51, #a989ff); font-weight: 900; }
.primary:disabled { color: #7c8799; background: #263248; cursor: not-allowed; }
.secondary { background: #e2e8f0; }
.end-turn { color: white; background: #334155; }
.hidden { display: none !important; }
.error { margin: 4px 0 0; padding: 11px 13px; border: 1px solid #7f1d1d; border-radius: 12px; background: #3f1520; color: #fecaca; line-height: 1.4; }
.game-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.game-header h1 { font-size: 28px; }
.game-header .eyebrow { margin-top: 0; }
.connection { min-height: 34px; display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 999px; background: #32260d; color: #fde68a; font-size: 13px; font-weight: 800; }
.connection.online { color: #86efac; }
.link-button { padding: 0; border: 0; background: none; color: white; font-weight: 900; letter-spacing: .14em; }
.status-card { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px; }
.turn-title { margin: 0; font-size: 18px; line-height: 1.2; }
.turn-note { margin: 5px 0 0; color: #b6c1d2; font-size: 14px; }
.timer { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: #0b1120; border: 4px solid #64748b; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer small { display: block; margin-top: 1px; color: #9aa9bd; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.timer.urgent { border-color: #ef4444; color: #fecaca; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(.96); } }
#lobby { padding: 18px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-box { border-radius: 18px; padding: 13px; background: #0b1120; border-top: 4px solid var(--team); }
.team-amber { --team: var(--amber); }
.team-violet { --team: var(--violet); }
.team-box h3 { margin: 0 0 10px; }
.person { display: flex; gap: 6px; justify-content: space-between; padding: 9px 0; border-top: 1px solid #283449; font-size: 14px; }
.person > span { min-width: 0; overflow-wrap: anywhere; }
.person b { flex: 0 0 auto; color: #dce6f4; }
.dot { color: #64748b; }.dot.online { color: #4ade80; }
.seat-controls { margin: 18px 0; }
.lobby-footer { display: grid; gap: 12px; }
.lobby-footer .primary { width: 100%; }
.fill-bots { min-height: 56px; font-size: 16px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.card { position: relative; min-width: 0; min-height: clamp(62px, 16vw, 118px); padding: 6px 3px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: linear-gradient(145deg, #fff4dd, #d9c8a9); color: #101828; box-shadow: inset 0 -5px 0 rgba(0,0,0,.08), 0 5px 13px rgba(0,0,0,.2); font-size: clamp(9px, 2.55vw, 17px); font-weight: 950; line-height: 1.04; overflow-wrap: anywhere; hyphens: auto; }
.card.secret-amber { background: linear-gradient(145deg, #ffd275, #d99319); }
.card.secret-violet { background: linear-gradient(145deg, #c7a8ff, #7543d4); color: white; }
.card.secret-neutral { background: linear-gradient(145deg, #a8b2c0, #586579); color: white; }
.card.secret-danger { background: linear-gradient(145deg, #2c3443, #080b11); color: white; }
.card.secret-amber::after, .card.secret-violet::after, .card.secret-neutral::after, .card.secret-danger::after { position: absolute; top: 4px; right: 5px; font-size: 10px; line-height: 1; }
.card.secret-amber::after { content: '●'; color: #6f3e00; }
.card.secret-violet::after { content: '◆'; color: #f3e8ff; }
.card.secret-neutral::after { content: '—'; color: #f8fafc; }
.card.secret-danger::after { content: '✕'; color: #fca5a5; }
.card.revealed { transform: scale(.96); opacity: .68; box-shadow: inset 0 0 0 3px rgba(255,255,255,.25); }
.card:disabled { cursor: default; }
.actions { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); display: grid; gap: 9px; margin-top: 13px; padding: 11px; border-radius: 18px; background: rgba(9,13,24,.95); backdrop-filter: blur(10px); }
.clue-form { display: grid; grid-template-columns: 1fr 78px auto; gap: 8px; }
.clue-pill { border-radius: 999px; padding: 9px 14px; background: #0b1120; border: 1px solid #334155; font-weight: 900; text-align: center; }
.score { display: flex; gap: 12px; font-weight: 800; font-size: 13px; }
.amber-text { color: #fbbf24; }.violet-text { color: #c4b5fd; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 90px; transform: translateX(-50%); width: min(90%, 480px); margin: 0; padding: 12px 16px; border-radius: 13px; background: #7f1d1d; color: white; box-shadow: 0 12px 30px #0008; }
.quiet { display: block; margin: 24px auto 0; border: 0; background: transparent; color: #94a3b8; padding: 12px; }
.rules { color: #cbd5e1; font-size: 14px; line-height: 1.5; }
.start-hint { margin: 0; color: #fcd34d; font-size: 13px; line-height: 1.4; }
.phase-badge { display: inline-flex; margin-bottom: 6px; padding: 4px 8px; border-radius: 999px; background: #27334a; color: #dbeafe; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 430px) {
  .shell { padding-left: 8px; padding-right: 8px; }
  .intro { padding: 21px; border-radius: 20px; }
  .board { gap: 5px; }
  .card { border-radius: 10px; }
  .clue-form { grid-template-columns: 1fr 68px; }
  .clue-form button { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .teams { grid-template-columns: 1fr; }
  .team-box { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .timer.urgent { animation: none; }
}
