/* Challenge Arena design system — P1-D + P2-D. All colour from tokens.css (R15). */
@import url("/tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Anton&family=Barlow:wght@400;500;600&family=Big+Shoulders+Display:wght@700;900&family=Cinzel:wght@700;900&family=Saira+Stencil+One&family=Share+Tech+Mono&display=swap");

/* ---------------------------------------------------------------------------
   Reset & base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  position: relative;
}
/* Grain under content so it never sits on video (brief). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}
body > * { position: relative; z-index: 1; }

a { color: var(--steel); }
a:hover { color: var(--ink); }

/* ---------------------------------------------------------------------------
   Type
--------------------------------------------------------------------------- */
.brand, h1, h2.display, .challenge-title, .player-name {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  text-transform: uppercase;
  line-height: 1.05;
}
h1 {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.lab {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink3);
  margin: 0 0 0.5rem;
}
.lab a { color: var(--ink2); text-decoration: none; }
.lab a:hover { color: var(--ink); }
h2.lab { margin-top: 1.75rem; }
.meta, .mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink3);
}
.body { white-space: pre-wrap; margin: 0 0 1rem; color: var(--ink); font-family: var(--font-body); }
p { margin: 0 0 0.75rem; }

/* ---------------------------------------------------------------------------
   1. Top bar
--------------------------------------------------------------------------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  min-height: 3.25rem;
}
.brand {
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  background: transparent;
}
/* Real Valkyrie wordmark — colours live in the SVG; transparent surround (P3-BRAND). */
.brand-wordmark {
  display: block;
  height: 1.65rem;
  width: auto;
  max-width: min(14rem, 58vw);
  background: transparent;
}
/* Trust screens (sign-in, invite claim): larger mark alone. */
.brand-hero {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 0 1.25rem;
  background: transparent;
}
/* Install walkthrough: the home-screen icon the person is about to add. */
.install-icon {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 0 1.25rem;
  background: transparent;
}
.bar-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink2);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bar-link:hover { color: var(--ink); }

/* ---------------------------------------------------------------------------
   2. Status pill
--------------------------------------------------------------------------- */
.pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--earned);
  color: var(--earned);
  background: transparent;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.3;
}
.pill.muted {
  border-color: var(--line2);
  color: var(--ink3);
}
.pill.warn {
  border-color: var(--warn);
  color: var(--warn);
}
/* Winner / Hers mark — still --earned only (inventory 2 + 18). */
.pill.earned {
  border-color: var(--earned);
  color: var(--earned-ink);
  background: var(--earned);
}

/* ---------------------------------------------------------------------------
   Layout shell
--------------------------------------------------------------------------- */
.wrap {
  max-width: 32.5rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
}
.queue-wrap {
  max-width: 32.5rem;
  margin: 0 auto;
  padding: 0.75rem 0.75rem 5rem;
}

