/* ============================================================
   Eggbeater tvOS — Game Detail (Summary + Play-by-Play)
   Theme-aware: uses --tx-*, .glass, brand accent. Light/dark
   both supported (see [data-theme="light"] overrides below).
   ============================================================ */

.gd {
  position: absolute; inset: 0; z-index: 50;
  background: radial-gradient(80% 90% at 78% -6%, rgba(77,214,210,0.16), transparent 55%), rgba(0,9,28,0.74);
  backdrop-filter: blur(30px) saturate(1.2); -webkit-backdrop-filter: blur(30px) saturate(1.2);
}
[data-theme="light"] .gd { background: radial-gradient(80% 90% at 78% -6%, rgba(77,214,210,0.28), transparent 55%), rgba(214,226,246,0.78); }
/* one frost layer only — inner glass surfaces drop their own backdrop-filter
   (nested backdrop-filters misrender) but keep their translucent fill */
.gd .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
.gd-wrap {
  position: absolute; top: var(--safe-y); left: var(--safe-x); right: var(--safe-x); bottom: var(--safe-y);
  display: flex; flex-direction: column; gap: 20px;
}
.gd-topbar { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.gd-back {
  display: inline-flex; align-items: center; gap: 11px; padding: 12px 22px; border-radius: var(--r-pill);
  font-size: 20px; font-weight: 700; color: var(--tx-1);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
}
.gd-back svg { width: 22px; height: 22px; stroke: currentColor; }
.gd-back.tvf.is-focused {
  transform: scale(1.06); background: #fff; color: var(--navy-2); border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 0 22px 1px var(--teal-glow), 0 14px 30px rgba(0,4,18,0.45);
}
.gd-back.tvf.is-focused svg { stroke: var(--navy-2); }
.gd-crumb { font-size: 18px; font-weight: 600; color: var(--tx-3); }

/* hero */
.gd-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 32px; padding: 30px 48px; border-radius: var(--r-lg); flex-shrink: 0; }
.gd-team { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gd-team.right { align-items: flex-end; text-align: right; }
.gd-team-id { display: flex; align-items: center; gap: 14px; }
.gd-team.right .gd-team-id { flex-direction: row-reverse; }
.gd-team-name { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; color: var(--tx-1); white-space: nowrap; }
.gd-team.home .gd-team-name { color: var(--teal-bright); }
.gd-team-sub { font-size: 16px; font-weight: 600; color: var(--tx-3); letter-spacing: 0.04em; text-transform: uppercase; }
.gd-team-score { font-size: 100px; font-weight: 800; line-height: 0.85; letter-spacing: -4px; font-variant-numeric: tabular-nums; color: var(--tx-1); }
.gd-team.trail .gd-team-score { color: var(--tx-3); }
.gd-center { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gd-clockpill { display: inline-flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: var(--r-pill); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tx-1); }
.gd-finalpill { font-size: 16px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-3); }

/* tabs */
.gd-tabs { display: flex; gap: 13px; flex-shrink: 0; }
.gd-tab {
  display: inline-flex; align-items: center; gap: 11px; padding: 13px 26px; border-radius: var(--r-pill);
  font-size: 21px; font-weight: 700; color: var(--tx-2);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
}
.gd-tab svg { width: 22px; height: 22px; stroke: currentColor; }
.gd-tab.on { background: rgba(255,255,255,0.15); color: var(--tx-1); border-color: rgba(255,255,255,0.26); }
.gd-tab.tvf.is-focused {
  transform: translateY(-2px); background: #fff; color: var(--navy-2); border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.55), 0 0 22px 1px var(--teal-glow), 0 14px 30px rgba(0,4,18,0.45);
}
.gd-tab.tvf.is-focused svg { stroke: var(--navy-2); }

/* panel area */
.gd-body { flex: 1; min-height: 0; position: relative; }
.gd-card { padding: 30px 38px; border-radius: var(--r-lg); height: 100%; }
.gd-sumhd { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--glass-rim); }
.gd-sumhd .t { display: flex; align-items: center; gap: 13px; font-size: 23px; font-weight: 800; color: var(--tx-1); letter-spacing: -0.3px; }
.gd-sumhd .t svg { width: 26px; height: 26px; stroke: var(--teal-bright); }
.gd-sumhd .r { font-size: 18px; font-weight: 600; color: var(--tx-3); }

