/* game-preview.css — the Game Preview panel (js/game-preview.js), shown when
   a coach expands a game that hasn't been played yet on Scores or Schedule.

   Everything is scoped under .gp-panel, the wrapper panelHtml() emits, so the
   module carries its own styling wherever it's mounted. The comparison grids
   deliberately reuse index.html's .h2h-overview* classes rather than
   redefining them -- the point is that this reads as the same product as the
   Pre-Scout Prep tabs, so those boxes should stay pixel-identical to them and
   follow along automatically if they ever change. Only what's genuinely new
   here is defined below. */

/* Declared rather than inherited, matching every other module root in the app
   (.pace-root, #so-root, #fo-root, #situations-root all do the same). It
   resolves to the identical Rubik the panel already picked up from body, so
   this changes nothing on screen -- it just stops the panel depending on an
   ancestor for its type, which is the thing that bit the Pace Chart when it
   was moved and had to be made self-contained (see its note in CLAUDE.md).
   Rubik is the whole panel: DM Mono is reserved for the main dashboard's
   compare/rank widgets (.rank, .compare-val, .stat-rank-val) and Rift for
   italic display headings, neither of which this panel has. */
.gp-panel {
  font-family: 'Rubik', sans-serif;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* .lg-detail-panel has no top padding of its own -- it was built to sit flush
   under a score card whose own content already ends in whitespace. */
.gp-panel.lg-detail-panel { padding-top: 0.85rem; }

/* ── Matchup header ─────────────────────────────────────────────────────── */
.gp-panel .gp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.gp-panel .gp-side { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
/* Both logos flank the centre column, scoreboard-style: the away block packs
   right as [text][logo], the home block packs left as [logo][text]. */
.gp-panel .gp-side-away { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
.gp-panel .gp-side-home { flex-direction: row; justify-content: flex-start; text-align: left; }
.gp-panel .gp-side-text { min-width: 0; }
.gp-panel .gp-logo {
  width: 38px; height: 38px; flex-shrink: 0;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  display: inline-block;
}
.gp-panel .gp-logo-sm {
  width: 15px; height: 15px; flex-shrink: 0; vertical-align: -3px; margin-right: 3px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  display: inline-block;
}
.gp-panel .gp-team-name {
  font-size: 1rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-panel .gp-team-sub { font-size: 0.76rem; color: var(--text2); line-height: 1.4; }
.gp-panel .gp-team-sub.gp-dim { color: var(--text3); font-size: 0.72rem; }

.gp-panel .gp-center { text-align: center; padding: 0 0.5rem; }
.gp-panel .gp-at { font-size: 1.1rem; font-weight: 700; color: var(--text3); line-height: 1.1; }
.gp-panel .gp-score { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.gp-panel .gp-score-dash { color: var(--text3); margin: 0 0.35rem; font-weight: 400; }
.gp-panel .gp-final {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text3);
}
.gp-panel .gp-final.gp-live { color: #d11f1f; }
.gp-panel .gp-when { font-size: 0.8rem; font-weight: 600; margin-top: 0.15rem; white-space: nowrap; }
.gp-panel .gp-where { font-size: 0.72rem; color: var(--text3); }

/* ── Schedule-situation chips ───────────────────────────────────────────── */
.gp-panel .gp-chips {
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem;
  justify-content: center; margin-top: 0.45rem;
}
.gp-panel .gp-chip-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.gp-panel .gp-chip-team {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text2); text-transform: uppercase;
}
.gp-panel .gp-chip {
  font-size: 0.68rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 8px; color: var(--text2);
}
/* A compressed schedule is a real edge, so it gets the app's "notable"
   treatment rather than sitting in the neutral chip style. Blue, not green --
   see the diverging-scale note on :root in index.html. */
.gp-panel .gp-chip-flag {
  background: var(--good-bg); border-color: transparent;
  color: var(--good-text); font-weight: 600;
}

.gp-panel .gp-season-note {
  font-size: 0.72rem; color: var(--text3); text-align: center; margin-top: 0.35rem;
}

/* ── Grid rows ──────────────────────────────────────────────────────────── */
/* auto-fit rather than the parent's fixed 1fr 1fr so a row holding a single
   box (no scoring leaders on a finished game, say) fills the width instead of
   leaving a hole, and so the whole panel stacks on a narrow viewport. */
.gp-panel .gp-wrapper {
  margin-top: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}
/* The shared grid reserves up to 190px for its label column, which is more
   than any label in this panel needs and comes straight out of the two value
   columns -- where a stacked leaders cell is fighting for every pixel. */
.gp-panel .h2h-overview-grid { grid-template-columns: minmax(130px, 168px) minmax(0, 1fr) minmax(0, 1fr); }
/* ── Vertical chrome ─────────────────────────────────────────────────────
   Measured at 1440 before touching any of this: of the panel's 2260px, 807
   was header chrome -- 14 grid headers at 24px, 10 unit headers at 21, 10 box
   titles at 17.5, plus box padding and row gaps. Every reduction below is
   padding or margin, never font-size: the headers are already at 9.9-11.5px
   and a coach reading a stat table at a glance is the wrong place to go
   smaller. All of it is scoped to .gp-panel -- the Pre-Scout tabs share
   .h2h-overview*, and this panel is the one with ten boxes stacked in it. */
.gp-panel .h2h-overview-title {
  margin-bottom: 0.22rem;
  padding-bottom: 0.18rem;
}
/* 12px top and bottom inside every one of ten boxes is 240px of the panel. */
.gp-panel .h2h-overview { padding: 0.5rem 0.7rem; }
/* Six rows at 1rem apart. */
.gp-panel .h2h-overview-wrapper { margin-top: 0.5rem; gap: 0.5rem; }
/* The single biggest line item: 14 of these. */
.gp-panel .h2h-ov-header { padding: 0.1rem 0.4rem 0.15rem; }
.gp-panel .h2h-ov-cell,
.gp-panel .h2h-ov-label { padding: 0.22rem 0.4rem; }
/* Lets a title carry a right-hand detail on the same line (LAST GAME puts
   which game it was there, rather than on a line of its own). */
.gp-panel .gp-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gp-panel .gp-raw { font-size: 0.68rem; color: var(--text3); font-weight: 400; }

/* ── Last-5 result pills ────────────────────────────────────────────────── */
.gp-panel .gp-pill {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0 3px; min-width: 22px; text-align: center;
  background: var(--surface);
}
.gp-panel .gp-pill + .gp-pill { margin-left: 2px; }

/* ── Leaders ────────────────────────────────────────────────────────────── */
/* Each cell holds the team's top few in that category rather than one name,
   so it stacks instead of inheriting .h2h-ov-cell's centred single row. */
/* The cell IS the grid, so its three `auto` columns size to the widest of the
   entries actually in it -- the value sits right against the name rather than
   across a column sized for a name that isn't there. justify-content centres
   the whole block under its column header. */
.gp-panel .gp-leader-cell {
  display: grid;
  grid-template-columns: auto auto auto auto;
  justify-content: center;
  align-content: center;
  gap: 0 7px;
  padding: 0.22rem 0.35rem;
}
.gp-panel .gp-leader-cell-empty { display: flex; justify-content: center; }
/* Four data columns: each team's forwards and defencemen side by side. The
   two-tier header puts the team on top spanning its pair, the position group
   underneath. */
/* Four columns of jersey + name + prior club + value have a real floor --
   measured at 1034px for the widest real entry ("#2 L. Schenn WPG,BUF 43"), so
   1040 with a little slack. Below it something has to give, and truncating
   either "R. Nugent-Hopkins" or the club a newcomer's numbers belong to loses
   the thing being read. So the grid keeps the width it needs and the box
   scrolls instead. Above the floor this is inert: the columns stretch and
   nothing scrolls. Re-measure this if a column is ever added. */
.gp-panel .gp-leader-scroll { overflow-x: auto; }
.gp-panel .gp-leader-grid {
  display: grid;
  grid-template-columns: minmax(96px, 150px) repeat(4, minmax(0, 1fr));
  gap: 0;
  min-width: 1040px;
}
.gp-panel .gp-lead-corner { border-bottom: 1px solid var(--border); }
.gp-panel .gp-lead-team {
  grid-column: span 2;
  text-align: center;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.05rem 0.5rem 0.15rem;
}
.gp-panel .gp-lead-sub { text-align: center; font-size: 0.62rem; color: var(--text3); }
/* With four similar columns there is otherwise nothing marking where one team
   ends and the other begins. */
.gp-panel .gp-lead-split { border-left: 1px solid var(--border); }

/* 1.65 across 21 stacked entries made LEADERS the tallest box on the panel by
   a distance; 1.42 still clears the descenders at this size and takes ~50px
   out of it. Not a header, but it is the biggest single block a coach has to
   scroll past. */
.gp-panel .gp-leader-cell > span { font-size: 0.76rem; line-height: 1.42; white-space: nowrap; }
.gp-panel .gp-leader-num { font-size: 0.68rem; color: var(--text3); font-weight: 400; text-align: right; }
.gp-panel .gp-leader-name { font-weight: 500; text-align: left; }
/* Where a newcomer's numbers were actually earned. Muted and small: it's a
   qualifier on the number, not a column anyone scans down. */
.gp-panel .gp-leader-prev { font-size: 0.62rem; color: var(--text3); letter-spacing: 0.02em; }
.gp-panel .gp-leader-val { font-weight: 700; text-align: right; }


/* ── 5v5 units and last-game lineup ─────────────────────────────────────── */
.gp-panel .gp-unit-group + .gp-unit-group { margin-top: 0.3rem; }
/* A row of three "#18 HYMAN" labels is much wider than anything else the
   panel puts in a half-width box, so these two rows stack a good deal sooner
   than the rest -- ellipsising a line's third name is the one truncation that
   actually loses information here. */
.gp-panel .gp-wrapper.gp-wrapper-wide {
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}
.gp-panel .gp-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 48px 48px 42px;
  gap: 0 6px;
  align-items: center;
  font-size: 0.76rem;
  padding: 0.24rem 0;
  border-bottom: 1px solid var(--border);
}
.gp-panel .gp-unit-row > span:not(.gp-unit-players) { text-align: center; }
.gp-panel .gp-unit-row:last-child { border-bottom: none; }
.gp-panel .gp-unit-head {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text3);
  padding: 0.12rem 0;
}
.gp-panel .gp-unit-head .gp-unit-players { font-weight: 700; }
.gp-panel .gp-unit-players {
  font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-panel .gp-unit-tag { font-size: 0.66rem; font-weight: 700; color: var(--text3); }
.gp-panel .gp-lineup-row { grid-template-columns: 26px minmax(0, 1fr) 48px 54px; }
/* Special-teams units carry no per-unit rate, so they get the tag and the
   names and nothing else -- two columns rather than a line row's four. */
.gp-panel .gp-st-row { grid-template-columns: 26px minmax(0, 1fr); }
/* Whoever has actually been getting the starts is the thing being looked for
   in that column. */
.gp-panel .gp-gk-hot { font-weight: 700; color: var(--good-text); }
/* Blue good, red bad -- the app's diverging scale, never green/red. */
.gp-panel .gp-flag-good {
  background: var(--good-bg); color: var(--good-text); font-weight: 700;
  border-radius: 3px; padding: 0 3px;
}
.gp-panel .gp-flag-bad {
  background: var(--bad-bg); color: var(--bad-text); font-weight: 700;
  border-radius: 3px; padding: 0 3px;
}
.gp-panel .gp-lineup-sub {
  font-size: 0.7rem; color: var(--text2); font-weight: 400;
  text-transform: none; letter-spacing: 0;
  display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.gp-panel .gp-lineup-foot {
  display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem;
  font-size: 0.74rem; color: var(--text2);
  margin-top: 0.3rem; padding-top: 0.28rem; border-top: 1px solid var(--border);
}

/* ── Goaltending ────────────────────────────────────────────────────────── */
/* Side by side when the box is wide enough for both tables to keep a readable
   name column, stacked when it isn't -- a fixed 1fr 1fr (what .h2h-st-split
   does) ellipsises goalie names from about a 1024px viewport down. */
.gp-panel .gp-gk-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 0.6rem 0.75rem;
  margin-top: 0.25rem;
}
.gp-panel .gp-gk-col { min-width: 0; }
.gp-panel .gp-gk-row {
  display: grid;
  /* Two of these tables sit side by side inside a half-width box, so the
     numeric columns are sized to their widest real value ("16-14-5", "3.05")
     and nothing more -- every pixel not spent here goes to the name. */
  grid-template-columns: minmax(76px, 1fr) 24px 24px 54px 52px 34px 36px 22px;
  gap: 0 6px; align-items: center;
  font-size: 0.76rem; padding: 0.24rem 0;
  border-bottom: 1px solid var(--border);
}
.gp-panel .gp-gk-row > span:not(.gp-gk-name) { text-align: center; }
.gp-panel .gp-gk-row:last-child { border-bottom: none; }
.gp-panel .gp-gk-head {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text3);
  padding: 0.12rem 0;
}
/* "Starts In Last 5" on two lines over its column. */
.gp-panel .gp-gk-head .gp-gk-st { line-height: 1.15; letter-spacing: 0.02em; }
.gp-panel .gp-gk-name {
  font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-panel .gp-gk-team { font-weight: 700; }

/* ── Season series ──────────────────────────────────────────────────────── */
.gp-panel .gp-series-tally {
  font-size: 0.8rem; font-weight: 600; text-align: center;
  padding-bottom: 0.4rem; margin-bottom: 0.3rem; border-bottom: 1px solid var(--border);
}
.gp-panel .gp-series-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 0 8px; align-items: center;
  font-size: 0.76rem; padding: 0.26rem 0.15rem;
  border-bottom: 1px solid var(--border);
}
.gp-panel .gp-series-row:last-child { border-bottom: none; }
.gp-panel .gp-series-row.gp-series-this { background: var(--accent-light); font-weight: 600; }
.gp-panel .gp-series-result { font-weight: 600; white-space: nowrap; }

/* ── States ─────────────────────────────────────────────────────────────── */
.gp-panel .gp-loading,
.gp-panel .gp-empty {
  text-align: center; color: var(--text3); font-size: 0.8rem;
  font-style: italic; padding: 1.1rem 0;
}
.gp-panel .gp-empty-sub {
  color: var(--text3); font-size: 0.74rem; font-style: italic; padding: 0.4rem 0;
}

/* ── Game Lineups (game day, EDM games) ─────────────────────────────────── */
.gp-panel .gp-gl-tabs { display: flex; justify-content: center; margin: 0.7rem 0 0.75rem; }
.gp-panel .gp-gl-tab {
  font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0.3rem 0.95rem;
  background: var(--surface); color: var(--text2); border: 1px solid var(--border);
}
.gp-panel .gp-gl-tab:first-child { border-radius: 6px 0 0 6px; }
.gp-panel .gp-gl-tab + .gp-gl-tab { border-radius: 0 6px 6px 0; margin-left: -1px; }
.gp-panel .gp-gl-tab.gp-gl-on { background: var(--accent); border-color: var(--accent); color: #fff; position: relative; }
.gp-panel .gp-gl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.gp-panel .gp-gl-col { min-width: 0; }
/* The phone layout's query (css/mobile.css): one sheet under the other. */
@media screen and (max-width: 700px), screen and (max-height: 500px) and (pointer: coarse), screen and (orientation: portrait) and (pointer: coarse) and (max-width: 1100px) {
  .gp-panel .gp-gl-grid { grid-template-columns: minmax(0, 1fr); }
}

/* The recap's Game Lineups window (openFinalLineups): the two sheets of a
   played game, side by side like Game Lineups. */
#game-lineups-final-overlay .gp-glf-modal {
  width: min(1800px, 98vw); max-width: none;
  height: 94vh; max-height: 94vh; height: 94dvh; max-height: 94dvh;
  overflow-y: auto; padding: 1rem 1.25rem;
}
#game-lineups-final-overlay .gp-glf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
#game-lineups-final-overlay .gp-glf-title { font-size: 1.15rem; font-weight: 700; }
#game-lineups-final-overlay .gp-glf-note { font-size: 0.75rem; color: var(--text3); margin: 0.2rem 0 0.75rem; }
@media screen and (max-width: 700px), screen and (max-height: 500px) and (pointer: coarse), screen and (orientation: portrait) and (pointer: coarse) and (max-width: 1100px) {
  #game-lineups-final-overlay .gp-glf-modal { width: 100vw; padding: 0.6rem 0.5rem; }
  #game-lineups-final-overlay .gp-glf-title { font-size: 0.95rem; white-space: normal; }
}

/* GAME LINEUPS buttons -- the Scores / Schedule card's (index.html
   nhlReportLinksHtml) and the recap's beside Print PDF: blue, white text. */
.nhl-report-link.gl-open-btn, .recap-pdf-btn.recap-gl-btn,
.nhl-report-link.gl-open-btn:hover, .recap-pdf-btn.recap-gl-btn:hover {
  background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none;
}
.nhl-report-link.gl-open-btn:hover, .recap-pdf-btn.recap-gl-btn:hover { filter: brightness(1.1); }