/* ---------------------------------------------------------------------------
   6–7. Primary & secondary actions
--------------------------------------------------------------------------- */
.act {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  cursor: pointer;
  background: var(--act-bg);
  color: var(--act-ink);
  border: 1px solid var(--act-line);
  border-radius: 0;
  font-family: var(--font-stencil);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  /* Chipped corner — square, never soft (brief). */
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  -webkit-appearance: none;
  appearance: none;
}
.act:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.act:not(:disabled):active {
  filter: brightness(1.08);
}
.act.sec, .act.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line2);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.act.mini {
  display: inline-block;
  width: auto;
  padding: 0.45rem 0.75rem;
  font-size: 0.6875rem;
  margin-top: 0.5rem;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.act.block { width: 100%; }
.act + .act { margin-top: 0.5rem; }
.act.mini + .act.mini { margin-left: 0.35rem; }

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */
input, textarea, select {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus, select:focus {
  outline: 1px solid var(--steel);
  outline-offset: 0;
  border-color: var(--steel);
}
textarea { min-height: 5rem; resize: vertical; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink3) 50%),
    linear-gradient(135deg, var(--ink3) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
label.lab { display: block; }

/* ---------------------------------------------------------------------------
   Dense list rows (roster, invites, tools)
--------------------------------------------------------------------------- */
.row {
  border: 1px solid var(--line2);
  background: var(--surface);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
}
a.row {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.row:active { background: var(--surface2); }
.row .meta { margin-top: 0.2rem; }

/* Bordered card surface (results, drawing panels, verify). Same density as .row. */
.card {
  border: 1px solid var(--line2);
  background: var(--surface);
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.5rem;
}
.card .thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border: 1px solid var(--line2);
  background: var(--surface2);
  margin-bottom: 0.5rem;
  display: block;
}

/* Player switcher chip (results / hall of fame). Square, mono — not a soft pill. */
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.chip.on {
  border-color: var(--earned);
  color: var(--earned);
  background: var(--act-bg);
}

.tools { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.tools li { border-bottom: 1px solid var(--line); }
.tools a {
  display: block;
  padding: 0.9rem 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  text-transform: uppercase;
  font-size: 1.05rem;
}
.tools a:hover { color: var(--earned); }

/* ---------------------------------------------------------------------------
   3. Challenge card
--------------------------------------------------------------------------- */
.challenge-card {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  border: 1px solid var(--line2);
  background: var(--surface);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
  /* Left plate bar carries state colour */
  border-left: 4px solid var(--steel);
}
.challenge-card.state-open,
.challenge-card.state-pending { border-left-color: var(--steel); }
.challenge-card.state-sent_back { border-left-color: var(--warn); }
.challenge-card.state-cleared { border-left-color: var(--earned); }
.challenge-card-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.25rem 0.75rem 0.75rem;
}
.challenge-title {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  color: var(--ink);
}
.challenge-entry {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--earned);
  padding: 0.75rem 0.75rem 0.75rem 0;
  align-self: center;
  white-space: nowrap;
  text-align: right;
}
.challenge-card .pill { margin-left: 0.35rem; vertical-align: middle; }

/* ---------------------------------------------------------------------------
   4. Ladder rung row
--------------------------------------------------------------------------- */
.rung-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line2);
  background: var(--surface);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.35rem;
}
.rung-row .rung-label {
  flex: 1;
  font-family: var(--font-body);
  color: var(--ink);
}
.rung-row .rung-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink3);
}
.rung-row.cleared .rung-val { color: var(--earned); }

/* ---------------------------------------------------------------------------
   9–10. Mark & pip (diamond)
--------------------------------------------------------------------------- */
.mark {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--steel-soft);
  vertical-align: middle;
}
.mark.lit { background: var(--earned); }

.pip {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  flex-shrink: 0;
  transform: rotate(45deg);
  border: 1px solid var(--earned);
  background: transparent;
  vertical-align: middle;
}
.pip.filled {
  background: var(--earned);
  border-color: var(--earned);
}
.pip.dim {
  border-color: var(--line2);
  background: transparent;
}

/* ---------------------------------------------------------------------------
   16. Sigil — personal mark; dim outline until first clear, then filled
--------------------------------------------------------------------------- */
.sigil {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  transform: rotate(45deg);
  border: 2px solid var(--line2);
  background: transparent;
  vertical-align: middle;
  flex-shrink: 0;
}
.sigil.dim {
  border-color: var(--line2);
  background: transparent;
  opacity: 0.55;
}
.sigil.filled {
  border-color: var(--earned);
  background: var(--earned);
  opacity: 1;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-meta h1 { margin-bottom: 0.35rem; }
.player-photo {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface2);
  flex-shrink: 0;
  display: block;
}
.player-photo-empty {
  width: 5.5rem;
  height: 5.5rem;
  border: 1px solid var(--line2);
  background: var(--surface2);
  flex-shrink: 0;
}
.marks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.35rem 0 0.5rem;
}
.marks-row .mark {
  width: 0.7rem;
  height: 0.7rem;
}

