/* =========================================================
   DBLD Projects — Components
   Shared UI pieces: header/nav, footer, cards, tiles, badges,
   buttons, bracket UI, rankings, suggestions.
   Flat, warm, editorial — no gloss, no glow, no theater-at-night.
   ========================================================= */

/* ---------- Site header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--color-dark);
  border-bottom: 1px solid var(--color-dark-border);
}

.site-header__inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  color: var(--color-dark-text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__big {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 0.05em;
  color: var(--color-dark-text);
}
.brand__small {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.14em;
  color: var(--color-dark-text-dim);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.site-nav a {
  color: var(--color-dark-text-dim);
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-pill);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--color-dark-text);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--color-accent-ink);
  background: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-dark-border);
  border-radius: var(--radius-sm);
  color: var(--color-dark-text);
  padding: var(--sp-2) var(--sp-3);
}

@media (max-width: 640px) {
  .site-nav {
    position: fixed;
    inset: var(--nav-height) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
    background: var(--color-dark);
    border-bottom: 1px solid var(--color-dark-border);
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .site-nav a { padding: var(--sp-3); border-radius: var(--radius-sm); }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Site footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-dark-text-dim);
  padding: var(--sp-6) 0 var(--sp-7);
  margin-top: var(--sp-7);
  font-size: var(--fs-sm);
  text-align: center;
}
.site-footer__mark {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  color: var(--color-dark-text);
  font-size: var(--fs-md);
  margin-bottom: var(--sp-2);
}
.site-footer__links {
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
  margin: var(--sp-3) 0;
  flex-wrap: wrap;
}
.site-footer__links a { color: var(--color-dark-text-dim); text-decoration: none; }
.site-footer__links a:hover { color: var(--color-dark-text); text-decoration: underline; }
.site-footer p { color: var(--color-dark-text-dim); }

/* ---------- Card (formerly "ticket-stub") ----------
   The bracket tiles you tap. Each gets a bold colored top band with a sheen
   over it, so it reads as a raised object against the calm tan page rather
   than another beige rectangle. Colors cycle per card via --card-accent. */
.ticket-stub {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ticket-stub__perforation {
  position: relative;
  height: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--sp-4) 0 var(--sp-3);
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-3);
  margin-bottom: var(--sp-2);
}

.badge {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
/* The "Play Now" badge is the call to action on the card, so it's the solid
   filled one rather than the tinted one the other statuses use. */
.badge--live {
  background: #2F6B39;
  color: #EAF6E2;
  box-shadow: var(--shadow-card);
}
.badge--live::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  min-height: 44px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.btn--primary:hover { box-shadow: var(--shadow-card-hover); }

.btn--ghost {
  background: transparent;
  border-color: var(--color-text);
  color: var(--color-text);
}
.btn--ghost:hover { background: var(--color-surface-2); }

.btn--velvet {
  background: var(--color-dark);
  color: var(--color-dark-text);
}
.btn--velvet:hover { box-shadow: var(--shadow-card-hover); }

.btn--block { width: 100%; }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Quote block ---------- */
.quote {
  font-style: italic;
  color: var(--color-text-dim);
  border-left: 3px solid var(--color-border);
  padding-left: var(--sp-4);
  margin: var(--sp-5) 0;
}
.quote cite {
  display: block;
  margin-top: var(--sp-1);
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  color: var(--color-text-faint);
}
.empty-state__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--color-text-dim);
  margin-bottom: var(--sp-2);
}

/* ---------- Form fields ---------- */
.field { display: block; margin-bottom: var(--sp-5); }
.field label {
  display: block;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  color: var(--color-text-dim);
  margin-bottom: var(--sp-2);
}
.field input[type="text"],
.field textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  color: var(--color-text);
  min-height: 44px;
}
.field textarea { min-height: 120px; resize: vertical; font-family: var(--font-body); }
.field input[type="text"]:focus-visible,
.field textarea:focus-visible { border-color: var(--color-text); }
.field__hint { font-size: var(--fs-xs); color: var(--color-text-faint); margin-top: var(--sp-1); }
.field__error {
  font-size: var(--fs-xs);
  color: var(--color-velvet);
  margin-top: var(--sp-1);
  display: none;
}
.field.has-error input,
.field.has-error textarea { border-color: var(--color-velvet); }
.field.has-error .field__error { display: block; }

