/* =========================================================
   GAFF — Vector Pop prototype
   Flat color. Heavy outlines. Hard shadows. Oversized type.
   ========================================================= */

:root {
  --paper:   #FAF4E8;
  --paper-2: #F3EAD8;
  --ink:     #16130E;
  --ink-70:  rgba(22, 19, 14, 0.70);
  --ink-50:  rgba(22, 19, 14, 0.50);
  --ink-30:  rgba(22, 19, 14, 0.30);
  --ink-12:  rgba(22, 19, 14, 0.12);

  --yellow:  #FFC629;
  --blue:    #2C5BFF;
  --coral:   #FF5A45;
  --green:   #1FA85C;
  --purple:  #7A5CFF;
  --white:   #FFFDF7;

  --line: 3px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 16px;
  --radius-sm: 10px;

  --display: "Archivo Black", "Archivo", sans-serif;
  --ui: "Archivo", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --snap: cubic-bezier(0.34, 1.4, 0.44, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Block iOS text-size inflation (the desktop/mobile scale mismatch)
   and double-tap-to-zoom. Same fix as Tactical Journal. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { touch-action: manipulation; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; color: inherit; cursor: pointer; }
input, textarea { font-family: inherit; color: inherit; }

/* =========================================================
   Desktop stage (gallery chrome around the phone)
   ========================================================= */

.stage-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: var(--line) solid var(--ink);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}

.stage-nav__brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}

.brand-mark {
  width: 34px; height: 34px; border: var(--line) solid var(--ink);
  border-radius: 9px; background: var(--yellow);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1.125rem; line-height: 1;
  box-shadow: var(--shadow-sm);
}

.stage-nav__brand span { font-family: var(--display); font-size: 1.063rem; letter-spacing: 0.04em; }

.stage-nav__meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-70);
}
.stage-nav__meta a { color: var(--ink); }

.stage {
  min-height: calc(100vh - 71px);
  display: grid;
  grid-template-columns: minmax(260px, 360px) auto;
  gap: 48px;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.stage__hint h2 {
  font-family: var(--display);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.02;
  text-transform: uppercase;
  margin: 10px 0 14px;
}

.stage__hint p { color: var(--ink-70); font-size: 0.938rem; line-height: 1.5; max-width: 34ch; }

.stage__hint-num {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em;
  border: var(--line) solid var(--ink); border-radius: 999px;
  padding: 4px 12px; background: var(--yellow); display: inline-block;
  box-shadow: var(--shadow-sm);
}

.stage__index { list-style: none; margin-top: 26px; display: grid; gap: 10px; }

.stage__index button {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 12px;
  border: var(--line) solid var(--ink); border-radius: var(--radius-sm);
  background: var(--white);
  padding: 11px 14px;
  font-family: var(--ui); font-weight: 700; font-size: 0.875rem;
  letter-spacing: 0.02em; text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  transition: transform 120ms var(--snap), box-shadow 120ms var(--snap), background 120ms;
}
.stage__index button em { font-family: var(--mono); font-style: normal; font-size: 0.688rem; color: var(--ink-50); }
.stage__index button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.stage__index button.is-active { background: var(--yellow); }
.stage__index button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* =========================================================
   The phone
   ========================================================= */

.phone {
  width: 393px; height: 830px;
  border: var(--line) solid var(--ink);
  border-radius: 52px;
  background: var(--ink);
  padding: 10px;
  box-shadow: 12px 12px 0 var(--ink-12), var(--shadow);
  position: relative;
}

.phone__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 42px;
  background: var(--paper);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* =========================================================
   Screens
   ========================================================= */

.screens { position: relative; flex: 1; overflow: hidden; }

.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 22px 20px calc(96px + env(safe-area-inset-bottom, 0px));
}
.screen::-webkit-scrollbar { display: none; }
.screen.is-active { display: flex; }

/* stamped entrance for children */
.screen.is-active .stamp {
  animation: stamp-in 420ms var(--snap) both;
}
.screen.is-active .stamp:nth-child(2) { animation-delay: 70ms; }
.screen.is-active .stamp:nth-child(3) { animation-delay: 140ms; }
.screen.is-active .stamp:nth-child(4) { animation-delay: 210ms; }
.screen.is-active .stamp:nth-child(5) { animation-delay: 280ms; }
.screen.is-active .stamp:nth-child(6) { animation-delay: 350ms; }
.screen.is-active .stamp:nth-child(7) { animation-delay: 420ms; }