/* ---------------------------------------------------------------------------
   5. Rung picker
--------------------------------------------------------------------------- */
.rung-pick {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.rung-pick button {
  width: 100%;
  padding: 0.85rem 0.75rem;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  -webkit-appearance: none;
  appearance: none;
}
.rung-pick button.selected {
  border-color: var(--earned);
  background: var(--act-bg);
  color: var(--act-ink);
}
.rung-pick button.granted { opacity: 0.5; }

/* ---------------------------------------------------------------------------
   8. Board row + 19. Goal meter (P2-8 / P2-D)
--------------------------------------------------------------------------- */
.goal-meter {
  border: 1px solid var(--line2);
  background: var(--surface);
  padding: 0.85rem 0.9rem;
  margin-bottom: 1rem;
}
.goal-meter .goal-reward {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.15rem 0 0.35rem;
  color: var(--ink);
}
.goal-meter .goal-nums {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink2, var(--ink));
  margin: 0 0 0.5rem;
}
.goal-meter .goal-total { color: var(--earned); }
.goal-bar {
  height: 0.45rem;
  background: var(--steel-soft);
  border: 1px solid var(--line2);
  margin-bottom: 0.35rem;
}
.goal-bar-fill {
  height: 100%;
  background: var(--earned);
  max-width: 100%;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line2);
  background: var(--surface);
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
  text-decoration: none;
}
a.board-row-link { cursor: pointer; }
a.board-row-link:hover .player-name { color: var(--earned); }
.board-row .player-name {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 5rem;
}
.board-row .marks { flex: 1; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.board-row .count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--earned);
}

/* ---------------------------------------------------------------------------
   11–12. Basket row & stepper (P2-D inventory)
--------------------------------------------------------------------------- */
.basket-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--line2);
  background: var(--surface);
  padding: 0.65rem;
  margin-bottom: 0.5rem;
}
.basket-row .thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--surface2, var(--surface));
  border: 1px solid var(--line2);
}
.basket-row .thumb.placeholder {
  display: block;
}
.basket-row-body { flex: 1; min-width: 0; }
.basket-row-body b,
.basket-row-body strong {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--ink);
}
.basket-row-body .meta {
  margin-top: 0.15rem;
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--earned);
  flex-shrink: 0;
}
.stepper button {
  background: transparent;
  border: 0;
  color: var(--earned);
  font-family: var(--font-mono);
  font-size: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.stepper .count {
  font-family: var(--font-mono);
  color: var(--earned);
  min-width: 1.75rem;
  text-align: center;
}

/* ---------------------------------------------------------------------------
   13. Video frame
--------------------------------------------------------------------------- */
.video-frame,
video.queue-video,
video.clip,
video#demo,
img#graphic {
  display: block;
  width: 100%;
  max-height: 55vh;
  background: var(--surface2);
  margin: 0 0 0.75rem;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 0;
}
img#graphic { max-height: 20rem; object-fit: contain; }

/* ---------------------------------------------------------------------------
   14. Note block (send-back / coach words only → --warn)
--------------------------------------------------------------------------- */
.note {
  border-left: 3px solid var(--warn);
  padding: 0.65rem 0.75rem;
  margin: 0 0 1rem;
  background: var(--surface);
}
.note p { margin: 0 0 0.4rem; }
.note p:last-child { margin-bottom: 0; }
.note .lab { color: var(--warn); }

