/* Setlist Showdown — "Marquee Night" design system.
 * BRANDING.md is law; tokens lifted verbatim from docs/brand-guide.html.
 * Dark house, one spotlight: no light mode, ever. Genre color appears on
 * cards only — the chrome stays neutral. */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Barlow+Condensed:wght@400;600;700&display=swap');

:root {
  --ink: #131019;
  --panel: #1E1830;
  --spot: #FFB43A;
  --cream: #F4EFE4;
  --dim: #9C93B0;
  --danger: #FF7A5C;
  --inactive: #3A3450;
  --action-green: #35C759; /* the "action taken" button-press flash [owner 2026-07-17] — a deliberate one-off, not a brand accent */
  --hype: #FF7A5C;
  --soul: #C08BFF;
  --craft: #6FD3FF;
  --rock: #D8452E;
  --electronic: #3CC8E5;
  --soul-genre: #9B6FE0;
  --metal: #8A8F98;
  --pop: #F25CA2;
  --folk: #7FB069;
  --hip_hop: #E5B93C;
  --country: #D98A3C;
  --card-shadow: 0 3px 10px rgba(0, 0, 0, .33);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--cream);
  background: var(--ink);
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  font-size: 16px;
}

/* The viewport-fixed purple glow, on its own layer rather than the body's own
   background. This is visually identical to the former
   `radial-gradient(...) fixed, var(--ink)` on `body`, but WITHOUT
   `background-attachment: fixed`, which on iOS Chrome (WKWebView) breaks
   `position: fixed` DESCENDANTS — the `.tab-bar` / `.match-action-bar` stop
   pinning to the viewport bottom and float at content-end. Safari renders the
   old form fine; this layer fixes Chrome-iOS while keeping the glow pinned to
   the viewport, behind all content (z-index:-1), and click-through
   (pointer-events:none). [#88] */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(1000px 500px at 50% -10%, #2A2142 0%, var(--ink) 60%);
  pointer-events: none;
}

.house {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 16px 60px;
  text-align: center;
}

/* The Label — the ticket-stub style that does most of the brand */
.label {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.label--amber { color: var(--spot); }

.marquee { margin-bottom: 26px; }
.marquee__title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(32px, 7vw, 54px);
  margin: 4px 0 2px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(255, 180, 58, .27);
}
.marquee__sub { font-size: 15px; color: var(--dim); margin: 0; }

.arena-prompt {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(19px, 4vw, 26px);
  color: var(--spot);
}

