/* Scoreboard polish layer v1: organization, readability, mobile fit. */
html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(135deg, rgba(9, 20, 27, .98), rgba(10, 13, 24, .98) 46%, rgba(13, 17, 14, .98)),
    #070a10;
}

body::before {
  opacity: .11;
}

body::after {
  opacity: .22;
}

.olympics-page {
  width: min(1440px, calc(100% - 40px));
  padding-top: 22px;
}

.topbar {
  align-items: stretch;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(4, 10, 18, .62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  min-width: 0;
  flex-wrap: wrap;
}

.actions {
  align-items: center;
  justify-content: flex-end;
}

.actions .btn {
  min-width: 0;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.btn,
.live-pill,
.kicker,
.badge,
.broadcast-chip,
.result-badge {
  border-radius: 8px !important;
}

.scoreboard-nav {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, .20);
  border-radius: 8px;
  background: rgba(5, 11, 19, .88);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.scoreboard-nav::-webkit-scrollbar {
  display: none;
}

.scoreboard-nav a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  color: #d7deec;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scoreboard-nav a:hover {
  border-color: rgba(56, 189, 248, .48);
  background: rgba(14, 38, 55, .82);
  color: #f8fbff;
}

#overview,
#live-game,
#network,
#league,
#players,
#live-feed,
#scoring-rules {
  scroll-margin-top: 86px;
}

.hero,
.team-card,
.panel,
.rule,
.mini-stat,
.clock-card,
.league-hero-strip,
.race-track-card,
.v2-panel,
.v3-panel,
.random-matchup-panel {
  border-radius: 8px !important;
}

.hero {
  padding: clamp(20px, 3vw, 34px);
}

.hero::before {
  opacity: .42;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: stretch;
}

h1 {
  max-width: 100%;
  letter-spacing: -.045em;
  font-size: clamp(56px, 7vw, 100px);
}

h1 span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.subtitle {
  max-width: 780px;
  color: #b7c3d7;
  overflow-wrap: anywhere;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-stat,
.rule,
.hit,
.game,
.team-card,
.panel {
  background: rgba(6, 13, 25, .74);
}

.mini-stat {
  min-width: 0;
}

.mini-stat .value,
.score,
.clock {
  font-variant-numeric: tabular-nums;
}

.clock-card {
  min-width: 0;
}

.clock-sub b {
  color: #eef4ff;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 26px 0 12px;
  padding: 0 2px;
}

.section-heading span {
  display: inline-flex;
  color: #facc15;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.02;
  letter-spacing: -.04em;
}

.section-heading p {
  max-width: 470px;
  margin: 0;
  color: #9eabc2;
  line-height: 1.45;
  font-weight: 700;
}

.score-grid,
.section-grid,
.rules,
.v2-arena-grid,
.v3-league-grid,
.league-enhance {
  gap: 20px;
}

.team-card {
  min-height: 230px;
}

.team-sub,
.hit-meta,
.game-meta,
.player-meta,
.power-meta,
.replay-meta,
.scout-lines,
.division-meta,
.quest-meta {
  color: #9eabc2 !important;
}

.team-head,
.hit,
.game {
  min-width: 0;
}

.team-name,
.hit-title,
.game-title,
.player-name,
.power-name,
.scout-name,
.division-name,
.quest-title {
  overflow-wrap: anywhere;
}

.hit-meta,
.hit-title,
.game-meta,
.game-title {
  min-width: 0;
}

.ticker,
.history {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, .38) rgba(15, 23, 42, .42);
}

#okiMeshStatsPanel .hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#okiMeshStatsPanel .section-grid > div {
  min-width: 0;
}

.footer {
  padding: 22px 0 4px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

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

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading p {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .olympics-page {
    width: min(100% - 24px, 680px);
    padding: 12px 0 30px;
  }

  .topbar {
    gap: 10px;
  }

  .brand {
    width: 100%;
  }

  .brand > span:not(.live-pill) {
    display: none;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .actions .btn {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .scoreboard-nav {
    top: 6px;
    margin: 10px 0 14px;
    padding: 7px;
  }

  .scoreboard-nav a {
    padding: 8px 10px;
    font-size: 11px;
  }

  .hero {
    padding: 18px;
  }

  .kicker {
    max-width: 100%;
    font-size: 10px;
    letter-spacing: .10em;
  }

  h1 {
    margin: 14px 0 10px;
    font-size: clamp(40px, 15.2vw, 58px);
    line-height: .96;
    letter-spacing: -.035em;
  }

  .subtitle {
    font-size: 15px;
    line-height: 1.48;
    max-width: 100%;
  }

  .hero-stats,
  #okiMeshStatsPanel .hero-stats {
    grid-template-columns: 1fr;
  }

  .clock {
    font-size: clamp(38px, 13.5vw, 54px);
    letter-spacing: -.035em;
  }

  .team-card {
    min-height: 0;
    padding: 18px;
  }

  .team-head {
    gap: 10px;
  }

  .team-name {
    font-size: 28px;
  }

  .mascot {
    flex: 0 0 auto;
    font-size: 34px;
  }

  .score-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .score {
    font-size: clamp(70px, 24vw, 96px);
  }

  .score-label {
    padding-bottom: 0;
  }

  .section-heading {
    margin-top: 22px;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .panel {
    padding: 16px;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .hit {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .hit-time {
    grid-column: 2;
  }

  .game {
    grid-template-columns: 1fr;
  }

  .result-row {
    flex-wrap: wrap;
  }

  .rules {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .olympics-page {
    width: calc(100% - 18px);
  }

  .hero {
    padding: 16px 14px;
  }

  h1 {
    font-size: clamp(38px, 14vw, 50px);
  }

  .clock-card {
    padding: 17px;
  }

  .mini-stat .value {
    font-size: 24px;
  }
}

/* Daily Home/Away matchup layer */
.random-matchup-title span {
  color: #38bdf8;
}

.random-side-label {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(250, 204, 21, .34);
  border-radius: 8px;
  color: #facc15;
  background: rgba(250, 204, 21, .08);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.random-matchup-history {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.random-history-title {
  color: #9eabc2;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.random-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background: rgba(2, 6, 23, .36);
}

.random-history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.random-history-row small,
.random-history-empty {
  color: #8d99af;
}

@media (max-width: 720px) {
  .random-history-row {
    grid-template-columns: 1fr;
  }

  .random-history-row span {
    white-space: normal;
  }
}
