/* ==========================================================================
   game-preview.css — upcoming-game preview page (game-preview.php)

   Additive and page-scoped: every rule is prefixed .gp- and only loads on
   game-preview.php, so theme.css and base.css are never touched. It relies on
   base.css only for fonts, the box model and the site layout wrappers.

   TEAM COLOURS
   The page sets two raw RGB triplets on .gp-page (no "rgb()" wrapper, so they
   can take an alpha):
       --gp-v   visitor accent        --gp-h   home accent
   They are decoration only (bar fills, banner tint, a marker under the better
   value). Every value and label is dark text on a light surface, so a pale
   team colour can never make anything unreadable.

   base.css gives every <img> max-width:100%. Inside a flex item that lets the
   browser squash the picture to nothing, so every logo/photo here states
   max-width:none and an explicit size (same fix the Pro/Farm toggle needed).
   ========================================================================== */

.gp-page {
    --gp-v: 65, 105, 225;
    --gp-h: 71, 85, 105;
    --gp-ink: #1f2937;
    --gp-muted: #5b6470;
    --gp-line: #d9dde3;
    --gp-soft: #f4f6f8;
    padding: 0 10px 40px;
    color: var(--gp-ink);
}

.gp-page h2 {
    font-size: 22px;
    line-height: 30px;
    padding: 30px 0 4px;
}
.gp-page h3 { padding: 0; }

.gp-note {
    margin: 0 0 14px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--gp-muted);
}

.gp-section { margin-top: 6px; }

.gp-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

img.gp-mini-logo   { width: 22px; height: 22px; max-width: none; object-fit: contain; flex: 0 0 auto; }
img.gp-win-logo    { width: 26px; height: 26px; max-width: none; object-fit: contain; }
img.gp-team__logo-img { width: 104px; height: 104px; max-width: none; object-fit: contain; flex: 0 0 auto; }
img.gp-mug         { width: 56px; height: 56px; max-width: none; object-fit: cover; border-radius: 50%; background: var(--gp-soft); flex: 0 0 auto; }
img.gp-mug--lg     { width: 72px; height: 72px; }

/* ── chips + badges ─────────────────────────────────────────────────── */

.gp-chip {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.2;
    color: #fff;
    background: #1f2937;
}
.gp-chip--farm { background: #0f766e; }
.gp-chip--soft { background: var(--gp-soft); color: var(--gp-muted); border: 1px solid var(--gp-line); text-transform: none; letter-spacing: 0; font-weight: 600; }

.gp-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #b6d0fb;
    background: #e8f1ff;
    color: #174ea6;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
}

/* Back button: site button style (royalblue fill, white bold text, 8px radius). */
.gp-back { margin: 22px 0 16px; }
.gp-back__btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 0; border-radius: 8px; background: royalblue; color: #fff; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; }
.gp-back__btn:hover { background: rgb(53, 84, 179); color: #fff; text-decoration: none; }
.gp-back__btn:focus-visible { background: rgb(53, 84, 179); color: #fff; outline: 2px solid rgb(53, 84, 179); outline-offset: 2px; }

.gp-out {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    background: #fde8e8;
    color: #b42318;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.3;
}

/* ── banner ─────────────────────────────────────────────────────────── */

.gp-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px 18px;
    margin-top: 18px;
    padding: 22px 20px;
    border: 1px solid var(--gp-line);
    border-radius: 12px;
    background:
        linear-gradient(90deg, rgba(var(--gp-v), .13) 0%, rgba(var(--gp-v), 0) 38%),
        linear-gradient(270deg, rgba(var(--gp-h), .13) 0%, rgba(var(--gp-h), 0) 38%),
        #fff;
}

.gp-team { display: flex; align-items: center; gap: 18px; min-width: 0; }
.gp-team--home { flex-direction: row-reverse; text-align: right; }
.gp-team__logo { display: block; flex: 0 0 auto; line-height: 0; }
.gp-team__id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gp-team--home .gp-team__id { align-items: flex-end; }

.gp-team__role  { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-muted); }
.gp-team__city  { font-size: 14px; line-height: 1.2; color: var(--gp-muted); overflow-wrap: anywhere; }
.gp-team__name  { font-size: 30px; line-height: 1.1; font-weight: 700; color: var(--gp-ink); overflow-wrap: anywhere; }
.gp-team__name:hover { text-decoration: underline; color: var(--gp-ink); }
.gp-team__rec   { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 6px; }
.gp-team--home .gp-team__rec { justify-content: flex-end; }
.gp-team__record { font-size: 24px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.gp-team__points { font-size: 14px; color: var(--gp-muted); font-variant-numeric: tabular-nums; }

.gp-banner__mid {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    min-width: 150px; text-align: center;
}
.gp-banner__day  { font-size: 26px; line-height: 1; font-weight: 700; }
.gp-banner__when { font-size: 13px; color: var(--gp-muted); }
.gp-banner__game { font-size: 12px; color: var(--gp-muted); }

/* ── team comparison ────────────────────────────────────────────────── */

.gp-cmp__head {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) minmax(0, 2.2fr) minmax(70px, 1fr);
    margin: 6px 0 2px;
}
.gp-cmp__who { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.gp-cmp__who--v { grid-column: 1; justify-content: flex-start; }
.gp-cmp__who--h { grid-column: 3; justify-content: flex-end; }

.gp-cmp { list-style: none; margin: 0; padding: 0; }
.gp-cmp__row {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) minmax(0, 2.2fr) minmax(70px, 1fr);
    align-items: center;
    gap: 6px 14px;
    padding: 11px 0;
    border-top: 1px solid var(--gp-line);
}
.gp-cmp__row:first-child { border-top: 0; }