/* Buttons — exactly one primary per screen, always a stage verb */
.btn {
  font-family: 'Archivo Black', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 13px 34px;
  border-radius: 10px;
  border: none;
  display: inline-block;
  background: var(--spot);
  color: var(--ink);
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.btn--off {
  background: var(--inactive);
  color: var(--dim);
  cursor: not-allowed;
  pointer-events: none;
}
.ghost {
  background: none;
  border: 1px solid rgba(255, 180, 58, .53);
  color: var(--spot);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* Compact battle card — the workhorse */
.card {
  width: 158px;
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  border-left: 4px solid var(--genre, var(--dim));
  box-shadow: var(--card-shadow);
  padding: 10px 12px;
  transition: all .15s ease;
}
.card--selected {
  outline: 1px solid var(--spot);
  box-shadow: 0 0 16px rgba(255, 180, 58, .33);
  transform: translateY(-6px);
}
.card--dead { opacity: .3; }
.card__top { display: flex; justify-content: space-between; align-items: baseline; }
.card__genre {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--genre, var(--dim));
  font-weight: 700;
}
.card__cost { font-size: 12px; font-weight: 700; color: var(--spot); }
.card__cost--bad { color: var(--danger); }
.card__id { display: flex; gap: 8px; align-items: center; margin: 5px 0 8px; }
.card__art { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; }
.card__title { font-family: 'Archivo Black', sans-serif; font-size: 13px; line-height: 1.15; }
.card__artist { font-size: 12px; color: var(--dim); }
.card__stats { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.card__winded {
  font-size: 10px;
  color: var(--danger);
  margin-top: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat--hype { color: var(--hype); }
.stat--soul { color: var(--soul); }
.stat--craft { color: var(--craft); }
.stat--nostalgia { color: var(--spot); }

/* Round-context ability chips — compact color-coded tags under the "tonight
   tests <stat>" label. Each chip is colored by its .stat--* class (reusing the
   stat/spot color vars); the color drives text + a faint matching border/bg. */
.kw-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.kw-chip {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  /* color comes from the .stat--* class; border/bg tint off it via currentColor */
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  background: color-mix(in srgb, currentColor 12%, transparent);
}

/* Vinyl-disc placeholder — art never renders empty */
.vinyl-disc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at center,
    var(--genre, var(--dim)) 0 4px,
    #0A0810 5px 12px,
    color-mix(in srgb, var(--genre, var(--dim)) 20%, transparent) 13px);
  border: 1px solid color-mix(in srgb, var(--genre, var(--dim)) 40%, transparent);
}

/* Genre color reaches cards only, through this one custom property */
.genre--rock { --genre: var(--rock); }
.genre--electronic { --genre: var(--electronic); }
.genre--soul { --genre: var(--soul-genre); }
.genre--metal { --genre: var(--metal); }
.genre--pop { --genre: var(--pop); }
.genre--folk { --genre: var(--folk); }
.genre--hip_hop { --genre: var(--hip_hop); }
.genre--country { --genre: var(--country); }

.hand { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Energy pips — always shown as a you/opponent pair */
.pips { display: flex; gap: 3px; justify-content: center; }
.pip { width: 9px; height: 14px; border-radius: 2px; background: var(--spot); }
.pip--empty { background: var(--inactive); }
.energy-pair { display: flex; gap: 40px; justify-content: center; }

/* Ruling card — the only amber-bordered panel in the system */
.ruling {
  background: var(--panel);
  border: 1px solid rgba(255, 180, 58, .33);
  border-radius: 12px;
  padding: 14px 20px;
  max-width: 560px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.4;
}

.detail-panel {
  background: var(--panel);
  border-radius: 10px;
  border-left: 4px solid var(--genre, var(--dim));
  max-width: 480px;
  margin: 12px auto 0;
  padding: 12px 16px;
  text-align: left;
}
.detail-panel__ability { color: var(--spot); font-weight: 700; }
.detail-panel__themes { font-size: 12px; color: var(--dim); }

.recap-row {
  background: var(--panel);
  border-left: 3px solid var(--spot);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  max-width: 560px;
  margin: 10px auto;
  text-align: left;
}
.recap-row--lost { border-left-color: var(--dim); }

/* Status banner — dashed means "temporary condition", the only dashed border */
.banner {
  border: 1px dashed rgba(156, 147, 176, .4);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--dim);
  max-width: 480px;
  margin: 10px auto;
  text-align: center;
}

.panelbox { background: var(--panel); border-radius: 12px; padding: 20px 24px; }

/* The show poster — gig-poster talent, so it hangs on a panel surface.
 * Self-contained (no .panelbox composition: same-specificity padding
 * would ride on source order). The share view's sizes="280px" is
 * max-width minus the 2×10px padding — keep them in sync. */
.poster {
  background: var(--panel);
  border-radius: 12px;
  padding: 10px;
  max-width: 300px;
  margin: 20px auto 0;
  box-shadow: var(--card-shadow);
}
.poster img { display: block; width: 100%; height: auto; border-radius: 8px; }

/* The login hero — the one full-width photograph in the system, reserved
 * for the "walking into the venue" moment before the sign-in form. Bottom
 * fade blends it into --ink so it reads as atmosphere the page continues
 * into, not a pasted-in photo insert. */
.hero-stage {
  position: relative;
  margin: 0 0 22px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.hero-stage img { display: block; width: 100%; height: auto; }
.hero-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--ink));
  pointer-events: none;
}

