/* Phone controller. Thumb-first: big targets, safe areas, no zoom. */

body.play { overscroll-behavior: none; touch-action: manipulation; }
.play .stage {
  position: fixed; inset: 0; z-index: 1; max-width: 520px; margin: 0 auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.play .view {
  display: flex; flex-direction: column; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.play .eyebrow { font-size: 0.68rem; }

/* ── Join ────────────────────────────────────────────────────────────────── */

.join { padding-top: 0 !important; }
.join .hero { position: relative; margin: 0 -20px; height: min(36vh, 300px); flex: none; overflow: hidden; }
.join .hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; animation: hero-in 1.6s var(--ease-out) both; }
@keyframes hero-in { from { transform: scale(1.12); opacity: 0; } }
.join .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--ink-rgb) / 0.15) 0%, transparent 35%, rgb(var(--ink-rgb) / 0.85) 82%, var(--ink)); }
.join .hero .flare { position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 22% 54%, rgba(255, 220, 150, 0.55), transparent 9%), radial-gradient(circle at 51% 56%, rgba(255, 220, 150, 0.5), transparent 8%); mix-blend-mode: screen; animation: flare 3.4s 0.6s ease-in-out infinite alternate; opacity: 0; }
@keyframes flare { to { opacity: 1; } }
.join .brand { margin-top: -56px; position: relative; z-index: 2; }
.join h1 { font-size: clamp(3.1rem, 15vw, 4.2rem); margin: 8px 0 0; }
.join .sub { font-size: clamp(1.9rem, 9vw, 2.5rem); color: var(--ivory); margin: -2px 0 0 18px; }

