/* =====================================================
   13 RUN LEAGUE — Classic Baseball Theme (Cream & Red)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* ── Cream palette ── */
  --bg:        #f5f0e4;
  --bg-warm:   #efe9da;
  --surface:   #faf7f0;
  --card:      #ffffff;
  --card-alt:  #fdfcf8;
  --stroke:    rgba(139,32,53,.10);
  --stroke2:   rgba(139,32,53,.18);

  /* ── Text ── */
  --text:      #2a1f1a;
  --text-sec:  #5a4a3e;
  --muted:     #8a7968;
  --dim:       rgba(42,31,26,.45);

  /* ── Baseball red ── */
  --red:       #c41e3a;
  --red-dark:  #8b2035;
  --red-light: #e8304a;
  --red-glow:  rgba(196,30,58,.12);

  /* ── Score states ── */
  --new:       #1a8a50;
  --new-dark:  #126e3c;
  --new-bg:    #e0f5ea;
  --repeat:    #c48820;
  --repeat-dark:#9a6a10;
  --repeat-bg: #faf0d8;
  --owned:     #4a7ab8;
  --owned-dark:#36608e;
  --owned-bg:  #e4eef8;

  /* ── Accent (red) ── */
  --accent:    var(--red);
  --accent2:   var(--red-dark);

  /* ── Radii ── */
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ── Shadows ── */
  --shadow-card: 0 2px 8px rgba(80,40,20,.06), 0 8px 28px rgba(80,40,20,.08);
  --shadow-lg:   0 4px 12px rgba(80,40,20,.08), 0 16px 44px rgba(80,40,20,.12);
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

button { font: inherit; }
img    { display: block; }

/* ─── Warm linen texture ───────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(196,30,58,.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(196,30,58,.03) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139,32,53,.012) 2px,
      rgba(139,32,53,.012) 4px
    );
  pointer-events: none;
}

/* ─── Home Button ───────────────────────────────────── */
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  padding: 7px 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke2);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-card);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.home-btn:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.home-btn span { font-size: 12px; }

/* ─── App Shell ─────────────────────────────────────── */
.app-shell {
  width: min(1650px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

/* ─── Card ──────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

/* ─── Hero Banner ───────────────────────────────────── */
.hero-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  overflow: hidden;
  transform: translateZ(0);
  transition: transform .4s ease;
}
.hero-banner:hover { transform: scale(1.005); }

.hero-logo {
  display: none;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.hero-logo-desktop { display: block; max-width: 1400px; }
.hero-logo-mobile  { display: none;  max-width: 720px; }

@keyframes heroPulse13 {
  0%   { box-shadow: var(--shadow-lg); transform: scale(1); }
  30%  { box-shadow: 0 8px 30px rgba(196,30,58,.18), 0 0 50px rgba(196,30,58,.10); transform: scale(1.008); }
  100% { box-shadow: var(--shadow-lg); transform: scale(1); }
}
.hero-banner.is-hot img { animation: heroPulse13 1.3s ease; }

/* ─── Board Toolbar ─────────────────────────────────── */
.board-toolbar.card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--stroke2);
  box-shadow: var(--shadow-card);
  margin: 0 0 14px;
}

.board-toolbar-top {
  padding: 10px 16px;
  background: var(--red-dark);
  border-bottom: 1px solid rgba(139,32,53,.30);
}

.board-toolbar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
}

.board-toolbar-left { flex: 0 0 auto; }

.board-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ─── League Label ──────────────────────────────────── */
.league-label {
  font-family: Bitter, Georgia, serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red-dark);
}

/* ─── Live Ticker ───────────────────────────────────── */
.live-ticker-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.live-ticker-label {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fce4e8;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.20);
}

.live-ticker-track {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  color: #fce8eb;
  font-weight: 700;
  font-size: 14px;
}

