/* ============================================================
   CRATEBIN — theme layer over the Gazette's styles
   Concept: the league as a dispatch yard. Every gameweek, goods
   in (transfers in), goods binned (players sold, points lost).
   Kraft board and stencil ink by day, a lit loading dock by night.
   Square corners, shipping-label rules, hazard-tape accents. The
   one bright colour, hi-vis yellow / brass, still marks money won.
   ============================================================ */

:root {
  --font-display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', sans-serif;
  --font-stencil: 'Big Shoulders Stencil Display', 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-body: 'Switzer', 'Inter', 'Helvetica Neue', sans-serif;
  --font-label: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 3px;
  --radius-xl: 4px;

  --hazard-a: #f2b705;
  --hazard-b: #1b1916;
}

/* ---------- Light: "Day shift" — kraft board, stencil ink ---------- */
:root,
[data-theme='light'] {
  --color-bg: #e9dcc2;
  --color-surface: #f1e8d6;
  --color-surface-2: #f8f2e6;
  --color-surface-offset: #e2d3b5;
  --color-surface-offset-2: #d9c8a6;
  --color-surface-dynamic: #cdb98f;
  --color-divider: #cfbd98;
  --color-border: #a8936b;

  --color-text: #1b1916;
  --color-text-muted: #5b5244;
  --color-text-faint: #8c8070;
  --color-text-inverse: #f8f2e6;

  --color-primary: #a83a0c;
  --color-primary-hover: #8c2f08;
  --color-primary-active: #6f2405;
  --color-primary-highlight: #f0cdb3;

  --color-gold: #7a5800;
  --color-gold-hover: #634700;
  --color-gold-active: #4d3700;
  --color-gold-highlight: #f2dc8a;

  --color-error: #8a1f1f;
  --color-error-hover: #701818;
  --color-error-highlight: #ecc9c3;

  --color-success: #2d5e2a;
  --color-success-highlight: #cfe0c4;

  --shadow-sm: 0 1px 0 oklch(0.3 0.03 70 / 0.18);
  --shadow-md: 0 3px 0 oklch(0.3 0.03 70 / 0.14);
  --shadow-lg: 0 10px 0 -4px oklch(0.3 0.03 70 / 0.16);

  /* Shipping-container paint for the four managers */
  --team-foden: #1f6a72;
  --team-accord: #a1302c;
  --team-hahe: #56651f;
  --team-road: #b0581a;

  --flute: oklch(0.35 0.04 70 / 0.05);
}

/* ---------- Dark: "Night shift" — the loading dock under lights ---------- */
[data-theme='dark'] {
  --color-bg: #111213;
  --color-surface: #191a1c;
  --color-surface-2: #202225;
  --color-surface-offset: #1d1f21;
  --color-surface-offset-2: #26282b;
  --color-surface-dynamic: #31343a;
  --color-divider: #2a2c30;
  --color-border: #43464c;

  --color-text: #ece6d7;
  --color-text-muted: #a69e8e;
  --color-text-faint: #6f685d;
  --color-text-inverse: #111213;

  --color-primary: #ff7a36;
  --color-primary-hover: #ff9560;
  --color-primary-active: #ffae85;
  --color-primary-highlight: #3a2216;

  --color-gold: #f5c518;
  --color-gold-hover: #ffd54a;
  --color-gold-active: #ffe07a;
  --color-gold-highlight: #3a3110;

  --color-error: #ef6b62;
  --color-error-hover: #f48b84;
  --color-error-highlight: #3b1f1d;

  --color-success: #7cc47a;
  --color-success-highlight: #1f3320;

  --shadow-sm: 0 1px 0 oklch(0 0 0 / 0.5);
  --shadow-md: 0 3px 0 oklch(0 0 0 / 0.5);
  --shadow-lg: 0 10px 0 -4px oklch(0 0 0 / 0.6);

  --team-foden: #4cb6bf;
  --team-accord: #e2675f;
  --team-hahe: #a8b84e;
  --team-road: #f0954e;

  --hazard-b: #111213;
  --flute: oklch(1 0 0 / 0.025);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111213;
    --color-surface: #191a1c;
    --color-surface-2: #202225;
    --color-surface-offset: #1d1f21;
    --color-surface-offset-2: #26282b;
    --color-surface-dynamic: #31343a;
    --color-divider: #2a2c30;
    --color-border: #43464c;
    --color-text: #ece6d7;
    --color-text-muted: #a69e8e;
    --color-text-faint: #6f685d;
    --color-text-inverse: #111213;
    --color-primary: #ff7a36;
    --color-primary-hover: #ff9560;
    --color-primary-active: #ffae85;
    --color-primary-highlight: #3a2216;
    --color-gold: #f5c518;
    --color-gold-hover: #ffd54a;
    --color-gold-highlight: #3a3110;
    --color-error: #ef6b62;
    --color-error-highlight: #3b1f1d;
    --color-success: #7cc47a;
    --color-success-highlight: #1f3320;
    --shadow-sm: 0 1px 0 oklch(0 0 0 / 0.5);
    --shadow-md: 0 3px 0 oklch(0 0 0 / 0.5);
    --shadow-lg: 0 10px 0 -4px oklch(0 0 0 / 0.6);
    --team-foden: #4cb6bf;
    --team-accord: #e2675f;
    --team-hahe: #a8b84e;
    --team-road: #f0954e;
    --hazard-b: #111213;
    --flute: oklch(1 0 0 / 0.025);
  }
}

