@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Crimson+Pro:ital,wght@0,300;0,400;1,300&family=DM+Sans:wght@300;400&display=swap');

/* ── Reset ───────────────────────────────────────────────────── */

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

/* ── Variables ───────────────────────────────────────────────── */

:root {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --border:      #1a1a1a;
  --border-mid:  #222222;
  --text:        #e8e4dc;
  --text-muted:  #666666;
  --text-dim:    #3a3a3a;
  --text-faint:  #2e2e2e;

  --font-display: 'Bebas Neue', sans-serif;
  --font-serif:   'Crimson Pro', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
}

/* ── Base ────────────────────────────────────────────────────── */

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

a {
  color: inherit;
  text-decoration: none;
}

/* ── Header ──────────────────────────────────────────────────── */

.site-header {
  padding: 3rem 2.5rem 2rem;
  border-bottom: 0.5px solid var(--border-mid);
}

.eyebrow {
  font-size:      10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--text-dim);
  font-weight:    300;
  margin-bottom:  0.6rem;
}

.page-title {
  font-family:    var(--font-display);
  font-size:      4rem;
  line-height:    0.95;
  letter-spacing: 0.02em;
  color:          var(--text);
  margin-bottom:  0.75rem;
}

.page-subtitle {
  font-family: var(--font-serif);
  font-style:  italic;
  font-weight: 300;
  font-size:   1.1rem;
  color:       var(--text-muted);
}

/* ── Header meta row (stats) ─────────────────────────────────── */

.header-meta {
  display:     flex;
  align-items: center;
  gap:         1.5rem;
  margin-top:  1.5rem;
}

.meta-stat {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.meta-stat-num {
  font-family: var(--font-display);
  font-size:   1.4rem;
  color:       var(--text);
  line-height: 1;
}

.meta-stat-label {
  font-size:      10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color:          var(--text-faint);
}

.meta-divider {
  width:      0.5px;
  height:     32px;
  background: var(--border-mid);
}

/* ── Category grid ───────────────────────────────────────────── */

.category-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
}

/* ── Category card ───────────────────────────────────────────── */

.category-card {
  position:    relative;
  border-right:  0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  cursor:      pointer;
  overflow:    hidden;
  display:     block;
  background:  var(--bg);
  transition:  background 0.2s ease;
}

.category-card:nth-child(3n) {
  border-right: none;
}

.category-card:hover {
  background: var(--surface);
}

/* Thumbnail area — fixed 3:2 aspect, standardised rendering via object-fit */

.card-thumb {
  width:           100%;
  height:          160px;              /* standardised rendered height */
  background:      var(--surface);
  position:        relative;
  overflow:        hidden;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background-size:     cover;
  background-position: center;
}

/* Placeholder letter shown when no thumbnail image is set */
.card-thumb-letter {
  font-family:    var(--font-display);
  font-size:      2.5rem;
  letter-spacing: 0.1em;
  color:          var(--text);
  opacity:        0.1;
}

.card-thumb::after {
  content:    '';
  position:   absolute;
  bottom:     0;
  left:       0;
  right:      0;
  height:     0.5px;
  background: var(--border-mid);
}

/* Card body */

.card-body {
  padding: 1rem 1.2rem 1.2rem;
}

.card-index {
  font-size:      10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-dim);
  font-weight:    300;
  margin-bottom:  0.3rem;
}

.card-name {
  font-family:    var(--font-display);
  font-size:      1.5rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  line-height:    1;
  margin-bottom:  0.4rem;
}

.card-desc {
  font-family:   var(--font-serif);
  font-style:    italic;
  font-weight:   300;
  font-size:     0.85rem;
  color:         var(--text-muted);
  line-height:   1.4;
  margin-bottom: 0.9rem;
}

.card-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}

.card-count {
  font-size:      10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

.card-arrow {
  width:           20px;
  height:          20px;
  border:          0.5px solid var(--border-mid);
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  transition:      border-color 0.2s ease;
}

.category-card:hover .card-arrow {
  border-color: var(--text-muted);
}

.card-arrow svg {
  width:  8px;
  height: 8px;
}

/* ── Footer ──────────────────────────────────────────────────── */

.site-footer {
  padding:         1.5rem 2.5rem;
  border-top:      0.5px solid var(--border);
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}

.footer-text {
  font-size:      11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--text-faint);
}