.field {
  background: var(--panel);
  border: 1px solid rgba(156, 147, 176, .27);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--cream);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

/* Song-search results — the catalog + library typeahead dropdowns.
 * Chrome, so it stays neutral with the amber spotlight as its only accent
 * (genre color is cards-only per BRANDING). The surface only paints when
 * populated (:not(:empty)) so an emptied container leaves no floating box.
 * Shared by both the catalog and "From your library" strips so they match. */
.hit-list { display: flex; flex-direction: column; gap: 4px; }
.hit-list:not(:empty) {
  margin-bottom: 10px;
  padding: 6px;
  border: 1px solid rgba(156, 147, 176, .18);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  box-shadow: var(--card-shadow);
}
/* The in-world "crates are jammed" note sits on the same surface. */
.hit-list .label { margin: 0; padding: 4px 6px; }

/* One hit: [art on the left] + [title over artist]. Composes with .ghost but
 * overrides its amber outline/compact padding — declared after .ghost so it
 * wins at equal specificity. */
.catalog-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.catalog-hit:hover,
.catalog-hit:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--spot) 12%, transparent);
  border-color: color-mix(in srgb, var(--spot) 40%, transparent);
}
.catalog-hit__art {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
  background: var(--ink); /* placeholder tone before the lazy image paints */
}
/* min-width:0 lets the ellipsis engage instead of blowing out the 480px panel */
.catalog-hit__body { display: flex; flex-direction: column; min-width: 0; }
.catalog-hit__title,
.catalog-hit__sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.catalog-hit__title { font-size: 15px; font-weight: 600; color: var(--cream); }
.catalog-hit__sub { font-size: 12px; color: var(--dim); }

.math-line { font-size: 13px; color: var(--dim); }
.math-line b { color: var(--cream); }

.vs {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  color: var(--spot);
}

.cta-row { margin-top: 18px; }

.error-list { color: var(--danger); font-size: 14px; list-style: none; padding: 0; }

