/* =====================================================================
   MLB Scoreboard page — builds on css/styles.css design tokens.
   Mobile-first.
   ===================================================================== */

.mlb-page { background: #eef2f7; }
.mlb-header .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mlb-header .title-block { display: flex; flex-direction: column; align-items: flex-start; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: rgba(255,255,255,.85); text-decoration: none; font-size: .8rem; font-weight: 700; letter-spacing: .02em; margin-bottom: 3px; }
.back-link:hover { color: #fff; text-decoration: underline; }
.back-link:focus-visible { outline: 2px solid var(--mets-orange); outline-offset: 2px; border-radius: 4px; }
.mlb-title { font-size: clamp(1.2rem, 6vw, 1.6rem); }
.t-mlb { color: var(--gold); }
.mlb-main { padding-top: 12px; }

/* ----- date navigator ----- */
.date-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 14px; }
.date-label { min-width: 200px; text-align: center; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.date-label strong { font-size: 1rem; color: var(--ink); }
.today-btn { border: 1px solid var(--mets-blue); background: #fff; color: var(--mets-blue); border-radius: 999px; font: inherit; font-size: .72rem; font-weight: 700; padding: 1px 10px; cursor: pointer; }

/* ----- scoreboard list ----- */
.scoreboard-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-soft); font-size: .9rem; }

.game-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: 12px 14px; cursor: pointer; transition: box-shadow .15s, transform .05s; }
.game-card:hover { box-shadow: var(--shadow); }
.game-card:active { transform: scale(.997); }
.game-card:focus-visible { outline: 2px solid var(--mets-orange); outline-offset: 2px; }
.game-card.is-live { border-left: 4px solid #e23636; }
.game-card.is-final { opacity: .92; }
.game-card.is-limbo { opacity: .9; border-left: 4px solid #b6c1cf; }
.gc-status.limbo { color: #8a5a00; }

.gc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gc-status { font-size: .72rem; font-weight: 800; letter-spacing: .03em; color: var(--ink-soft); text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; }
.gc-status.final { color: #6b7688; }
.gc-status.live { color: #e23636; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #e23636; display: inline-block; animation: lpulse 1.3s ease-in-out infinite; }
@keyframes lpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.gc-venue { font-size: .68rem; color: #9aa6b4; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }

.team-line { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.tlogo { object-fit: contain; flex: none; }
.tl-meta { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.tl-abbr { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.tl-rec { font-size: .72rem; color: var(--ink-soft); }
.tl-score { font-size: 1.5rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; }
.tl-score.win { color: var(--mets-blue); }

.gc-rhe { font-size: .72rem; color: var(--ink-soft); margin-top: 6px; font-variant-numeric: tabular-nums; }
.gc-prob { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: .76rem; color: var(--ink-soft); }
.gc-prob .vs { color: #c4cdd6; }

/* live state row */
.live-state { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.ls-count { font-weight: 800; font-size: .9rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.ls-outs { font-size: .74rem; color: var(--ink-soft); }
.ls-matchup { font-size: .76rem; color: var(--ink-soft); }
.ls-matchup b { color: var(--ink); }
.ls-matchup .vs { color: #c4cdd6; }
.bases { position: relative; width: 22px; height: 22px; display: inline-block; flex: none; }
.base { position: absolute; width: 7px; height: 7px; background: #d3dbe5; border: 1px solid #b6c1cf; transform: rotate(45deg); }
.base.on { background: var(--mets-orange); border-color: var(--mets-orange); }
.base-second { top: 0; left: 50%; margin-left: -3.5px; }
.base-first { right: 0; top: 50%; margin-top: -3.5px; }
.base-third { left: 0; top: 50%; margin-top: -3.5px; }

.gc-tap { margin-top: 9px; font-size: .68rem; color: var(--mets-orange); font-weight: 700; text-align: right; }

/* ----- box score detail overlay ----- */
body.detail-open { overflow: hidden; }
.detail-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(12,35,64,.4); display: flex; align-items: stretch; justify-content: center; }
.detail-backdrop[hidden] { display: none; }
.detail-sheet { background: #fff; width: 100%; max-width: 720px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 0 40px; }
.detail-head { position: sticky; top: 0; z-index: 2; background: linear-gradient(120deg, var(--mets-blue), var(--yanks-navy)); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.detail-head .btn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: transparent; }
.detail-score { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; }
.ds-team { display: flex; align-items: center; gap: 7px; }
.ds-team.end { flex-direction: row; }
.ds-abbr { font-weight: 800; font-size: 1rem; }
.ds-score { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ds-at { opacity: .6; font-size: .8rem; }
.detail-head .status-pill { flex: none; }

.team-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); position: sticky; top: 56px; background: #fff; z-index: 1; }
.team-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 8px; border: none; background: none; font: inherit; font-weight: 700; color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.team-tab.active { color: var(--mets-blue); border-bottom-color: var(--mets-orange); }

.box-body { padding: 6px 0 0; }
.box-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.box-table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 460px; }
.box-table thead th { background: #f3f6fa; color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.box-table td { padding: 7px 6px; text-align: right; border-bottom: 1px solid #eef2f6; font-variant-numeric: tabular-nums; color: var(--ink); }
.box-table .c-num { width: 22px; text-align: center; color: var(--ink-soft); }
.box-table .c-name { text-align: left; min-width: 150px; position: sticky; left: 0; background: #fff; }
.box-table thead .c-name { background: #f3f6fa; text-align: left; }
.box-table .c-sea { color: var(--ink-soft); }
.bname { font-weight: 600; }
.bpos { font-size: .68rem; color: var(--ink-soft); font-style: italic; margin-left: 5px; }
.sub-row .c-name { padding-left: 14px; }
.sub-row td { color: var(--ink-soft); }
.totals-row td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: none; background: #fafbfc; }
.totals-row .c-name { background: #fafbfc; }

.box-notes { padding: 10px 14px; font-size: .76rem; color: #56627a; border-bottom: 1px solid var(--line); }
.note-title { font-weight: 800; color: var(--ink); margin: 8px 0 3px; font-size: .72rem; letter-spacing: .03em; }
.note-line { margin: 2px 0; line-height: 1.35; }
.note-line b { color: var(--ink); }
.note-sub { margin: 2px 0; font-style: italic; }

.bench-wrap { margin: 6px 0; border-top: 1px solid var(--line); }
.bench-wrap summary { padding: 9px 14px; font-weight: 700; font-size: .8rem; color: var(--mets-blue); cursor: pointer; }

.game-info { padding: 12px 14px 0; }
.gi-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin: 6px 0 8px; }
.gi-grid { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: #56627a; }
.gi-row b { color: var(--ink); }

@media (min-width: 620px) {
  .scoreboard-list { grid-template-columns: 1fr 1fr; }
  .detail-backdrop { padding: 24px; align-items: flex-start; }
  .detail-sheet { border-radius: var(--radius); max-height: calc(100vh - 48px); box-shadow: var(--shadow); }
}