/* ── Loading / error states ──────────────────────────────────── */

.loading, .error {
  padding:   3rem 2.5rem;
  font-size: 0.85rem;
  color:     var(--text-dim);
}

.error {
  color: #5a2020;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 700px) {
  .page-title {
    font-size: 3rem;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-card:nth-child(3n) {
    border-right: 0.5px solid var(--border);
  }

  .category-card:nth-child(2n) {
    border-right: none;
  }

  .site-header {
    padding: 2rem 1.5rem 1.5rem;
  }
}

@media (max-width: 420px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    border-right: none;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CATEGORY / VOTING PAGE
   ═══════════════════════════════════════════════════════════════ */

/* ── Category page header ────────────────────────────────────── */

.category-header {
  padding:         1.5rem 2rem;
  border-bottom:   0.5px solid var(--border-mid);
  display:         flex;
  align-items:     flex-end;
  justify-content: space-between;
}

.back-link {
  font-size:      10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-dim);
  transition:     color 0.2s ease;
}

.back-link:hover { color: var(--text-muted); }

.category-page-title {
  font-family:    var(--font-display);
  font-size:      2rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  line-height:    1;
}

.progress-text {
  font-size:      10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color:          var(--text-faint);
}

/* ── Voting rows container ───────────────────────────────────── */

.voting-rows {
  display:        flex;
  flex-direction: column;
}

/* ── Individual row ──────────────────────────────────────────── */

.voting-row {
  display:     flex;
  align-items: stretch;
  border-bottom: 0.5px solid var(--border);
  min-height:  110px;
  transition:  background 0.4s ease, opacity 0.4s ease;
  position:    relative;
}

/* voted — greyed out, buttons hidden */
.voting-row.state-voted {
  background: #0d0d0d;
  opacity:    0.5;
}

/* current active row */
.voting-row.state-active {
  background: #0f0f0f;
}

/* future rows not yet revealed */
.voting-row.state-future {
  background: var(--bg);
}

/* ── Row index column ────────────────────────────────────────── */

.row-index {
  width:           44px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  border-right:    0.5px solid var(--border);
  flex-shrink:     0;
}

.row-num {
  font-family:    var(--font-display);
  font-size:      0.9rem;
  color:          var(--text-faint);
  letter-spacing: 0.08em;
}

.voting-row.state-active .row-num { color: var(--text-dim); }

/* ── Thumbnail column ────────────────────────────────────────── */

.row-thumb {
  width:        130px;
  flex-shrink:  0;
  position:     relative;
  overflow:     hidden;
  border-right: 0.5px solid var(--border);
}

.row-thumb img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
}

/* Placeholder shown for future rows */
.thumb-future {
  width:           100%;
  height:          100%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-direction:  column;
  gap:             4px;
}

.thumb-qmark {
  font-family:    var(--font-display);
  font-size:      2rem;
  color:          #1e1e1e;
  letter-spacing: 0.1em;
}

.thumb-future-label {
  font-size:      9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          #1e1e1e;
}

/* ── Row body — name, detail, JSON chips ─────────────────────── */

.row-body {
  flex:           1;
  display:        flex;
  flex-direction: column;
  justify-content: center;
  padding:        1rem 1.2rem;
  gap:            0.35rem;
}

.row-char-name {
  font-family:    var(--font-display);
  font-size:      1.3rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  line-height:    1;
}

