/* Version 4.1 — "Your first week" cards (Train) and the guided workout player.
   Immersive dark panel in the School's own deep green, in both themes. */

/* ---------- Train: Workout A / B cards ---------- */
.week-cards { display: grid; gap: 12px; margin: 8px 0 20px; }
.week-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px;
  min-height: 168px; padding: 16px; border-radius: 14px; overflow: hidden; isolation: isolate;
  background: var(--splash, #06413D); color: #fff; text-decoration: none;
  box-shadow: 0 6px 18px var(--shadow);
}
.week-card-bg { position: absolute; inset: 0; z-index: -2; }
.week-card-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.week-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(2,51,48,.15) 0%, rgba(2,40,37,.88) 78%); }
.week-card-status {
  position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.45); font-size: 13px; font-weight: 600;
}
.week-card-status .ic { width: 16px; height: 16px; }
.week-card-body { display: grid; gap: 4px; }
.week-card-title { font-size: 28px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.week-card-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: rgba(255,255,255,.85); }
.week-card-meta .ic { width: 16px; height: 16px; }
.week-card-go {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.18);
}
.week-card-go .ic { width: 22px; height: 22px; }
.week-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* ---------- Guided player ---------- */
body.in-guided { background: #0f1f1c; }
body.in-guided .tabbar, body.in-guided #rest { display: none !important; }
body.in-guided .page { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.g-wrap {
  --g-bg: #0f1f1c; --g-panel: #18302b; --g-raised: #223b36; --g-text: #f1f6f4; --g-muted: #a9bdb6; --g-accent: #80d8bd; --g-accent-text: #0b201b;
  color: var(--g-text); margin: calc(-8px - env(safe-area-inset-top)) calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter);
  min-height: 100vh; background: var(--g-bg);
}
.g-top {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 44px 1fr 44px 44px; align-items: center; gap: 4px;
  padding: calc(8px + env(safe-area-inset-top)) 0 8px; background: var(--g-bg);
}
.g-title { text-align: center; display: grid; line-height: 1.2; }
.g-title strong { font-size: 17px; }
.g-title .elapsed { color: var(--g-muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.g-icon {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--g-panel); color: var(--g-text); cursor: pointer;
}
.g-icon .ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.g-icon.is-off { color: var(--g-muted); }
.g-segs { display: flex; gap: 4px; padding: 4px 0 14px; }
.g-seg { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.16); }
.g-seg.is-done { background: var(--g-accent); }
.g-seg.is-skipped { background: rgba(255,255,255,.4); }
.g-seg.is-current { background: #fff; }

.g-flash, .g-paused {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--g-accent); color: var(--g-accent-text); font-weight: 700;
}
.g-flash .ic { width: 20px; height: 20px; }
.g-paused { flex-direction: column; text-align: center; background: var(--g-raised); color: var(--g-text); font-weight: 400; }
.g-paused strong { font-size: 24px; }
.g-paused p { margin: 0; color: var(--g-muted); }

.g-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.g-video iframe, .g-video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.g-novideo { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--g-muted); background: var(--g-panel); }
.g-novideo .ic { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.g-video-note { margin: 6px 2px 0; font-size: 13px; color: var(--g-muted); }
.g-video-note a { color: var(--g-accent); }

.g-ex-head { padding: 16px 0 4px; }
.g-eyebrow { margin: 0; color: var(--g-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.g-ex-head h1 { margin: 4px 0 2px; font-size: 28px; line-height: 1.15; color: var(--g-text); }
.g-variation { margin: 0 0 8px; color: var(--g-muted); }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.g-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--g-panel); font-size: 14px; }
.g-chip.is-strong { background: #fff; color: #0f1f1c; font-weight: 700; }
.g-chip .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.g-last { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--g-muted); font-size: 14px; }
.g-last .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.g-last strong { color: var(--g-text); }
.g-notes { margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: var(--g-panel); }
.g-notes summary { cursor: pointer; font-weight: 600; }
.g-notes p { margin: 8px 0 0; color: var(--g-muted); }

.g-entry { margin: 16px 0 8px; padding: 16px; border-radius: 16px; background: var(--g-panel); text-align: center; }
.g-entry-label { display: block; color: var(--g-muted); font-weight: 600; margin-bottom: 8px; }
.g-stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 12px; }
.g-actual {
  width: 100%; min-width: 0; height: 96px; border: 2px solid transparent; border-radius: 14px;
  background: var(--g-raised); color: var(--g-text); text-align: center;
  font: 800 64px/1 inherit; font-variant-numeric: tabular-nums;
}
.g-actual::placeholder { color: rgba(255,255,255,.28); font-size: 36px; }
.g-actual:focus { outline: none; border-color: var(--g-accent); }
.g-actual[aria-invalid="true"] { border-color: #ff8a80; }
.g-round {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--g-raised); color: var(--g-text); font-size: 26px; font-weight: 700;
}
.g-round:active, .g-icon:active { transform: scale(.96); }
.g-hold { margin-top: 12px; }
.g-wrap .btn-secondary { background: var(--g-raised); color: var(--g-text); border-color: transparent; }
.g-hold.is-running { background: var(--g-accent); color: var(--g-accent-text); }
.g-err { min-height: 1em; margin: 8px 0 0; color: #ff8a80; font-weight: 600; }
.g-wrap .btn-primary { background: var(--g-accent); color: var(--g-accent-text); border-color: transparent; }
.g-done { min-height: 60px; font-size: 18px; border-radius: 999px; }
.g-links { display: flex; justify-content: space-between; margin: 10px 4px 16px; }
.g-wrap .link-btn { color: var(--g-accent); }

.g-next { display: grid; gap: 2px; margin: 8px 0 16px; padding: 14px 16px; border-radius: 14px; background: var(--g-panel); }
.g-next-label { font-size: 13px; color: var(--g-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.g-next strong { font-size: 18px; }
.g-next-meta { color: var(--g-muted); font-size: 14px; }

/* Rest: the biggest thing on the screen, readable from across the room. */
.g-rest { display: grid; justify-items: center; text-align: center; padding-top: 8px; }
.g-rest-label { margin: 0; font-size: 18px; font-weight: 700; color: var(--g-muted); text-transform: uppercase; letter-spacing: .12em; }
.g-ring { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 8px 0 20px; }
.g-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-ring circle { fill: none; stroke-width: 7; }
.g-ring-bg { stroke: rgba(255,255,255,.12); }
.g-ring-fg { stroke: var(--g-accent); stroke-linecap: round; transition: stroke-dashoffset .45s linear; }
.g-rest-time {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(64px, 22vw, 104px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.g-rest-actions { display: grid; grid-template-columns: 64px 1fr 64px; gap: 12px; align-items: center; width: 100%; margin-bottom: 16px; }
.g-skip { min-height: 64px; border-radius: 999px; font-size: 18px; }
.g-rest .g-next { width: 100%; text-align: left; }
.g-hint { color: var(--g-muted); font-size: 13px; max-width: 34ch; }

.g-finished { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 32px 0; }
.g-finished .ic { width: 64px; height: 64px; stroke: var(--g-accent); fill: none; stroke-width: 1.8; }
.g-finished h1 { margin: 0; color: var(--g-text); }
.g-finished p { margin: 0; color: var(--g-muted); }

/* Exit sheet */
.g-sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; }
.g-sheet-backdrop[hidden] { display: none; }
.g-sheet {
  width: 100%; max-width: 560px; margin: 0 auto; display: grid; gap: 10px;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--g-panel);
}
.g-sheet h2 { margin: 6px 0; text-align: center; color: var(--g-text); }
.g-sheet-grip { justify-self: center; width: 56px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.35); }
.g-sheet .btn { min-height: 52px; }

@media (prefers-reduced-motion: reduce) { .g-ring-fg { transition: none; } }