/* ---------- Bracket: intro screen ---------- */
.bracket-intro__note {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--color-text-dim);
  margin: var(--sp-4) 0;
}
.bracket-intro__howto { margin: var(--sp-4) 0; padding-left: 1.1em; }
.bracket-intro__howto li { margin-bottom: var(--sp-2); color: var(--color-text-dim); }

/* ---------- Bracket: progress ---------- */
.bracket-progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  overflow: hidden;
  margin: var(--sp-3) 0 var(--sp-4);
}
.bracket-progress__fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.25s ease;
}
.bracket-progress__label {
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Bracket: section tabs ---------- */
.bracket-tabs {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-4);
  -webkit-overflow-scrolling: touch;
}
.bracket-tab {
  flex: 0 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--color-text-dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 40px;
}
.bracket-tab.is-active {
  border-color: var(--color-text);
  color: var(--color-accent-ink);
  background: var(--color-accent);
}
.bracket-tab.is-complete::after { content: "✓"; color: var(--status-live-text); }
.bracket-tab[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- Bracket: matchup tree ---------- */
.bracket-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-3);
  margin: 0 calc(var(--sp-4) * -1);
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}
.bracket-columns { display: flex; gap: var(--sp-4); width: max-content; }
.bracket-col { display: flex; flex-direction: column; justify-content: space-around; flex: 0 0 auto; }
.bracket-col-label {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--sp-3);
}
.bracket-matchup {
  display: flex;
  flex-direction: column;
  margin: var(--sp-2) 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.bracket-team {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-surface);
  padding: var(--sp-2) var(--sp-3);
  min-height: 44px;
  width: 176px;
  border: none;
  border-bottom: 1px solid var(--color-border-soft);
  text-align: left;
  color: var(--color-text);
}
.bracket-team:last-child { border-bottom: none; }
.bracket-team:active { background: var(--color-surface-2); }
.bracket-team.is-selected { background: var(--status-live-bg); }
.bracket-team.is-selected .bracket-name { color: var(--status-live-text); font-weight: 600; }
.bracket-team.is-empty { opacity: 0.45; cursor: default; }
.bracket-seed {
  font-family: var(--font-display);
  color: var(--color-text-faint);
  font-size: var(--fs-sm);
  min-width: 16px;
  flex-shrink: 0;
}
.bracket-name { font-size: var(--fs-sm); line-height: 1.25; flex: 1; min-width: 0; }
.bracket-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-dark-text);
  background: var(--color-text-faint);
}

/* ---------- Bracket: Final Four / Champion ---------- */
.ff-matchups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}
@media (min-width: 640px) { .ff-matchups { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ff-matchup-label {
  text-align: center;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--sp-2);
}

.champion-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.champion-box__trophy { font-size: var(--fs-3xl); line-height: 1; margin-bottom: var(--sp-2); }
.champion-box__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-3);
  margin-bottom: var(--sp-2);
}
.champion-box__name { font-family: var(--font-display); font-size: var(--fs-2xl); }
.champion-pick-row { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.champion-pick {
  flex: 1;
  max-width: 160px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  text-align: center;
  color: var(--color-text);
}
.champion-pick .bracket-name { font-size: var(--fs-sm); }
.champion-vs { font-family: var(--font-display); color: var(--color-text-faint); }

/* ---------- Success / stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin: var(--sp-5) 0; }
@media (min-width: 640px) { .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  text-align: center;
}
.stat-card__value { font-family: var(--font-display); font-size: var(--fs-2xl); color: var(--color-text); }
.stat-card__label { font-size: var(--fs-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Bracket: view mode toggle (Cards / Grid) ---------- */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}
.view-toggle button {
  border: none;
  background: transparent;
  color: var(--color-text-dim);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  min-height: 36px;
}
.view-toggle button.is-active {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* ---------- Bracket: swipe deck (one matchup at a time) ----------
   touch-action: pan-y lets the page still scroll vertically while we
   claim horizontal drags for swiping between matchups. */
.deck { position: relative; margin: var(--sp-4) 0 var(--sp-5); touch-action: pan-y; }
.deck__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.deck__round {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}
.deck__count {
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  white-space: nowrap;
}
.deck__stage { transition: transform 0.16s ease, opacity 0.16s ease; }
.deck__stage.is-out-left { transform: translateX(-36px); opacity: 0; }
.deck__stage.is-out-right { transform: translateX(36px); opacity: 0; }

/* Always side by side, at every width.
   This used to stack below 700px, which was fine when a contender was a short
   text button — but a head-to-head that you have to SCROLL between isn't a
   head-to-head. With posters it was the whole problem: on a phone you saw one
   poster, scrolled past it, and met the second one with the first already out
   of view. Two 2:3 posters fit a 390px screen at roughly 165px each. */
.deck__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: start;
}
@media (min-width: 700px) {
  .deck__cards { gap: var(--sp-4); }
}
.deck__vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  padding: var(--sp-1) 0;
}