@keyframes stamp-in {
  0%   { opacity: 0; transform: scale(1.06) rotate(-1deg) translateY(8px); }
  60%  { opacity: 1; transform: scale(1.01) rotate(0.4deg) translateY(-2px); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-active .stamp { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* =========================================================
   Shared atoms
   ========================================================= */

.kicker {
  font-family: var(--mono); font-size: 0.688rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-70);
  display: flex; align-items: center; gap: 8px;
}
.kicker::before { content: ""; width: 16px; height: 3px; background: var(--ink); display: inline-block; }

.display-xl {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 2.625rem; line-height: 0.95; letter-spacing: 0.005em;
  margin: 8px 0 4px;
}

.display-md {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.5rem; line-height: 1.02;
}

.card {
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 16px;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: var(--line) solid var(--ink); border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--mono); font-size: 0.688rem; letter-spacing: 0.06em;
  background: var(--white);
}
.chip--yellow { background: var(--yellow); }
.chip--blue   { background: var(--blue); color: var(--white); }
.chip--coral  { background: var(--coral); color: var(--white); }
.chip--green  { background: var(--green); color: var(--white); }

.btn-pop {
  display: block; width: 100%;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--yellow);
  font-family: var(--display); font-size: 1.125rem; text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 110ms var(--snap), box-shadow 110ms var(--snap);
}
.btn-pop:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.btn-pop:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn-pop--ghost { background: var(--white); }
.btn-pop--blue { background: var(--blue); color: var(--white); }

/* Host speech */
.host-line {
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 14px 16px 15px;
  position: relative;
  margin-top: 18px;
}
.host-line .host-tag {
  position: absolute; top: -13px; left: 12px;
  font-family: var(--display); font-size: 0.688rem; letter-spacing: 0.1em;
  background: var(--yellow);
  border: var(--line) solid var(--ink); border-radius: 7px;
  padding: 2px 8px;
}
.host-line p {
  font-size: 1.031rem; line-height: 1.42; font-weight: 600;
}
.host-line p strong { background: var(--yellow); padding: 0 3px; border-radius: 3px; }
.host-line--callback { background: var(--paper-2); }

/* =========================================================
   Home: an inbox of turns
   ========================================================= */

.league-card { margin-top: 16px; }
.league-card__top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.league-card__name {
  font-family: var(--display); font-size: 1.125rem;
  text-transform: uppercase; line-height: 1.05;
}
.league-card__line {
  margin: 10px 0 14px;
  font-weight: 600; font-size: 0.938rem; line-height: 1.45;
  color: var(--ink-70);
}
.league-card .btn-pop { font-size: 1rem; padding: 13px; }
.league-card__rank {
  font-family: var(--mono); font-size: 0.688rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-50);
  margin: -6px 0 14px;
}
.league-card--waiting .league-card__rank { margin-bottom: 2px; }
.league-card--waiting { background: var(--paper-2); box-shadow: var(--shadow-sm); }
.league-card--waiting .league-card__line { margin-bottom: 2px; }

/* =========================================================
   Wizard bits
   ========================================================= */

.wiz-block { margin-top: 20px; }
.wiz-help {
  margin: 4px 0 14px;
  font-weight: 600; font-size: 0.875rem; line-height: 1.45;
  color: var(--ink-70);
}
.wiz-addrow { display: flex; gap: 10px; margin-top: 10px; }
.wiz-addrow .join-input { margin-top: 0; text-align: left; flex: 1; }
.wiz-add { width: auto; padding: 12px 18px; font-size: 1rem; }
.player-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.invite-sub {
  font-family: var(--mono); font-size: 0.688rem; letter-spacing: 0.1em;
  text-transform: uppercase; margin-top: 10px;
}

/* Per-question verdict cards on the Reveal */
.q-result { margin-top: 16px; padding: 14px; }
.q-result__top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.q-result__pts { font-family: var(--mono); font-weight: 800; font-size: 0.938rem; }
.q-result__q { font-weight: 800; font-size: 0.938rem; line-height: 1.35; margin-bottom: 4px; }
.q-result__who {
  margin-top: 12px;
  font-family: var(--mono); font-size: 0.688rem; line-height: 1.55;
  letter-spacing: 0.02em; color: var(--ink-50);
}

