/* ============================================================
   A Game of Two Scarves
   Dark/gold matchday-floodlight aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,700;9..144,900&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg:         #0F0F0F;
  --surface:    #1A1A1A;
  --surface-2:  #242424;
  --border:     #2E2E2E;
  --border-2:   #3A3A3A;
  --text:       #F5F5F0;
  --text-dim:   #A8A8A0;
  --text-mute:  #707070;
  --gold:       #D4AF37;
  --gold-dim:   #8C7325;
  --gold-bg:    #2A2310;
  --success:    #5BA45B;
  --warning:    #D4954E;
  --danger:     #C45050;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(212, 175, 55, 0.06), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(212, 175, 55, 0.03), transparent 50%);
  background-attachment: fixed;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ---------- Header / masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 20px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.brand h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}

.brand h1 .ampersand {
  color: var(--gold);
  font-style: italic;
  font-weight: 400;
}

.brand .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 6px;
  font-variation-settings: "opsz" 14;
}

.masthead-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: right;
  line-height: 1.6;
}

.masthead-meta .ep {
  color: var(--gold);
  font-weight: 600;
}

/* ---------- Nav toggle ---------- */
.view-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--gold-dim);
  border-radius: var(--r-sm);
  margin-bottom: 28px;
  background: var(--surface);
}

.view-toggle a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--text-dim);
  transition: all 0.15s;
}

.view-toggle a.active {
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
}

.view-toggle a:not(.active):hover {
  color: var(--text);
  background: var(--surface-2);
}

/* ---------- Section labels ---------- */
.section {
  margin-bottom: 36px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
}

/* ---------- The funnel ---------- */
.funnel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.funnel-stage {
  background: var(--surface);
  padding: 18px 12px;
  text-align: center;
  position: relative;
}

.funnel-stage.active {
  background: var(--gold-bg);
}

.funnel-stage .num {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variation-settings: "opsz" 144;
}

.funnel-stage.active .num { color: var(--gold); }

.funnel-stage .stage-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 6px;
}

.funnel-stage.active .stage-label { color: var(--gold); }

/* ---------- Profile tile + stats ---------- */
.tier-banner {
  background: linear-gradient(90deg, var(--gold-bg) 0%, var(--surface) 100%);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.tier-banner .tier-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.tier-banner .tier-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.stat {
  background: var(--surface);
  padding: 16px 18px;
}

.stat .stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat .stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 6px;
  font-variation-settings: "opsz" 144;
}

.stat .stat-value .denom {
  color: var(--text-mute);
  font-size: 16px;
  font-weight: 400;
}

/* ---------- Shortlist table ---------- */
.shortlist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.shortlist table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.shortlist thead {
  background: var(--bg);
}

.shortlist th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}

.shortlist th.l { text-align: left; padding-left: 18px; }
.shortlist th.r { text-align: right; padding-right: 18px; }

.shortlist td {
  text-align: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}

.shortlist tbody tr:last-child td { border-bottom: none; }
.shortlist tbody tr:hover td { background: var(--surface-2); }

.shortlist td.l { text-align: left; padding-left: 18px; font-family: var(--font-body); }
.shortlist td.r { text-align: right; padding-right: 18px; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--gold); }
.shortlist td.pos { color: var(--text-mute); font-size: 11px; }
.shortlist td .club-name { font-weight: 500; font-size: 14px; color: var(--text); }
.shortlist td .division-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  border: 1px solid var(--border-2);
  padding: 1px 5px;
  border-radius: 2px;
  vertical-align: middle;
}

.shortlist td .score-hi { color: var(--success); font-weight: 600; }
.shortlist td .score-lo { color: var(--text-mute); }

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-mute);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
}

/* ---------- Eliminated panel ---------- */
.eliminated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.elim-row {
  display: flex;
  align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.elim-row:last-child { border-bottom: none; }

.elim-club {
  font-weight: 500;
  text-decoration: line-through;
  color: var(--text-mute);
  min-width: 180px;
  font-size: 14px;
}

.elim-reason {
  flex: 1;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-dim);
  font-size: 14px;
  min-width: 200px;
}

.elim-ep {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Episode log ---------- */
.episode-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 22px;
}

.episode-log .ep-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.episode-log .ep-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 4px 0 10px;
  line-height: 1.2;
  font-variation-settings: "opsz" 60;
}

.episode-log .ep-body {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================================
   Sticker album view
   ============================================================ */

.album-section { margin-bottom: 32px; }

.progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar > div {
  height: 100%;
  background: var(--gold);
  transition: width 0.4s;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.sticker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 12px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}

.sticker:hover { transform: translateY(-2px); border-color: var(--gold-dim); }

.sticker.locked {
  opacity: 0.35;
  border-style: dashed;
  border-color: var(--border-2);
}

.sticker.locked:hover { transform: none; border-color: var(--border-2); }

.sticker .glyph {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  font-variation-settings: "opsz" 144;
  margin-bottom: 8px;
  font-style: italic;
}

.sticker.locked .glyph { color: var(--text-mute); }

.sticker .name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.sticker.locked .name { color: var(--text-mute); }

.sticker .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sticker .stat-best {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--success);
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.06em;
}

/* Scarf-stickers — render the actual scarf colours */
.scarf-strip {
  width: 100%;
  height: 20px;
  border-radius: 2px;
  margin-bottom: 10px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-2);
}

.scarf-strip > div { flex: 1; }

/* Contender pill */
.pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 10px;
  margin-top: 6px;
  display: inline-block;
}

.pill.active    { background: rgba(91, 164, 91, 0.15);   color: var(--success); }
.pill.watching  { background: rgba(212, 149, 78, 0.15);  color: var(--warning); }
.pill.eliminated{ background: rgba(196, 80, 80, 0.15);   color: var(--danger); }
.pill.chosen    { background: var(--gold); color: var(--bg); }

/* ============================================================
   Footer
   ============================================================ */
.colophon {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-align: center;
}

.colophon .gold { color: var(--gold); }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 720px) {
  .container { padding: 20px 14px 40px; }
  .funnel { grid-template-columns: repeat(5, 1fr); }
  .funnel-stage { padding: 12px 4px; }
  .funnel-stage .num { font-size: 24px; }
  .funnel-stage .stage-label { font-size: 8px; letter-spacing: 0.08em; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .shortlist { overflow-x: auto; }
  .shortlist table { min-width: 640px; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .sticker { min-height: 96px; padding: 12px 8px; }
}

/* ============================================================
   Loading state
   ============================================================ */
.loading {
  padding: 64px 20px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--text-mute);
}