.contender {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-5) var(--sp-4);
  min-height: 112px;
  color: var(--color-text);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.contender:hover,
.contender:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-accent);
}
.contender:active { transform: scale(0.99); }
.contender.is-picked { background: var(--status-live-bg); border-color: var(--status-live-text); }
.contender.is-picked .contender__name { color: var(--status-live-text); }
.contender.is-empty { opacity: 0.5; }
.contender__top {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}
.contender__seed { font-family: var(--font-display); font-size: var(--fs-sm); }
.contender__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--status-coming-bg);
  color: var(--status-coming-text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}
.contender__check { margin-left: auto; color: var(--status-live-text); font-weight: 700; }
.contender__name { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.05; }
.contender__meta { font-size: var(--fs-sm); color: var(--color-text-dim); }

/* ---- the matchup arena ------------------------------------------------ */
/*
   The one-on-one screen is dark on purpose. Posters are the only saturated
   thing on this site, and on the tan page background they were competing with
   it. Against near-black they read as lit objects instead — the same reason
   cinemas, Letterboxd and Netflix all put artwork on dark.

   The card chrome is gone with it. On a dark stage the poster IS the card;
   wrapping it in a pale rounded box put a second, louder border around the
   thing you actually want people looking at.
*/
.deck.is-arena {
  background: var(--color-dark);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
  box-shadow: var(--shadow-card);
}
/* The head is baseline-aligned for the text; the button needs centring. */
.deck.is-arena .deck__head { align-items: center; }
.deck.is-arena .deck__count { margin-left: auto; }
.deck__focus {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--color-dark-border);
  border-radius: var(--radius-pill);
  color: var(--color-dark-text);
  /* 40px is the smallest a tap target should get — this sits next to the
     round label and is easy to hit slightly wide of centre. */
  min-width: 40px;
  min-height: 32px;
  font-size: var(--fs-sm);
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease;
}
.deck__focus:hover { background: rgba(255, 255, 255, 0.16); }

/* ---- focus mode --------------------------------------------------------
   The matchup takes the whole screen and everything else goes away: header,
   title, progress bar, view toggle, reset and submit, footer. What's left is
   two posters and Compare.

   A CSS overlay rather than the Fullscreen API, deliberately — iOS Safari
   doesn't support Fullscreen on iPhone, and the phone is the primary device.
   This behaves the same everywhere.
------------------------------------------------------------------------- */
body.is-deck-focus { overflow: hidden; }
/* Hide the page around the bracket, but NOT the panel the deck lives in. */
body.is-deck-focus #site-header-mount,
body.is-deck-focus #site-footer-mount,
body.is-deck-focus #bracket-app > *:not(#bracket-panel) {
  display: none !important;
}
body.is-deck-focus #bracket-app > #bracket-panel { margin: 0; }