.ticker-marquee {
  overflow: hidden;
  position: relative;
}
.ticker-marquee-inner {
  display: inline-block;
  white-space: nowrap;
  animation: tickerScroll 28s linear infinite;
}
.ticker-marquee-inner:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 0;
}
.ticker-team   { font-weight: 800; color: #fff; }
.ticker-score  { font-weight: 900; color: #ffd4da; }
.ticker-at     { color: rgba(255,255,255,.6); }
.ticker-status { color: rgba(255,255,255,.65); font-size: 13px; }
.ticker-dot    { color: rgba(255,255,255,.4); margin-left: 4px; }
.ticker-section{ text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: rgba(255,255,255,.55); }
.ticker-item.is-empty { color: rgba(255,255,255,.5); }

/* Bases & outs in ticker */
.bo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}
.bo-svg { overflow: visible; }
.is-mini .bo-svg { width: 22px; height: 18px; }
.is-full .bo-svg { width: 32px; height: 26px; }
.bo-outs {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bo-out {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(42,31,26,.12);
  border: 1px solid rgba(42,31,26,.18);
}
.bo-out.is-on {
  background: var(--repeat);
  border-color: var(--repeat-dark);
  box-shadow: 0 0 4px rgba(196,136,32,.5);
}

/* ─── Info Pills ────────────────────────────────────── */
.info-pill {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 42px;
  padding: 7px 12px;
  border-radius: var(--radius);
  background: var(--bg-warm);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.pill-label {
  font-size: 9px;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--red);
  margin-bottom: 3px;
}
.pill-value {
  font-size: 14px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
}
.info-pill-sync .pill-value { font-size: 13px; }

/* ─── Leader scroll (tied leaders) ─────────────────── */
.pill-value.leader-scroll {
  overflow: hidden;
  max-width: 140px;
  position: relative;
}
.leader-scroll-track {
  display: inline-flex;
  white-space: nowrap;
  animation: leaderMarquee calc(var(--leader-count, 2) * 3s) linear infinite;
}
.leader-scroll-item {
  flex-shrink: 0;
  padding-right: 24px;
}
@keyframes leaderMarquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Legend ────────────────────────────────────────── */
.legend-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 700;
}
.swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.swatch-new    { background: linear-gradient(180deg, var(--new), var(--new-dark)); }
.swatch-repeat { background: linear-gradient(180deg, var(--repeat), var(--repeat-dark)); }
.swatch-owned  { background: linear-gradient(180deg, var(--owned), var(--owned-dark)); }
.swatch-miss   { background: var(--bg-warm); border: 1px dashed rgba(139,32,53,.25); }

/* ─── Board Wrap ────────────────────────────────────── */
.board-wrap.card {
  width: 100%;
  max-width: none;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--stroke2);
}

.board-head-standings {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 0 16px;
}
.standings-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.standings-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: Bitter, Georgia, serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.standings-kicker::before {
  content: "\26BE";  /* baseball */
  font-size: 14px;
  margin-right: 10px;
}
.standings-rule {
  flex: 1;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--red) 0%,
    rgba(196,30,58,.20) 40%,
    transparent 100%
  );
  border-radius: 999px;
}
.standings-rule::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 44px;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--red));
  border-radius: 999px;
}

/* ─── Table Scroller ────────────────────────────────── */
.table-scroller {
  width: 100%;
  max-width: none;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  scrollbar-width: thin;
  scrollbar-color: rgba(196,30,58,.18) transparent;
}
.table-scroller::-webkit-scrollbar        { height: 6px; }
.table-scroller::-webkit-scrollbar-track  { background: transparent; }
.table-scroller::-webkit-scrollbar-thumb  {
  background: rgba(196,30,58,.18);
  border-radius: 999px;
}

/* ─── Board Table ───────────────────────────────────── */
.board-table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}

.board-table th,
.board-table td {
  padding: 0;
  border-bottom: 1px solid rgba(139,32,53,.06);
  text-align: center;
  white-space: nowrap;
}

.board-table th {
  height: 44px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red-dark);
  position: sticky;
  top: 0;
  z-index: 3;
}

.board-table td {
  height: 54px;
  font-size: 15px;
}

