/* ============================================================
   Cherry Jam Stat Cast — the jam-jar label look.
   Straight off the podcast logo: warm white paper, tomato-red
   jar lids, thick black outlines, flat offset shadows — every
   panel a sticker, every card a label off the jar.
   Tier palette validated (dataviz six checks) against the white
   card face: #96202F · #C05617 · #6FAC58 · #2F5E94 · #0E9488.
   Heat numbers wear ink, never the tier colour — chips, bands
   and medallions carry the colour instead.
   ============================================================ */

:root {
  --paper: #FAF3E6;          /* warm white page */
  --paper-deep: #F0E5D0;
  --card-face: #FFFFFF;      /* label stock, like the jar */
  --card-deep: #F6EFE2;
  --ink: #2B2B2B;            /* the logo's outline black */
  --ink-soft: #5C5248;
  --ink-faint: #8D8276;
  --jam: #DD4736;            /* the jar red */
  --jam-deep: #B32E1F;
  --leaf: #45803C;           /* the cherry-stalk green */
  --rule: #E2D7C2;
  --up: #45803C;
  --down: #B32E1F;
  --font-display: 'Ultra', 'Georgia', serif;
  --font-cond: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Lora', 'Georgia', serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  /* the jar lid, running across the very top of the page */
  border-top: 14px solid var(--jam);
  background-image: repeating-linear-gradient(90deg,
    transparent 0 26px, rgba(255, 255, 255, 0.55) 26px 34px);
  background-size: 100% 14px;
  background-repeat: no-repeat;
  background-position: 0 -14px;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: repeating-linear-gradient(90deg,
    var(--jam) 0 26px, #E8705F 26px 34px);
  z-index: 5;
}

/* scattered cherries-in-the-jam dots */
.jamdots {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle 5px at 12% 22%, rgba(221, 71, 54, 0.09) 0 5px, transparent 5px),
    radial-gradient(circle 4px at 78% 14%, rgba(221, 71, 54, 0.07) 0 4px, transparent 4px),
    radial-gradient(circle 6px at 90% 62%, rgba(221, 71, 54, 0.08) 0 6px, transparent 6px),
    radial-gradient(circle 4px at 32% 78%, rgba(221, 71, 54, 0.07) 0 4px, transparent 4px),
    radial-gradient(circle 5px at 58% 42%, rgba(221, 71, 54, 0.05) 0 5px, transparent 5px),
    radial-gradient(circle 3px at 8% 58%, rgba(69, 128, 60, 0.07) 0 3px, transparent 3px),
    radial-gradient(circle 3px at 68% 88%, rgba(69, 128, 60, 0.07) 0 3px, transparent 3px);
}

.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.30 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- masthead: the big label ---------------------------------------- */

.masthead {
  position: relative;
  padding: 40px 20px 0;
}

.masthead-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
  background: var(--card-face);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 7px 7px 0 var(--jam), 7px 7px 0 2.5px var(--ink);
  padding: 22px 28px;
  position: relative;
  overflow: hidden;
}
.masthead-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg,
    var(--jam) 0 22px, var(--card-face) 22px 30px);
  border-bottom: 2.5px solid var(--ink);
}

/* The logo and the "listen" link travel together as one column, so the link
   sits under the jar rather than becoming a third flex item beside it. */
.masthead-brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
  width: 128px;
}
.masthead-logo {
  display: block;
}
.pod-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
  background: var(--card-face);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--paper-deep);
  transition: background 0.12s ease, transform 0.12s ease;
}
.pod-link:hover { background: var(--paper-deep); transform: translateY(-1px); }
.pod-link:focus-visible { outline: 3px solid var(--jam); outline-offset: 2px; }
.pod-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: #1DB954;
}
.masthead-logo img {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: cover;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 4px 4px 0 var(--paper-deep);
  transition: transform 0.15s ease;
}
.masthead-logo:hover img { transform: rotate(-2deg) scale(1.03); }

.masthead-word { flex: 1; min-width: 0; text-align: left; margin-top: 8px; }

.ticket-stub {
  display: inline-flex;
  gap: 14px;
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #FFFFFF;
  background: var(--ink);
  padding: 4px 14px;
  border-radius: 3px;
  margin-bottom: 10px;
}
.stub-season { color: #F1B4AA; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.wm-cherry {
  font-size: clamp(30px, 5.4vw, 54px);
  color: var(--jam);
  text-shadow: 2.5px 2.5px 0 var(--ink);
  -webkit-text-stroke: 1px var(--ink);
}
.wm-stat {
  font-size: clamp(30px, 5.4vw, 54px);
  color: var(--ink);
}

.tagline {
  margin-top: 10px;
  font-family: var(--font-cond);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  border-top: 1.5px dashed var(--rule);
  padding-top: 9px;
}