/* Forms (auth, builder) */
.auth-form { max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.slate-arena { cursor: pointer; max-width: 200px; border: none; color: var(--cream); }

/* Large card detail view — art as hero (BRANDING §9 inverted ratio).
 * Existing tokens only; the genre strip carries the card's color. */
.card-detail {
  position: fixed;
  /* inset:0 is the pre-dvh fallback; 100dvh is the *visible* viewport, so on
   * iOS the panel fits whatever height the chrome leaves (rules-modal fix). */
  inset: 0;
  height: 100dvh;
  box-sizing: border-box;
  background: rgba(19, 16, 25, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  z-index: 20;
}
/* A live pick delegates Perform to the fixed Match Action Bar [perform-in-bar]:
   the centered panel takes extra bottom room so it clears the bar pinned
   beneath it (84px bar + a 20px gap + the home-indicator inset). Must follow
   .card-detail to win the equal-specificity padding override. */
.card-detail--barred {
  padding-bottom: calc(84px + 20px + env(safe-area-inset-bottom));
}
.card-detail__panel {
  background: var(--panel);
  border-radius: 12px;
  /* The spotlight hits the talent: amber surround so the card never blends
   * into the darkened house (owner QA), genre strip stays on the left. */
  border: 1px solid rgba(255, 180, 58, .53);
  border-left: 4px solid var(--genre, var(--dim));
  box-shadow: 0 0 40px rgba(255, 180, 58, .25), 0 8px 30px rgba(0, 0, 0, .5);
  max-width: 420px;
  width: 100%;
  /* Bounded by the padded overlay, which is itself the visible viewport. */
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px;
  text-align: left;
}
/* Both labels (▶ Preview / ◼ Stop) share one footprint — no layout jump.
 * The glyphs come from different fallback fonts with different vertical
 * metrics, so the box is pinned in BOTH dimensions and flex-centered;
 * line-height 1 stops a tall glyph from inflating the line box. */
.card-detail__actions .ghost,
.card-detail__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.card-detail__actions .ghost { height: 32px; }
.card-detail__preview { min-width: 96px; }

/* Deliberation interstitial — visible activity while the judge model call
 * is in flight. The gentle pulse is a loading state, not decoration. */
.deliberation__quote { font-size: 16px; font-style: italic; color: var(--dim); }
.deliberation__pulse { animation: deliberation-pulse 1.6s ease-in-out infinite; }
@keyframes deliberation-pulse {
  50% { opacity: .35; }
}
/* The art is the hero AND the frame for the card's controls: position:relative
 * anchors the cost pill, the ✕, and the bottom stat/preview strip over it;
 * overflow clips them to the rounded corners. */
.card-detail__hero {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0A0810;
  border-radius: 8px;
  min-height: 180px;
  overflow: hidden;
}
/* Cap the art so the whole card fits a phone without the footer clipping under
 * the fixed tab bar — the art is the biggest height consumer [owner rework #6].
 * cover (not contain) keeps it crisp edge-to-edge; the square source crops a
 * little top/bottom, staying centered. */
.card-detail__art {
  width: 100%;
  max-height: 44dvh;
  object-fit: cover;
  border-radius: 8px;
}
.card-detail__vinyl { width: 160px; height: 160px; margin: 20px 0; }
/* Two corner overlays over a dark scrim so they read on any art: the cost pill
 * balances the ✕ close, one in each top corner, reclaiming the info-block rows
 * they used to sit on. */
.card-detail__cost {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, #000 55%, transparent);
  font-size: 14px;
  line-height: 1;
}
.card-detail__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, #000 55%, transparent);
  color: var(--cream);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.card-detail__close:hover { background: color-mix(in srgb, #000 75%, transparent); }
.card-detail__close:focus-visible { outline: 2px solid var(--spot); outline-offset: 2px; }
/* The bottom strip: H/S/C left, ▶ Preview right, on a translucent black fill
 * so both read over the art [owner rework #1–3]. */
.card-detail__hero-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(0, 0, 0, .72);
}
.card-detail__hero-bar .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 30px;
  flex-shrink: 0;
}
.card-detail__title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  line-height: 1.1;
  margin-top: 6px;
}
/* The H/S/C row, now the left side of the hero strip (over the 85% black fill),
 * not an info-block row. */
.card-detail__stats {
  display: flex;
  gap: 20px;
  font-size: 17px;
  font-weight: 700;
}
/* Genre eyebrow leading the info block below the art. */
.card-detail__genre { margin-top: 12px; }
.card-detail__winded {
  color: var(--danger);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 13px;
  margin-top: 10px;
}
/* Keyword abilities on the large card [Task 1.7]. A quiet block under the
 * flavor move: the "Abilities" key uses the shared .label (dim, uppercase),
 * each ability's NAME in the amber spot (like .detail-panel__ability) with its
 * effect dim beside it — Marquee Night, subordinate to the hero art/stats. */
.card-detail__abilities { margin-top: 8px; }
.card-detail__ability { font-size: 13px; color: var(--dim); line-height: 1.4; }
.card-detail__ability-name { color: var(--spot); font-weight: 700; }
/* Bottom row of the large view: the ISRC readout sits lower-LEFT, the
 * Preview/Perform/Close actions lower-RIGHT. margin-left:auto keeps the
 * actions hugging the right edge whether or not the ISRC is present (a song
 * with no matched ISRC omits it, so space-between can't be relied on). */
.card-detail__footer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 16px;
}
.card-detail__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
/* A subtle data readout, not a hero element: dim + monospace so the code
 * reads cleanly (Marquee Night). The "ISRC" key is quieter still. */
.card-detail__isrc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: .5px;
  color: var(--dim);
  word-break: break-all;
}
.card-detail__isrc-key {
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .7;
  margin-right: 4px;
}
.card { cursor: pointer; }