.board-table tbody tr {
  background: var(--card);
  transition: background .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.board-table tbody tr:nth-child(even) {
  background: var(--bg-warm);
}
.board-table tbody tr:hover {
  background: #fdf4e8;
  box-shadow: inset 0 0 0 1px rgba(196,30,58,.12);
}
.board-table tbody tr.is-favorite {
  background: rgba(196,136,32,.06);
}

/* Sticky rank column only */
.board-table .sticky-col {
  position: sticky;
  z-index: 2;
  background: inherit;
}
.board-table .sticky-rank {
  left: 0;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
  box-shadow: 4px 0 12px rgba(80,40,20,.06);
  background: var(--red-dark);
  color: #fff;
  font-weight: 800;
}
.board-table thead th.sticky-rank {
  z-index: 30;
  background: var(--red-dark);
}
.board-table tbody td.sticky-rank {
  z-index: 20;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.board-table tbody tr:nth-child(even) td.sticky-rank {
  background: var(--red-dark);
}

/* Name is NOT sticky */
.board-table .sticky-team {
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ─── Table Cells ───────────────────────────────────── */
.team-name {
  text-align: left;
  padding: 0 12px;
  font-weight: 700;
  color: var(--text);
}
.team-code {
  color: var(--red-dark);
  font-weight: 800;
  padding: 0 10px;
  font-size: 13px;
}
.gp-cell,
.hits-cell  { padding: 0 8px; }

.hits-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--red);
  border: 1px solid var(--red-dark);
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

/* ─── Favorite Button ───────────────────────────────── */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 5px 0 0;
  color: rgba(42,31,26,.22);
  vertical-align: middle;
  transition: color .15s;
}
.fav-btn:hover  { color: var(--repeat); }
.fav-btn.is-active { color: var(--repeat); }

/* ─── Score Cells ───────────────────────────────────── */
.score-td {
  width: 34px;
  min-width: 34px;
  padding: 0 2px;
  background: transparent !important;
}

.score-cell {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  background: var(--owned-bg);
  border: 1px solid rgba(74,122,184,.20);
  color: var(--owned-dark);
}

.score-new {
  background: linear-gradient(180deg, #22a85e, #18884a);
  border-color: rgba(34,168,94,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.15),
    0 0 0 1px rgba(34,168,94,.20),
    0 2px 8px rgba(34,168,94,.16);
  color: #fff;
}
.score-repeat {
  background: linear-gradient(180deg, #d49420, #a87410);
  border-color: rgba(212,148,32,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.15),
    0 0 0 1px rgba(212,148,32,.18),
    0 2px 8px rgba(212,148,32,.14);
  color: #fff;
}
.score-owned {
  background: var(--owned-bg);
  border-color: rgba(74,122,184,.22);
  color: var(--owned-dark);
}
.score-miss {
  background: var(--bg-warm);
  border: 1px dashed rgba(139,32,53,.16);
  box-shadow: none;
}
.score-miss .val { visibility: hidden; }
.score-last {
  outline: 2px solid var(--red);
  outline-offset: -1px;
  box-shadow: 0 0 10px rgba(196,30,58,.18);
}

/* ─── Pulse animation ───────────────────────────────── */
@keyframes tilePulseNew {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(34,168,94,0); }
  35%  { transform: scale(1.10); box-shadow: 0 0 0 2px rgba(34,168,94,.40), 0 0 14px rgba(34,168,94,.28); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(34,168,94,0); }
}
.pulse-tile-new { animation: tilePulseNew .85s ease; }

/* ─── Modal ─────────────────────────────────────────── */
.team-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 920px;
  width: calc(100% - 32px);
}
.team-modal::backdrop {
  background: rgba(42,31,26,.55);
  backdrop-filter: blur(8px);
}
.team-modal-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--stroke2);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--stroke2);
  background: var(--bg-warm);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover {
  background: var(--red);
  color: #fff;
}

/* ─── Modal Hero ─────────────────────────────────────── */
.team-scoreboard-hero.modern-hero {
  padding: 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(196,30,58,.06) 0%, transparent 50%),
    var(--bg-warm);
  border: 1px solid var(--stroke2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), var(--shadow-card);
  margin-bottom: 0;
}
.team-scoreboard-hero.modern-hero.is-complete {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    var(--shadow-card),
    0 0 20px rgba(26,138,80,.14);
  border-color: rgba(26,138,80,.30);
}