.deck.is-focus {
  position: fixed;
  inset: 0;
  z-index: 200;
  margin: 0;
  border-radius: 0;
  /* Keep clear of the notch and the home indicator on a phone. */
  padding: max(var(--sp-4), env(safe-area-inset-top)) var(--sp-4)
           max(var(--sp-4), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-y: auto;
}
/* Round label pinned top, arrows pinned bottom, the matchup centred in what's
   left. Using auto margins rather than justify-content:center because centred
   flex content that overflows gets its top clipped — and on a small phone in
   landscape this will overflow. */
.deck.is-focus .deck__stage { margin-block: auto; width: 100%; }
/* More room for the art once the page furniture is gone, but still capped so
   a laptop doesn't get a poster the height of the window. */
.deck.is-focus .contender__art { max-width: 260px; }
.deck.is-focus .deck__head { margin-bottom: 0; }
.deck.is-focus .deck__foot { margin-top: var(--sp-3); }

@media (min-width: 700px) {
  .deck.is-focus .deck__stage { max-width: 760px; margin: 0 auto; width: 100%; }
  .deck.is-focus .deck__head,
  .deck.is-focus .deck__foot { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
}

.deck.is-arena .deck__round { color: var(--color-dark-text); }
.deck.is-arena .deck__count,
.deck.is-arena .deck__progress { color: var(--color-dark-text-dim); }
.deck.is-arena .deck__vs { color: #6E6857; }
.deck.is-arena .deck__arrow {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--color-dark-border);
  color: var(--color-dark-text);
}
.deck.is-arena .deck__arrow:hover:not([disabled]) { background: rgba(255, 255, 255, 0.14); }

.deck.is-arena .contender {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  gap: var(--sp-2);
  text-align: center;
  align-items: center;
}
.deck.is-arena .contender:hover,
.deck.is-arena .contender:focus-visible { transform: none; }
.deck.is-arena .contender__name { color: var(--color-dark-text); }
.deck.is-arena .contender__meta,
.deck.is-arena .contender__top { color: var(--color-dark-text-dim); }
.deck.is-arena .contender__top { justify-content: center; }
.deck.is-arena .contender__check { margin-left: 0; color: var(--color-accent); }
.deck.is-arena .contender.is-picked { background: none; }
.deck.is-arena .contender.is-picked .contender__name { color: var(--color-accent); }
.deck.is-arena .contender.is-empty .contender__name { color: var(--color-dark-text-dim); }

/* ---- poster / headshot art -------------------------------------------- */
/*
   What makes poster art read as expensive is a short, specific list: a strict
   2:3 box, a SMALL corner radius, a faint inset highlight, and a shadow that
   tightens on hover. The inset border is the one people skip — it's what keeps
   a dark poster from dissolving into a dark background.
*/
.contender.has-art { justify-content: flex-start; }
.contender__art {
  position: relative;
  display: block;
  width: 100%;
  /* The cap is what stops a poster eating a laptop screen. Without it the
     grid column is ~330px wide, the 2:3 box becomes 495px tall, and the title
     underneath falls below the fold — you saw art and had to scroll to find
     out what it was. */
  max-width: 190px;
  margin: 0 auto;
  /* Reserve the space before the image arrives, so nothing jumps when it
     lands and shifts the button out from under a moving thumb. */
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  overflow: hidden;
  background: #2A2721;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.contender__art::after {
  /* inset highlight — above the image, ignores pointer events */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.contender__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* never letterbox, never stretch */
  object-position: center top; /* headshots: keep the face, crop the chest */
}
.contender:hover .contender__art,
.contender:focus-visible .contender__art {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}
.contender:active .contender__art { transform: translateY(-1px) scale(1); }
.contender.is-picked .contender__art {
  box-shadow: 0 0 0 3px var(--color-accent), 0 14px 30px rgba(0, 0, 0, 0.5);
}
.contender.has-art .contender__name { font-size: var(--fs-lg); }

@media (prefers-reduced-motion: reduce) {
  .contender__art,
  .contender:hover .contender__art { transition: none; transform: none; }
}

.deck__foot { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.deck__arrow {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  min-height: 40px;
  min-width: 46px;
  color: var(--color-text);
}
.deck__arrow[disabled] { opacity: 0.4; cursor: not-allowed; }
.deck__progress { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--color-text-faint); }

/* The "Compare" panel — side-by-side info for close/hard matchups */
/* The comparison panel.
   This was a faint grey line of text reading "Tale of the tape" — a boxing
   term, and styled so quietly that almost nobody would have discovered it.
   It's now a real button: filled, centred, sized like something you tap. The
   whole point of the panel is to help with the hard matchups, so it has to
   look like an offer rather than a footnote. */
.tape {
  margin-top: var(--sp-4);
  border: none;
  background: none;
}
.tape > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin: 0 auto;
  max-width: 260px;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-pill);
  background: var(--color-accent-2);
  color: var(--color-accent-2-ink);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.06em;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.tape > summary:hover,
.tape > summary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.tape > summary:active { transform: translateY(0); }
.tape > summary::-webkit-details-marker { display: none; }
.tape > summary::after {
  content: "▾";
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  transition: transform 0.14s ease;
}
.tape[open] > summary::after { transform: rotate(180deg); }
.tape__body {
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
@media (prefers-reduced-motion: reduce) {
  .tape > summary, .tape > summary::after { transition: none; }
}
.tape__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-sm);
}
.tape__row:first-child { border-top: none; }
.tape__label {
  text-align: center;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  white-space: nowrap;
}
/* Cast lists and award strings are long. Without these they set the column's
   minimum width and push the whole row past the screen. */
