:root {
  --charcoal: #141414;
  --charcoal-card: #171717;
  --charcoal-ink: #0f0f0f;
  --mustard: #dfa05d;
  --mustard-deep: #bf8a4f;
  --clay-red: #ac5045;
  --sage-green: #658761;
  --warm-gray: #7a7d81;
  --ivory: #d8ceb9;
  --ink-muted: #a89d8a;
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  background: #11100e;
  font-family: 'Barlow Condensed', Arial, sans-serif;
  letter-spacing: .02em;
  position: relative;
  overflow-x: hidden;
}
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  background: url('/assets/textures/board-noise.png') center/540px repeat;
  opacity: .18;
}
body::after {
  background: url('/assets/textures/paper-noise.png') center/420px repeat;
  opacity: .045;
  mix-blend-mode: screen;
}
button, input, select { font: inherit; }
button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
}
.page-shell { position: relative; z-index: 1; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(12, 12, 12, .96);
  backdrop-filter: blur(8px);
}
.topbar__title {
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ivory);
}
.filter-toggle {
  min-width: 72px;
  height: 46px;
  padding: 0 13px;
  border-radius: 16px;
  background-color: #202020;
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 280px;
  background-blend-mode: multiply;
  color: var(--ivory);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filter-toggle.has-active-filter {
  background-color: var(--sage-green);
  color: var(--charcoal-ink);
}
.main-content { padding: 12px 20px 48px; }
.hero { margin: 12px 0 22px; }
.hero-title {
  margin: 0;
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(64px, 16.3vw, 168px);
  line-height: .86;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.textured-ivory {
  color: transparent;
  background-color: var(--ivory);
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 280px;
  background-repeat: repeat;
  background-blend-mode: multiply;
  -webkit-background-clip: text;
  background-clip: text;
}
.status-block {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #1a1a1a;
  color: var(--ink-muted);
  font-size: 22px;
}
.leaderboard-list { display: flex; flex-direction: column; gap: 18px; }
.leader-row {
  position: relative;
  border-radius: var(--radius-lg);
  background-color: var(--charcoal-card);
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 300px;
  background-repeat: repeat;
  background-blend-mode: multiply;
  overflow: hidden;
}
.leader-row--first { background-color: var(--mustard); }
.leader-row__main {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 8px;
  min-height: 86px;
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.rank-badge {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-weight: 700;
  background-color: #101010;
  color: var(--ivory);
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 260px;
  background-repeat: repeat;
  background-blend-mode: multiply;
}
.leader-row--first .rank-badge {
  background-color: var(--mustard-deep);
  color: var(--charcoal-ink);
}
.leader-player {
  min-width: 0;
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(32px, 7vw, 50px);
  line-height: .95;
  letter-spacing: .01em;
  color: var(--ivory);
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.leader-row--first .leader-player,
.leader-row--first .leader-points__value,
.leader-row--first .leader-points__label,
.leader-row--first .expand-btn { color: var(--charcoal-ink); }
.leader-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: .9;
  margin-right: 2px;
}
.leader-points__value {
  font-family: 'Anton', Impact, sans-serif;
  font-size: clamp(34px, 7vw, 50px);
  color: var(--ivory);
}
.leader-points__label {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.expand-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #0e0e0e;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--mustard);
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 260px;
  background-repeat: repeat;
  background-blend-mode: multiply;
}
.leader-row--first .expand-btn { background-color: rgba(0,0,0,.12); }
.leader-row__details { padding: 0 18px 18px; }
.fixture-day-group + .fixture-day-group { margin-top: 14px; }
.fixture-day-label {
  margin: 0 0 6px;
  padding-left: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.fixture-stack { display: flex; flex-direction: column; gap: 10px; }
.fixture-bar {
  border-radius: 18px;
  padding: 9px 10px 10px;
  background-color: #232323;
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 280px;
  background-repeat: repeat;
  background-blend-mode: multiply;
}
.fixture-bar--win { background-color: var(--sage-green); }
.fixture-bar--draw { background-color: #9b7a45; }
.fixture-bar--loss { background-color: var(--clay-red); }
.fixture-bar--upcoming, .fixture-bar--live { background-color: #242424; }
.fixture-bar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(20,20,20,.75);
}
.fixture-bar--upcoming .fixture-bar__meta,
.fixture-bar--live .fixture-bar__meta { color: rgba(231,226,214,.72); }
.fixture-bar__body {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 8px;
}
.team-block { min-width: 0; }
.team-block--away { text-align: right; }
.team-name {
  display: block;
  font-size: clamp(18px, 4.25vw, 26px);
  line-height: 1;
  font-weight: 700;
  color: var(--ivory);
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.team-owner {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
  color: rgba(20,20,20,.72);
}
.fixture-bar--upcoming .team-owner,
.fixture-bar--live .team-owner,
.fixture-bar--upcoming .team-name,
.fixture-bar--live .team-name { color: var(--ivory); }
.score-pill {
  min-width: 70px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #0b0b0b;
  color: var(--ivory);
  font-family: 'Anton', Impact, sans-serif;
  font-size: 23px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.empty-state {
  padding: 14px 18px;
  border-radius: 20px;
  background: #1b1b1b;
  color: var(--ink-muted);
  font-size: 22px;
}
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0,0,0,.46);
}
.filter-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  padding: 18px 18px 28px;
  background: #181818;
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 320px;
  background-repeat: repeat;
  background-blend-mode: multiply;
}
.filter-sheet__head,
.filter-sheet__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.filter-sheet__head strong,
.sheet-action,
.sheet-close {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filter-sheet__head strong { color: var(--ivory); }
.sheet-close { color: var(--mustard); }
.filter-sheet__actions { margin-top: 10px; }
.sheet-action { color: var(--ink-muted); }
.filter-options {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 54vh;
  overflow: auto;
}
.filter-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: #202020;
  background-image: url('/assets/textures/paper-noise.png');
  background-size: 280px;
  background-repeat: repeat;
  background-blend-mode: multiply;
}
.filter-option input { width: 22px; height: 22px; accent-color: var(--sage-green); }
.filter-option span { font-size: 24px; font-weight: 600; color: var(--ivory); }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .topbar { padding-inline: 16px; }
  .main-content { padding-inline: 16px; }
  .hero-title { font-size: clamp(54px, 13.5vw, 96px); }
  .leaderboard-list { gap: 10px; }
  .leader-row__main {
    grid-template-columns: 54px minmax(0, 1fr) auto 40px;
    gap: 9px;
    min-height: 82px;
    padding: 11px 13px;
  }
  .rank-badge {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 22px;
  }
  .leader-player { font-size: clamp(30px, 7.2vw, 46px); }
  .leader-points__value { font-size: clamp(32px, 7.6vw, 46px); }
  .leader-points__label { font-size: 13px; }
  .expand-btn {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .fixture-day-label { font-size: 16px; }
  .fixture-bar__meta { font-size: 13px; }
  .fixture-bar__body { gap: 7px; }
  .team-name { font-size: clamp(16px, 4.1vw, 22px); }
  .team-owner { font-size: 13px; }
  .score-pill {
    min-width: 62px;
    height: 38px;
    font-size: 21px;
    padding-inline: 10px;
  }
}

@media (max-width: 380px) {
  .leader-row__main { grid-template-columns: 62px minmax(0,1fr) auto 44px; gap: 10px; }
  .rank-badge { width: 62px; height: 62px; border-radius: 18px; }
  .leader-player { font-size: 36px; }
  .leader-points__value { font-size: 40px; }
  .expand-btn { width: 44px; height: 44px; }
  .hero-title { font-size: 58px; }
}

/* Compact no-ellipsis pass */
.leader-player,
.team-name,
.team-owner {
  text-overflow: clip !important;
}
.team-name,
.team-owner {
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
}
.leader-player {
  overflow: visible;
  text-overflow: clip;
}


/* Final compact + filter-matching pass */
.leader-row--first .fixture-day-label {
  color: var(--charcoal-ink) !important;
  opacity: .82;
}

@media (max-width: 640px) {
  .topbar {
    padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  }
  .topbar__title {
    font-size: clamp(18px, 3.65vw, 24px);
  }
  .filter-toggle {
    min-width: 66px;
    height: 40px;
    padding-inline: 11px;
    border-radius: 15px;
    font-size: 14px;
  }
  .main-content {
    padding: 8px 16px 34px;
  }
  .hero {
    margin: 5px 0 14px;
  }
  .hero-title {
    font-size: clamp(46px, 11.9vw, 80px);
    line-height: .86;
  }
  .leaderboard-list {
    gap: 8px;
  }
  .leader-row {
    border-radius: 20px;
  }
  .leader-row__main {
    grid-template-columns: 48px minmax(0, 1fr) auto 34px;
    gap: 8px;
    min-height: 68px;
    padding: 8px 10px;
  }
  .rank-badge {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 20px;
  }
  .leader-player {
    font-size: clamp(26px, 6.35vw, 38px);
    line-height: .95;
  }
  .leader-points__value {
    font-size: clamp(30px, 6.8vw, 40px);
  }
  .leader-points__label {
    margin-top: 2px;
    font-size: 11px;
  }
  .expand-btn {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }
  .leader-row__details {
    padding: 0 12px 12px;
  }
  .fixture-day-group + .fixture-day-group {
    margin-top: 10px;
  }
  .fixture-day-label {
    font-size: 14px;
    margin-bottom: 5px;
  }
  .fixture-stack {
    gap: 8px;
  }
  .fixture-bar {
    border-radius: 16px;
    padding: 8px 9px 9px;
  }
  .fixture-bar__meta {
    margin-bottom: 6px;
    font-size: 12px;
  }
  .fixture-bar__body {
    gap: 6px;
  }
  .team-name {
    font-size: clamp(15px, 3.85vw, 20px);
    line-height: 1.05;
  }
  .team-owner {
    margin-top: 3px;
    font-size: 12px;
  }
  .score-pill {
    min-width: 56px;
    height: 34px;
    padding-inline: 8px;
    font-size: 19px;
  }
}

@media (max-width: 380px) {
  .leader-row__main {
    grid-template-columns: 46px minmax(0, 1fr) auto 32px !important;
    gap: 7px !important;
    min-height: 66px !important;
    padding: 8px 9px !important;
  }
  .rank-badge {
    width: 46px !important;
    height: 46px !important;
    border-radius: 14px !important;
    font-size: 19px !important;
  }
  .leader-player {
    font-size: 27px !important;
  }
  .leader-points__value {
    font-size: 31px !important;
  }
  .expand-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 18px !important;
  }
  .hero-title {
    font-size: 45px !important;
  }
}