/* --- nav ---------------------------------------------------------------- */

.level-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px auto 0;
  max-width: 900px;
}

.level-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 122px;
  padding: 8px 18px 7px;
  text-decoration: none;
  background: var(--card-face);
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.level-tab:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.level-tab.active {
  background: var(--jam);
  color: #FFFFFF;
  box-shadow: 3px 3px 0 var(--ink);
}
.tab-level {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
}
.tab-team {
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.75;
  text-transform: uppercase;
}

/* --- main scaffold --------------------------------------------------------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 18px 66px;
}

.level-head { text-align: center; margin: 8px 0 24px; }
.level-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 4.5vw, 40px);
  color: var(--ink);
}
.level-sub {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 7px;
}

/* --- team hero --------------------------------------------------------------- */

.team-hero {
  display: flex;
  gap: 26px;
  align-items: center;
  background: var(--card-face);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--jam), 6px 6px 0 2.5px var(--ink);
  padding: 24px 26px 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
/* the hero always wears the jar red — only the tier chip inside
   changes colour with the team's form */
.team-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 9px;
  background: repeating-linear-gradient(90deg,
    var(--jam) 0 20px, var(--card-face) 20px 28px);
  border-bottom: 2.5px solid var(--ink);
}
.team-hero-left { min-width: 190px; }
.team-hero-title {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
}
.team-heat-num {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1.05;
  color: var(--ink);
}
.team-heat-num span {
  font-family: var(--font-cond);
  font-size: 18px;
  color: var(--ink-faint);
  margin-left: 4px;
}
.team-hero-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.team-hero-chart { flex: 1; min-width: 280px; }
.team-chart { width: 100%; height: auto; display: block; }

/* --- summary tiles -------------------------------------------------------------- */

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.tile {
  background: var(--card-face);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  border-top-width: 8px;
  padding: 10px 14px 11px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--paper-deep);
}
.tile-hot { border-top-color: var(--jam); }
.tile-cold { border-top-color: #2F5E94; }
.tile-rise { border-top-color: var(--leaf); }
.tile-fall { border-top-color: var(--jam-deep); }
.tile-label {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}
.tile-value {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.2;
  color: var(--ink);
}
.tile-name {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- filters ------------------------------------------------------------------------ */

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.seg { display: flex; flex-wrap: wrap; }
.seg-btn {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 8px 16px;
  background: var(--card-face);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-right-width: 0;
  cursor: pointer;
  transition: background 0.1s ease;
}
.seg-btn:first-child { border-radius: 8px 0 0 8px; }
.seg-btn:last-child { border-right-width: 2.5px; border-radius: 0 8px 8px 0; }
.seg-btn:hover { background: var(--paper-deep); }
.seg-btn.on { background: var(--ink); color: #FFFFFF; }
.seg-wrap .seg-btn { border-right-width: 2.5px; border-radius: 8px; margin: 0 5px 5px 0; }

/* --- tier sections ---------------------------------------------------------------------- */

.tier-section { margin-bottom: 38px; }
.tier-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tier-flames { font-size: 15px; letter-spacing: -2px; }
.tier-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.tier-count {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 12px;
  background: var(--ink);
  color: #FFFFFF;
  padding: 1px 9px;
  border-radius: 10px;
}
.tier-rule { flex: 1; border-top: 2px solid var(--ink); opacity: 0.16; }

/* --- cards --------------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 22px;
}

.bcard {
  perspective: 1100px;
  cursor: pointer;
  min-height: 430px;
  outline: none;
}
.bcard:focus-visible .bcard-frame { outline: 3px solid var(--jam); outline-offset: 3px; }

.bcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 430px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.bcard.flipped .bcard-inner { transform: rotateY(180deg); }

.bcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.bcard-back { transform: rotateY(180deg); }

.bcard-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-face);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 var(--paper-deep), 5px 5px 0 2.5px rgba(43, 43, 43, 0.55);
  padding: 10px 13px 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.bcard:hover .bcard-frame {
  transform: translateY(-5px) rotate(-0.4deg);
  box-shadow: 7px 8px 0 var(--tier, var(--jam)), 7px 8px 0 2.5px var(--ink);
}

.bcard-topbar {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0 1px 8px;
}
.bcard-rank { color: var(--ink); }

/* --- the photo window --- */
.bcard-photo {
  position: relative;
  border-radius: 7px;
  overflow: hidden;
  aspect-ratio: 5 / 4;
  border: 2px solid var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, #F3E3CE 0%, #E4CFB2 70%),
    var(--paper-deep);
}
.bcard-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the CMS thumbnails are 2:3 portraits with the head near the top —
     anchor the window a touch below the top edge so the whole face
     lands in frame instead of just the forehead */
  object-position: center 22%;
  filter: saturate(1.04) contrast(1.03);
}
/* jar-lid band along the photo's bottom edge, in the tier colour */
.photo-band {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg,
    var(--tier, var(--jam)) 0 20px, var(--card-face) 20px 28px);
  border-top: 2px solid var(--ink);
}
/* shirt number, stamped in the corner */
.photo-shirt {
  position: absolute;
  top: 7px; left: 8px;
  min-width: 30px;
  text-align: center;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 15px;
  color: #FFFFFF;
  background: var(--ink);
  border-radius: 5px;
  padding: 2px 6px;
  letter-spacing: 0.06em;
}
/* NEW-signing flash, opposite the shirt number */
.photo-new {
  position: absolute;
  top: 7px; right: 8px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  background: var(--leaf);
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  padding: 3px 8px 2px;
}
/* the heat medallion, overlapping the band like the label roundel */
.photo-heat {
  position: absolute;
  right: 9px; bottom: 6px;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--tier-text, #FFFFFF);
  background: var(--tier, var(--jam));
  border: 2.5px solid var(--ink);
  box-shadow: 0 0 0 3px var(--card-face);
}

.bcard-nameplate {
  text-align: center;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--ink);
  color: #FFFFFF;
  border-radius: 6px;
  padding: 5px 8px 4px;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bcard-poolrank {
  text-align: center;
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--jam-deep);
  margin: 6px 0 8px;
}