.tape__a, .tape__b { min-width: 0; overflow-wrap: anywhere; }
.tape__a { text-align: left; }
.tape__b { text-align: right; }
.tape__note { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); font-style: italic; color: var(--color-text-dim); }
.tape__source {
  margin: var(--sp-4) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

/* ---------- Bracket: success-screen recap (readable on a phone) ---------- */
.recap { margin-top: var(--sp-4); }
.recap__region { margin-bottom: var(--sp-5); }
.recap__region h4 {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-md);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.recap__round { padding: var(--sp-3) 0; border-top: 1px solid var(--color-border); }
.recap__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--sp-2);
}
.recap__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.recap__chip {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.recap__chip.is-champ {
  background: var(--status-live-bg);
  border-color: var(--status-live-text);
  color: var(--status-live-text);
  font-weight: 600;
}

/* ---------- Share screen ---------- */
.share-canvas-wrap { display: flex; justify-content: center; margin: var(--sp-5) 0; }
.share-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
/* The share image is rendered as a real <img> (not a <canvas>) so that a
   long-press on a phone offers "Add to Photos" — canvases don't get that
   menu. The canvas is still used to draw it, just kept off-screen. */
.share-img-wrap { display: flex; justify-content: center; margin: var(--sp-5) 0 var(--sp-3); }
.share-img-wrap img {
  width: 320px;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
.share-hint { text-align: center; font-size: var(--fs-sm); color: var(--color-text-faint); margin-bottom: var(--sp-4); }

/* ---------- Create Post composer ---------- */
.composer {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-3);
}
.composer__context {
  padding: 0 var(--sp-2) var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent-3);
}
.composer__trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  background: transparent;
  border: none;
  padding: var(--sp-2);
  text-align: left;
  border-radius: var(--radius-pill);
  transition: background 0.12s ease;
}
.composer__trigger:hover { background: var(--color-surface-2); }
.composer__avatar {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 700;
}
.composer__placeholder { color: var(--color-text-faint); font-size: var(--fs-sm); }
.composer__body { padding: var(--sp-2); }
.composer__prompts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.chip {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-dim);
  min-height: 36px;
}
.chip:hover { border-color: var(--color-text); }
.chip.is-active { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.composer__text {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  padding: var(--sp-3);
  color: var(--color-text);
  font-family: var(--font-body);
}
.composer__text:focus-visible { border-color: var(--color-text); }
.composer__foot { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }
.composer__name {
  flex: 1;
  min-width: 150px;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
  padding: 0 var(--sp-3);
  color: var(--color-text);
}
.composer__count { font-size: var(--fs-xs); color: var(--color-text-faint); }
.composer__error { color: var(--color-velvet); font-size: var(--fs-sm); margin-top: var(--sp-2); }
.composer__done {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--status-live-text);
}

/* ---------- Hero ----------
   Kept short on purpose. The brackets are the point of the page, so the top
   should hand you off to them rather than fill itself with copy. */
.hero { padding: var(--sp-6) 0 var(--sp-5); }
/* No max-width here on purpose. Constraining the headline by character count
   is a desktop-only idea: on a phone it boxes the h1 into a narrow column
   with empty space beside it and wraps to five lines. The measure limit is
   applied at >=640px only, below. */
.hero h1 { margin-bottom: var(--sp-3); }
@media (min-width: 640px) { .hero h1 { max-width: 16ch; } }
.hero__quote {
  font-style: italic;
  font-size: var(--fs-md);
  color: var(--color-text-dim);
  margin: 0;
}
.hero__quote cite {
  display: block;
  margin-top: var(--sp-1);
  font-style: normal;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

/* ---------- Claim band ----------
   Replaced the pill "stamps". Three short claims on one dark full-width
   strip: it separates the hero from the brackets, and reads as a statement
   rather than three floating tags. */
.claim-band {
  background: var(--color-dark);
  color: var(--color-dark-text);
  padding: var(--sp-3) 0;
}
.claim-band__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2) var(--sp-6);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}
/* A dot before every claim, so it looks deliberate whether the row wraps
   onto two lines on a phone or sits on one on a desktop. */
.claim-band__inner span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-right: var(--sp-2);
  vertical-align: middle;
}

/* ---------- Featured bracket tiles ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}
@media (min-width: 720px) { .feature-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.feature-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 230px;
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--tile-bg, linear-gradient(155deg, #3A3730, #1C1A15));
  color: #F5F0E3;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feature-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.feature-tile > * { position: relative; z-index: 1; }
.feature-tile:hover,
.feature-tile:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-lift);
  text-decoration: none;
}
.feature-tile:hover::after,
.feature-tile:focus-visible::after { opacity: 0.85; }
.feature-tile:active { transform: translateY(-2px); }

.feature-tile__eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: var(--sp-2);
}
.feature-tile__title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  line-height: 0.95;
  letter-spacing: 0.02em;
}
.feature-tile__meta {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* Per-bracket colour. A new bracket falls back to the neutral gradient
   above, so nothing breaks if this list isn't updated. */