.field { margin-top: 26px; }
.field label, .field .label { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.field input {
  width: 100%; height: 58px; padding: 0 18px; border: 0; border-radius: 14px; outline: none;
  font-family: var(--serif); font-weight: 600; font-size: 1.45rem; color: var(--ivory);
  background: rgb(var(--ivory-rgb) / 0.06); box-shadow: inset 0 0 0 1px rgb(var(--ivory-rgb) / 0.14);
  transition: box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: rgb(var(--ivory-rgb) / 0.28); font-style: italic; }
.field input:focus { background: rgb(var(--ivory-rgb) / 0.09); box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 4px rgb(var(--gold-rgb) / 0.15); }

.paints { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 6px; }
.paint { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 8px 2px 6px; border-radius: 14px; transition: background 0.2s; }
.paint .swatch { position: relative; display: grid; place-items: center; }
.paint .chip { --size: 42px; transition: transform 0.3s var(--ease-spring), box-shadow 0.2s; }
.paint .swatch svg { position: absolute; width: 20px; height: 20px; color: var(--chip-ink, #fff); filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.35)); opacity: 0; transform: scale(0.4); transition: opacity 0.2s, transform 0.35s var(--ease-spring); pointer-events: none; }
.paint[aria-checked="true"] .swatch svg { opacity: 1; transform: scale(1.12); }
.paint .swatch { --chip-ink: #fff; }
.paint .swatch:has([data-paint="gold"], [data-paint="white"], [data-paint="lime"], [data-paint="yellow"], [data-paint="brittany"], [data-paint="silver"]) { --chip-ink: #1d1a14; }
.paint span.lbl { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ivory-dim); text-align: center; line-height: 1.2; }
.paint[aria-checked="true"] { background: rgb(var(--gold-rgb) / 0.1); }
.paint[aria-checked="true"] .chip { transform: scale(1.12); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 0 0 2.5px var(--gold-hi), 0 0 18px rgb(var(--gold-hi-rgb) / 0.5); }
.paint[aria-checked="true"] span.lbl { color: var(--gold-hi); }

.join .go { width: 100%; margin-top: 26px; --h: 60px; font-size: 0.9rem; }
.join .err { min-height: 1.4em; margin-top: 12px; color: var(--bad-ink); font-size: 0.88rem; font-weight: 600; text-align: center; }
.join .foot { margin-top: auto; padding-top: 18px; text-align: center; font-size: 0.7rem; color: var(--ivory-faint); letter-spacing: 0.08em; }

/* ── Waiting room ────────────────────────────────────────────────────────── */

.center { align-items: center; justify-content: center; text-align: center; }
.wait .chip { --size: 104px; margin-bottom: 22px; animation: zoom-in 0.8s var(--ease-spring) both; }
.wait .ring { position: relative; }
.wait .ring::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgb(var(--gold-rgb) / 0.35); animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { from { transform: scale(0.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.wait h2 { font-size: 2.5rem; margin: 10px 0 0; word-break: break-word; }
.wait .status { margin-top: 14px; font-family: var(--serif); font-variation-settings: "opsz" 16; font-style: italic; font-size: 1.15rem; color: var(--ivory-dim); }
.dots i { display: inline-block; animation: blink 1.4s infinite both; font-style: normal; }
.dots i:nth-child(2) { animation-delay: 0.2s; } .dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
.wait .count { margin-top: 26px; display: inline-flex; align-items: center; gap: 10px; }
.wait .count b { font-family: var(--sans); font-weight: 800; font-size: 1.5rem; color: var(--gold-hi); }
.rules { margin-top: 30px; width: 100%; padding: 20px 18px; text-align: left; --s: 16px; --bg: rgb(var(--ink-2-rgb) / 0.55); }
.rules ol { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 12px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 0.92rem; line-height: 1.4; color: var(--ivory-dim); }
.rules li::before { content: counter(r); font-family: var(--sans); font-weight: 800; font-size: 1.1rem; color: var(--gold); line-height: 1; }
.rules b { color: var(--ivory); }
.linkish { margin-top: 18px; font-size: 0.78rem; color: var(--ivory-faint); text-decoration: underline; text-underline-offset: 3px; }

/* ── Intro ───────────────────────────────────────────────────────────────── */

.p-intro .odo { font-size: 5.4rem; margin: 14px 0 6px; }
.p-intro .of { font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ivory-dim); font-weight: 600; }
.p-intro .pills { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.p-intro .prompt { margin-top: 26px; font-family: var(--serif); font-variation-settings: "opsz" 16; font-weight: 600; font-size: 1.45rem; line-height: 1.22; text-wrap: balance; }
.p-intro .ready { margin-top: 28px; font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

/* ── Question ────────────────────────────────────────────────────────────── */

.p-q { gap: 0; }
.p-q .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-q .qn { font-weight: 800; color: var(--gold-hi); font-size: 0.95rem; letter-spacing: 0.08em; }
.p-q .qn small { color: var(--ivory-faint); font-weight: 600; }
.p-q .top .pill { font-size: 0.6rem; }
.p-q .secs { min-width: 52px; height: 34px; display: grid; place-items: center; padding: 0 12px; border-radius: 99px; font-weight: 800; font-size: 1rem; background: rgb(var(--ivory-rgb) / 0.07); box-shadow: inset 0 0 0 1px rgb(var(--ivory-rgb) / 0.12); font-variant-numeric: tabular-nums; transition: color 0.3s, background 0.3s; }
.p-q .secs.hot { color: #fff; background: var(--t0); box-shadow: 0 0 18px rgb(var(--t0-hi-rgb) / 0.6); animation: pop 0.5s var(--ease-spring); }
.fuel { height: 4px; border-radius: 4px; margin: 14px 0 0; background: rgb(var(--ivory-rgb) / 0.1); overflow: hidden; flex: none; }
.fuel i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--t0-hi), var(--gold) 30%, var(--gold-hi)); border-radius: 4px; }
.p-q .prompt { margin: 20px 0 18px; font-family: var(--serif); font-variation-settings: "opsz" 16; font-weight: 600; font-size: clamp(1.3rem, 6vw, 1.6rem); line-height: 1.2; text-wrap: balance; }
.p-q .tiles { display: grid; gap: 10px; margin-top: auto; }
.play .tile { width: 100%; min-height: 70px; padding: 12px 16px 12px 12px; gap: 14px; border-radius: 16px; animation: rise 0.5s var(--ease-out) both; animation-delay: calc(var(--d) * 1ms); }
.play .tile .letter { width: 38px; height: 38px; font-size: 1.15rem; }
.play .tile .text { font-size: 1.05rem; flex: 1; }
.play .tile:active { transform: scale(0.97); }
.p-q.locked .tile:not(.mine) { opacity: 0.22; filter: saturate(0.3); }
.p-q .tile.mine { box-shadow: 0 0 0 3px var(--ivory), 0 0 30px rgb(var(--ivory-rgb) / 0.3), 0 12px 30px rgba(0, 0, 0, 0.35); }
.p-q .tile .lock { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; padding: 5px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.25); }
.lockbar { margin-top: 16px; text-align: center; min-height: 52px; }
.lockbar .script { font-size: 1.9rem; }
.lockbar small { display: block; margin-top: 4px; font-size: 0.74rem; color: var(--ivory-faint); letter-spacing: 0.06em; }

/* ── Reveal ──────────────────────────────────────────────────────────────── */

.p-rev { text-align: center; align-items: center; }
.verdict { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.verdict .badge { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; animation: zoom-in 0.7s var(--ease-spring) both; }
.verdict .badge svg { width: 46%; height: 46%; }
.verdict.good .badge { background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 60%, var(--gold-lo)); color: var(--ink); box-shadow: 0 0 0 6px rgb(var(--gold-hi-rgb) / 0.15), 0 0 50px rgb(var(--gold-hi-rgb) / 0.45); }
.verdict.bad .badge { background: rgb(var(--bad-rgb) / 0.16); color: var(--bad-ink); box-shadow: inset 0 0 0 2px rgb(var(--bad-rgb) / 0.6); }
.verdict h2 { margin: 16px 0 0; font-size: 2.6rem; }
.verdict.bad h2 { color: var(--ivory); }
.verdict .pts { margin-top: 6px; font-weight: 800; font-size: 1.6rem; color: var(--gold-hi); letter-spacing: 0.02em; }
.verdict .jab {
  position: relative; margin: 14px 6px 0; padding: 12px 18px; max-width: 340px;
  font-family: var(--serif); font-variation-settings: "opsz" 16; font-style: italic; font-size: 1.12rem; line-height: 1.35; color: var(--ivory);
  border-radius: 16px; background: rgb(var(--bad-rgb) / 0.1); box-shadow: inset 0 0 0 1px rgb(var(--bad-rgb) / 0.3);
  text-wrap: balance;
}
.verdict .jab::before { content: "“"; position: absolute; left: 10px; top: -9px; font-size: 2.4rem; color: var(--bad-ink); font-style: normal; line-height: 1; }
.verdict .streak { margin-top: 8px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--streak); }
.answer-was { margin-top: 18px; width: 100%; }
.answer-was .eyebrow { margin-bottom: 8px; display: block; }
.answer-was .tile { min-height: 58px; animation: none; box-shadow: 0 0 0 2px var(--gold-hi), 0 10px 26px rgba(0, 0, 0, 0.35); }
.p-rev .photo { margin-top: 22px; max-width: 88%; max-height: 46vh; width: auto; object-fit: contain; transform: rotate(-2deg); visibility: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); border-radius: 2px; }
.p-rev .photo.ready { visibility: visible; animation: print-drop-p 0.9s var(--ease-out) both; }
@keyframes print-drop-p { from { opacity: 0; transform: translateY(-30px) rotate(-10deg) scale(1.08); } }
/* A several-photo reveal: the photos cross-fade in step with the big screen */
.p-reel { margin-top: 22px; width: 88%; }
.p-reel .frame { position: relative; aspect-ratio: 1; transform: rotate(-2deg); }
.p-reel .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.9s ease; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.55)); }
.p-reel .frame img.on { opacity: 1; }
.p-reel .caption { margin: 12px 4px 0; min-height: 2.6em; font-family: var(--serif); font-variation-settings: "opsz" 16; font-style: italic; font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--gold-hi); text-wrap: balance; }
.p-intro .shout { font-size: 3.4rem; line-height: 1; color: var(--t0-hi); transform: rotate(-4deg); margin-bottom: 18px; animation: shout-p 0.7s var(--ease-spring) both; }
@keyframes shout-p { from { opacity: 0; transform: scale(2) rotate(-8deg); } }
.p-rev .story { margin: 18px 4px 0; font-family: var(--serif); font-variation-settings: "opsz" 16; font-style: italic; font-size: 1.1rem; line-height: 1.4; color: var(--ivory); text-wrap: balance; }
.scorebar { margin-top: auto; padding-top: 22px; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; }
.scorebar .k { font-size: 0.6rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ivory-faint); font-weight: 700; text-align: left; }
.scorebar .v { font-weight: 800; font-size: 1.35rem; color: var(--ivory); margin-top: 3px; }
.scorebar > div:last-child { text-align: right; }
.scorebar > div:last-child .k { text-align: right; }