/* The one chrome sound control [owner sound directive 2026-07-17]. Amber is
   scarce (BRANDING §1): the glyph stays grayscale at rest AND on hover — only
   opacity lifts — so the emoji's color never competes with the single spotlight.
   Fixed to the house's top-right corner, out of the marquee's way. */
.mute-control { position: fixed; top: 12px; right: 12px; z-index: 50; }
.mute-control__btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 6px; border-radius: 8px;
  filter: grayscale(1); opacity: 0.6; transition: all .15s ease;
}
.mute-control__btn:hover { opacity: 1; }
.mute-control__btn:focus-visible { outline: 1px solid var(--spot); opacity: 1; }

/* The persistent "Rules" launcher [rules feature], beside the mute control.
   Neutral chrome to keep the single amber spotlight scarce (BRANDING §1) —
   dim at rest, cream on hover, amber only on keyboard focus. */
.rules-launch {
  position: fixed; top: 12px; right: 50px; z-index: 50;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--dim); text-decoration: none;
  padding: 6px 8px; border-radius: 8px; line-height: 1;
  opacity: .75; transition: all .15s ease;
}
.rules-launch:hover { color: var(--cream); opacity: 1; }
.rules-launch:focus-visible { outline: 1px solid var(--spot); color: var(--cream); opacity: 1; }

/* While the full-page card overlay is open, the card owns the top corners
   (cost pill + ✕ close), so the fixed layout chrome that lives there must yield
   — the controller toggles this body flag on open/close [owner rework #5]. */
body.card-detail-open .rules-launch,
body.card-detail-open .mute-control { display: none; }

/* The in-app modal: a header bar pinned above scrollable content, so the
   close stays reachable even for the long rules mid-match. Sized to the
   DYNAMIC viewport (100dvh) + safe areas: on iOS `100vh` is the chrome-
   retracted height, so it overflowed the visible area and clipped the close
   bar AND the last line at once [owner QA, iOS Chrome]. `inset: 0` stays as
   the pre-dvh fallback; safe-area padding keeps clear of the notch/home bar. */
.rules-modal {
  position: fixed; inset: 0; z-index: 60;
  height: 100dvh; box-sizing: border-box;
  background: rgba(19, 16, 25, .82);
  display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.rules-modal__panel {
  background: var(--panel);
  border: 1px solid rgba(255, 180, 58, .33);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .55);
  max-width: 680px; width: 100%;
  /* Bounded by the padded overlay, which is itself the visible viewport. */
  max-height: 100%;
  display: flex; flex-direction: column;
  padding: 16px 20px 20px;
  text-align: left;
}
.rules-modal__bar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(156, 147, 176, .16);
}
.rules-modal__body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
.rules-modal__loading { color: var(--dim); padding: 20px 4px; }
.rules-modal__body .rules { margin: 0; }

/* How to Play — the rules page + modal content [rules feature].
   Reading surface, so it opts OUT of the stage's centered text; the wheel is
   the one visual that stays centered. Tokens only — genre vars on the wheel,
   stat colors on the stats, --action-green / --danger for the beats/loses
   cues. Amber stays scarce: only the 30-second core wears it. */
.rules { text-align: left; max-width: 620px; margin: 0 auto; }
.rules b { color: var(--cream); font-weight: 700; }
.rules-section { margin-top: 30px; }
.rules-lead { font-size: 16px; color: var(--cream); margin: 6px 0 14px; }
.rules .label { display: block; margin-bottom: 4px; }

/* The 30-second core — the page's one amber focal (no CTA competes here).
   Amber arrives as a spot left-border (the recap-row pattern), NOT a full
   amber border: BRANDING §5 reserves that for the ruling card. */