/* ---------------------------------------------------------------------------
   15. Empty state
--------------------------------------------------------------------------- */
.empty {
  margin: 2.5rem 0 1.5rem;
  padding: 1.25rem 0;
  text-align: left;
}
.empty-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink3);
  margin: 0 0 0.5rem;
}
.empty-body {
  font-family: var(--font-body);
  color: var(--ink2);
  margin: 0 0 1rem;
  max-width: 24rem;
}
.empty .act { max-width: 20rem; }
.empty-queue {
  margin-top: 3rem;
  text-align: center;
}
.empty-queue .empty-label { text-align: center; }
.empty-queue .empty-body { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------------------------------------------------------------------------
   Loading skeleton
--------------------------------------------------------------------------- */
.loading, .skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skeleton-card {
  height: 4.25rem;
  background: var(--surface2);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface) 50%,
    transparent 100%
  );
  opacity: 0.35;
  animation: sk 1.2s linear infinite;
}
@keyframes sk {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---------------------------------------------------------------------------
   Messages / error states (never a raw unstyled string)
--------------------------------------------------------------------------- */
.msg {
  font-family: var(--font-body);
  font-size: 0.9rem;
  min-height: 1.25rem;
  margin: 0.75rem 0;
  padding: 0;
  color: var(--ink2);
}
.msg.bad, .msg.error, .error-block {
  color: var(--ink);
  border-left: 3px solid var(--warn);
  background: var(--surface);
  padding: 0.65rem 0.75rem;
}
.msg.good {
  color: var(--earned);
  border-left: 3px solid var(--earned);
  background: var(--surface);
  padding: 0.65rem 0.75rem;
}
.error-block .error-retry { margin-top: 0.75rem; }

/* ---------------------------------------------------------------------------
   Progress (upload — measurable only)
--------------------------------------------------------------------------- */
.progress-track {
  border: 1px solid var(--line2);
  background: var(--surface2);
  height: 0.5rem;
  margin: 0.35rem 0 0.75rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--earned);
}

/* ---------------------------------------------------------------------------
   Queue extras
--------------------------------------------------------------------------- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.reasons button {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.reasons button:active {
  border-color: var(--warn);
  color: var(--warn);
}
.send-panel {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
#preload { display: none; }

/* ---------------------------------------------------------------------------
   Player switcher
--------------------------------------------------------------------------- */
.switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.switcher .act.mini { margin-top: 0; }

/* ---------------------------------------------------------------------------
   Player Mode (P3-3) — parent hands the phone over; exit needs confirm
--------------------------------------------------------------------------- */
body.player-mode .switcher { display: none; }
body.player-mode [data-parent-only] { display: none; }
.pm-leave { margin-left: auto; }
.pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.pm-overlay[hidden] { display: none; }
.pm-dialog {
  width: min(100%, 22rem);
  margin: 0;
}
.pm-dialog .act { width: 100%; margin-top: 0.5rem; }
.pm-enter { margin-top: 0.75rem; }