.gd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 24px 0; }
.gd-meta .lbl { font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 8px; }
.gd-meta .val { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 600; color: var(--tx-1); }
.gd-meta .val svg { width: 22px; height: 22px; stroke: var(--teal-bright); }

.gd-sec-lbl { font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); margin: 4px 0 14px; }

/* scoring by period */
table.gd-per { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.gd-per th { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx-3); padding: 10px 14px; text-align: center; }
.gd-per th.l { text-align: left; }
.gd-per td { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tx-2); padding: 13px 14px; text-align: center; }
.gd-per td.l { text-align: left; }
.gd-per td.team { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; color: var(--tx-1); }
.gd-per td.tot { font-size: 30px; font-weight: 800; color: var(--tx-1); }
.gd-per tr + tr td { border-top: 1px solid rgba(255,255,255,0.08); }

/* team stat bars */
.gd-bars { display: flex; flex-direction: column; gap: 18px; }
.gd-bar .row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.gd-bar .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tx-1); }
.gd-bar .lbl { font-size: 15px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); }
.gd-bar .track { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: rgba(255,255,255,0.08); }
.gd-bar .fill-a { background: rgba(255,255,255,0.55); }
.gd-bar .fill-h { background: var(--teal-bright); }

/* starters · bench (tvOS 5.0 (78)): one team's bar under the team stats — the starters' share
   in the team fill, the bench's in the muted fill, then goals / shots and the per-period line */
.gd-sb { margin-top: 28px; }
.gd-sb .gd-sec-lbl { margin-bottom: 12px; }
.gd-sb-pairs { display: flex; flex-wrap: wrap; gap: 6px 32px; margin-top: 14px; font-size: 20px; color: var(--tx-3); }
.gd-sb-pairs em { font-style: normal; font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin-right: 8px; }
.gd-sb-pairs b { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tx-1); }
.gd-sb-note { margin-top: 8px; font-size: 16px; line-height: 1.4; color: var(--tx-3); }