.rules-core {
  list-style: none;
  margin: 4px 0 0;
  padding: 16px 18px 16px 20px;
  background: var(--panel);
  border-radius: 12px;
  border-left: 3px solid var(--spot);
  display: grid;
  gap: 12px;
}
.rules-core li { display: flex; align-items: baseline; gap: 12px; font-size: 18px; }
.rules-core__num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Archivo Black', sans-serif; font-size: 13px;
  color: var(--spot);
  border: 1px solid rgba(255, 180, 58, .5); border-radius: 50%;
}
.rules-core__tag { font-size: 14px; color: var(--dim); font-style: italic; margin: 10px 2px 0; }

/* Card anatomy — the compact card + inspect panel are the REAL classes, so
   they render identically; only the callout cues are new. */
.rules-anatomy { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.rules-anatomy__card { flex: 0 0 auto; }
.rules-anatomy__card .card { cursor: default; margin: 0 auto; }
.rules-anatomy__statsnote { font-size: 12px; color: var(--dim); margin: 4px 2px 0; }
.rules-anatomy__card .detail-panel { margin-top: 10px; max-width: 220px; }
.rules-anatomy__badges { margin: 8px 0 0; }
.rules-callouts { list-style: none; margin: 0; padding: 0; flex: 1 1 240px; display: grid; gap: 9px; }
.rules-callouts li { font-size: 15px; color: var(--dim); line-height: 1.35; }
.rules-callouts li b { color: var(--cream); }
/* The numbered cue chip — shared by the card sups and the callout list. */
.rules-cue {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  line-height: 1; vertical-align: middle;
  color: var(--ink); background: var(--dim); border-radius: 8px;
}
sup.rules-cue { font-size: 9px; min-width: 13px; height: 13px; }
.rules-winded { color: var(--danger); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* The three stats */
.rules-stats { display: grid; gap: 10px; }
.rules-stat { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.rules-stat__name { font-family: 'Archivo Black', sans-serif; font-size: 14px; min-width: 58px; }
.rules-stat__desc { color: var(--dim); }

/* The Type Wheel — self-contained inline SVG (no external asset), genre color
   from the same tokens the cards use. */
.rules-wheel { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: center; }
.rules-wheel__svg { flex: 1 1 300px; max-width: 360px; height: auto; }
.rules-wheel__seg { fill: var(--genre, var(--dim)); stroke: var(--ink); stroke-width: 2; }
.rules-wheel__label {
  fill: var(--cream);
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  dominant-baseline: middle;
}
.rules-wheel__hub { fill: var(--ink); stroke: rgba(156, 147, 176, .4); stroke-width: 1; }
.rules-wheel__hubtext {
  fill: var(--dim);
  font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 700; letter-spacing: 1px;
}
.rules-wheel__spin { fill: none; stroke: var(--action-green); stroke-width: 2.5; opacity: .9; }
.rules-wheel__arrowhead { fill: var(--action-green); }
.rules-wheel__key { flex: 1 1 260px; }
.rules-wheel__cue { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.rules-wheel__dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 14px; font-weight: 700;
}
.rules-wheel__dot--beats { color: var(--ink); background: var(--action-green); }
.rules-wheel__dot--loses { color: var(--ink); background: var(--danger); }
.rules-wheel__table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.rules-wheel__table th, .rules-wheel__table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid rgba(156, 147, 176, .16); }
.rules-wheel__table thead th { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.rules-wheel__table tbody th { font-weight: 700; color: var(--cream); white-space: nowrap; }
.rules-wheel__beats { color: var(--action-green); }
.rules-wheel__loses { color: var(--danger); }
.rules-swatch {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin-right: 7px; vertical-align: middle;
  background: var(--genre, var(--dim));
}

/* Depth — one line each, secondary weight */
.rules-depth__list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.rules-depth__list li { font-size: 14px; color: var(--dim); line-height: 1.4; }
.rules-depth__list li b { color: var(--cream); }

/* Fixed bottom tab bar [#77] — replaces the cramped cross-nav ghost footers
   with a mobile-style tab bar of comfortable tap targets. Neutral chrome on a
   panel surface; the single spotlight stays scarce (BRANDING §1) — only the
   ACTIVE section's tab wears amber (text + a 2px top spotlight rule), the rest
   stay dim. Rendered only on the shell pages that carried those footers, so it
   is never a global bar. */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30; /* above content, below the rules modal (60) and top chrome (50) */
  display: flex;
  justify-content: center;
  background: var(--panel);
  border-top: 1px solid rgba(156, 147, 176, .16);
  /* iOS: keep the row clear of the home indicator. */
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, .33);
}
.tab-bar__tab {
  flex: 1 1 0;
  max-width: 220px; /* on wide screens the tabs stay a thumb-sized, centered row */
  min-height: 52px; /* comfortable tap target, well past the 44px floor */
  display: flex;
  align-items: center;
  justify-content: center;
  /* The Label — the ticket-stub style, so the bar speaks the brand's voice. */
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--dim);
  text-decoration: none;
  /* The active tab's amber top rule lives here as a transparent placeholder so
     activating a tab never shifts the label by a pixel. */
  box-shadow: inset 0 2px 0 transparent;
  transition: color .15s ease, box-shadow .15s ease;
}
.tab-bar__tab:hover { color: var(--cream); }
.tab-bar__tab:focus-visible { outline: 1px solid var(--spot); outline-offset: -3px; color: var(--cream); }
.tab-bar__tab--active {
  color: var(--spot);
  box-shadow: inset 0 2px 0 var(--spot);
}
.tab-bar__tab--active:hover { color: var(--spot); }
/* Clear the fixed bar so page content never hides behind it. Scoped to the
   pages that render the bar (via the layout's house--tabbed class) — the
   battle screen and every bar-less page keep their original spacing. */