.verdict-row {
  display: flex; align-items: center; gap: 10px;
  border: var(--line) solid var(--ink); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-top: 8px;
  background: var(--white);
}
.verdict-row--right, .verdict-row--truth { background: var(--green); color: var(--white); }
.verdict-row--wrong { background: var(--coral); color: var(--white); }
.verdict-row--yours { background: var(--yellow); }
.v-mark { font-family: var(--display); font-size: 1.125rem; line-height: 1; flex-shrink: 0; }
.v-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; line-height: 1.3; }
.v-text strong { font-weight: 800; }
.v-text em {
  font-style: normal; font-family: var(--mono); font-size: 0.625rem;
  letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.85;
}

/* Reactions on verdict cards */
.react-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.react-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: var(--line) solid var(--ink); border-radius: 999px;
  background: var(--white);
  padding: 4px 10px;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform 110ms var(--snap), box-shadow 110ms var(--snap), background 120ms;
}
.react-chip:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.react-chip.is-on { background: var(--yellow); }
.react-emo { font-size: 0.938rem; line-height: 1; }

.tally { margin-top: 4px; }
.tally-row {
  display: flex; justify-content: space-between; align-items: center;
  border: var(--line) solid var(--ink); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-top: 8px;
  background: var(--white);
  font-weight: 800; font-size: 0.875rem;
}
.tally .tally-row:first-child { background: var(--ink); color: var(--yellow); }
.tally-count {
  font-family: var(--mono); font-size: 0.625rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* Reveal scorecard (your results live here, not in play) */
.scorecard { margin-top: 18px; }
.scorecard .score-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 6px;
}
.scorecard p { font-weight: 600; font-size: 0.875rem; color: var(--ink-70); }

.wait-line {
  margin-top: 8px;
  font-weight: 700; font-size: 0.938rem; line-height: 1.45;
}

/* =========================================================
   Reveal screen
   ========================================================= */

.reveal-head { margin-bottom: 4px; }

.bluff-result { margin-top: 18px; }
.bluff-result .bluff-q {
  font-size: 0.875rem; font-weight: 700; line-height: 1.35; color: var(--ink-70);
  margin-bottom: 12px;
}

.truth-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: var(--line) solid var(--ink); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-top: 8px;
  font-weight: 700; font-size: 0.875rem;
  background: var(--white);
}
.truth-row--real { background: var(--green); color: var(--white); }
.truth-row--real .chip { background: var(--white); color: var(--ink); }
.truth-row .who { font-family: var(--mono); font-size: 0.688rem; opacity: 0.85; }

.points-pop {
  font-family: var(--mono); font-weight: 800; font-size: 0.813rem;
  white-space: nowrap;
}

.reveal-cta { margin-top: 22px; }