.bcard-heatrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.bcard-heat .heat-num {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
}
.bcard-heat .heat-of {
  font-family: var(--font-cond);
  font-size: 13px;
  color: var(--ink-faint);
  margin-left: 3px;
}
.heat-szn {
  display: block;
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-top: 3px;
}
.bcard-tier { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

.tier-chip {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--tier-text, #FFFFFF);
  background: var(--tier, var(--jam));
  border: 1.5px solid var(--ink);
  padding: 2px 10px;
  border-radius: 5px;
}
.team-tier-chip { font-size: 13px; padding: 4px 12px; }

.delta { font-family: var(--font-cond); font-weight: 600; font-size: 12px; color: var(--ink-faint); }
.delta small { font-size: 9px; letter-spacing: 0.08em; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }

.bcard-spark { margin: 2px 0 8px; }
.spark { width: 100%; height: 34px; display: block; }
.spark-mid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 3; }

.bcard-statline {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border-top: 1.5px dashed var(--rule);
  padding-top: 5px;
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bcard-statline + .bcard-statline { margin-top: 4px; }

/* card back */
.bcard-chart { min-height: 130px; margin: 2px 0 8px; }
.season-chart { width: 100%; height: auto; display: block; }
.chart-empty {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-align: center;
  padding: 44px 0;
}

.adv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
  margin-bottom: 8px;
}
.adv-cell {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-cond);
  font-size: 11px;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 2px;
}
.adv-cell span { color: var(--ink-faint); letter-spacing: 0.05em; font-size: 10px; }
.adv-cell strong { color: var(--ink); }
.heat-grid {
  background: var(--card-deep);
  padding: 6px 8px;
  border-radius: 5px;
  border-left: 4px solid var(--tier, var(--jam));
}

.slash-row {
  font-family: var(--font-cond);
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--ink);
}
.slash-row span {
  color: var(--jam-deep);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-right: 8px;
  font-size: 10px;
}
.back-recent {
  font-family: var(--font-cond);
  font-size: 11px;
  color: var(--ink-soft);
  border-top: 1.5px dashed var(--rule);
  padding-top: 5px;
}
.bcard-flip-hint {
  font-family: var(--font-cond);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  text-align: center;
  margin-top: auto;
  padding-top: 6px;
}

/* --- tables ------------------------------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  background: var(--card-face);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--paper-deep);
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-cond);
  font-size: 13px;
  min-width: 760px;
}
.rank-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #FFFFFF;
  background: var(--ink);
  padding: 8px 10px;
  white-space: nowrap;
}
/* A sortable header hands its padding to the button so the whole cell is the
   target, not just the few pixels under the label. */
.rank-table.sortable th { padding: 0; }
.th-sort {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.th-sort:hover { background: rgba(255, 255, 255, 0.15); }
.th-sort:focus-visible { outline: 2px solid var(--jam); outline-offset: -2px; }
.sort-arrow {
  font-size: 8px;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.sort-arrow::after { content: "▼"; }
.th-sort:hover .sort-arrow { opacity: 0.5; }
th[aria-sort="ascending"] .sort-arrow,
th[aria-sort="descending"] .sort-arrow { opacity: 1; }
th[aria-sort="ascending"] .sort-arrow::after { content: "▲"; }
.rank-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  color: var(--ink);
}
.rank-table tr:nth-child(even) td { background: rgba(226, 215, 194, 0.22); }
.td-name { font-weight: 600; }
.td-heat { font-weight: 700; }
.td-form { font-size: 12px; color: var(--ink-soft); }
.up { color: var(--up); }
.down { color: var(--down); }
.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  border: 1px solid var(--ink);
  vertical-align: baseline;
}
.row-glaws td { background: rgba(221, 71, 54, 0.1) !important; }
.glaws-mark { color: var(--jam); font-size: 10px; }
.league-more {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 10px;
}
.league-more-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 14px;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: left;
  color: var(--ink);
  background: var(--card-face);
  border: 2.5px dashed var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.league-more-btn:hover { background: var(--paper-deep); }