.house--tabbed { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) {
  .tab-bar__tab { transition: none; }
}

/* The fixed Match Action Bar [match-action-bar]. Mirrors the bottom nav's
   fixed-bottom + safe-area treatment (#77): it pins the CURRENT phase's primary
   CTA to the bottom of the match so the action is unmissable and never scrolls
   off (owner: "obvious interactions that lead the user's eyes to that space").
   The nav tab bar never renders on matches#show (show_bottom_nav? skips it), so
   this bar owns the bottom alone — no conflict. */
.match-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15; /* above stage content, below the card-detail modal (20) + rules modal (60) */
  background: var(--panel);
  border-top: 1px solid rgba(156, 147, 176, .16);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, .33);
  /* iOS: keep the row clear of the home indicator. A fixed pixel height + the
     safe-area inset, never vh — the visible viewport shifts under iOS chrome
     (the dvh/modal lesson), and a vh-based bar would drift off the home bar. */
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.match-action-bar__inner {
  max-width: 560px;
  margin: 0 auto;
}
/* The primary CTA fills the bar — a big, high-contrast amber tap target that
   leads the eye (BRANDING §1 spotlight). Reuses the .btn token; only the
   full width and the comfortable tap height are bar-specific. */
.match-action-bar__cta.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 15px 34px;
  text-align: center;
}
/* No primary action this phase (blind waiting, already-advanced, or a
   "tap a card / strike an arena" hint): the SAME bar holds a dim status so the
   layout never jumps between phases. */
.match-action-bar__status {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}
/* Clear the fixed bar so no phase's content hides behind it (mirrors
   .house--tabbed). Added to the stage in connect() only while the flag is on. */
.battle-stage--barred { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
/* A fresh, actionable CTA glows a few times to pull the eye to the bar, then
   rests. Only a newly-available action gets the --fresh class (a poll re-render
   of the same action does not), so this fires once per real transition. */
.match-action-bar__cta--fresh { animation: action-bar-pulse 1.1s ease-in-out 3; }
@keyframes action-bar-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 180, 58, 0); }
  50% { box-shadow: 0 0 22px rgba(255, 180, 58, .7); }
}
@media (prefers-reduced-motion: reduce) {
  .match-action-bar__cta--fresh { animation: none; }
}
/* When the bar carries Perform over an open card-detail large view [perform-in-bar],
   it must float above the modal backdrop (z 20) and stay tappable — still below
   the rules modal (60). The overlay's .card-detail--barred makes the matching
   bottom room so the panel never hides it. */
