:root {
  color-scheme: light;
  --graphite-bg: #f5f2e9;
  --graphite-surface: #fffcf4;
  --graphite-alt: #ebe7db;
  --graphite-text: #20242b;
  --graphite-muted: #525b65;
  --graphite-line: #d3cec0;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --graphite-bg: #1e232a;
  --graphite-surface: #262d36;
  --graphite-alt: #2f3742;
  --graphite-text: #f4f4f1;
  --graphite-muted: #bdc5ce;
  --graphite-line: #46515f;
}
body.club-app.graphite-app {
  --bg: var(--graphite-bg);
  --surface: var(--graphite-surface);
  --surface-alt: var(--graphite-alt);
  --text: var(--graphite-text);
  --muted: var(--graphite-muted);
  --line: var(--graphite-line);
  --accent: #f8d646;
  --accent-text: #13171c;
  --ink: var(--text);
  --gold: var(--line);
  --shadow: none;
  --grain: 0;
  --ticket: var(--surface);
  --ticket-text: var(--text);
  background: var(--bg);
  color: var(--text);
}
.graphite-app .site-shell { max-width: 1180px; }
.graphite-app .club-header { border-bottom: 1px solid var(--line); }
.graphite-app .club-header .brand {
  display: inline-flex; align-items: center; gap: 10px;
  width: auto; min-width: 0; flex: none;
  color: var(--text); font-size: clamp(18px, 4.8vw, 24px); font-weight: 800;
}
.graphite-logo { display: block; flex: none; }
.graphite-app h1, .graphite-app .section-heading h2 {
  font-family: system-ui, sans-serif; font-weight: 800;
}
.graphite-app .main-nav button,
.graphite-app .mobile-nav button,
.graphite-app .club-bar button,
.graphite-app .account-ticket,
.graphite-app .theme-toggle {
  background: var(--surface); color: var(--text); border-color: var(--line);
  border-radius: 8px; box-shadow: none; transform: none;
}
.graphite-app .main-nav button[aria-current],
.graphite-app .discipline-switch button[aria-pressed=true],
.graphite-app button.primary {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}
.graphite-app .mobile-nav { background: var(--bg); border-color: var(--line); }
.graphite-app .mobile-nav button[aria-current] { color: var(--text); }
.graphite-app .page-heading,
.graphite-app .panel, .graphite-app .more-points, .graphite-app .daily-bonus,
.graphite-app .tournament-group, .graphite-app .empty-state {
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: none;
}
.graphite-app .page-heading::before, .graphite-app .page-heading::after,
.graphite-app .more-points::before, .graphite-app .more-points::after { display: none; }
.graphite-app :is(.graphite-hero,.score-promo) {
  min-height: clamp(160px, 24vw, 250px); color: #fff;
  background: linear-gradient(90deg,#20262e 24%,#20262ed9 43%,#20262e15 78%),
    url('graphite-techies.webp') right center / auto 100% no-repeat, #20262e;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: none;
}
.graphite-app .graphite-hero { padding: clamp(18px, 4vw, 34px); display: grid; align-content: center; }
.graphite-app .graphite-hero h1 { max-width: 65%; color: #fff; margin: 0; }
.graphite-app .graphite-hero p { color: #fff1a6; margin: 6px 0 0; }
.graphite-app .score-promo::before, .graphite-app .score-promo::after { display: none; }
.graphite-app .score-promo .score-promo-copy { position: relative; z-index: 1; }
.graphite-app .score-promo .score-promo-copy button { background: var(--accent); color: var(--accent-text); }
.graphite-app .score-promo .score-promo-copy .score-prize { color: #fff1a6; }
.graphite-app .tournament-group > summary { color: var(--text); background: var(--surface-alt); }
.graphite-app .tournament-group .tournament-meta { color: var(--muted); }
.graphite-app .tournament-matches { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
.graphite-app .graphite-match {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: none;
}
.graphite-app .tournament-matches .graphite-match {
  border-width: 0 0 1px; border-radius: 0;
}
.graphite-app .graphite-match::before, .graphite-app .graphite-match::after { display: none; }
.graphite-app .graphite-match .match-open { grid-column: 1; text-align: left; color: var(--text); }
.graphite-match-league { grid-column: 1/-1; font-size: 12px; color: var(--muted); font-weight: 700; }
.graphite-team-stack { display: grid; gap: 4px; }
.graphite-app .graphite-match .team {
  min-width: 0; display: flex; flex-direction: row; justify-content: flex-start;
  align-items: center; gap: 7px; font: 700 14px/1.25 system-ui,sans-serif;
  color: var(--text); text-align: left; overflow-wrap: anywhere;
}
.graphite-app .graphite-match .team-emblem {
  width: 23px; height: 23px; flex: 0 0 23px; border-radius: 5px;
  border: 0; padding: 3px; background: var(--surface-alt); box-shadow: none; color: var(--muted);
}
.graphite-app .graphite-match .team-emblem .initial { font-size: 12px; }
.graphite-match-status { display: block; color: var(--muted); font: 12px/1.3 system-ui,sans-serif; margin: 5px 0 0; }
.graphite-odds { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,86px); gap: 6px; }
.graphite-app .graphite-odds .selection {
  min-width: 0; min-height: 52px; display: grid; justify-items: center;
  align-content: center; gap: 2px; padding: 5px; border-radius: 7px;
  background: var(--surface-alt); border: 1px solid var(--line); color: var(--text);
  box-shadow: none; font: 600 11px/1.1 system-ui,sans-serif;
}
.graphite-app .graphite-odds .selection strong { font: 800 19px/1.1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.graphite-app .graphite-odds .selection[aria-pressed=true] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.graphite-app .graphite-odds .selection[aria-pressed=true]::after { display: none; }
.graphite-app .graphite-match .card-hint { grid-column: 1/-1; margin: 0; }
.graphite-app #bet-form {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: 10px; padding: 16px;
}
.graphite-app #bet-form .primary { display: block; width: 100%; }
.graphite-app #coupon-feedback:empty { display: none; }
.graphite-app #refresh-coupon { margin-bottom: 6px; }
.graphite-app .coupon-legs { margin: 6px 0 10px; gap: 0; }
@media (min-width: 1000px) {
  .graphite-app main[data-page=home]:has(#coupon:not(:empty)) {
    display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 0 20px; align-items: start;
  }
  .graphite-app main[data-page=home]:has(#coupon:not(:empty)) > :not(#home-matches,#coupon) { grid-column: 1/-1; }
  .graphite-app main[data-page=home] #coupon:not(:empty) { grid-column: 2; margin: 0; }
}
@media (max-width: 700px) {
  /* Keep the footer below the first screen while the home match list loads. */
  .club-app.graphite-app #content:not([data-page]),
  .club-app.graphite-app #content[data-page=home] {
    min-height: 100vh;
    min-height: 100svh;
  }
  .graphite-app .graphite-match,
  .graphite-app .featured-match .graphite-match { padding: 9px 10px; }
  .graphite-app .graphite-odds { grid-auto-columns: 57px; gap: 5px; }
  .graphite-app .graphite-match .team { font-size: 13px; }
  .graphite-app .graphite-odds--three { grid-auto-columns: 41px; }
  .graphite-app .graphite-odds--three .selection strong { font-size: 16px; }
}
body.club-app.graphite-app { font-family: system-ui, sans-serif; --display: 'Club', system-ui, sans-serif; }
.club-app.graphite-app :is(a,button,input,summary):focus-visible { outline-color: #e4b313; }
.club-app.graphite-app button,
.club-app.graphite-app button:hover { box-shadow: none; }
.club-app.graphite-app button.primary:hover:not(:disabled),
.club-app.graphite-app .graphite-odds .selection[aria-pressed=true]:hover { background: #ffe47a; color: #13171c; }
.club-app.graphite-app button.primary:disabled { opacity: .55; cursor: not-allowed; }
.graphite-app .amount-row input, .graphite-app #auth-form input {
  background: var(--bg); color: var(--text); border-color: var(--line);
}
.graphite-app .score-spotlight {
  background:
    linear-gradient(90deg, #20262e 38%, #20262ef0 48%, #20262e80 64%, transparent 82%),
    url('graphite-techies.webp') right center / auto 100% no-repeat, #20262e;
  color: #fff;
  border-color: var(--line);
  box-shadow: none;
}
.graphite-app .score-spotlight > * {
  max-inline-size: 65%;
  overflow-wrap: break-word;
}
.graphite-app .club-header .brand { flex-direction: row; text-align: left; }
.club-app.graphite-app :is(#show-coupon,.mobile-nav button[aria-current=page]) {
  background: var(--surface-alt); color: var(--text); border-color: var(--line);
}
.club-app.graphite-app .graphite-odds .selection { text-align: center; }
.club-app.graphite-app .graphite-odds .selection {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  justify-items: center;
  text-align: center;
}
.club-app.graphite-app .graphite-odds .selection > span,
.club-app.graphite-app .graphite-odds .selection > strong {
  width: 100%;
  text-align: center;
}
.club-app.graphite-app .market-odds--three .selection {
  align-items: center;
}
.club-app.graphite-app .market-odds--three .selection > span {
  text-align: center;
}
.club-app.graphite-app .header-tools {
  gap: 8px;
  min-width: 0;
}
.club-app.graphite-app :is(.theme-toggle, .account-ticket) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  max-width: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1.25 system-ui, sans-serif;
}
.club-app.graphite-app :is(.theme-toggle, .account-ticket):hover {
  background: var(--surface-alt);
}
.club-app.graphite-app .theme-option {
  width: 18px;
  height: 18px;
  background: transparent;
  color: var(--text);
}
.club-app.graphite-app #theme-label {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
}
.club-app.graphite-app .theme-option svg {
  width: 18px;
  height: 18px;
}
[data-theme=dark] .club-app.graphite-app :is(.theme-option--day, .account-balance strong) {
  color: var(--accent);
}
[data-theme=dark] .club-app.graphite-app .theme-option--night,
[data-theme=light] .club-app.graphite-app .theme-option--day {
  display: none;
}
.club-app.graphite-app .account-balance {
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 5px;
  color: var(--muted);
  font-size: 12px;
}
.club-app.graphite-app .account-balance strong {
  color: var(--text);
  font: 750 16px/1.15 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.club-app.graphite-app .account-profile {
  display: flex;
  align-items: center;
  gap: 5px;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 8px;
}
.club-app.graphite-app .account-profile svg {
  width: 17px;
  height: 17px;
  flex: none;
}
@media (max-width: 1000px) {
  .club-app.graphite-app .club-header {
    flex-wrap: wrap;
  }
  .club-app.graphite-app .header-tools {
    margin-inline-start: auto;
  }
  .club-app.graphite-app .theme-toggle {
    padding-inline: 0;
  }
  .club-app.graphite-app #theme-label,
  .club-app.graphite-app .account-profile > span {
    display: none;
  }
}
@media (max-width: 360px) {
  .club-app.graphite-app .header-tools {
    gap: 5px;
  }
  .club-app.graphite-app .club-header .brand {
    gap: 5px;
  }
  .club-app.graphite-app .account-ticket {
    gap: 5px;
    padding-inline: 7px;
  }
  .club-app.graphite-app .account-profile {
    padding-inline-start: 5px;
  }
}

/* The prize panel is shared by the club, ranking, and prizes. */
.club-app.graphite-app .contest-prizes {
  padding: clamp(14px, 2.5vw, 24px);
}
.club-app.graphite-app .contest-prizes > h2 {
  margin: 0 0 12px;
}
.club-app.graphite-app .contest-prizes .prize-grid {
  margin: 0 0 14px;
}
.club-app.graphite-app .contest-prizes .prize-tile {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  padding: 0;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: none;
}
.club-app.graphite-app .contest-prizes .prize-tile img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  opacity: 1;
}
.club-app.graphite-app .contest-prizes .prize-tile strong {
  position: static;
  margin: 0;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  font: 700 clamp(12px, 3.1vw, 16px)/1.3 system-ui, sans-serif;
  text-align: left;
}
.club-app.graphite-app .contest-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.club-app.graphite-app .contest-bottom > span { min-width: 0; }
.club-app.graphite-app .contest-prizes > .muted { margin: 8px 0 0; }

/* Shared navigation on club screens, the school catalog and articles. */
.club-sections, .club-app .club-bar .club-shortcuts {
  display: flex;
  align-items: center;
  gap: 4px;
}
.club-sections { margin-inline: auto; }
.club-sections svg { display: none; }
.club-sections a, .club-app .club-shortcuts a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text);
  font: 650 14px/1.25 system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
}
.club-sections a:hover, .club-app .club-shortcuts a:hover { background: var(--surface-alt); }
.club-sections a[aria-current], .club-app .club-shortcuts a[aria-current] {
  color: var(--accent-text);
  background: var(--accent);
}
.club-sections a:focus-visible, .club-shortcuts a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.club-app .brand, .club-app .account-ticket { text-decoration: none; }
.club-app .club-bar { flex-wrap: wrap; }
.club-app .club-bar .club-shortcuts { flex-wrap: wrap; }
@media (max-width: 850px) {
  .club-app.graphite-app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .club-sections {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .club-sections a { flex-direction: column; gap: 4px; padding: 4px 2px; font-size: 12px; }
  .club-sections svg { display: block; width: 20px; height: 20px; }
  .club-app .club-bar .club-shortcuts { justify-content: flex-start; gap: 2px; }
  .club-app .club-shortcuts a { padding-inline: 8px; font-size: 13px; }
}