.league-more-btn:focus-visible { outline: 3px solid var(--jam); outline-offset: 2px; }

/* --- benched / errors / loading ------------------------------------------------------------------- */

.benched {
  margin-top: 8px;
  border-top: 1.5px dashed var(--rule);
  padding-top: 16px;
}
.benched-title {
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.benched-list { font-family: var(--font-cond); font-size: 13px; color: var(--ink-soft); line-height: 1.9; }
.departed-meta { opacity: 0.65; font-size: 12px; }

.loading { text-align: center; padding: 100px 0; }
.loading-flame {
  font-size: 44px;
  animation: flicker 1.1s infinite alternate ease-in-out;
}
@keyframes flicker {
  from { transform: scale(1) rotate(-3deg); opacity: 0.85; }
  to { transform: scale(1.15) rotate(3deg); opacity: 1; }
}
.loading-team {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--jam);
  margin-top: 14px;
}
.loading-progress {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-top: 8px;
}

.error-box {
  text-align: center;
  padding: 80px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.error-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--jam);
  margin-bottom: 10px;
}
.btn-retry {
  margin-top: 18px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  padding: 10px 28px;
  background: var(--jam);
  color: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.btn-retry:hover { transform: translateY(-1px); }

/* --- charts ------------------------------------------------------------------------------------------ */

.grid { stroke: var(--rule); stroke-width: 1; }
.grid-mid { stroke: var(--ink-faint); stroke-dasharray: 4 3; }
.axis-lab {
  font-family: var(--font-cond);
  font-size: 9px;
  fill: var(--ink-faint);
  letter-spacing: 0.06em;
}
.xhair { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; }

.chart-tooltip {
  position: fixed;
  z-index: 50;
  background: var(--ink);
  color: #FFFFFF;
  font-family: var(--font-cond);
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 12px;
  border-radius: 6px;
  pointer-events: none;
  max-width: 300px;
  box-shadow: 3px 3px 0 rgba(43, 43, 43, 0.25);
}
.chart-tooltip strong { color: #F1B4AA; }

/* --- FAQ ------------------------------------------------------------------------------------------------ */

.faq { max-width: 720px; margin: 0 auto; }
.faq-item {
  background: var(--card-face);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 var(--paper-deep);
  border-top-width: 8px;
  border-top-color: var(--jam);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.faq-q {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--jam-deep);
  margin-bottom: 10px;
}
.faq-item p, .faq-item li { font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.faq-item ol, .faq-item ul { padding-left: 22px; }
.faq-table-wrap { margin: 10px 0; box-shadow: none; border-width: 1.5px; }
.faq-table { min-width: 0; }

/* --- footer ------------------------------------------------------------------------------------------------ */

.footer {
  border-top: 2.5px solid var(--ink);
  background: var(--paper-deep);
  text-align: center;
  padding: 28px 20px 38px;
  font-size: 13px;
  color: var(--ink-soft);
}
.footer p { max-width: 640px; margin: 0 auto 8px; }
.footer-fine {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.footer-fine strong { color: var(--jam-deep); }

/* --- responsive --------------------------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .masthead-inner { flex-direction: column; text-align: center; gap: 14px; padding: 26px 18px 18px; }
  .masthead-brand { align-self: center; margin-top: 0; }
  .masthead-word { text-align: center; }
  .wordmark { justify-content: center; }
  .team-hero { padding: 22px 16px 16px; gap: 14px; }
  .team-heat-num { font-size: 48px; }
  .filter-row { justify-content: center; }
  /* the flip cards have a fixed height, so a full-width phone card
     grows its photo until the stat footer is pushed out of frame —
     cap the column at the width the card was designed for instead */
  .card-grid { grid-template-columns: minmax(0, 330px); justify-content: center; }
  /* at 330px the photo is ~46px taller than the desktop column it was
     sized for — give the fixed-height flip card the same headroom */
  .bcard, .bcard-inner { min-height: 478px; }
}

@media (prefers-reduced-motion: reduce) {
  .bcard-inner { transition: none; }
  .loading-flame { animation: none; }
  .bcard:hover .bcard-frame { transform: none; }
  .masthead-logo:hover img { transform: none; }
  html { scroll-behavior: auto; }
}