.match-action-bar--over-modal { z-index: 25; }

/* The green "action taken" flash on button interaction [owner 2026-07-17]. A
   deliberate departure from the amber-only chrome — the owner's explicit call:
   green = an action was taken. Transient (~220ms via JS), a clean confident
   green over primary and ghost buttons alike. */
.btn--pressed,
.btn.btn--pressed {
  background-color: var(--action-green) !important;
  border-color: var(--action-green) !important;
  color: var(--ink) !important;
  transition: background-color .06s ease, border-color .06s ease, color .06s ease;
}
/* Reduced motion: instant, no fade — the feedback still lands, just unanimated. */
@media (prefers-reduced-motion: reduce) {
  .btn--pressed,
  .btn.btn--pressed { transition: none; }
}

/* The opaque support code [beta feedback]: quiet and secondary — a dim,
   monospaced reference the tester can tap to copy. Present on both the battle
   island (injected footer) and the recap. Amber only on the code itself, so it
   reads as a copyable value without competing with the marquee. */
.match-code { text-align: center; margin: 16px 0 4px; }
.match-code__btn {
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  opacity: .8;
  transition: opacity .12s ease;
}
.match-code__btn:hover,
.match-code__btn:focus-visible { opacity: 1; }
.match-code__btn:focus-visible { outline: 1px solid var(--spot); border-radius: 6px; }
.match-code__value {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  letter-spacing: 1px;
  color: var(--spot);
  font-weight: 700;
}
.match-code__hint { margin-left: 8px; opacity: .6; }

/* ---- New-user welcome [new-user-welcome] --------------------------------
   The one-time curtain-up. Composes house tokens; the amber spotlight is
   reserved for the single CTA (BRANDING §1), so the orientation panels stay
   quiet neutral surfaces. Left-aligned body under a centered marquee reads
   like a short program note rather than a wall of centered text. */
.welcome { max-width: 560px; margin: 0 auto; text-align: left; }
.welcome .marquee { text-align: center; }

.welcome-section { margin-top: 26px; }
.welcome-section > .label { display: block; margin-bottom: 10px; }

/* The running order — a real sequence, so it's numbered. Neutral panel and
   dim numerals: the CTA below owns the amber. */
.welcome-steps {
  list-style: none;
  margin: 0;
  padding: 16px 18px;
  background: var(--panel);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.welcome-steps li { display: flex; align-items: baseline; gap: 12px; font-size: 17px; color: var(--cream); }
.welcome-steps__num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Archivo Black', sans-serif; font-size: 12px;
  color: var(--dim);
  border: 1px solid rgba(156, 147, 176, .45); border-radius: 50%;
}
.welcome-steps b { color: var(--cream); }
.welcome-note { font-size: 14px; color: var(--dim); font-style: italic; margin: 10px 2px 0; }

/* Tab-bar orientation — echoes the real bottom bar's three labels. */
.welcome-tabs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.welcome-tabs li { font-size: 16px; color: var(--dim); }
.welcome-tabs b {
  color: var(--cream);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: .5px;
}

/* Rules pointer — names the persistent chrome button, styled like the real
   thing (neutral, never amber — the button itself is scarce chrome). */
.welcome-rules {
  margin-top: 24px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border: 1px solid rgba(156, 147, 176, .18);
  border-radius: 10px;
  font-size: 15px; color: var(--cream);
}
.welcome-rules__name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--dim);
  font-size: 12px;
  border: 1px solid rgba(156, 147, 176, .3); border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}

.welcome .cta-row { text-align: center; }