/* Corrugated board: faint vertical flutes instead of the paper glow */
body {
  background-image: repeating-linear-gradient(90deg, var(--flute) 0 1px, transparent 1px 14px);
}

/* ---------- Masthead: stencilled crate label + hazard tape ---------- */
.masthead {
  border-bottom: 0;
  box-shadow: none;
}
.masthead::after {
  content: '';
  display: block;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--hazard-a) 0 10px, var(--hazard-b) 10px 20px);
}
.brand__title {
  font-family: var(--font-stencil);
  font-weight: 800;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 0.95;
}
.brand__title .tld {
  color: var(--color-primary);
}
.brand__subtitle {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
.brand__mark {
  color: var(--color-text);
}

/* ---------- Type: condensed display, mono labels ---------- */
h1,
h2,
h3,
.section-title {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}
.section-title {
  text-transform: uppercase;
  font-weight: 800;
}
[class*='__kicker'],
[class*='__eyebrow'],
[class*='-tag'],
.edition-strip__tag,
.verdict-card__tag {
  font-family: var(--font-label);
  letter-spacing: 0.04em;
}

/* Big figures read like numbers stencilled on a crate side */
[class*='__figure'],
[class*='figure__value'],
[class*='hero__value'] {
  font-family: var(--font-stencil);
  font-weight: 800;
}

/* Cards: shipping labels — square, ruled, with a solid edge */
.dugout-card,
.verdict-card,
.kpi,
[class*='-card'] {
  border-radius: var(--radius-md);
}
.verdict-card {
  border: 1.5px solid var(--color-text);
  box-shadow: 4px 4px 0 var(--color-text);
}
.dugout-card {
  border-color: var(--color-border);
}

/* Ticker sits on its own strip of tape */
.edition-strip {
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-border);
}

/* ---------- Front page ---------- */
.lead__headline {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0;
  font-size: clamp(3rem, 1rem + 6.5vw, 7rem);
}
.lead__kicker,
.lead__edition,
.lead__figure-caption,
.rail-stat__label,
.desk-figures__item > :first-child {
  font-family: var(--font-label);
  letter-spacing: 0.04em;
}
.lead__figure {
  border: 1.5px solid var(--color-text);
  background: var(--color-surface-2);
  box-shadow: 4px 4px 0 var(--color-text);
  position: relative;
}
.lead__figure::before {
  content: 'THIS SIDE UP ↑';
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
}
.lead__figure-value {
  font-family: var(--font-stencil);
  font-weight: 800;
  color: var(--color-primary);
}
.rail-stat__value,
.desk-figures__item strong,
.count-up {
  font-family: var(--font-display);
  font-weight: 700;
}

.brand__mark {
  width: 44px;
  height: 44px;
  color: var(--color-text) !important;
}

/* Square off the pill-shaped controls and tags (round dots, rank
   badges and the theme button stay round). */
.jump-chip,
.btn-verdict,
.fixture-nav__btn,
.radar-scope__btn,
.hit-badge,
.owned-badge,
.almanac__tab-badge,
.awards-month__badge {
  border-radius: var(--radius-sm);
}

/* ============================================================
   Components — the yard's hardware
   ============================================================ */

/* Eyebrows become shipping tags: ink block, kraft letters, mono */
.eyebrow {
  font-family: var(--font-label);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-text-inverse);
  background: var(--color-text);
  display: inline-flex;
  width: fit-content;
  padding: 0.25em 0.7em 0.2em;
}
.eyebrow::before {
  content: '▣';
  width: auto;
  height: auto;
  background: none;
  opacity: 1;
  color: var(--color-primary);
  font-size: 0.9em;
}
.section-title {
  letter-spacing: 0.005em;
  line-height: 0.95;
}