/* First run (day zero) */
.welcome-hero { padding-top: 10px; }
.brand-mark--big {
  width: 56px; height: 56px; border-radius: 14px;
  font-size: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.welcome-sub {
  margin-top: 12px;
  font-weight: 600; font-size: 1rem; line-height: 1.45;
  color: var(--ink-70);
  max-width: 30ch;
}
.how-card {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 14px; padding: 14px;
}
.how-num {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: var(--line) solid var(--ink); border-radius: 10px;
  background: var(--yellow);
  font-family: var(--display); font-size: 1.125rem;
  box-shadow: var(--shadow-sm);
}
.how-card strong { font-size: 1rem; display: block; margin: 2px 0 4px; }
.how-card p { font-size: 0.875rem; font-weight: 600; line-height: 1.45; color: var(--ink-70); }
.welcome-alt { margin-top: 12px; text-align: center; }
.welcome-skip { display: inline-block; margin-top: 14px; }

/* Room header: league name + segmented views (Today | Table) */
.room-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.room-name {
  font-family: var(--display); font-size: 0.938rem;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15;
}
.seg {
  display: flex; flex-shrink: 0;
  border: var(--line) solid var(--ink); border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.seg button {
  border: none; background: var(--white);
  font-family: var(--display); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 9px 14px;
}
.seg button + button { border-left: var(--line) solid var(--ink); }
.seg button.is-active { background: var(--ink); color: var(--yellow); }

.reveal-head__row { display: flex; justify-content: space-between; align-items: baseline; }

/* Quiet breadcrumb back to Today: deliberately not a button-button */
.crumb {
  background: none; border: none;
  font-family: var(--mono); font-size: 0.688rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-50);
  padding: 4px 6px 4px 0;
  transition: color 120ms;
}
.crumb:hover { color: var(--ink); }
.crumb-row {
  margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.reveal-progress {
  font-family: var(--mono); font-size: 0.688rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-50);
}

.streak-strip { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* You: your title in each league */
.you-title {
  font-family: var(--display);
  font-size: 1.5rem; line-height: 1;
  text-transform: uppercase;
  margin: 12px 0 8px;
}

/* Settings rows and chunky toggles */
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px;
  border-bottom: 2px dashed var(--ink-30);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-label { font-weight: 700; font-size: 0.938rem; }
.toggle {
  width: 58px; height: 32px; flex-shrink: 0;
  border: var(--line) solid var(--ink); border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: background 160ms;
}
.toggle::after {
  content: "";
  position: absolute; top: 3px; left: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink);
  transition: left 160ms var(--snap), background 160ms;
}
.toggle.is-on { background: var(--green); }
.toggle.is-on::after { left: calc(100% - 24px); background: var(--white); }

/* Winner beat: the only screen allowed to be loud */
.winner {
  position: relative; z-index: 0;
  text-align: center;
  padding: 44px 0 18px;
  overflow: visible;
}
.winner-burst {
  position: absolute; z-index: -1;
  left: 50%; top: 50%;
  width: 300px; height: 300px;
  transform: translate(-50%, -50%);
  background: var(--yellow);
  /* 12-point star */
  clip-path: polygon(
    50% 0%, 58.28% 19.09%, 75% 6.7%, 72.63% 27.37%, 93.3% 25%,
    80.91% 41.72%, 100% 50%, 80.91% 58.28%, 93.3% 75%, 72.63% 72.63%,
    75% 93.3%, 58.28% 80.91%, 50% 100%, 41.72% 80.91%, 25% 93.3%,
    27.37% 72.63%, 6.7% 75%, 19.09% 58.28%, 0% 50%, 19.09% 41.72%,
    6.7% 25%, 27.37% 27.37%, 25% 6.7%, 41.72% 19.09%
  );
  animation: burst-spin 26s linear infinite;
}
@keyframes burst-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.winner-name {
  font-family: var(--display);
  font-size: 4rem; line-height: 0.95;
  text-transform: uppercase;
  margin: 6px 0 12px;
  /* Sticker treatment: white fill, thick ink outline, hard offset shadow */
  color: var(--white);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-4deg);
  /* Slams in after the star is already spinning */
  animation: name-slam 560ms var(--snap) 240ms both;
}
@keyframes name-slam {
  0%   { opacity: 0; transform: rotate(-4deg) scale(2.6); }
  60%  { opacity: 1; transform: rotate(-4deg) scale(0.94); }
  80%  { transform: rotate(-4deg) scale(1.05); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .winner-burst { animation: none; }
  .winner-name { animation: none; }
}

/* =========================================================
   Play screen
   ========================================================= */

.play-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.qdots { display: flex; gap: 7px; }
.qdot {
  width: 14px; height: 14px; border: var(--line) solid var(--ink);
  border-radius: 4px; background: var(--white);
  transition: background 150ms, transform 150ms var(--snap);
}
.qdot.is-done { background: var(--ink); }
.qdot.is-now { background: var(--yellow); transform: rotate(45deg); }

/* Shot clock: 30 seconds per question */
.timebar-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.timebar {
  flex: 1; height: 16px;
  border: var(--line) solid var(--ink); border-radius: 999px;
  background: var(--white);
  overflow: hidden;
}
.timebar__fill {
  height: 100%; width: 100%;
  background: var(--yellow);
  border-radius: 999px 0 0 999px;
  transition: width 140ms linear;
}
.timebar__fill.is-low { background: var(--coral); animation: clock-pulse 600ms ease-in-out infinite alternate; }
@keyframes clock-pulse { from { opacity: 1; } to { opacity: 0.55; } }
.timebar-secs {
  font-family: var(--mono); font-weight: 800; font-size: 0.813rem;
  min-width: 3ch; text-align: right;
  font-variant-numeric: tabular-nums;
}
.timebar-secs.is-low { color: var(--coral); }

.q-topic { margin-bottom: 12px; }

.q-text {
  font-family: var(--display);
  font-size: 1.625rem; line-height: 1.08; text-transform: uppercase;
  margin: 6px 0 20px;
}

.answers { display: grid; gap: 12px; }

.answer {
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 14px 14px;
  text-align: left;
  font-size: 1rem; font-weight: 700; line-height: 1.3;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: transform 110ms var(--snap), box-shadow 110ms var(--snap), background 150ms, color 150ms;
}
.answer:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.answer:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.answer .who { font-family: var(--mono); font-size: 0.625rem; color: var(--ink-50); }
/* Bluff attribution stays secret until the vote is in */
#screen-play .answers:not(.is-revealed) .answer .who { visibility: hidden; }
.answer.is-picked { background: var(--blue); color: var(--white); }
.answer.is-correct { background: var(--green); color: var(--white); animation: jolt 380ms var(--snap); }
.answer.is-wrong { background: var(--coral); color: var(--white); animation: shake 360ms var(--ease); }
.answer.is-dim { opacity: 0.45; }
.answer:disabled { cursor: default; }
.answer.is-correct .who, .answer.is-wrong .who, .answer.is-picked .who { color: rgba(255,255,255,0.8); }

@keyframes jolt {
  0% { transform: scale(1); } 45% { transform: scale(1.04) rotate(0.6deg); } 100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); } 55% { transform: translateX(4px); } 80% { transform: translateX(-2px); }
}

