/* ===== Game page ===== */

/* Sidebar starts at the top on this page */
.gm-page .sb-side { margin-top: 0; }
.gm-page .sb-layout { margin-top: 0; }
.gm-tabs { margin-top: 20px; }

/* ===== Hero: split in team colors ===== */
.gm-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(100deg, var(--away) 0%, var(--away) 48%, var(--home) 52%, var(--home) 100%);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.gm-hero > * { position: relative; z-index: 1; }
.gm-hero-team { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-width: 0; }
.gm-hero-home { grid-template-columns: auto 1fr auto; direction: rtl; }
.gm-hero-home > * { direction: ltr; }
.gm-hero-logo { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35)); }
.gm-hero-name { font-size: 18px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,0.35); min-width: 0; }
.gm-hero-home .gm-hero-name { text-align: right; }
.gm-hero-score { font-size: 52px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.gm-hero-team.gm-lost .gm-hero-score { opacity: 0.6; }
.gm-hero-mid { text-align: center; }
.gm-hero-status { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(0,0,0,0.45); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

/* #7 Rank pill */
.gm-hero-rank { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; background: #fff; color: #111; font-size: 11px; font-weight: 800; line-height: 1.4; vertical-align: middle; text-shadow: none; }

/* #4 Context strip (spans the full width under the scoreline) */
.gm-hero-ctx { grid-column: 1 / -1; margin-top: 2px; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; opacity: 0.9; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }

/* #1 Giant faded background logos — remove "gm-hero--wm" from the hero's class in view-game.cfm to turn off */
.gm-hero--wm::before,
.gm-hero--wm::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 320px;
    height: 320px;
    transform: translateY(-50%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.14;
    z-index: 0;
    pointer-events: none;
}
.gm-hero--wm::before { left: -70px; background-image: var(--away-logo); }
.gm-hero--wm::after { right: -70px; background-image: var(--home-logo); }

/* ===== Line score: team column ~40%, quarters spread evenly across the rest ===== */
.gm-ls-wrap { margin-top: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 20px; overflow-x: auto; }
.gm-ls { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.gm-ls .gm-ls-team { width: 40%; padding-left: 0; text-align: left; }
.gm-ls th { padding: 6px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; }
.gm-ls td { padding: 10px 4px; font-size: 16px; font-weight: 600; color: var(--muted); text-align: center; border-top: 1px solid var(--border); }
.gm-ls-name { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-ls-name img { width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; }
.gm-ls .gm-ls-total { font-size: 22px; font-weight: 900; color: var(--text); background: var(--bg); }
.gm-ls th.gm-ls-total { font-size: 11px; background: var(--bg); color: var(--text); border-radius: 6px 6px 0 0; }
.gm-ls tr.gm-lost .gm-ls-name,
.gm-ls tr.gm-lost .gm-ls-total { color: var(--muted); }

/* ===== Tabs ===== */
.gm-tabs { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.gm-tab-nav { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.gm-tab-nav::-webkit-scrollbar { display: none; }
.gm-tab { flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 18px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.gm-tab:hover { color: var(--text); }
.gm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.gm-tab-panel { display: none; padding: 16px; }
.gm-tab-panel.active { display: block; }
.gm-empty { padding: 24px 8px; text-align: center; color: var(--muted); }

/* Game Stats table */
.gm-ts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.gm-ts th { padding: 8px; font-size: 13px; font-weight: 800; text-align: center; border-bottom: 2px solid var(--border); }
.gm-ts td { padding: 9px 8px; font-size: 14px; font-weight: 700; text-align: center; border-bottom: 1px solid var(--border); }
.gm-ts tr:last-child td { border-bottom: 0; }
.gm-ts .gm-ts-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

/* Player stats */
.gm-ps-title { margin: 18px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.05em; color: var(--accent); }
.gm-ps-title:first-child { margin-top: 0; }
.gm-ps-wrap { overflow-x: auto; }
.gm-ps { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.gm-ps th { padding: 6px 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.gm-ps td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.gm-ps tr:last-child td { border-bottom: 0; }
.gm-ps .gm-ps-player { text-align: left; }
.gm-ps-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.gm-ps-cell img,
.gm-ps-nohead { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; object-fit: cover; background: var(--bg); }

/* Highlights grid */
.gm-vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gm-vid-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; }
.gm-vid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.gm-vid-thumb:hover img { transform: scale(1.03); }
.gm-vid-play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.gm-vid-play::after { content: ''; position: absolute; left: 19px; top: 15px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.gm-vid-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.75); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.gm-vid-title { margin: 8px 0 0; font-size: 13px; line-height: 1.35; }

/* ===== Scoring plays ===== */
.gm-sp { margin-top: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.gm-sp-head { margin: 0; background: #111; color: #fff; font-size: 14px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 14px 16px; }
.gm-sp-head span { color: var(--accent); }
.gm-sp-q { padding: 8px 16px; background: var(--bg); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gm-sp-play { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gm-sp-play:last-child { border-bottom: 0; }
.gm-sp-logo { width: 32px; height: 32px; object-fit: contain; }
.gm-sp-type { font-size: 13px; }
.gm-sp-type span { color: var(--muted); font-size: 12px; margin-left: 4px; }
.gm-sp-text { font-size: 13px; margin-top: 2px; }
.gm-sp-drive { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gm-sp-score { display: grid; grid-template-columns: repeat(2, 36px); text-align: center; font-variant-numeric: tabular-nums; }
.gm-sp-score span { font-size: 10px; font-weight: 700; color: var(--muted); }
.gm-sp-score strong { font-size: 16px; }

/* ===== Sidebar: game info ===== */
.gi-venue { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gi-list li { grid-template-columns: auto minmax(0, 1fr); }
.gi-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.gi-value { text-align: right; font-weight: 600; }

/* ===== Sidebar: game leaders ===== */
.gl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gl-row:last-child { border-bottom: 0; }
.gl-cat { align-self: center; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: var(--accent); text-transform: uppercase; text-align: center; }
.gl-player { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.gl-head { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.gl-name { font-size: 12px; font-weight: 700; line-height: 1.2; }
.gl-pos { font-weight: 500; color: var(--muted); }
.gl-sum { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* ===== Sidebar: win probability ===== */
.wp-body { padding: 12px 16px 16px; }
.wp-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.wp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wp-legend span::before { content: ''; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.wp-away { color: var(--accent); }
.wp-home { color: #111; }

/* ===== Phones ===== */
@media (max-width: 640px) {
    .gm-hero { padding: 16px; gap: 8px; }
    .gm-hero-team { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 6px; }
    .gm-hero-home { direction: ltr; }
    .gm-hero-home .gm-hero-name { text-align: center; }
    .gm-hero-logo { width: 48px; height: 48px; }
    .gm-hero-name { font-size: 13px; }
    .gm-hero-score { font-size: 36px; }
    .gm-hero-status { font-size: 10px; padding: 4px 8px; }
    .gm-hero-ctx { font-size: 11px; }
    .gm-hero--wm::before,
    .gm-hero--wm::after { width: 180px; height: 180px; }
    .gm-hero--wm::before { left: -50px; }
    .gm-hero--wm::after { right: -50px; }
    .gm-ls-wrap { padding: 8px 12px; }
    .gm-ls .gm-ls-team { width: 34%; }
    .gm-ls td { font-size: 14px; }
    .gm-ls .gm-ls-total { font-size: 18px; }
    .gm-ls-name img { width: 22px; height: 22px; flex-basis: 22px; }
}