.voting-row.state-future .row-char-name { color: #1e1e1e; }

.row-char-detail {
  font-family: var(--font-serif);
  font-style:  italic;
  font-weight: 300;
  font-size:   0.8rem;
  color:       var(--text-muted);
  line-height: 1.3;
}

.voting-row.state-future .row-char-detail { color: #1a1a1a; }

/* JSON detail chips */
.row-chips {
  display:   flex;
  gap:       1rem;
  flex-wrap: wrap;
}

.detail-chip {
  font-size:      9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

.voting-row.state-future .detail-chip { color: #181818; }

/* Vote result badge — shown after voting */
.vote-result {
  display:     flex;
  align-items: center;
  gap:         6px;
  margin-top:  2px;
}

.vote-badge {
  font-size:      9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding:        3px 8px;
  border-radius:  2px;
}

.vote-badge.yes {
  background: #0e1f12;
  color:      #2a5c34;
  border:     0.5px solid #1a3d22;
}

.vote-badge.no {
  background: #1f0e0e;
  color:      #5c2a2a;
  border:     0.5px solid #3d1a1a;
}

/* ── Vote buttons column ─────────────────────────────────────── */

.row-actions {
  display:        flex;
  flex-direction: column;
  gap:            8px;
  padding:        1rem;
  justify-content: center;
  flex-shrink:    0;
  border-left:    0.5px solid var(--border);
  transition:     opacity 0.3s ease;
}

.voting-row.state-voted .row-actions,
.voting-row.state-future .row-actions {
  opacity:        0;
  pointer-events: none;
}

.vote-btn {
  width:          72px;
  padding:        0.5rem 0;
  border-radius:  2px;
  font-family:    var(--font-body);
  font-size:      10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor:         pointer;
  background:     transparent;
  transition:     background 0.15s ease, border-color 0.15s ease;
  text-align:     center;
}

.vote-btn-yes {
  border: 0.5px solid #1a3d22;
  color:  #2a5c34;
}

.vote-btn-yes:hover {
  background:   #0e1f12;
  border-color: #2a5c34;
}

.vote-btn-no {
  border: 0.5px solid #3d1a1a;
  color:  #5c2a2a;
}

.vote-btn-no:hover {
  background:   #1f0e0e;
  border-color: #5c2a2a;
}

/* ── Completion block ────────────────────────────────────────── */

.vote-complete {
  padding:     2rem;
  border-top:  0.5px solid var(--border);
  display:     none;
}

.vote-complete.visible { display: block; }

.vote-complete-title {
  font-family:    var(--font-display);
  font-size:      1.6rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  margin-bottom:  0.4rem;
}

.vote-complete-sub {
  font-family: var(--font-serif);
  font-style:  italic;
  font-size:   0.9rem;
  color:       var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .row-thumb {
    width: 90px;
  }

  .vote-btn {
    width: 56px;
    font-size: 9px;
  }

  .category-header {
    padding: 1.2rem 1.2rem;
  }
}

@media (max-width: 420px) {
  .category-page-title {
    font-size: 1.5rem;
  }

  .row-thumb {
    width: 70px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════ */

.tab-nav {
  display:       flex;
  border-bottom: 0.5px solid var(--border-mid);
  padding:       0 2rem;
  gap:           2rem;
}

.tab-btn {
  background:     transparent;
  border:         none;
  padding:        1rem 0;
  font-family:    var(--font-body);
  font-size:      11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-dim);
  cursor:         pointer;
  position:       relative;
  transition:     color 0.2s ease;
}

.tab-btn:hover { color: var(--text-muted); }

.tab-btn.active { color: var(--text); }

.tab-btn.active::after {
  content:    '';
  position:   absolute;
  bottom:     -0.5px;
  left:       0;
  right:      0;
  height:     1px;
  background: var(--text);
}

.tab-panel { display: none; }

.tab-panel.active { display: block; }

.tab-placeholder {
  padding:    4rem 2rem;
  text-align: center;
}

.placeholder-title {
  font-family:    var(--font-display);
  font-size:      2rem;
  letter-spacing: 0.04em;
  color:          var(--text-muted);
  margin-bottom:  0.5rem;
}

.placeholder-sub {
  font-family: var(--font-serif);
  font-style:  italic;
  font-size:   0.95rem;
  color:       var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   VOTE AGAIN BUTTON
   ═══════════════════════════════════════════════════════════════ */

.vote-again-btn {
  margin-top:     1.25rem;
  background:     transparent;
  border:         0.5px solid var(--border-mid);
  padding:        0.8rem 1.5rem;
  font-family:    var(--font-body);
  font-size:      11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text);
  cursor:         pointer;
  transition:     background 0.2s ease, border-color 0.2s ease;
  border-radius:  2px;
}

.vote-again-btn:hover {
  background:   var(--surface);
  border-color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   BYPASS INDICATOR — forced vote badge variant
   ═══════════════════════════════════════════════════════════════ */

.vote-badge.forced {
  background: #1a1610;
  color:      #5c4a2a;
  border:     0.5px solid #3d3020;
}

/* ═══════════════════════════════════════════════════════════════
   STATISTICS TAB
   ═══════════════════════════════════════════════════════════════ */

.stats-container {
  padding: 1.5rem 2rem 2rem;
}

.stats-row {
  display:       flex;
  align-items:   center;
  gap:           1rem;
  padding:       1rem 0;
  border-bottom: 0.5px solid var(--border);
}

.stats-rank {
  font-family:    var(--font-display);
  font-size:      1.2rem;
  color:          var(--text-dim);
  width:          28px;
  letter-spacing: 0.08em;
}

.stats-thumb {
  width:         56px;
  height:        56px;
  flex-shrink:   0;
  background:    var(--surface);
  border-radius: 2px;
  overflow:      hidden;
}

.stats-thumb img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.stats-body {
  flex:           1;
  display:        flex;
  flex-direction: column;
  gap:            6px;
  min-width:      0;
}

.stats-name {
  font-family:    var(--font-display);
  font-size:      1.1rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  line-height:    1;
}

.stats-bar-track {
  width:         100%;
  height:        3px;
  background:    var(--border);
  border-radius: 2px;
  overflow:      hidden;
}

.stats-bar-fill {
  height:     100%;
  background: #2a5c34;
  transition: width 0.8s cubic-bezier(.4, 0, .2, 1);
}

.stats-numbers {
  display:         flex;
  gap:             1rem;
  font-size:       10px;
  letter-spacing:  0.1em;
  text-transform:  uppercase;
  color:           var(--text-dim);
}

.stats-yes { color: #3a7c4a; }
.stats-no  { color: #7a3c3c; }


/* ═══════════════════════════════════════════════════════════════
   TAB INTRO BLOCKS
   ═══════════════════════════════════════════════════════════════ */

.tab-intro {
  padding:       1.5rem 2rem 1.25rem;
  border-bottom: 0.5px solid var(--border);
  max-width:     640px;
}

.intro-eyebrow {
  font-size:      10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--text-dim);
  margin-bottom:  0.5rem;
}

.intro-text {
  font-family: var(--font-serif);
  font-style:  italic;
  font-weight: 300;
  font-size:   0.95rem;
  line-height: 1.6;
  color:       var(--text-muted);
}

.intro-hl {
  color:      var(--text);
  font-style: normal;
  font-family: var(--font-body);
  font-size:   0.85rem;
  letter-spacing: 0.04em;
}

.tag-inline {
  display:        inline-block;
  padding:        2px 7px;
  border-radius:  2px;
  font-family:    var(--font-body);
  font-style:     normal;
  font-size:      10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin:         0 2px;
}

.tag-inline.qw { background: #1a1f2a; color: #6b7f9e; border: 0.5px solid #2a3448; }
.tag-inline.as { background: #2a1a1f; color: #9e6b7f; border: 0.5px solid #482a34; }
.tag-inline.zx { background: #1f2a1a; color: #7f9e6b; border: 0.5px solid #34482a; }

/* ═══════════════════════════════════════════════════════════════
   TAGGING TAB
   ═══════════════════════════════════════════════════════════════ */

.tag-rounds {
  display:        flex;
  flex-direction: column;
}

/* Each round is a collapsed / active / completed block */
.tag-round {
  border-bottom: 0.5px solid var(--border);
  transition:    background 0.3s ease, opacity 0.3s ease;
}

.tag-round.state-completed { opacity: 0.5; background: #0d0d0d; }
.tag-round.state-active    { background: #0f0f0f; }
.tag-round.state-future    { background: var(--bg); }

.tag-round-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         1rem 2rem;
  border-bottom:   0.5px solid var(--border);
}

.tag-round-label {
  display:     flex;
  align-items: center;
  gap:         0.8rem;
}

.tag-round-num {
  font-family:    var(--font-display);
  font-size:      1rem;
  letter-spacing: 0.08em;
  color:          var(--text-dim);
}

.tag-round.state-active .tag-round-num { color: var(--text); }

.tag-round-title {
  font-size:      11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-muted);
}

.tag-round.state-future .tag-round-title { color: #1e1e1e; }

.tag-round-status {
  font-size:      10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

/* The 3-card grid of characters */
.tag-cards {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
}

.tag-card {
  padding:        1.2rem 1rem;
  border-right:   0.5px solid var(--border);
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  gap:            0.6rem;
  min-height:     260px;
}

.tag-card:last-child { border-right: none; }

.tag-round.state-future .tag-card { opacity: 0.3; }

.tag-card-thumb {
  width:        100%;
  aspect-ratio: 1 / 1;
  max-width:    140px;
  background:   var(--surface);
  overflow:     hidden;
  border-radius: 2px;
  display:      flex;
  align-items:  center;
  justify-content: center;
}

.tag-card-thumb img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.tag-card-thumb-placeholder {
  font-family:    var(--font-display);
  font-size:      1.4rem;
  color:          #222;
  letter-spacing: 0.1em;
}

.tag-card-name {
  font-family:    var(--font-display);
  font-size:      1rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  line-height:    1;
}

.tag-round.state-future .tag-card-name { color: #1e1e1e; }

.tag-card-detail {
  font-family: var(--font-serif);
  font-style:  italic;
  font-weight: 300;
  font-size:   0.75rem;
  color:       var(--text-muted);
  line-height: 1.3;
}

.tag-round.state-future .tag-card-detail { color: #1a1a1a; }

/* Tag picker row — three buttons per card */
.tag-picker {
  display:  flex;
  gap:      4px;
  margin-top: auto;
  padding-top: 0.4rem;
}

.tag-btn {
  flex:           1;
  padding:        6px 0;
  background:     transparent;
  border:         0.5px solid var(--border-mid);
  border-radius:  2px;
  font-family:    var(--font-body);
  font-size:      10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color:          var(--text-muted);
  cursor:         pointer;
  transition:     background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tag-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  color:        var(--text);
}

.tag-btn.selected.qw { background: #1a1f2a; border-color: #4a5d7e; color: #8ba0be; }
.tag-btn.selected.as { background: #2a1a1f; border-color: #7e4a5d; color: #be8ba0; }
.tag-btn.selected.zx { background: #1f2a1a; border-color: #5d7e4a; color: #a0be8b; }

/* A disabled tag means another card already used it */
.tag-btn.disabled {
  opacity:        0.2;
  cursor:         not-allowed;
}

/* Round confirm row */
.tag-round-confirm {
  padding:     1rem 2rem;
  display:     flex;
  align-items: center;
  justify-content: space-between;
  gap:         1rem;
}

.tag-round-hint {
  font-size:      10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

.tag-confirm-btn {
  background:     transparent;
  border:         0.5px solid var(--border-mid);
  padding:        0.6rem 1.2rem;
  font-family:    var(--font-body);
  font-size:      11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text);
  cursor:         pointer;
  transition:     background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  border-radius:  2px;
}

.tag-confirm-btn:hover:not(:disabled) {
  background:   var(--surface);
  border-color: var(--text-muted);
}

.tag-confirm-btn:disabled {
  opacity: 0.25;
  cursor:  not-allowed;
}

.tag-round.state-completed .tag-round-confirm,
.tag-round.state-future    .tag-round-confirm { display: none; }

/* Responsive — stack cards on narrow screens */
@media (max-width: 600px) {
  .tag-cards { grid-template-columns: 1fr; }
  .tag-card  {
    border-right:  none;
    border-bottom: 0.5px solid var(--border);
    min-height:    auto;
  }
  .tag-card:last-child { border-bottom: none; }
}


/* ═══════════════════════════════════════════════════════════════
   STATISTICS TAB — enhanced
   ═══════════════════════════════════════════════════════════════ */

.stats-section {
  padding:       1.5rem 2rem 2rem;
  border-bottom: 0.5px solid var(--border);
}

.stats-section:last-child { border-bottom: none; }

.stats-section-label {
  font-size:      10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--text-dim);
  margin-bottom:  1rem;
}

/* ── Hero card — top yes-voted character ──────────────────── */

.stats-hero {
  display:       grid;
  grid-template-columns: 200px 1fr;
  gap:           1.5rem;
  align-items:   stretch;
}

.stats-hero-img {
  width:         100%;
  aspect-ratio:  1 / 1;
  background:    var(--surface);
  border-radius: 2px;
  overflow:      hidden;
  position:      relative;
}

.stats-hero-img img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.stats-hero-badge {
  position:       absolute;
  top:            8px;
  left:           8px;
  background:     rgba(10, 10, 10, 0.9);
  padding:        4px 8px;
  font-size:      9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--text);
  border:         0.5px solid #2a5c34;
}

.stats-hero-body {
  display:        flex;
  flex-direction: column;
  justify-content: center;
  gap:            0.5rem;
}

.stats-hero-label {
  font-size:      10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

.stats-hero-name {
  font-family:    var(--font-display);
  font-size:      3rem;
  letter-spacing: 0.02em;
  line-height:    1;
  color:          var(--text);
}

.stats-hero-detail {
  font-family: var(--font-serif);
  font-style:  italic;
  font-size:   1rem;
  color:       var(--text-muted);
}

.stats-hero-numbers {
  display:     flex;
  gap:         2rem;
  margin-top:  0.75rem;
}

.stats-hero-num {
  display:        flex;
  flex-direction: column;
  gap:            4px;
}

.stats-hero-num-big {
  font-family: var(--font-display);
  font-size:   1.6rem;
  color:       var(--text);
  line-height: 1;
}

.stats-hero-num-big.yes { color: #3a7c4a; }
.stats-hero-num-big.no  { color: #7a3c3c; }

.stats-hero-num-label {
  font-size:      9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

/* ── Tag champions row — 3 cards side by side ────────────── */

.tag-champions {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   1rem;
}

.champion-card {
  background:    var(--surface);
  border:        0.5px solid var(--border);
  border-radius: 2px;
  padding:       1rem;
  display:       flex;
  flex-direction: column;
  gap:           0.7rem;
}

.champion-tag-label {
  display:        inline-block;
  align-self:     flex-start;
  padding:        3px 9px;
  border-radius:  2px;
  font-family:    var(--font-body);
  font-size:      10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.champion-tag-label.qw { background: #1a1f2a; color: #8ba0be; border: 0.5px solid #2a3448; }
.champion-tag-label.as { background: #2a1a1f; color: #be8ba0; border: 0.5px solid #482a34; }
.champion-tag-label.zx { background: #1f2a1a; color: #a0be8b; border: 0.5px solid #34482a; }

.champion-body {
  display:     flex;
  align-items: center;
  gap:         0.8rem;
}

.champion-thumb {
  width:         60px;
  height:        60px;
  flex-shrink:   0;
  background:    var(--bg);
  border-radius: 2px;
  overflow:      hidden;
}

.champion-thumb img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.champion-info {
  display:        flex;
  flex-direction: column;
  gap:            4px;
  min-width:      0;
}

.champion-name {
  font-family:    var(--font-display);
  font-size:      1rem;
  letter-spacing: 0.04em;
  color:          var(--text);
  line-height:    1;
}

.champion-count {
  font-size:      10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--text-dim);
}

/* ── Data table ─────────────────────────────────────────── */

.stats-table-controls {
  display:         flex;
  gap:             1rem;
  margin-bottom:   1rem;
  align-items:     center;
  flex-wrap:       wrap;
}

.stats-search {
  background:     var(--bg);
  border:         0.5px solid var(--border-mid);
  color:          var(--text);
  padding:        0.55rem 0.8rem;
  font-family:    var(--font-body);
  font-size:      12px;
  letter-spacing: 0.04em;
  border-radius:  2px;
  min-width:      220px;
  outline:        none;
  transition:     border-color 0.2s ease;
}

.stats-search:focus { border-color: var(--text-muted); }

.stats-search::placeholder { color: var(--text-faint); }

.stats-filter-group {
  display:     flex;
  gap:         4px;
}

.stats-filter-btn {
  background:     transparent;
  border:         0.5px solid var(--border-mid);
  color:          var(--text-dim);
  padding:        0.5rem 0.8rem;
  font-family:    var(--font-body);
  font-size:      10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor:         pointer;
  border-radius:  2px;
  transition:     color 0.15s ease, border-color 0.15s ease;
}

.stats-filter-btn:hover { color: var(--text); }

.stats-filter-btn.active {
  color:        var(--text);
  border-color: var(--text-muted);
  background:   var(--surface);
}

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

.stats-table thead {
  border-bottom: 0.5px solid var(--border-mid);
}

.stats-table th {
  text-align:     left;
  padding:        0.75rem 0.5rem;
  font-family:    var(--font-body);
  font-weight:    400;
  font-size:      10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-dim);
  cursor:         pointer;
  user-select:    none;
  transition:     color 0.15s ease;
}

.stats-table th:hover { color: var(--text); }

.stats-table th.sorted { color: var(--text); }

.stats-table th.sorted::after {
  content: ' ↓';
  color:   var(--text-muted);
}

.stats-table th.sorted.asc::after { content: ' ↑'; }

.stats-table tbody tr {
  border-bottom: 0.5px solid var(--border);
  transition:    background 0.15s ease;
}

.stats-table tbody tr:hover { background: var(--surface); }

.stats-table td {
  padding:     0.75rem 0.5rem;
  color:       var(--text);
  vertical-align: middle;
}

.stats-table td.col-name {
  font-family:    var(--font-display);
  font-size:      0.95rem;
  letter-spacing: 0.04em;
}

.stats-table td.col-num {
  font-variant-numeric: tabular-nums;
  text-align:           right;
  color:                var(--text-muted);
}

.stats-table td.yes-cell  { color: #3a7c4a; }
.stats-table td.no-cell   { color: #7a3c3c; }

.stats-table-empty {
  padding:    2rem;
  text-align: center;
  color:      var(--text-dim);
  font-style: italic;
  font-family: var(--font-serif);
}

/* Responsive */
@media (max-width: 700px) {
  .stats-hero {
    grid-template-columns: 1fr;
  }

  .tag-champions {
    grid-template-columns: 1fr;
  }

  .stats-hero-name { font-size: 2.2rem; }

  .stats-table th,
  .stats-table td {
    padding: 0.6rem 0.3rem;
    font-size: 11px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   LANDING — META LINK (view global stats)
   ═══════════════════════════════════════════════════════════════ */

.meta-link {
  text-decoration: none;
  transition:      color 0.15s ease;
  border-left:     0.5px solid var(--border-mid);
  padding-left:    1.5rem;
}

.meta-link .meta-stat-num { color: var(--text); }

.meta-link:hover .meta-stat-num,
.meta-link:hover .meta-stat-label {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   LANDING — ABOUT SECTION
   ═══════════════════════════════════════════════════════════════ */

.about-section {
  padding:       3rem 2.5rem 4rem;
  border-top:    0.5px solid var(--border-mid);
  max-width:     720px;
}

.section-label {
  font-size:      10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--text-dim);
  margin-bottom:  1rem;
}

.about-heading {
  font-family:    var(--font-display);
  font-size:      2.2rem;
  line-height:    1.1;
  letter-spacing: 0.02em;
  color:          var(--text);
  margin-bottom:  1.5rem;
}

.about-body {
  display:        flex;
  flex-direction: column;
  gap:            1rem;
}

.about-body p {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size:   1rem;
  line-height: 1.7;
  color:       var(--text-muted);
}

.about-hl {
  color:       var(--text);
  font-family: var(--font-body);
  font-size:   0.85rem;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL STATS PAGE — shared table link styles
   ═══════════════════════════════════════════════════════════════ */

.table-link {
  color:           var(--text);
  text-decoration: none;
  border-bottom:   0.5px solid var(--border-mid);
  transition:      border-color 0.15s ease, color 0.15s ease;
}

.table-link:hover {
  color:         var(--text);
  border-color:  var(--text);
}

/* Back link for stats page header */
.site-header .back-link {
  display:       inline-block;
  margin-bottom: 1.2rem;
}

/* Tighter spacing for the main stats sections on dedicated page */
.site-header + main .stats-section:first-child {
  border-top: 0.5px solid var(--border-mid);
}

/* Responsive */
@media (max-width: 700px) {
  .about-section { padding: 2rem 1.5rem 3rem; }
  .about-heading { font-size: 1.6rem; }

  .meta-link {
    border-left:  none;
    border-top:   0.5px solid var(--border-mid);
    padding-left: 0;
    padding-top:  0.75rem;
  }
}


/* ═══════════════════════════════════════════════════════════════
   SOURCE LINK ICON
   ═══════════════════════════════════════════════════════════════ */

.source-link {
  display:        inline-flex;
  align-items:    center;
  justify-content: center;
  width:          1em;
  height:         1em;
  margin-right:   0.45em;
  vertical-align: middle;
  border-radius:  2px;
  opacity:        0.5;
  transition:     opacity 0.15s ease, background 0.15s ease;
}

.source-link:hover {
  opacity:    1;
  background: var(--surface);
}

/* Make the SVG inherit current text colour via filter, sized to the em-box */
.source-link img {
  width:  0.75em;
  height: 0.75em;
  display: block;
  /* Tint the icon to match the text colour without editing the SVG */
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.source-link:hover img { opacity: 1; }

/* In data tables — slightly smaller and tighter spacing */
.stats-table .source-link {
  margin-right: 0.35em;
  width:        0.9em;
  height:       0.9em;
}