.q-react { min-height: 90px; }
.q-react .host-line { margin-top: 20px; }

.points-float {
  position: absolute; right: 26px; top: 84px;
  font-family: var(--display); font-size: 1.875rem;
  color: var(--ink);
  background: var(--yellow);
  border: var(--line) solid var(--ink); border-radius: 12px;
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none;
  z-index: 5;
}
.points-float.is-on { animation: points-rise 900ms var(--snap) both; }
@keyframes points-rise {
  0% { opacity: 0; transform: translateY(14px) scale(0.8) rotate(-4deg); }
  25% { opacity: 1; transform: translateY(0) scale(1.05) rotate(2deg); }
  70% { opacity: 1; transform: translateY(-8px) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-26px) scale(0.95); }
}

/* =========================================================
   Plant screen
   ========================================================= */

.plant-q { margin-top: 16px; background: var(--paper-2); }
.plant-q .bluff-q { font-size: 1.063rem; font-weight: 800; line-height: 1.35; }

.plant-input {
  margin-top: 16px;
  width: 100%;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 1.063rem; font-weight: 600; line-height: 1.4;
  padding: 14px; min-height: 110px; resize: none;
}
.plant-input:focus { outline: none; box-shadow: var(--shadow); transform: translate(-1px, -1px); }

.plant-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin: 10px 2px 18px;
  font-family: var(--mono); font-size: 0.688rem; color: var(--ink-50);
}

.planted-stamp {
  margin: 26px auto 8px;
  width: max-content;
  font-family: var(--display); font-size: 2.5rem; text-transform: uppercase;
  border: 4px solid var(--ink); border-radius: 14px;
  padding: 8px 20px;
  background: var(--green); color: var(--white);
  transform: rotate(-5deg);
  box-shadow: var(--shadow);
  animation: stamp-slam 500ms var(--snap) both;
}
@keyframes stamp-slam {
  0% { opacity: 0; transform: rotate(-5deg) scale(2.2); }
  55% { opacity: 1; transform: rotate(-5deg) scale(0.94); }
  75% { transform: rotate(-5deg) scale(1.04); }
  100% { transform: rotate(-5deg) scale(1); }
}

/* =========================================================
   Standings screen
   ========================================================= */

.lb { display: grid; gap: 12px; margin-top: 18px; }

.lb-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center; gap: 12px;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}
.lb-row--leader { background: var(--yellow); box-shadow: var(--shadow); }
.lb-row--me { outline: 3px dashed var(--ink); outline-offset: 3px; }

.lb-rank { font-family: var(--display); font-size: 1.375rem; }
.lb-name { font-weight: 800; font-size: 1rem; line-height: 1.1; }
.lb-title { font-family: var(--mono); font-size: 0.656rem; color: var(--ink-70); letter-spacing: 0.04em; margin-top: 3px; display: block; }
.lb-pts { font-family: var(--mono); font-weight: 800; font-size: 1rem; text-align: right; }
.lb-delta { display: block; font-size: 0.656rem; font-weight: 600; color: var(--green); }
.lb-delta.is-down { color: var(--coral); }

.sunday-banner {
  margin-top: 20px;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--purple); color: var(--white);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sunday-banner .display-md { font-size: 1.188rem; }
.sunday-banner .chip { background: var(--white); color: var(--ink); flex-shrink: 0; }