/* ── Standings / Final ───────────────────────────────────────────────────── */

.place { font-family: var(--sans); font-weight: 800; letter-spacing: -0.04em; font-size: 5.6rem; line-height: 0.9; color: var(--gold-hi); margin-top: 12px; animation: zoom-in 0.8s var(--ease-spring) both; }
.place sup { font-size: 0.36em; vertical-align: 0; position: relative; top: -1.15em; margin-left: 2px; font-weight: 700; }
.of-n { margin-top: 8px; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ivory-dim); font-weight: 700; }
.gap { margin-top: 16px; font-family: var(--serif); font-variation-settings: "opsz" 16; font-style: italic; font-size: 1.1rem; color: var(--ivory); }
.gap b { font-style: normal; color: var(--gold-hi); font-family: var(--sans); font-weight: 800; }
.mini-board { margin-top: 26px; width: 100%; display: grid; gap: 8px; }
.mini-row { display: grid; grid-template-columns: 28px 30px 1fr auto; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border-radius: 12px; background: rgb(var(--ivory-rgb) / 0.045); box-shadow: inset 0 0 0 1px rgb(var(--ivory-rgb) / 0.07); text-align: left; animation: rise 0.5s var(--ease-out) both; animation-delay: calc(var(--d) * 1ms); }
.mini-row .r { font-family: var(--sans); font-weight: 800; font-size: 1rem; color: var(--gold); text-align: center; }
.mini-row .chip { --size: 30px; }
.mini-row .n { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .s { font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.mini-row.me { background: rgb(var(--gold-rgb) / 0.16); box-shadow: inset 0 0 0 1px rgb(var(--gold-hi-rgb) / 0.6); }
.p-final .sign { font-size: 2.3rem; margin-top: 24px; }
.p-final .thanks { margin-top: 10px; font-size: 0.82rem; color: var(--ivory-faint); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px; font-size: 0.88rem; font-weight: 600; text-align: center;
  background: rgb(var(--ink-2-rgb) / 0.94); box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px);
  animation: rise 0.4s var(--ease-out) both;
}
.offline-dot { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 110; display: flex; align-items: center; gap: 6px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bad-ink); padding: 6px 10px; border-radius: 99px; background: rgb(var(--bad-rgb) / 0.18); }
