/* BibleWords V2 – quiet night sky in team colours, paper cards, serif display type. */
:root {
  --bg: #0a0d1f;
  --ink: #f2f3f8;
  --muted: #a1a7c4;
  --panel: rgba(255, 255, 255, .055);
  --panel-line: rgba(255, 255, 255, .11);
  --blue: #5a83de;
  --blue-2: #a9c0f0;
  --red: #d45467;
  --red-2: #eea8b3;
  --gold: #dfb35e;
  --gold-2: #c99a45;
  --green: #3aa776;
  --amber: #d9a04a;
  --paper: #fbf6ec;
  --paper-ink: #23223a;
  --team: #7d86c9;
  --team-2: #b8bde6;
  --glow-a: #34509e;
  --glow-b: #6b3552;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
body[data-team="0"] { --team: var(--blue); --team-2: var(--blue-2); --glow-a: #2c4fae; --glow-b: #34307e; }
body[data-team="1"] { --team: var(--red); --team-2: var(--red-2); --glow-a: #a23047; --glow-b: #6e2f4d; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.i { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i .fill { fill: currentColor; stroke: none; }
.t0 { color: var(--blue-2); }
.t1 { color: var(--red-2); }
.muted { color: var(--muted); }
.noscript { padding: 40px; text-align: center; }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, #141834 0%, var(--bg) 62%); }
.glow { position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%;
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.3) 45%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.3) 45%, transparent 100%);
  opacity: .34; transition: background-color 1.5s ease; will-change: transform; }
.glow-a { background-color: var(--glow-a); left: -30vmax; top: -25vmax; animation: drift-a 40s ease-in-out infinite alternate; }
.glow-b { background-color: var(--glow-b); right: -32vmax; bottom: -30vmax; animation: drift-b 46s ease-in-out infinite alternate; }
.glow-c { background-color: var(--gold); width: 50vmax; height: 50vmax; left: 30%; top: 40%; opacity: .05; animation: drift-c 50s ease-in-out infinite alternate; }
.dust { position: absolute; inset: -50%; opacity: .28;
  background-image: radial-gradient(1.2px 1.2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 90px 70px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 150px 140px, #cfd6ff 50%, transparent 51%);
  background-size: 190px 190px; animation: dust 200s linear infinite; }
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-12vmax, -10vmax) scale(1.1); } }
@keyframes drift-c { to { transform: translate(-24vmax, -16vmax) scale(.85); } }
@keyframes dust { to { transform: translate(190px, -380px); } }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; }
.screen { min-height: 100vh; min-height: 100dvh; max-width: 640px; margin: 0 auto;
  padding: calc(14px + var(--safe-t)) 16px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px; animation: screen-in .4s ease-out both; }