.lore-card { margin-top: 20px; }
.lore-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 2px;
  border-bottom: 2px dashed var(--ink-30);
  font-weight: 700; font-size: 0.875rem;
}
.lore-item:last-child { border-bottom: none; }
.lore-item .when { font-family: var(--mono); font-size: 0.656rem; color: var(--ink-50); white-space: nowrap; }

/* =========================================================
   Join / session zero
   ========================================================= */

.join-league-card {
  margin-top: 18px; text-align: center; padding: 22px 16px;
  background: var(--yellow);
}
.join-league-card .display-md { font-size: 1.688rem; }
.join-league-card p { font-weight: 600; margin-top: 6px; font-size: 0.875rem; }

/* Invite roster: who's in, who's stalling */
.roster { margin-top: 16px; }
.roster-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px;
  border-bottom: 2px dashed var(--ink-30);
}
.roster-row:last-of-type { border-bottom: none; }
.roster-name { font-weight: 800; font-size: 0.938rem; }
.roster-name em {
  font-style: normal; font-family: var(--mono);
  font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-50); margin-left: 8px;
}
.chip--wait {
  background: var(--paper-2); color: var(--ink-50);
  border-color: var(--ink-30);
}
.roster-row--you { border-bottom: none; }
.you-input {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  font-weight: 800; font-size: 0.938rem;
  border-bottom: 3px dashed var(--ink-30);
  border-radius: 0;
  padding: 4px 2px; margin-right: 12px;
}
.you-input:focus { outline: none; border-bottom-color: var(--ink); }
.you-input::placeholder { color: var(--ink-30); font-weight: 700; }

.roster-sum {
  margin-top: 10px;
  font-family: var(--mono); font-size: 0.688rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-50);
}

.join-input {
  width: 100%; margin-top: 16px;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 1.125rem; font-weight: 700; text-align: center;
  padding: 14px;
}
.join-input:focus { outline: none; box-shadow: var(--shadow); }

.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.pick-grid .answer { justify-content: center; text-align: center; font-size: 0.938rem; padding: 13px 8px; }

.intake-progress { margin-bottom: 12px; }

/* =========================================================
   Tab bar
   ========================================================= */

.tabbar {
  position: absolute; left: 14px; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: 1fr 1fr;
  border: var(--line) solid var(--ink); border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 20;
}
.tabbar button {
  padding: 13px 8px;
  font-family: var(--display); font-size: 0.813rem; text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--white);
  border: none;
}
.tabbar button + button { border-left: var(--line) solid var(--ink); }
.tabbar button.is-active { background: var(--ink); color: var(--yellow); }
.tabbar[hidden] { display: none; }

/* =========================================================
   Action dock: the flow's primary button, anchored
   ========================================================= */

.action-dock {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
}
.action-dock[hidden] { display: none; }
.action-dock .btn-pop { animation: dock-pop 260ms var(--snap) both; }
@keyframes dock-pop {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: none; }
}

/* =========================================================
   Demo controls (triple-tap the GAFF mark)
   ========================================================= */

.admin {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(22, 19, 14, 0.45);
  display: flex; align-items: flex-end;
}
.admin[hidden] { display: none; }
.admin__panel {
  width: 100%;
  background: var(--paper);
  border-top: var(--line) solid var(--ink);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.admin__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.admin__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.admin__grid button {
  border: var(--line) solid var(--ink); border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--ui); font-weight: 700; font-size: 0.813rem;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 10px 8px;
  box-shadow: var(--shadow-sm);
}
.admin__grid button:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.admin__reload { margin-top: 12px; padding: 12px; font-size: 0.875rem; }

/* =========================================================
   Responsive: phone-first on small screens
   ========================================================= */

@media (max-width: 920px) {
  /* Proportional type: the desktop frame is the 393px reference.
     All font sizes are rem, so scaling the root makes a 430pt phone
     render the same composition as the frame, just bigger. */
  html { font-size: clamp(13px, calc(100vw * 16 / 393), 19px); }

  /* Flex column sized by the real viewport (dvh) and the real header
     height, so the tab bar can never fall below the fold. */
  body {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    overflow: hidden;
  }
  .stage-nav { position: static; flex: none; }
  .stage {
    grid-template-columns: 1fr; padding: 0; gap: 0;
    align-items: stretch;
    flex: 1; min-height: 0;
  }
  .stage__hint { display: none; }
  .phone {
    width: 100%; height: 100%; min-height: 0;
    border: none; border-radius: 0; padding: 0; box-shadow: none;
  }
  .phone__screen { border-radius: 0; }
}