.modern-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modern-hero-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.modern-hero-abbr {
  font-family: Bitter, Georgia, serif;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--red-dark);
}
.modern-hero-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.modern-hero-stats {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.modern-stat {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.modern-stat-value {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}
.modern-stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.modern-hero-bottom { margin-top: 14px; }
.modern-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sec);
}
.progress-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.team-scoreboard-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(139,32,53,.08);
  overflow: hidden;
}
.team-scoreboard-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ─── Scoreboard Grid (modal) ───────────────────────── */
.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 8px;
  margin-top: 14px;
}

.scoreboard-cell {
  min-height: 60px;
  border-radius: 10px;
  padding: 7px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: var(--owned-bg);
  border: 1px solid rgba(74,122,184,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.scoreboard-cell.score-new    { background: linear-gradient(180deg, #22a85e, #18884a); border-color: rgba(34,168,94,.25); color: #fff; }
.scoreboard-cell.score-repeat { background: linear-gradient(180deg, #d49420, #a87410); border-color: rgba(212,148,32,.25); color: #fff; }
.scoreboard-cell.score-miss   { background: var(--bg-warm); border: 1px dashed rgba(139,32,53,.16); }
.scoreboard-cell.score-miss .scoreboard-val { visibility: hidden; }
.scoreboard-cell.score-last   {
  box-shadow:
    0 0 0 2px var(--red),
    inset 0 1px 0 rgba(255,255,255,.5);
}

.scoreboard-num {
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  color: inherit;
}
.scoreboard-cell.score-new .scoreboard-num,
.scoreboard-cell.score-repeat .scoreboard-num { color: rgba(255,255,255,.85); }
.scoreboard-cell.score-miss .scoreboard-num   { color: var(--muted); }
.scoreboard-runs {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .10em;
  color: inherit;
  opacity: .7;
  text-transform: uppercase;
}
.scoreboard-val {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  color: inherit;
}
.scoreboard-cell.score-new .scoreboard-val,
.scoreboard-cell.score-repeat .scoreboard-val { color: #fff; }

/* ─── Modal Block / Score List ──────────────────────── */
.modal-block { margin-top: 22px; }

.block-title {
  font-family: Bitter, Georgia, serif;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
  font-weight: 700;
}

.score-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(196,30,58,.18) transparent;
}
.score-list::-webkit-scrollbar       { width: 6px; }
.score-list::-webkit-scrollbar-track { background: transparent; }
.score-list::-webkit-scrollbar-thumb { background: rgba(196,30,58,.18); border-radius: 999px; }

/* ─── Games Timeline ────────────────────────────────── */
.games-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.games-block { display: flex; flex-direction: column; gap: 8px; }
.games-block-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 2px;
}

/* ─── Game Card ─────────────────────────────────────── */
.game-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color .18s, box-shadow .18s;
}
.game-card.result-win {
  border-color: rgba(26,138,80,.60);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(26,138,80,.12);
}
.game-card.result-loss {
  border-color: rgba(196,30,58,.50);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(196,30,58,.10);
}
.game-card.result-other {
  border-color: rgba(196,136,32,.60);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(196,136,32,.10);
}
.game-card.is-focus {
  border-color: rgba(196,30,58,.35);
  box-shadow: var(--shadow-lg);
}
.game-card.is-live-focus {
  border-color: rgba(26,138,80,.45);
  box-shadow: var(--shadow-lg), 0 0 14px rgba(26,138,80,.12);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--stroke);
}
.game-card-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-state {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.game-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* Bases in game card */
.game-bases-mobile,
.game-bases-shared { display: inline-flex; align-items: center; }

/* ─── Game Scoreboard ───────────────────────────────── */
.game-scoreboard {
  padding: 10px 14px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.game-scoreboard::-webkit-scrollbar { display: none; }
.game-scoreboard.has-shared-bases {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow: visible;
}

.game-rhe-head,
.game-team-row {
  display: grid;
  align-items: center;
}
.game-rhe-head {
  padding: 0 0 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
}
.game-rhe-head > span,
.game-col {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}
.game-team-row {
  min-height: 40px;
  border-top: 1px solid rgba(139,32,53,.06);
}
.game-team-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}
.game-team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.game-team-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.game-team-row.is-user .game-team-name { color: var(--red); }
.game-col {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}
.game-empty {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-warm);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 14px;
}

/* ─── Misc / Chips ──────────────────────────────────── */
.complete-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, #22a85e, #18884a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 14px rgba(26,138,80,.20);
}
.missing-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg-warm);
  border: 1px solid var(--stroke);
}