.gp-cmp__val { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; font-variant-numeric: tabular-nums; }
.gp-cmp__val--v { justify-content: flex-start; }
.gp-cmp__val--h { justify-content: flex-end; text-align: right; }
.gp-cmp__num  { font-size: 20px; line-height: 1.2; font-weight: 600; padding-bottom: 1px; border-bottom: 3px solid transparent; }
.gp-cmp__rank { font-size: 12px; color: var(--gp-muted); }
.gp-cmp__val.is-best .gp-cmp__num { font-weight: 800; }
.gp-cmp__val--v.is-best .gp-cmp__num { border-bottom-color: rgb(var(--gp-v)); }
.gp-cmp__val--h.is-best .gp-cmp__num { border-bottom-color: rgb(var(--gp-h)); }

.gp-cmp__mid   { min-width: 0; }
.gp-cmp__label { text-align: center; font-size: 13px; line-height: 1.3; margin-bottom: 5px; }
.gp-cmp__label abbr { font-weight: 800; font-size: 14px; text-decoration: none; cursor: help; }
.gp-cmp__full  { display: block; font-size: 11.5px; color: var(--gp-muted); }

.gp-bar { display: flex; gap: 3px; height: 10px; }
.gp-bar__half { flex: 1 1 0; display: flex; background: #e9ecf0; border-radius: 5px; overflow: hidden; }
.gp-bar__half--v { justify-content: flex-end; }
.gp-bar__half--h { justify-content: flex-start; }
.gp-bar__half i { display: block; height: 100%; border-radius: 5px; opacity: .78; }
.gp-bar__half--v i { background: rgb(var(--gp-v)); }
.gp-bar__half--h i { background: rgb(var(--gp-h)); }
.gp-cmp__row[data-better] .gp-bar__half i { opacity: .35; }
.gp-cmp__row[data-better="v"] .gp-bar__half--v i,
.gp-cmp__row[data-better="h"] .gp-bar__half--h i { opacity: 1; }

/* ── players to watch ───────────────────────────────────────────────── */

.gp-watch__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
    align-items: center;
    gap: 10px 14px;
    padding: 12px 0;
    border-top: 1px solid var(--gp-line);
}
.gp-watch__row:first-of-type { border-top: 0; }

.gp-watch__cat { text-align: center; line-height: 1.15; }
.gp-watch__cat abbr { display: block; font-size: 22px; font-weight: 800; text-decoration: none; cursor: help; }
.gp-watch__cat small { display: block; font-size: 11.5px; color: var(--gp-muted); }

