/* Matchday colors and a single source of truth for the responsive header. */
:root {
  --paper: #f5f6f3;
  --card: #ffffff;
  --ink: #202b28;
  --muted: #58635f;
  --line: #dce1dc;
  --soft: #f0f3ef;
  --green: #265e47;
  --orange: #a66635;
  --shadow: 0 8px 28px #1435530b;
  --team-primary: #157347;
  --team-secondary: #f4c64b;
  --team-ink: #ffffff;
  --team-secondary-ink: #091421;
  --team-solid: #157347;
  --team-deep: #124632;
  --team-soft: #edf7f1;
  --team-secondary-soft: #fff6db;
  --action: #265e47;
  --font-ui: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-family: var(--font-ui);
  font-weight: 500;
}
body {
  background: var(--paper);
}
button, a { touch-action: manipulation; }
input, select { background: #fff; }
.primary { background: var(--action); border-color: var(--action); color: #ffffff; }
.secondary { background: #ffffff; border-color: var(--line); color: var(--ink); }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.secondary:hover:not(:disabled) { background: #f0f4ef; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline-color: var(--team-solid);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: 'brand nav actions';
  align-items: center;
  gap: 24px;
  position: static;
  height: auto;
  min-height: 82px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.brand { grid-area: brand; display: flex; align-items: center; min-width: 0; gap: 11px; }
.brand-mark {
  width: 40px; height: 43px; flex: none; position: relative;
  display: grid; place-items: center; border-radius: 11px;
  background: var(--action); color: #fff;
  font: 800 32px var(--font-ui);
  box-shadow: none;
}
.brand-mark:after {
  content: ''; position: absolute; width: 28px; height: 28px;
  border: 1px solid #ffffff70; border-radius: 4px; transform: rotate(45deg);
}
.brand-type {
  display: block; min-width: 0; font: 800 25px/.98 var(--font-ui);
  letter-spacing: -.5px; color: var(--ink); white-space: normal; font-size: 20px; font-weight: 800; line-height: 1.15;
}
.brand-type small {
  display: block; font: 700 7px/1.6 var(--font-ui);
  letter-spacing: .7px; margin-top: 6px; color: var(--muted); font-size: 10px; font-weight: 600;
}
.main-nav {
  grid-area: nav; position: static; order: 0; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch;
  gap: 5px; width: auto; margin: 0; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px; background: #edf0eb; border-color: var(--line);
}
.nav-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 0; min-height: 39px; margin: 0; padding: 9px 15px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.2;
  white-space: nowrap;
}
.nav-btn .icon { width: 16px; height: 16px; flex: none; }
.nav-btn.active { background: var(--action); color: #ffffff; box-shadow: none; }
.nav-btn[data-value='survivor'].active { background: var(--action); color: #ffffff; box-shadow: none; }
.nav-btn[data-value='board'].active { background: var(--action); color: #ffffff; box-shadow: none; }
.header-actions { grid-area: actions; display: flex; align-items: center; gap: 7px; flex: none; }
.account-button {
  min-height: 38px; padding: 9px 13px; border: 1px solid #c8d8e3;
  border-radius: 9px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700;
}
.header-actions .icon-btn { width: 35px; height: 35px; color: var(--ink); background: #fff; }

.game-heading {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; position: static; margin: 20px 0 15px; padding: 0; gap: 16px;
}
.game-heading h1 {
  font: 800 34px/1.02 var(--font-ui);
  text-transform: none; letter-spacing: -.2px;
  max-width: none; margin: 6px 0 0; color: var(--ink); font-size: 28px; font-weight: 700; line-height: 1.2;
}
.game-heading .mode-label { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; }
.game-heading .button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0; }
.game-heading .button-row .secondary { min-height: 34px; padding: 8px 11px; font-size: 10px; background: #fff; }
.career-ribbon { padding: 10px 0 13px; border-top: 1px solid var(--line); }
.level-medallion { background: var(--action); color: #ffffff; border-color: var(--action); }
.board-shortcut .icon { color: var(--muted); }
.board-shortcut strong { color: var(--ink); }

/* Each club gets an entire score panel, rather than a tiny colored badge. */
.scoreboard {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  align-items: stretch; gap: 0; padding: 0; overflow: hidden;
  background: #f1f3ef; border: 1px solid var(--line); border-radius: 13px 13px 0 0;
}
.team-score {
  display: grid; grid-template-columns: 37px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; min-width: 0; min-height: 83px;
  background: #ffffff; color: var(--ink); padding: 14px 16px;
  border-bottom: 3px solid var(--club-color);
}
.team-score.right { grid-template-columns: auto minmax(0, 1fr) 37px; }
.team-score.right > .team-monogram { grid-column: 3; grid-row: 1; }
.team-score.right > .team-identity { grid-column: 2; grid-row: 1; text-align: right; }
.team-score.right > strong { grid-column: 1; grid-row: 1; }
.team-monogram {
  display: grid; place-items: center; width: 37px; height: 37px; flex: none;
  border: 1px solid #ffffff66; border-radius: 50%; background: var(--club-color);
  color: var(--club-ink); font-size: 10px; font-weight: 700; border-color: var(--club-color);
}
.team-identity { min-width: 0; }
.team-score .name {
  font: 800 22px/.98 var(--font-ui);
  overflow-wrap: anywhere; letter-spacing: -.25px; font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-score small {
  display: block; color: var(--muted); font-size: 10px; line-height: 1.45;
  letter-spacing: 0; text-transform: uppercase; margin-top: 5px; opacity: 1; font-weight: 500;
}
.team-status { display: block; font-size: 10px; letter-spacing: .2px; font-weight: 600; margin-top: 2px; }
.team-score > strong, .team-score.right > strong {
  margin: 0; color: inherit; font: 800 43px/1 var(--font-ui);
  font-variant-numeric: tabular-nums; text-align: center; font-size: 36px; font-weight: 800;
}
.inning-score { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 9px 5px; text-align: center; border: 0; color: var(--ink); background: #edf0eb; }
.inning-score b { display: block; font: 800 25px/1 var(--font-ui); font-size: 18px; font-weight: 800; }
.inning-score span { display: block; font-size: 10px; letter-spacing: 0; color: var(--muted); margin-top: 7px; line-height: 1.4; font-weight: 600; }
.park-name { background: #244c3b; border-top-color: #476854; color: #ffffff; }
.field-hud span { border-color: #ffffff45; background: #0c352bbc; color: #fff; }
.legend-marker { background: var(--field-offense); border: 2px solid var(--field-offense-accent,#f4c64b); box-shadow: 0 0 0 1px #7c8d9c50; }
.legend-marker.def { background: var(--field-defense); border-color: #fff; }
.legend-marker.ball { background: #fff; }

/* Colored play choices and distinct analytics. */
.choice:nth-child(4n+1) { background: #ffffff; border-color: var(--line); }
.choice:nth-child(4n+2) { background: #ffffff; border-color: var(--line); }
.choice:nth-child(4n+3) { background: #ffffff; border-color: var(--line); }
.choice:nth-child(4n+4) { background: #ffffff; border-color: var(--line); }
.choice.selected { background: #edf4ee; color: var(--ink); border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.choice.selected .choice-odds b, .choice.selected .choice-odds span { color: inherit; }
.choice-odds b { color: var(--ink); font-weight: 700; }
.top-decisions .choice strong { padding-right: 0; }
.top-decisions .choice.selected::after { content: none; }
.top-decisions .choice-odds span { display: block; line-height: 1.4; }
.batting-call-note { margin: 7px 0 0; font-size: 11px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.survivor-continue { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; margin-bottom: 20px; background: #edf4ee; border: 1px solid #b5c6b7; border-radius: 10px; }
.survivor-continue strong, .survivor-continue span { display: block; }
.survivor-continue strong { font-size: 18px; font-weight: 800; }
.survivor-continue span { font-size: 12px; margin-top: 4px; line-height: 1.5; }
.survivor-continue button { flex-shrink: 0; }
.upgrade-entry { min-width: 230px; }
.checkout-status { display: block; font-size: 11px; font-weight: 600; line-height: 1.5; margin-top: 8px; }
.survivor-ended { background: #f4f5f1; border-color: var(--line); }
.grade-context { font-weight: 700; line-height: 1.7; }
.grade-comparison { max-height: 310px; overflow: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 8px; }
.grade-comparison table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.grade-comparison th, .grade-comparison td { padding: 10px; border-bottom: 1px solid var(--line); }
.grade-comparison th { background: #f0f3ee; font-weight: 700; position: sticky; top: 0; }
.grade-comparison td:nth-child(n+2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.grade-comparison .your-call { background: #edf4ee; font-weight: 700; }
.grade-comparison small { display: block; font-size: 9px; letter-spacing: .5px; }
@media (max-width: 550px) {
  .top-decisions .choice-odds span { font-size: 9px; }
  .batting-call-note { font-size: 10px; }
  .survivor-continue { align-items: stretch; flex-direction: column; gap: 12px; }
  .survivor-continue button { width: 100%; }
  .playback-decision .button-row { flex-wrap: wrap; justify-content: flex-end; }
}
.tactic { background: #fff; border-color: #d5e1e9; }
.tactic.on { background: var(--action); border-color: var(--action); color: #ffffff; }
.tactic.all-tactics { background: transparent; color: var(--ink); }
.clutch-bar { background: #f0f3ee; border-color: var(--line); color: var(--ink); }
.clutch-bar.hot { background: #f0f3ee; color: var(--ink); border-color: var(--line); }
.clutch-bar.final { background: #f0f3ee; color: var(--ink); border-color: var(--line); }
.clutch-label i { background: var(--action); }
.manager-panel { background: #ffffff; border-top-color: #a7b7a8; }
.live-quality { display: flex; align-items: center; justify-content: center; text-align: center; gap: 13px; padding: 9px 0; }
.live-quality > b { color: var(--ink); }
.manager-style-mini { text-align: center; color: var(--ink); }
.manager-style-mini small { text-align: center; }
.matchup-context { border-top: 3px solid #c6d1c5; }
.model-panel { background: #f2f5f0; border-color: var(--line); text-align: center; }
.prob-head { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-align: center; }
.prob-head > span { font-size: 10px; letter-spacing: 1px; }
.prob-head b { font-size: 42px; line-height: 1; color: var(--ink); font-weight: 800; }
.prob-track { background: #dce5d9; }
.prob-track i { background: var(--action); }
.prob-caption { color: var(--muted); text-align: center; }

/* Equal columns keep every result metric centered at every screen size. */
.result-topline {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 23px; margin: -4px -3px 0; border: 1px solid var(--line); border-radius: 9px;
  background: #f5f7f3; color: var(--ink); border-top: 3px solid var(--team-primary);
}
.result-topline .overline { font-size: 10px; letter-spacing: 1.9px; color: var(--muted); }
.result-topline h2 { color: var(--ink); font: 800 clamp(33px,4vw,50px)/1 var(--font-ui); margin: 9px 0 10px; font-size: 32px; font-weight: 800; letter-spacing: -.8px; line-height: 1.15; }
.result-topline p { font-size: 11px; margin: 0; color: var(--muted); line-height: 1.6; font-weight: 500; }
.result-topline p > span { display: inline-block; background: #e6eee3; color: var(--ink); border-radius: 5px; padding: 2px 7px; margin-left: 5px; font-weight: 700; }
.manager-score {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 0 0 125px; min-width: 0; min-height: 116px; padding: 14px 9px; border-radius: 10px;
  transform: none; background: var(--action); color: #ffffff;
  box-shadow: none; text-align: center;
}
.manager-score strong { display: block; font: 800 66px/.95 var(--font-ui); color: inherit; font-size: 54px; font-weight: 800; letter-spacing: -2px; }
.manager-score span { display: block; font-size: 10px; font-weight: 600; line-height: 1.6; letter-spacing: .2px; margin-top: 8px; color: #ffffff; }
.result-competition {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr);
  align-items: center; gap: 22px; padding: 21px 0 5px;
}
.placement { min-width: 0; }
.placement > span { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; color: var(--ink); }
.placement > strong { display: block; font: 800 43px/1 var(--font-ui); margin: 7px 0; color: var(--ink); font-weight: 800; }
.placement strong > small { font-size: 20px; color: var(--muted); font-weight: 500; }
.placement p { max-width: 270px; font-size: 10px; line-height: 1.7; color: var(--ink); margin: 7px 0 0; }
.quality-breakout { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; align-items: stretch; text-align: center; min-width: 0; }
.quality-breakout > div {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  grid-column: auto; min-width: 0; min-height: 91px; gap: 7px; padding: 13px 6px;
  border-radius: 9px; background: #f5f7f3; border: 1px solid var(--line);
}
.quality-breakout > .metric-bonus { background: #f5f7f3; border-color: #f1dfa7; border: 1px solid var(--line); }
.quality-breakout > .metric-sharp { background: #f5f7f3; border-color: #ddd3f0; border: 1px solid var(--line); }
.quality-breakout strong { display: block; font: 800 33px/1 var(--font-ui); color: var(--ink); font-weight: 800; font-size: 29px; }
.quality-breakout .metric-bonus strong { color: var(--ink); font-weight: 800; font-size: 29px; }
.quality-breakout .metric-sharp strong { color: var(--ink); font-weight: 800; font-size: 29px; }
.quality-breakout span { display: flex; max-width: 100%; font-size: 10px; line-height: 1.4; color: var(--muted); margin: 0; overflow-wrap: normal; font-weight: 600; min-height: 2.8em; align-items: center; justify-content: center; text-align: center; }
.style-card { background: #ffffff; border-color: var(--line); border-top: 3px solid #b5c3b3; }
.style-card h3 { color: var(--ink); font-size: 23px; font-weight: 700; line-height: 1.2; }
.earned-card { background: #f3f6ef; border-color: var(--line); border-top: 3px solid #b5c3b3; }
.earned-card > strong { color: var(--ink); font-weight: 800; }
.earned-card .section-eyebrow { color: var(--muted); }
.earned-card .xp-track { background: #dce5d9; }
.xp-track i { background: var(--action); }
.moment-card.turning { background: #f7f9f5; border-color: var(--line); border-left-color: #829a80; }
.moment-card.learning { background: #f7f9f5; border-color: var(--line); border-left-color: #b6b49e; }
.mission.achieved { background: #f4f7f0; }
.mission { border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.win-chart { background: #ffffff; border-color: var(--line); }
.sharp-streak { background: #eef4e9; color: var(--ink); }
.career-badge.earned { background: #f3f6ef; border-color: #b8c8b4; }
.career-badge.earned > span { background: var(--action); color: #ffffff; border-color: var(--action); box-shadow: 0 0 0 3px #e3ebdd; }

.board-summary > div:nth-child(1) { background: #ffffff; border-color: var(--line); }
.board-summary > div:nth-child(2) { background: #ffffff; border-color: var(--line); }
.board-summary > div:nth-child(3) { background: #ffffff; border-color: var(--line); }
.board-summary > .your-standing { background: #eaf1e6; border-color: #b9cab3; color: var(--ink); }
.board-summary .your-standing span, .board-summary .your-standing small { color: var(--muted); }
.board-tabs { background: #edf0eb; }
.board-tabs button.active { background: var(--action); color: #ffffff; }
.leaderboard-card .is-you { background: #edf3e8; }
.podium-rank { background: #edf1e7; border-color: #bdc9b7; color: var(--ink); }
.score-bin i { background: #c1cfbb; }
.score-bin.your-bin i { background: var(--action); }
.board-career { background: #f2f5ef; border-color: var(--line); }
.run-card {
  background: #234d3b;
  border-top: 3px solid #65806b; color: #ffffff;
}
.run-card .run-counter { color: #ffffff; font-size: 80px; font-weight: 800; }
.run-card .survivor-upgrade { border-top-color: #ffffff38; }
.run-card .survivor-upgrade small { color: #d6e3d3; font-weight: 500; }
.run-card .survivor-upgrade .secondary { background: #ffffff; color: var(--ink); border-color: #ffffff; }
.survivor-hero h1 { color: var(--ink); font-size: clamp(46px,5vw,74px); font-weight: 800; letter-spacing: -2px; line-height: 1.05; }
.survivor-hero > div:first-child > .overline { color: var(--muted); }

.game-format {
  margin: 7px 0 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
}

.club-short {
  display: none;
}

@media (max-width:1100px) {
  .topbar { gap: 15px; }
  .brand-type { font-size: 20px; }
  .brand-type small { letter-spacing: 1px; font-size: 10px; }
  .nav-btn { padding: 9px 12px; }
  .scoreboard { grid-template-columns: minmax(0,1fr) 61px minmax(0,1fr); }
  .team-score { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 13px 12px; }
  .team-score.right { grid-template-columns: auto minmax(0,1fr); }
  .team-score > .team-monogram { display: none; }
  .team-score.right > .team-identity { grid-column: 2; }
  .team-score .name { font-size: 17px; }
  .team-score > strong { font-size: 32px; }
  .result-topline { padding: 18px; }
  .manager-score { flex-basis: 106px; min-height: 103px; }
  .manager-score strong { font-size: 52px; }
  .result-competition { gap: 15px; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); }
  .quality-breakout { gap: 6px; }
  .quality-breakout strong { font-size: 27px; }
  .quality-breakout span { font-size: 10px; }
}
@media (max-width:900px) {
  .topbar {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: 'brand actions' 'nav nav';
    gap: 12px 18px; min-height: 0; height: auto; padding: 13px 0 12px;
  }
  .main-nav { width: 100%; order: 0; padding: 4px; }
  .nav-btn { min-height: 39px; padding: 9px 12px; }
  .brand-type { font-size: 20px; }
  .brand-type small { display: block; font-size: 10px; letter-spacing: 1.3px; }
  .header-actions .icon-btn { width: 35px; height: 35px; }
  .game-heading { margin-top: 17px; }
}
@media (max-width:650px) {
  .game-heading { grid-template-columns: minmax(0,1fr); gap: 11px; margin: 17px 0 13px; }
  .game-heading h1 { font-size: 24px; }
  .game-heading .button-row { justify-content: flex-start; }
  .game-heading .button-row .secondary { min-height: 33px; font-size: 10px; padding: 8px 10px; }
  .scoreboard { grid-template-columns: minmax(0,1fr) 52px minmax(0,1fr); }
  .team-score { min-height: 83px; padding: 13px 11px; gap: 7px; }
  .team-score .name { font-size: 14px; }
  .team-score small { font-size: 10px; letter-spacing: .2px; }
  .team-status { font-size: 10px; }
  .team-score > strong, .team-score.right > strong { font-size: 32px; }
  .inning-score b { font-size: 14px; }
  .inning-score span { font-size: 10px; letter-spacing: .4px; }
  .result-topline { padding: 20px 16px; margin: -3px 0 0; gap: 13px; }
  .result-topline h2 { font-size: 26px; }
  .result-topline p { font-size: 10px; }
  .manager-score { flex-basis: 101px; min-height: 105px; padding: 12px 6px; }
  .manager-score strong { font-size: 46px; }
  .manager-score span { font-size: 10px; letter-spacing: .45px; }
  .result-competition { grid-template-columns: minmax(0,1fr); gap: 16px; padding-top: 20px; }
  .placement { text-align: center; }
  .placement > strong { font-size: 40px; }
  .placement p { max-width: 340px; margin: 7px auto 0; font-size: 10px; }
  .quality-breakout { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; width: 100%; }
  .quality-breakout > div { grid-column: auto; min-height: 84px; padding: 12px 6px; }
  .quality-breakout strong { font-size: 27px; }
  .quality-breakout span { font-size: 10px; }
  .score-formula { text-align: center; font-size: 10px; line-height: 1.7; }
  .result-actions { justify-content: center; }
  .manager-panel, .model-panel { text-align: center; }
}
@media (max-width:420px) {
  .topbar { gap: 10px 10px; padding: 12px 0 11px; }
  .brand { gap: 8px; }
  .brand-mark { width: 33px; height: 36px; font-size: 27px; border-radius: 9px; }
  .brand-mark:after { width: 24px; height: 24px; }
  .brand-type { font-size: 16px; line-height: 1; }
  .brand-type small { font-size: 10px; letter-spacing: .7px; margin-top: 4px; }
  .header-actions { gap: 5px; }
  .header-actions .help-button { display: none; }
  .header-actions .icon-btn { width: 33px; height: 33px; }
  .account-button { font-size: 10px; padding: 8px 10px; min-height: 34px; }
  .nav-btn { min-height: 37px; padding: 9px 6px; font-size: 11px; gap: 6px; }
  .nav-btn .icon { width: 14px; height: 14px; }
  .nav-btn span { display: inline; }
  .game-heading h1 { font-size: 22px; }
  .team-score { gap: 6px; padding: 12px 9px; min-height: 82px; }
  .team-score .name { font-size: 15px; }
  .team-score small { font-size: 10px; }
  .team-score > strong, .team-score.right > strong { font-size: 29px; }
  .result-topline { padding: 19px 13px; gap: 10px; }
  .result-topline h2 { font-size: 23px; }
  .result-topline .overline { font-size: 10px; letter-spacing: 1.4px; }
  .result-topline p > span { display: block; width: fit-content; margin: 5px 0 0; }
  .manager-score { flex-basis: 86px; min-height: 100px; padding: 12px 6px; }
  .manager-score strong { font-size: 40px; }
  .manager-score span { font-size: 10px; letter-spacing: .3px; }
  .quality-breakout { gap: 6px; }
  .quality-breakout strong { font-size: 27px; }
  .quality-breakout span { font-size: 10px; }
}
@media (max-width:650px) {
  .brand-type small {
    display: none;
  }
  .club-long {
    display: inline;
  }
  .club-short {
    display: none;
  }
  .survivor-hero h1 {
    font-size: 54px;
  }
}
@media (max-width:420px) {
  .club-long {
    display: none;
  }
  .club-short {
    display: inline;
  }
}