.screen.still, .screen.still * { animation: none; }
.screen.still .chip-in { animation: chip-in .25s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
.topbar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; min-height: 44px; }
.topbar .tools { display: flex; gap: 6px; grid-column: 3; justify-self: end; }
.page-title { margin: 0; text-align: center; font: 600 22px/1.15 var(--display); }
.panel { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.kicker { font: 600 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel);
  display: inline-grid; place-items: center; transition: background .2s, opacity .2s; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn:active { background: rgba(255,255,255,.14); }
.icon-btn:disabled { opacity: .3; }
.icon-btn .i { width: 20px; height: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--panel-line); background: var(--panel); font-weight: 600; transition: background .2s, filter .2s; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 54px; font-size: 17px; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-primary { background: linear-gradient(180deg, #e7c072, var(--gold-2)); color: #1d1405; border-color: transparent; }
.btn-danger { background: #b9435a; border-color: transparent; }
.btn-go { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 0 24px; border: 0; border-radius: 14px;
  background: linear-gradient(180deg, #e7c072 0%, var(--gold-2) 100%); color: #1d1405;
  font: 600 18px/1 var(--font); letter-spacing: .02em;
  box-shadow: 0 8px 22px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35);
  transition: filter .2s, box-shadow .2s, transform .15s; }
.btn-go:hover { filter: brightness(1.05); }
.btn-go:active { transform: translateY(1px); }
.btn-go:disabled { filter: grayscale(.9) brightness(.55); box-shadow: none; }
.btn-go .i { width: 20px; height: 20px; }
.btn-xl { min-height: 60px; font-size: 19px; }
.btn-go.t0 { background: linear-gradient(180deg, #6a90e4, #4a72cf); color: #fff; }
.btn-go.t1 { background: linear-gradient(180deg, #dc6476, #bd4357); color: #fff; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 4px; color: var(--gold); font-weight: 600; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* ---------- logo ---------- */
.logo { margin: 0; display: inline-flex; align-items: center; gap: 14px; font: 600 34px/1 var(--display); letter-spacing: -.01em; animation: fade-up .8s ease-out both; }
.logo-big { font-size: clamp(40px, 11vw, 58px); }
.logo-mark { display: grid; place-items: center; width: 1.15em; height: 1.15em; border-radius: .22em; border: 1.5px solid rgba(223,179,94,.7); color: var(--gold); background: rgba(223,179,94,.08); }
.logo-mark .i { width: .66em; height: .66em; stroke-width: 1.6; }
.logo-text i { font-style: normal; }
.logo .l2 { color: var(--gold); font-style: italic; font-weight: 500; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
.hero { text-align: center; padding: 6px 0 2px; }
.tagline { margin: 12px auto 0; max-width: 32ch; color: var(--muted); font-size: 15px; text-align: center; letter-spacing: .01em; }

/* ---------- gate ---------- */
.gate, .loading { justify-content: center; align-items: center; text-align: center; }
.gate-card { width: 100%; max-width: 420px; padding: 22px; display: grid; gap: 12px; text-align: left; margin-top: 18px; }
.gate-card label { font-weight: 600; }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--panel-line);
  background: rgba(5,7,22,.5); color: var(--ink); font: 500 16px var(--font); transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: rgba(161,167,196,.6); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(223,179,94,.16); }
.input-lg { min-height: 54px; font-size: 18px; }
.form-error { margin: 0; min-height: 1.3em; color: #f09aa8; font-weight: 600; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--gold); animation: spin .9s linear infinite; margin: 26px auto 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- setup ---------- */
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-color: rgba(223,179,94,.4); }
.resume-score { font: 600 24px/1.2 var(--display); }
.resume-score .muted { font: 500 14px var(--font); }
.resume-actions { display: flex; gap: 8px; }
.teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.team-card { padding: 14px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.team-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.team-card.t0 { --c: var(--blue); background: linear-gradient(180deg, rgba(90,131,222,.13), rgba(90,131,222,.03)); }
.team-card.t1 { --c: var(--red); background: linear-gradient(180deg, rgba(212,84,103,.13), rgba(212,84,103,.03)); }
.team-head { display: flex; align-items: center; gap: 8px; }
.team-head h2 { margin: 0; font: 600 19px/1.1 var(--display); flex: 1; color: var(--ink); }
.team-dot, .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.dot.t0 { --c: var(--blue); } .dot.t1 { --c: var(--red); }
.team-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: rgba(255,255,255,.1); color: var(--ink); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.team-count:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; align-content: flex-start; flex: 1; }
.chips-empty { color: var(--muted); font-size: 14px; padding: 7px 2px; }
.chip { display: inline-flex; align-items: center; max-width: 100%; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.chip-in { animation: chip-in .25s ease-out both; }
@keyframes chip-in { from { opacity: 0; transform: scale(.92); } }
.chip-name { border: 0; background: none; padding: 6px 4px 6px 12px; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.chip-x { border: 0; background: none; width: 30px; height: 32px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.chip-x:hover { color: #fff; }
.chip-x .i { width: 14px; height: 14px; }
.add-player { display: flex; gap: 6px; }
.add-player .input { min-height: 42px; font-size: 15px; }
.add-btn { flex: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--panel-line); background: rgba(255,255,255,.08); color: var(--c); display: grid; place-items: center; }
.add-btn:hover { background: rgba(255,255,255,.14); }
.shuffle { align-self: center; display: grid; justify-items: center; gap: 4px; width: 62px; padding: 12px 0; border-radius: 14px;
  border: 1px solid var(--panel-line); background: var(--panel); font-size: 12px; font-weight: 600; color: var(--muted); transition: color .2s, background .2s; }
.shuffle .i { width: 22px; height: 22px; color: var(--gold); }
.shuffle:hover:not(:disabled) { color: #fff; background: rgba(255,255,255,.09); }
.shuffle:disabled { opacity: .4; }
.options { padding: 14px 16px; display: grid; gap: 14px; }
.opt { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 10px; }
.opt-label { font-weight: 600; color: var(--muted); font-size: 14px; }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: rgba(5,7,22,.45); border: 1px solid var(--panel-line); }
.seg button { flex: 1 1 0; min-width: 0; min-height: 38px; border: 0; border-radius: 9px; background: none; font-weight: 600; font-size: 15px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, color .2s; white-space: nowrap; font-variant-numeric: tabular-nums; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed="true"] { background: rgba(223,179,94,.16); color: #f3d79c; box-shadow: inset 0 0 0 1px rgba(223,179,94,.55); }
.seg .dot { width: 9px; height: 9px; }
.deck-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: 14px; text-align: center; }
.deck-line .i { color: var(--gold); }
.deck-line b { color: var(--ink); font-weight: 600; }
.start-wrap { display: grid; gap: 6px; text-align: center; }
.start-hint { margin: 0; min-height: 1.2em; color: var(--muted); font-size: 14px; }
.foot { text-align: center; margin-top: auto; }

/* ---------- scoreboards ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.board-team { display: grid; gap: 4px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-line); }
.board-team.t1 { text-align: right; }
.board-name { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.board-num { font: 600 32px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.board-vs { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; text-align: center; }
.board-compact .board-num { font-size: 26px; }
.bar { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: currentColor; transition: width .5s ease-out; }
.board-team.t1 .bar, .score.t1 .bar { transform: scaleX(-1); }

/* ---------- handoff ---------- */
.handoff { text-align: center; }
.round-chip { justify-self: center; padding: 6px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-line); font-weight: 600; font-size: 13px; letter-spacing: .04em; }
.handoff .topbar { grid-template-columns: 44px 1fr 44px; }
.handoff-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; }
.team-tag { padding: 5px 14px; border-radius: 999px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; border: 1px solid currentColor; background: none; }
.team-tag.t0 { color: var(--blue-2); } .team-tag.t1 { color: var(--red-2); }
.orb { position: relative; width: 116px; height: 116px; margin: 22px 0 16px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, var(--team-2) -40%, var(--team) 70%); box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.18); }
.orb .i { width: 46px; height: 46px; stroke-width: 1.7; position: relative; }
.orb-ring { position: absolute; inset: -12px; border-radius: 50%; border: 1px solid var(--team-2); opacity: 0; animation: ring 3.6s ease-out infinite; }
.orb-ring.r2 { display: none; }
@keyframes ring { 0% { transform: scale(.9); opacity: .5; } 100% { transform: scale(1.35); opacity: 0; } }
.handoff-pass { margin: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; }
.handoff-name { margin: 2px 0 0; font: 600 clamp(42px, 12vw, 68px)/1.05 var(--display); overflow-wrap: anywhere; }
.handoff-sub { margin: 12px 0 0; color: var(--ink); font-weight: 500; }
.handoff-sub span { color: var(--muted); }
.handoff-go { display: grid; gap: 8px; }
.handoff-go p { margin: 0; font-size: 14px; }

.countdown { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(6,8,22,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .3s; }
.countdown.out { opacity: 0; }
.cd-num { font: 600 min(40vw, 220px)/1 var(--display); color: #fff; animation: cd .72s ease-out both; }
.cd-go { color: var(--gold); font-size: min(24vw, 140px); font-style: italic; }
@keyframes cd { 0% { transform: scale(1.15); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- round ---------- */
.round { gap: 10px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow: hidden; height: 100vh; height: 100dvh; }
.round::after { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 0; }
.round.flash-yes::after { background: radial-gradient(circle at 80% 50%, rgba(58,167,118,.28), transparent 60%); animation: flash .5s ease-out; }
.round.flash-no::after { background: radial-gradient(circle at 20% 50%, rgba(212,84,103,.3), transparent 60%); animation: flash .5s ease-out; }
.round.flash-skip::after { background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.14), transparent 60%); animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.hud { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; position: relative; z-index: 2; }
.score { position: relative; display: grid; gap: 3px; padding: 8px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-line); opacity: .6; transition: opacity .3s, box-shadow .3s; }
.score.t1 { text-align: right; }
.score.is-active { opacity: 1; box-shadow: inset 0 0 0 1.5px currentColor; }
.score-name { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.score-num { font: 600 28px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.score.bump .score-num { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.12); } }
.pop { position: absolute; top: 8px; left: 50%; font: 600 22px/1 var(--display); pointer-events: none; animation: pop .9s ease-out forwards; }
.pop-yes { color: #7fd3a8; } .pop-no { color: var(--red-2); }
@keyframes pop { 0% { transform: translate(-50%, 6px); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, 0); } 100% { transform: translate(-50%, 34px); opacity: 0; } }
.clock { position: relative; width: 80px; height: 80px; display: grid; place-items: center; }
.clock svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.clock circle { fill: none; stroke-width: 5; }
.clock-track { stroke: rgba(255,255,255,.09); }
.clock-ring { stroke: var(--team-2); stroke-linecap: round; stroke-dasharray: 1000; transition: stroke-dashoffset .1s linear, stroke .4s; }
.clock-time { position: relative; font: 600 20px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock.is-warn .clock-ring { stroke: var(--amber); }
.clock.is-urgent .clock-ring { stroke: #e0637a; }
.clock.is-urgent .clock-time { color: #f3b2bd; animation: urgent 1s ease-in-out infinite; }
@keyframes urgent { 50% { opacity: .55; } }
.who { display: flex; justify-content: center; position: relative; z-index: 2; }
.who-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 16px 7px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-line); }
.who-pill b { color: var(--ink); font: 600 17px/1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-pill span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.table { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; z-index: 1; }
.table::before, .table::after { content: ''; grid-area: 1 / 1; width: min(86vw, 400px); height: min(62%, 430px); border-radius: 20px; background: rgba(251,246,236,.08); border: 1px solid rgba(255,255,255,.08); }
.table::before { transform: rotate(-3deg) translate(-4px, 8px); }
.table::after { transform: rotate(2.2deg) translate(4px, 4px); background: rgba(251,246,236,.12); }
.card { grid-area: 1 / 1; position: relative; z-index: 2; width: min(88vw, 410px); max-height: 100%; border-radius: 20px; overflow: hidden;
  background: var(--paper); color: var(--paper-ink); display: flex; flex-direction: column; touch-action: none; cursor: grab;
  box-shadow: 0 24px 50px -14px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.05); --yes: 0; --no: 0; --skip: 0; will-change: transform; }
.card.dragging { cursor: grabbing; transition: none; }
.card.spring { transition: transform .3s ease-out; }
.card.gone { z-index: 3; pointer-events: none; }
.card.flying { transition: transform .5s cubic-bezier(.5,0,.75,.4), opacity .5s ease-in; }
.card.fade { transition: opacity .22s, transform .22s; opacity: 0; transform: scale(.96); }
.card.deal { animation: deal .38s ease-out both; }
.card.back-right { animation: back-right .38s ease-out both; }
.card.back-left { animation: back-left .38s ease-out both; }
.card.back-up { animation: back-up .38s ease-out both; }
@keyframes deal { from { opacity: 0; transform: translateY(20px) scale(.97); } }
@keyframes back-right { from { opacity: 0; transform: translateX(40vw) rotate(8deg); } }
@keyframes back-left { from { opacity: 0; transform: translateX(-40vw) rotate(-8deg); } }
@keyframes back-up { from { opacity: 0; transform: translateY(-40vh); } }
.card-top { position: relative; padding: 20px 20px 22px; text-align: center; color: #fff; background: var(--team); background: linear-gradient(180deg, var(--team) 0%, color-mix(in srgb, var(--team) 82%, #000) 100%); border-bottom: 3px solid var(--gold); }
.card-kicker { display: block; font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; opacity: .8; }
.card-word { margin: 8px 0 2px; font: 600 clamp(32px, 10vw, 50px)/1.08 var(--display); overflow-wrap: normal; word-break: normal; letter-spacing: -.005em; }
.card-no { list-style: none; margin: 0; padding: 8px 22px 18px; display: grid; }
.card-no li { display: flex; align-items: center; gap: 12px; padding: clamp(6px, 1.3vh, 11px) 2px; font: 500 clamp(18px, 2.8vh, 23px)/1.2 var(--font); border-bottom: 1px solid rgba(35,34,58,.1); }
.card-no li:last-child { border-bottom: 0; }
.card-no .i { width: 19px; height: 19px; color: #c2445a; stroke-width: 2; }
.stamp { position: absolute; top: 20px; z-index: 4; padding: 5px 12px; border: 2px solid; border-radius: 8px; font: 700 17px/1 var(--font); text-transform: uppercase; letter-spacing: .12em; background: rgba(251,246,236,.94); pointer-events: none; }
.stamp-yes { left: 16px; color: #23865a; transform: rotate(-8deg); opacity: var(--yes); }
.stamp-no { right: 16px; color: #b8394f; transform: rotate(8deg); opacity: var(--no); }
.stamp-skip { left: 50%; top: auto; bottom: 22px; color: #7a6230; transform: translateX(-50%); opacity: var(--skip); }
.streak { position: absolute; top: -2px; left: 50%; z-index: 5; transform: translateX(-50%); pointer-events: none; opacity: 0; }
.streak span { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(10,13,31,.85); border: 1px solid rgba(223,179,94,.6); color: #f3d79c; font: 600 14px/1 var(--font); letter-spacing: .04em; white-space: nowrap; }
.streak.on { animation: streak 1.8s ease-out both; }
@keyframes streak { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
.controls { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; justify-items: center; gap: 8px; position: relative; z-index: 2; padding-top: 4px; }
.controls .icon-btn { align-self: end; margin-bottom: 24px; }
.ctl { display: grid; justify-items: center; gap: 6px; border: 0; background: none; padding: 0; font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ctl .i { box-sizing: content-box; width: 30px; height: 30px; padding: 18px; border-radius: 50%; color: #fff; stroke-width: 2.4; transition: filter .15s, transform .15s; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.ctl-yes .i { background: var(--green); }
.ctl-no .i { background: #c9475c; }
.ctl-skip .i { width: 24px; height: 24px; padding: 14px; background: rgba(255,255,255,.08); border: 1px solid var(--panel-line); color: var(--ink); stroke-width: 2.2; box-shadow: none; }
.ctl:active .i { transform: scale(.95); }
.ctl:hover .i { filter: brightness(1.08); }
.keys { margin: 0; text-align: center; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .04em; opacity: .65; position: relative; z-index: 2; }
@media (hover: none), (max-height: 760px) { .keys { display: none; } }

.splash { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle, rgba(140,30,55,.5), rgba(8,8,24,.92) 70%); animation: splash-in .3s ease-out both; transition: opacity .35s; }
.splash.out { opacity: 0; }
.splash span { font: 600 min(14vw, 92px)/1 var(--display); color: #fff; animation: fade-up .4s .05s ease-out both; }
@keyframes splash-in { from { opacity: 0; } }

/* ---------- summary ---------- */
.sum-head { text-align: center; padding-top: 8px; }
.sum-points { font: 600 clamp(72px, 22vw, 108px)/1 var(--display); margin-top: 8px; animation: fade-up .5s ease-out both; font-variant-numeric: tabular-nums; }
.sum-head .muted { margin: 4px 0 12px; font-weight: 500; }
.sum-counts { display: inline-flex; gap: 8px; }
.sum-counts span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-line); font-weight: 600; font-variant-numeric: tabular-nums; }
.c-yes .i { color: #7fd3a8; } .c-no .i { color: var(--red-2); } .c-skip .i { color: var(--muted); }
.sum-words { padding: 12px; }
.hint { margin: 0 4px 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 36vh; overflow-y: auto; }
.res { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 8px 0 14px; border-radius: 10px; border: 1px solid transparent; font: 500 17px var(--display); text-align: left; transition: background .2s; }
.res-word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; }
.res-mark .i { width: 16px; height: 16px; stroke-width: 2.6; }
.res-yes { background: rgba(58,167,118,.1); border-color: rgba(58,167,118,.28); } .res-yes .res-mark { background: var(--green); color: #fff; }
.res-no { background: rgba(212,84,103,.1); border-color: rgba(212,84,103,.28); } .res-no .res-mark { background: #c9475c; color: #fff; }
.res-skip { background: rgba(255,255,255,.04); color: var(--muted); } .res-skip .res-mark { background: rgba(255,255,255,.1); }
.sum-next { margin-top: auto; display: grid; gap: 8px; text-align: center; }
.up-next { margin: 0; color: var(--muted); font-weight: 500; }
.up-next b { font: 600 18px var(--display); }

/* ---------- end ---------- */
.end { text-align: center; }
.end-hero { padding-top: 12px; }
.trophy { display: inline-grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; color: #1d1405;
  background: linear-gradient(180deg, #ecca82, var(--gold-2)); box-shadow: 0 14px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4); animation: fade-up .7s ease-out both; }
.trophy .i { width: 52px; height: 52px; stroke-width: 1.6; }
.winner { margin: 20px 0 6px; font: 600 clamp(38px, 10vw, 58px)/1.08 var(--display); animation: fade-up .6s .15s ease-out both; }
.final { display: inline-flex; align-items: baseline; gap: 14px; font: 600 50px/1 var(--display); font-variant-numeric: tabular-nums; }
.final span { color: var(--muted); font-size: 36px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 12px 8px; display: grid; gap: 4px; }
.stat span { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat b { font: 600 22px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat small { color: var(--muted); font-weight: 500; font-size: 12px; }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; text-align: left; }
.players h3 { margin: 0 0 6px; font: 600 16px var(--display); }
.player-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--panel-line); font-weight: 500; font-variant-numeric: tabular-nums; }
.player-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row b { font-weight: 600; }
.end-actions { display: grid; gap: 8px; margin-top: auto; }

/* ---------- propose ---------- */
.propose-grid { display: grid; gap: 16px; }
.propose-form { padding: 18px; display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field > span { font-weight: 600; }
.field-hint { min-height: 1.2em; font-weight: 600; font-size: 14px; }
.field-hint.is-good { color: #7fd3a8; } .field-hint.is-bad { color: #f09aa8; }
.no-list { display: grid; gap: 8px; }
.no-item { display: flex; align-items: center; gap: 10px; }
.no-item i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: 13px; border: 1px solid rgba(212,84,103,.45); color: var(--red-2); }
.note { margin: 0; color: var(--muted); font-size: 14px; }
.note b { color: var(--ink); font-weight: 600; }
.preview { display: grid; justify-items: center; gap: 8px; }
.preview-label { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.preview-card { display: grid; }
.card.is-preview { --team: var(--blue); --team-2: var(--blue-2); width: min(88vw, 360px); cursor: default; }
.card.is-preview .stamp { display: none; }

/* ---------- modals and toasts ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(4,6,18,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s; }
.modal-wrap.in { opacity: 1; }
.modal { width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px; border-radius: 18px; background: linear-gradient(180deg, #1b2042, #131731); border: 1px solid var(--panel-line); box-shadow: 0 30px 80px rgba(0,0,0,.5); transform: translateY(8px); transition: transform .22s ease-out; }
.modal-wrap.in .modal { transform: none; }
.modal h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 600 23px/1.2 var(--display); }
.modal h2 .i { color: var(--gold); }
.modal p { margin: 0 0 6px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-stack { display: grid; gap: 8px; margin-top: 18px; }
.modal-pause { text-align: center; }
.pause-head { display: grid; justify-items: center; gap: 4px; }
.pause-head > .i { width: 40px; height: 40px; padding: 12px; box-sizing: content-box; border-radius: 50%; border: 1px solid rgba(223,179,94,.5); color: var(--gold); }
.pause-head h2 { justify-content: center; margin: 6px 0 0; font-size: 28px; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: #d6d9ea; }
.rules b { color: #fff; font-weight: 600; }
.rules span { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font-weight: 600; }
.r-yes { color: #7fd3a8; } .r-no { color: var(--red-2); } .r-skip { color: var(--muted); }
.toasts { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); z-index: 90; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: rgba(19,23,49,.96); border: 1px solid var(--panel-line); box-shadow: 0 12px 30px rgba(0,0,0,.4); font-weight: 600; text-align: center; animation: toast-in .3s ease-out both; transition: opacity .35s, transform .35s; }
.toast.good { border-color: rgba(58,167,118,.45); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .teams { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .shuffle { grid-column: 1 / -1; grid-row: 2; width: auto; display: flex; justify-content: center; gap: 8px; padding: 9px 16px; justify-self: center; font-size: 14px; }
  .shuffle .i { width: 18px; height: 18px; }
  .team-card.t1 { grid-column: 2; grid-row: 1; }
  .team-card { padding: 12px; }
  .chip-name { max-width: 110px; }
  .opt { grid-template-columns: 1fr; gap: 6px; }
  .seg button { font-size: 14px; }
  .stats { gap: 6px; }
  .stat b { font-size: 19px; }
}
@media (max-width: 380px) {
  .seg button { font-size: 13px; }
  .ctl .i { width: 26px; height: 26px; padding: 16px; }
  .clock { width: 72px; height: 72px; }
  .score-num { font-size: 24px; }
}
@media (max-height: 680px) {
  .card-top { padding: 14px 16px 16px; }
  .card-word { margin: 4px 0 0; font-size: clamp(28px, 9vw, 42px); }
  .card-no { padding: 2px 18px 12px; }
  .ctl .i { width: 26px; height: 26px; padding: 15px; }
  .ctl-skip .i { width: 20px; height: 20px; padding: 12px; }
  .clock { width: 68px; height: 68px; }
  .controls .icon-btn { margin-bottom: 20px; }
}
/* phone held sideways: word left, forbidden words right */
@media (max-height: 520px) and (orientation: landscape) {
  .round { gap: 6px; padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); }
  .who, .table::before, .table::after { display: none; }
  .score { padding: 4px 10px; } .score-num { font-size: 22px; } .score-name { font-size: 10px; }
  .clock { width: 56px; height: 56px; } .clock-time { font-size: 15px; }
  .card { flex-direction: row; width: min(94vw, 640px); }
  .card-top { flex: 0 0 44%; display: grid; align-content: center; padding: 12px 14px; border-bottom: 0; border-right: 3px solid var(--gold); }
  .card-word { margin: 4px 0 0; font-size: clamp(24px, 8vh, 38px); }
  .card-no { flex: 1; align-content: center; padding: 6px 16px; }
  .card-no li { padding: 3px 2px; font-size: 16px; }
  .card-no .i { width: 16px; height: 16px; }
  .ctl { font-size: 10px; gap: 2px; }
  .ctl .i { width: 20px; height: 20px; padding: 11px; } .ctl-skip .i { width: 16px; height: 16px; padding: 9px; }
  .controls { padding-top: 0; } .controls .icon-btn { width: 38px; height: 38px; margin-bottom: 16px; }
  .stamp { font-size: 14px; top: 10px; }
}
@media (min-width: 900px) {
  .screen.propose { max-width: 900px; }
  .propose-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .preview { position: sticky; top: 20px; padding-top: 10px; }
  .screen.round { max-width: 720px; }
  .card { width: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .05s !important; }
}