/* play-by-play */
.gd-pbp { display: flex; flex-direction: column; gap: 11px; }
.gd-event {
  display: grid; grid-template-columns: 96px 52px 1fr auto; align-items: center; gap: 20px;
  padding: 15px 22px; border-radius: var(--r);
}
.gd-event.tvf.is-focused { transform: scale(1.015) translateY(-2px); }
.gd-event .time { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tx-3); }
.gd-event .cap { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 19px; font-weight: 800; color: #fff; }
.gd-event .who { font-size: 23px; font-weight: 700; color: var(--tx-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-event .who .note { font-size: 17px; font-weight: 600; color: var(--tx-3); margin-left: 12px; }
.gd-event .type { font-size: 16px; font-weight: 800; letter-spacing: 0.06em; padding: 7px 15px; border-radius: var(--r-pill); justify-self: end; }
.type.goal { background: rgba(77,214,210,0.18); color: var(--teal-bright); }
.type.assist { background: rgba(45,127,219,0.2); color: #9ec3ff; }
.type.excl { background: rgba(255,107,107,0.18); color: var(--live); }
.type.save { background: rgba(157,108,245,0.2); color: #c4abff; }
.type.other { background: rgba(255,255,255,0.1); color: var(--tx-2); }

/* follow CTA */
.gd-follow {
  display: flex; align-items: center; justify-content: center; gap: 13px; flex-shrink: 0;
  padding: 18px; border-radius: var(--r); font-size: 22px; font-weight: 800; color: #04263a;
  background: linear-gradient(135deg, var(--accent-glow, #6ff0ec), var(--teal-bright));
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 12px 30px rgba(77,214,210,0.32), inset 0 1px 0 rgba(255,255,255,0.6);
}
.gd-follow svg { width: 23px; height: 23px; stroke: currentColor; }
.gd-follow.on { background: rgba(255,255,255,0.08); color: var(--tx-1); border-color: rgba(255,255,255,0.2); box-shadow: none; }
.gd-follow.tvf.is-focused {
  transform: scale(1.012) translateY(-2px);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6), 0 0 26px 2px var(--teal-glow), 0 16px 34px rgba(0,4,18,0.45);
}

/* honest empty state (Play-by-Play with no event feed) */
.gd-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 70px 40px; }
.gd-empty-ico {
  width: 92px; height: 92px; border-radius: 24px; display: grid; place-items: center; margin-bottom: 10px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--glass-rim);
}
.gd-empty-ico svg { stroke: var(--teal-bright); }
[data-theme="light"] .gd-empty-ico { background: rgba(20,40,90,0.06); }
.gd-empty-t { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; color: var(--tx-1); }
.gd-empty-p { font-size: 20px; font-weight: 500; color: var(--tx-3); }

/* This Tournament tab */
.gd .segbar { margin: 4px 0 18px; }
.gdt-list { display: flex; flex-direction: column; margin-bottom: 14px; }
.gdt-list .srow { margin-bottom: 10px; }
.gdt-wl {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  font-size: 17px; font-weight: 800; color: var(--tx-3); background: rgba(255,255,255,0.08);
}
.gdt-wl.w { color: var(--teal-bright); background: rgba(77,214,210,0.16); }
.gdt-wl.l { color: var(--tx-3); background: rgba(255,255,255,0.06); }
/* TIE — a real result: quieter than a win, never painted as a loss. */
.gdt-wl.t { color: var(--tx-2); background: rgba(255,255,255,0.1); }
[data-theme="light"] .gdt-wl { background: rgba(20,40,90,0.08); }
[data-theme="light"] .gdt-wl.w { color: #0c7a82; background: rgba(13,138,147,0.14); }
[data-theme="light"] .gdt-wl.t { color: var(--tx-2); background: rgba(20,40,90,0.1); }
.gdt-note { font-size: 17px; font-weight: 600; color: var(--tx-3); padding: 2px 4px 16px; }
.gdt-plac { max-width: 900px; padding-bottom: 8px; }
.gdt-plac .pool.tvf.is-focused { transform: none; }

.gd-enter { animation: gdIn .4s var(--ease); }
@keyframes gdIn { from { transform: translateY(20px) scale(.992); } }

/* ── LIGHT THEME tweaks for detail ── */
[data-theme="light"] .gd-tab.on { background: rgba(20,40,90,0.1); border-color: rgba(20,40,90,0.16); }
[data-theme="light"] .gd-bar .track { background: rgba(20,40,90,0.1); }
[data-theme="light"] .gd-bar .fill-a { background: #3a63b8; }
[data-theme="light"] .gd-event .who .note { color: var(--tx-3); }
[data-theme="light"] .type.assist { background: rgba(45,90,200,0.14); color: #1d4ed8; }
[data-theme="light"] .type.save { background: rgba(124,58,237,0.14); color: #6d28d9; }
[data-theme="light"] .gd-team.home .gd-team-name { color: #0c7a82; }
[data-theme="light"] .gd-team-score { color: var(--tx-1); }
[data-theme="light"] .gd-team.trail .gd-team-score { color: var(--tx-3); }

/* Cap chips on play-by-play rows — CAP colours, never the team's (owner,
   2026-10-04: no club or team colours on the TV; native GameDetail EventRow:
   dark cap = home, white cap = away). Caps never re-skin, so every skin. */
.gd-event .cap.dark  { background: #16233F; color: #fff;    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.gd-event .cap.white { background: #F3F7FF; color: #16233F; box-shadow: inset 0 0 0 1px rgba(22, 35, 63, 0.25); }

/* ═══════════════════════════════════════════════════════════════════════════
   NAVY AND SUN (2026-10-04) — the STANDARD look: game detail
   Scoped like tv.css (:root:not([data-skin="jo"])), so JO is untouched.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The drawer scrim is the pool colour (native: pool @.58 night / @.62 paper over
   the bay banner's detail strip), a little heavier here because the embed's
   dashboard sits under it; the old teal glow is the sun's orange. */
:root:not([data-skin="jo"]) [data-theme] .gd {
  background: radial-gradient(80% 90% at 78% -6%, rgba(247, 136, 74, 0.12), transparent 55%), rgba(6, 13, 31, 0.66);
}
:root:not([data-skin="jo"]) [data-theme="light"] .gd {
  background: radial-gradient(80% 90% at 78% -6%, rgba(247, 136, 74, 0.16), transparent 55%), rgba(250, 246, 239, 0.70);
}

/* Home team name on the accent (was the teal #0c7a82 on paper). */
:root:not([data-skin="jo"]) [data-theme] .gd-team.home .gd-team-name { color: var(--teal-bright); }
:root:not([data-skin="jo"]) [data-theme] .gd-per tr + tr td { border-top-color: var(--line-soft); }

/* Stat bars: home = the accent, away = the lightest ink (native statBar: accent
   vs tx4) — was white on night / a royal blue on paper. */
:root:not([data-skin="jo"]) [data-theme] .gd-bar .fill-a { background: var(--tx-4); }

/* Event type pills — native typeColor: GOAL = accent, ASSIST = accent2 (navy-
   text), SAVE = gold, EXCL = the live red. On paper accent and accent2 are both
   navy, so ASSIST goes outline-only to stay tellable apart; SAVE sits on the
   sun-subtle wash (sun-deep on it 6.3:1). EXCL keeps --live at night and uses
   the sheet's existing light live-text red on paper (the bright red was 2.5:1). */
:root:not([data-skin="jo"]) [data-theme] .type.goal { background: var(--accent-wash); color: var(--teal-bright); box-shadow: inset 0 0 0 1px var(--accent-edge); }
:root:not([data-skin="jo"]) [data-theme] .type.assist { background: rgba(157, 189, 242, 0.20); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(157, 189, 242, 0.45); }
:root:not([data-skin="jo"]) [data-theme="light"] .type.assist { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(0, 47, 108, 0.45); }
:root:not([data-skin="jo"]) [data-theme] .type.save { background: #3A2F0E; color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 216, 98, 0.40); }
:root:not([data-skin="jo"]) [data-theme="light"] .type.save { background: #FFF4D1; box-shadow: inset 0 0 0 1px rgba(122, 82, 0, 0.30); }
:root:not([data-skin="jo"]) [data-theme="light"] .type.excl { color: #cc1f1f; }

/* Follow = the PRIMARY button pair (TOKENS): navy fill / white type on paper,
   the SUN fill / navy type at night (never white on the sun — 1.4:1). Focus is
   an offset ring so it reads against its own fill in both themes. */
:root:not([data-skin="jo"]) [data-theme] .gd-follow {
  background: var(--cta-bg); color: var(--cta-ink); border-color: transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}
:root:not([data-skin="jo"]) [data-theme="light"] .gd-follow { box-shadow: 0 12px 30px rgba(0, 47, 108, 0.22); }
:root:not([data-skin="jo"]) [data-theme] .gd-follow.on { background: rgba(255, 255, 255, 0.08); color: var(--tx-1); border-color: var(--glass-rim); box-shadow: none; }
:root:not([data-skin="jo"]) [data-theme="light"] .gd-follow.on { background: rgba(0, 47, 108, 0.06); }
:root:not([data-skin="jo"]) [data-theme] .gd-follow.tvf.is-focused {
  box-shadow: 0 0 0 3px var(--bg-base), 0 0 0 6px var(--focus-ring), 0 16px 34px rgba(0, 0, 0, 0.40);
}
:root:not([data-skin="jo"]) [data-theme="light"] .gd-follow.tvf.is-focused {
  box-shadow: 0 0 0 3px var(--bg-base), 0 0 0 6px var(--focus-ring), 0 16px 34px rgba(0, 47, 108, 0.22);
}

/* This Tournament W chip = the win colour (was teal). */
:root:not([data-skin="jo"]) [data-theme] .gdt-wl.w { color: var(--win); background: rgba(111, 214, 154, 0.16); }
:root:not([data-skin="jo"]) [data-theme="light"] .gdt-wl.w { background: rgba(27, 107, 58, 0.12); }