/* Jump links: masking-tape labels */
.jump-chip {
  font-family: var(--font-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1.5px solid var(--color-text);
  background: var(--color-surface-2);
  color: var(--color-text);
}
.jump-chip:hover {
  background: var(--color-text);
  color: var(--color-text-inverse);
  border-color: var(--color-text);
}

/* Buttons and toggles: square, ink-edged, inked when on */
.radar-scope__btn,
.almanac__tab,
.btn-verdict {
  border-radius: var(--radius-sm);
}
.radar-scope__btn {
  border: 1.5px solid var(--color-border);
  font-weight: 600;
}
.radar-scope__btn:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}
.radar-scope__btn.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-text-inverse);
}
.btn-verdict {
  border: 1.5px solid var(--color-text);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.almanac__tab[aria-selected='true'],
.almanac__tab.is-active {
  border-bottom-width: 3px;
}

/* Rank: stencilled numbers in square plates, not coins */
.rank-badge {
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

/* The manifest: an ink header bar like the top of a delivery note */
.ledger thead th {
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-family: var(--font-label);
  font-weight: 500;
  letter-spacing: 0.06em;
}
@media (min-width: 641px) {
  .ledger tbody td {
    border-bottom: 1px dashed var(--color-border);
  }
}

/* −4 BINNED: a rubber stamp, slightly crooked, never a pill */
.hit-badge,
.bin-stamp {
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-error);
  border: 1.5px solid var(--color-error);
  font-family: var(--font-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transform: rotate(-2.5deg);
  padding: 0.12em 0.5em;
}
.bin-stamp b {
  font-weight: 500;
}
.hit-mark {
  font-family: var(--font-label);
}

/* Cards: shipping labels with a stapled corner */
.dugout-card {
  border: 1.5px solid var(--color-border);
  box-shadow: 3px 3px 0 var(--color-surface-offset-2);
  position: relative;
}
.dugout-card::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 3px;
  background: var(--color-text-faint);
  transform: rotate(-35deg);
  opacity: 0.7;
}
.dugout-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.awards-card {
  background: var(--color-surface-2);
  border: 1.5px dashed var(--color-border);
}
.awards-card__label {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Stickers: earned ones are slapped on at an angle, locked ones are outlines */
.trophy-badge {
  border-style: dashed;
  border-width: 1.5px;
}
.trophy-badge.is-earned {
  border-style: solid;
  border-color: var(--color-text);
  background: var(--color-gold-highlight);
  box-shadow: 2px 2px 0 var(--color-text);
}
.trophy-badge.is-earned:nth-child(odd) {
  transform: rotate(-2deg);
}
.trophy-badge.is-earned:nth-child(even) {
  transform: rotate(1.5deg);
}
.trophy-badge__label {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* On the Belt (live): a moving conveyor stripe along the top */
.stop-press {
  background: var(--color-surface-offset);
  border-bottom: 1.5px solid var(--color-text);
  position: relative;
}
.stop-press::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--color-text) 0 14px, transparent 14px 22px);
  animation: belt 1.2s linear infinite;
}
@keyframes belt {
  to {
    background-position: 22px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stop-press::before {
    animation: none;
  }
}
.stop-press__flag {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Tabs: the open bay door gets a thick dock-orange edge */
.tab-btn[aria-selected='true'] {
  color: var(--color-text);
}
@media (min-width: 641px) {
  .tab-btn {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}

/* Verdict tag reads like a stencilled crate label */
.verdict-card__tag {
  color: var(--color-primary);
  text-transform: uppercase;
}
.verdict-card__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  line-height: 1.15;
}

/* Footer: the crate mark and a strip of tape */
.site-footer {
  border-top: 0;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--hazard-a) 0 10px, var(--hazard-b) 10px 20px);
}
.site-footer__mark {
  color: var(--color-text);
}

/* Loading Bay: crate tabs and the sealed-crate card */
.draft-sealed {
  border: 1.5px solid var(--color-text);
  box-shadow: 4px 4px 0 var(--color-text);
}
.draft-sealed__state.is-sealed {
  font-family: var(--font-label);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.draft-stamp--none {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Short tab labels for the phone bottom bar */
.tab-btn__short {
  display: none;
}
@media (max-width: 640px) {
  .tab-btn__long {
    display: none;
  }
  .tab-btn__short {
    display: inline;
  }
}

/* ---------- The Dispatch Note panel ---------- */
.dispatch {
  margin-top: var(--space-12);
}
.dispatch__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: var(--space-8);
  align-items: center;
  border: 1.5px solid var(--color-text);
  background: var(--color-surface);
  padding: var(--space-8);
  box-shadow: 4px 4px 0 var(--color-text);
}
.dispatch__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.dispatch__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-2);
}
.dispatch__pick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dispatch__pick select {
  font: inherit;
  padding: 0.35em 0.6em;
  border: 1.5px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
}
.dispatch__controls .radar-scope__btn {
  min-height: 44px;
  padding-inline: 1.1em;
}
.dispatch__preview {
  width: 100%;
  height: auto;
  border: 1.5px solid var(--color-text);
  transform: rotate(1.2deg);
  box-shadow: 6px 6px 0 var(--color-surface-offset-2);
}
@media (max-width: 760px) {
  .dispatch__card {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-5);
  }
  .dispatch__preview {
    max-width: 420px;
    justify-self: center;
  }
}

.payout-tag {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
  padding: 0.1em 0.45em;
  vertical-align: middle;
  margin-right: 0.3em;
}

.awards-month__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
