/* 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: radial-gradient(1000px 500px at 50% -10%, #2A2142 0%, var(--ink) 60%) fixed, var(--ink);
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  font-size: 16px;
}

.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); }

/* 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; }

.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;
}

.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;
}
.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; }
}
.card-detail__hero {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0A0810;
  border-radius: 8px;
  min-height: 180px;
}
.card-detail__art {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
}
.card-detail__vinyl { width: 160px; height: 160px; margin: 20px 0; }
.card-detail__title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  line-height: 1.1;
  margin-top: 6px;
}
.card-detail__stats {
  display: flex;
  gap: 26px;
  font-size: 18px;
  font-weight: 700;
  margin-top: 10px;
}
.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; }

/* 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); }

/* 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; }