/* ---------------------------------------------------------------------------
   Install steps list
--------------------------------------------------------------------------- */
.steps {
  padding-left: 1.25rem;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.steps li { margin-bottom: 0.5rem; }

/* ---------------------------------------------------------------------------
   Parent bottom chrome (Challenges / Baskets / Board / Results / Her)
--------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--surface);
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a, .tabbar span {
  flex: 1;
  text-align: center;
  padding: 0.65rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink3);
  border: 0;
  background: transparent;
}
.tabbar a.on, .tabbar span.on {
  color: var(--earned);
}
.tabbar a:not(.on):not([href]), .tabbar span.disabled {
  opacity: 0.45;
  pointer-events: none;
}
body.has-tabbar .wrap { padding-bottom: 5.5rem; }

/* ---------------------------------------------------------------------------
   Utility
--------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.hidden, [hidden] { display: none !important; }
.mt { margin-top: 1rem; }
.stack-gap > * + * { margin-top: 0.5rem; }
.center { text-align: center; }
.break-all { word-break: break-all; }

/* Results / hall of fame drawing blocks */
.drawing-results, .hof-drawing {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.drawing-results h2, .hof-drawing h2 {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  text-transform: uppercase;
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  color: var(--ink);
}
/* 18. Winner reveal — phone results use the same meaning as the TV reveal. */
.winner-reveal {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  text-transform: uppercase;
  color: var(--earned);
}

/* ---------------------------------------------------------------------------
   17–18. Presentation mode — full-screen TV wheel (P2-6 / P2-D).
   Room scale: larger type ramp and targets. Same tokens, same meanings (R15).
   Segment fills come from token variables only. Reveal uses --earned.
--------------------------------------------------------------------------- */
body.present-mode {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  /* TV type ramp — sizes only; themes never touch these (R15). */
  --present-title: clamp(2.5rem, 6vw, 4.5rem);
  --present-who: clamp(3rem, 10vw, 6rem);
  --present-meta: clamp(1.2rem, 2.5vw, 1.65rem);
  --present-tag: clamp(1rem, 2.2vw, 1.35rem);
  --present-wheel: min(78vw, 78vh, 36rem);
}
body.present-mode::before { opacity: calc(var(--grain) * 0.6); }
.present-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 2rem 1.75rem;
  max-width: 80rem;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}
/* TV corner wordmark — room-scale, transparent surround (P3-BRAND). */
.present-wordmark {
  position: absolute;
  top: 1.25rem;
  right: 2rem;
  height: clamp(2rem, 4.5vw, 3.25rem);
  width: auto;
  max-width: min(28rem, 42vw);
  background: transparent;
  z-index: 2;
  pointer-events: none;
}
.present-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
  padding-right: min(30vw, 16rem);
}
.present-label {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink2);
  margin: 0;
}
.present-basket-name {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  font-size: var(--present-title);
  line-height: 1.05;
  margin: 0.15rem 0 0;
  color: var(--ink);
  text-transform: uppercase;
}
.present-meta {
  font-family: var(--font-body);
  font-size: var(--present-meta);
  color: var(--ink2);
  margin: 0.35rem 0 0;
}
.present-photo {
  width: clamp(5rem, 12vw, 8rem);
  height: clamp(5rem, 12vw, 8rem);
  object-fit: cover;
  border: 2px solid var(--line2);
  background: var(--surface2);
  flex-shrink: 0;
}
.present-photo.placeholder {
  display: block;
  background: var(--surface2);
}
.present-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
  gap: 1.25rem;
}
.present-wheel-wrap {
  position: relative;
  width: var(--present-wheel);
  height: var(--present-wheel);
  max-width: 100%;
}
.present-pointer {
  position: absolute;
  top: -0.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 1.15rem solid transparent;
  border-right: 1.15rem solid transparent;
  border-top: 1.85rem solid var(--earned);
  z-index: 3;
  filter: none;
}
.present-wheel {
  width: 100%;
  height: 100%;
  /* Circle via clip-path — design system forbids soft border-radius. */
  clip-path: circle(50% at 50% 50%);
  border: 4px solid var(--line2);
  background: var(--surface);
  /* Token-only segment palette (inventory 17). Consumed by the present page. */
  --seg-0: var(--steel-soft);
  --seg-1: var(--surface2);
  --seg-2: var(--line2);
  --seg-3: var(--steel-soft);
  --seg-4: var(--surface);
  /* rotation applied inline; transition only when animating */
  transition: none;
  will-change: transform;
}
.present-wheel.spinning {
  transition: transform 4.2s cubic-bezier(0.12, 0.75, 0.12, 1);
}
@media (prefers-reduced-motion: reduce) {
  .present-wheel.spinning {
    transition: none;
  }
}
.present-wheel svg {
  display: block;
  width: 100%;
  height: 100%;
}
.present-reveal,
.winner-reveal.present-reveal {
  text-align: center;
  min-height: 5rem;
  padding: 0.5rem 1rem;
}
.present-reveal .who {
  font-family: var(--font-display);
  font-weight: var(--disp-weight);
  letter-spacing: var(--disp-track, -0.005em);
  font-size: var(--present-who);
  line-height: 1;
  color: var(--earned);
  text-transform: uppercase;
  margin: 0;
}
.present-reveal .tag {
  font-family: var(--font-mono);
  font-size: var(--present-tag);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--earned);
  margin: 0.4rem 0 0;
}
.present-reveal .also {
  font-family: var(--font-body);
  font-size: var(--present-meta);
  color: var(--ink);
  margin: 0.5rem 0 0;
}
.present-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding-top: 0.75rem;
}
.present-controls .act {
  width: auto;
  min-width: 11rem;
  min-height: 4rem;
  padding: 1.1rem 2rem;
  font-size: 1.125rem;
  letter-spacing: 0.12em;
}
.present-exit-wrap {
  text-align: center;
  margin-top: 0.75rem;
}
.present-exit {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
}
.present-exit:hover, .present-exit:focus {
  color: var(--ink2);
}
.present-empty, .present-error {
  max-width: 32rem;
  margin: 4rem auto;
  padding: 1.5rem;
  text-align: center;
}