.feature-tile[data-bracket="movie-madness"]  { --tile-bg: linear-gradient(155deg, #4C7A54, #223D28); }
.feature-tile[data-bracket="tv-madness"]     { --tile-bg: linear-gradient(155deg, #B0603A, #5E2C18); }
.feature-tile[data-bracket="comedy-madness"] { --tile-bg: linear-gradient(155deg, #B99640, #5F4A14); }

/* Secondary brackets: same tile, full width and shorter. Sharing the class
   rather than having a separate component means the two can't drift apart
   visually the way a white row next to a colour tile did. */
.feature-stack { display: grid; gap: var(--sp-4); margin-top: var(--sp-4); }
.feature-tile--wide { min-height: 150px; }
.feature-tile--wide .feature-tile__title { font-size: var(--fs-2xl); }

@media (prefers-reduced-motion: reduce) {
  .feature-tile { transition: none; }
  .feature-tile:hover { transform: none; }
}

.home-section {
  scroll-margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-top: 1px solid var(--color-border);
}
.home-section--first { border-top: none; }

/* ---------- Mobile pass ----------
   Everything above is written desktop-first; this section is where the
   phone-specific corrections live so they're findable in one place. */
@media (max-width: 640px) {
  /* Bebas Neue is already condensed, so it needs leading rather than less.
     line-height 1.0 plus a wrapped headline made the lines collide. */
  h1, h2 { line-height: 1.06; }

  .hero { padding: var(--sp-5) 0 var(--sp-4); }

  .page-section { padding: var(--sp-6) 0; }
  .page-section--tight { padding: var(--sp-5) 0; }

  /* Tiles were 230px each. Two stacked plus the hero pushed everything below
     the fold — the opposite of leading with the brackets. */
  .feature-tile { min-height: 168px; padding: var(--sp-4); }
  .feature-tile--wide { min-height: 128px; }
  .feature-grid, .feature-stack { gap: var(--sp-3); }

  /* Wide letter-spacing on uppercase text is a desktop luxury; on a phone it
     forces the band onto three cramped lines. */
  .claim-band__inner { gap: var(--sp-2) var(--sp-4); letter-spacing: 0.06em; }

  /* The picker cards are the main thing you touch — give them room. */
  .contender { min-height: 96px; padding: var(--sp-4); }
  .contender__name { font-size: var(--fs-lg); }
}

@media (max-width: 400px) {
  .badge { padding: var(--sp-1) var(--sp-3); }
  .claim-band__inner { font-size: 0.7rem; }
}

/* ---------- Stats leaderboard ---------- */
.stats-empty { color: var(--color-text-faint); font-size: var(--fs-sm); }

/* ---------- Rankings ---------- */
.rankings-meta {
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

/* ---------- Rankings list ---------- */
.rank-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.rank-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
}
.rank-row:nth-child(1) { border-color: var(--color-accent); background: var(--status-live-bg); }
.rank-badge {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--color-text-faint);
  min-width: 2.2ch;
  text-align: center;
  flex-shrink: 0;
}
.rank-title { flex: 1; min-width: 0; }
.rank-title h3 { font-size: var(--fs-md); margin-bottom: 0; }
.rank-stats { display: flex; gap: var(--sp-4); flex-shrink: 0; }
.rank-stat { text-align: center; min-width: 44px; }
.rank-stat__value { font-family: var(--font-display); font-size: var(--fs-md); color: var(--color-text); }
.rank-stat__label { font-size: 0.65rem; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 480px) {
  .rank-row { flex-wrap: wrap; }
  .rank-stats { width: 100%; justify-content: flex-start; margin-left: calc(2.2ch + var(--sp-4)); gap: var(--sp-5); }
}

/* ---------- Suggestions feed ---------- */
.suggestion-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.suggestion-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.suggestion-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card);
}
.suggestion-card__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.suggestion-card__name { color: var(--color-accent-3); }
.suggestion-card__time { color: var(--color-text-faint); }
.suggestion-card__message { margin: 0; color: var(--color-text); white-space: pre-wrap; word-break: break-word; }