/* ─── Game Grid Rows (bases layout) ─────────────────── */
.game-grid-rows {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.game-grid-rows::-webkit-scrollbar { display: none; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .board-toolbar-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  .board-toolbar-right { justify-content: flex-start; }
  .legend-inline       { margin-left: 0; }
}

@media (max-width: 700px) {
  .home-btn { top: 10px; left: 10px; padding: 6px 10px; font-size: 12px; }

  .app-shell      { padding: 60px 0 30px; }
  .hero-banner    { margin: 0 0 10px; padding: 0 8px; }
  .hero-logo-desktop { display: none; }
  .hero-logo-mobile  { display: block; width: 100%; max-width: 100%; }

  .board-toolbar.card { border-radius: var(--radius-lg); }
  .board-toolbar-top  { padding: 8px 10px; }
  .board-toolbar-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }
  .board-toolbar-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .board-toolbar-right {
    display: grid;
    grid-template-columns: auto auto minmax(0,1fr);
    gap: 6px;
    align-items: stretch;
    width: 100%;
  }

  .info-pill        { min-height: 34px; padding: 5px 8px; border-radius: 10px; }
  .pill-label       { font-size: 8px; letter-spacing: .10em; }
  .pill-value       { font-size: 12px; }
  .info-pill-sync   { min-width: 0; }
  .info-pill-sync .pill-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .legend-inline {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
  }
  .legend-inline::-webkit-scrollbar { display: none; }
  .legend-inline span { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }

  /* Board */
  .board-wrap.card {
    padding: 14px 0 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .board-head-standings { padding: 0 14px 14px; }
  .table-scroller       { border-radius: 0; margin: 0; padding: 0; border-left: none; border-right: none; }

  .board-table          { min-width: 840px; }
  .board-table th       { height: 38px; font-size: 10px; }
  .board-table td       { height: 48px; font-size: 14px; }

  .board-table td:nth-child(2),
  .board-table th:nth-child(2) { max-width: 120px; width: 120px; }
  .board-table td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
  .board-table td:nth-child(3),
  .board-table th:nth-child(3) { width: 48px; min-width: 48px; }
  .board-table td:nth-child(4),
  .board-table th:nth-child(4) { width: 44px; min-width: 44px; }

  .hits-pill { min-width: 44px; padding: 5px 8px; font-size: 13px; }

  .score-td   { width: 30px; min-width: 30px; }
  .score-cell { width: 30px; height: 30px; font-size: 12px; border-radius: 5px; }

  /* Modal */
  .team-modal-card { padding: 16px; }
  .modern-hero-abbr { font-size: 28px; }
  .modern-hero-stats { gap: 6px; }
  .modern-stat      { min-width: 52px; padding: 6px 8px; }
  .modern-stat-value{ font-size: 16px; }

  .scoreboard-grid  { gap: 5px; }
  .scoreboard-cell  { min-height: 52px; padding: 5px 2px 6px; border-radius: 8px; }
  .scoreboard-num   { font-size: 10px; }
  .scoreboard-val   { font-size: 15px; }

  .game-card-top  { padding: 8px 12px; }
  .game-scoreboard{ padding: 8px 10px 10px; }
  .game-team-logo { width: 16px; height: 16px; }
  .game-team-name { display: none; }
  .game-col       { font-size: 13px; }
  .game-team-row  { min-height: 34px; }

  .score-list { scrollbar-width: none; }
  .score-list::-webkit-scrollbar { display: none; }
}

@media (max-width: 500px) {
  .app-shell { padding-top: 56px; }
  .modern-hero-stats { display: none; }
}