.gp-pl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gp-pl--h { flex-direction: row-reverse; text-align: right; }
.gp-pl__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.gp-pl__name { font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--gp-ink); overflow-wrap: anywhere; }
.gp-pl__name:hover { text-decoration: underline; color: var(--gp-ink); }
.gp-pl__sub  { font-size: 12.5px; color: var(--gp-muted); }
.gp-pl__val  { font-size: 32px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.gp-pl--v .gp-pl__val { padding-bottom: 3px; border-bottom: 4px solid rgb(var(--gp-v)); }
.gp-pl--h .gp-pl__val { padding-bottom: 3px; border-bottom: 4px solid rgb(var(--gp-h)); }
.gp-pl--empty { color: var(--gp-muted); font-size: 13px; }
.gp-pl--empty.gp-pl--h { justify-content: flex-start; flex-direction: row-reverse; }

/* ── goaltending ────────────────────────────────────────────────────── */

.gp-goalies__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gp-goalie {
    padding: 16px;
    border: 1px solid var(--gp-line);
    border-radius: 12px;
    background: #fff;
}
.gp-goalie--v { border-top: 4px solid rgb(var(--gp-v)); }
.gp-goalie--h { border-top: 4px solid rgb(var(--gp-h)); }
.gp-goalie__team { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.gp-goalie__team .gp-chip { margin-left: auto; }
.gp-goalie__who  { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.gp-goalie__name { font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--gp-ink); overflow-wrap: anywhere; }
.gp-goalie__name:hover { text-decoration: underline; color: var(--gp-ink); }
.gp-goalie__none { margin: 0; color: var(--gp-muted); font-size: 13px; }

.gp-goalie__stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; }
.gp-goalie__stats > div { padding: 8px 6px; border-radius: 8px; background: var(--gp-soft); text-align: center; }
.gp-goalie__stats dt { font-size: 11.5px; font-weight: 700; color: var(--gp-muted); letter-spacing: .03em; }
.gp-goalie__stats dd { margin: 3px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gp-goalie__stats .is-best { background: #e7f6ec; }
.gp-goalie__stats .is-best dd { font-weight: 800; color: #14532d; }

/* ── season series ──────────────────────────────────────────────────── */

.gp-series__line { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.gp-series__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--gp-line); border-radius: 12px; overflow: hidden; }
.gp-series__game {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 34px auto;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-top: 1px solid var(--gp-line);
    font-size: 14px;
}
.gp-series__game:first-child { border-top: 0; }
.gp-series__day   { color: var(--gp-muted); font-variant-numeric: tabular-nums; }
.gp-series__match { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.gp-series__team  { display: inline-flex; align-items: center; gap: 6px; min-width: 62px; }
.gp-series__team:first-child { justify-content: flex-end; }
.gp-series__team.is-win b { font-weight: 800; }
.gp-series__team:not(.is-win) { opacity: .9; }
.gp-series__score { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gp-series__score small { font-size: 11px; font-weight: 700; color: var(--gp-muted); }
.gp-series__winner { text-align: center; line-height: 0; }
.gp-series__link  { white-space: nowrap; font-size: 13px; }

/* ── recent form ────────────────────────────────────────────────────── */

.gp-formwrap__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gp-form { padding: 16px; border: 1px solid var(--gp-line); border-radius: 12px; background: #fff; }
.gp-form--v { border-top: 4px solid rgb(var(--gp-v)); }
.gp-form--h { border-top: 4px solid rgb(var(--gp-h)); }
.gp-form__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 15px; }
.gp-form__none { margin: 0; color: var(--gp-muted); font-size: 13px; }
.gp-form__sum  { margin: 12px 0 0; font-size: 13px; color: var(--gp-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.gp-form__sum b { color: var(--gp-ink); font-variant-numeric: tabular-nums; }

.gp-pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gp-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 34px; padding: 0 7px;
    border-radius: 8px;
    font-size: 13px; font-weight: 800; line-height: 1;
    color: #fff; background: var(--gp-muted);
    text-decoration: none;
}
a.gp-pill:hover { text-decoration: none; color: #fff; filter: brightness(1.12); }
.gp-pill--w   { background: #1a7f37; }
.gp-pill--l   { background: #b42318; }
.gp-pill--otl { background: #a15c07; min-width: 44px; font-size: 12px; }
.gp-pill--t   { background: #5b6470; }

.gp-legend { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; font-size: 12.5px; color: var(--gp-muted); }
.gp-legend .gp-pill { height: 24px; min-width: 30px; font-size: 11px; margin-left: 10px; }
.gp-legend .gp-pill:first-child { margin-left: 0; }

.gp-backlink { margin: 26px 0 0; font-size: 14px; }

/* ── narrower screens ───────────────────────────────────────────────── */

@media (max-width: 900px) {
    .gp-team__name { font-size: 24px; }
    img.gp-team__logo-img { width: 80px; height: 80px; }
    .gp-team { gap: 12px; }
}

@media (max-width: 720px) {
    .gp-banner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "away home"
            "mid  mid";
        padding: 16px 12px;
    }
    .gp-banner > .gp-team--away { grid-area: away; }
    .gp-banner > .gp-team--home { grid-area: home; }
    .gp-banner > .gp-banner__mid { grid-area: mid; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px 12px; padding-top: 10px; border-top: 1px solid var(--gp-line); }
    .gp-team, .gp-team--home { flex-direction: column; text-align: center; gap: 8px; }
    .gp-team__id, .gp-team--home .gp-team__id { align-items: center; }
    .gp-team__rec, .gp-team--home .gp-team__rec { justify-content: center; }
    img.gp-team__logo-img { width: 72px; height: 72px; }
    .gp-team__name { font-size: 22px; }
    .gp-team__record { font-size: 21px; }

    .gp-cmp__row, .gp-cmp__head { grid-template-columns: minmax(58px, 1fr) minmax(0, 1.8fr) minmax(58px, 1fr); gap: 6px 8px; }
    .gp-cmp__num { font-size: 17px; }
    .gp-cmp__full { display: none; }

    .gp-watch__row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .gp-watch__cat { order: -1; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
    .gp-watch__cat abbr { font-size: 20px; }
    .gp-pl--h { flex-direction: row; text-align: left; }
    .gp-pl--empty.gp-pl--h { flex-direction: row; }

    .gp-goalies__grid, .gp-formwrap__grid { grid-template-columns: minmax(0, 1fr); }
    .gp-goalie__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .gp-series__game { grid-template-columns: 56px minmax(0, 1fr) 30px; row-gap: 4px; }
    .gp-series__link { grid-column: 1 / -1; justify-self: end; }
    .gp-series__match { gap: 8px; }
    .gp-series__team { min-width: 0; }
}

@media (max-width: 380px) {
    .gp-page { padding: 0 6px 32px; }
    .gp-team__name { font-size: 19px; }
    .gp-pill { min-width: 32px; height: 32px; }
    .gp-pill--otl { min-width: 40px; }
}
