/* ============================================================
   REP RUSH — Power Arcade aesthetic
   ============================================================ */
:root {
  --bg:        #07080c;
  --bg-2:      #0d1018;
  --ink:       #f4f7ef;
  --muted:     #7e8a7a;
  --lime:      #c6ff3d;
  --lime-dim:  #8fbf1e;
  --magenta:   #ff2e88;
  --cyan:      #19e3ff;
  --amber:     #ffb020;
  --red:       #ff4d4d;
  --ring-w:    8;
  --font-disp: "Anton", system-ui, sans-serif;
  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-head);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(255,46,136,.18), transparent 55%),
    radial-gradient(110% 90% at 5% 110%, rgba(25,227,255,.16), transparent 55%),
    radial-gradient(80% 60% at 50% 50%, rgba(198,255,61,.05), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

/* texture overlays ------------------------------------------------ */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998; opacity: .35;
  background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0,0,0,.25) 2px 3px);
  mix-blend-mode: multiply;
}

/* screens --------------------------------------------------------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: clamp(16px, 4vw, 48px); }
.hidden { display: none !important; }

.kicker {
  font-family: var(--font-mono); font-size: 28px; letter-spacing: .32em;
  color: var(--lime); text-transform: uppercase;
}

/* ============================ START ============================== */
.start-inner { width: min(960px, 100%); text-align: center; }
.logo {
  font-family: var(--font-disp); line-height: .82; margin: 14px 0 6px;
  font-size: clamp(72px, 17vw, 190px); letter-spacing: -.02em; text-transform: uppercase;
}
.logo-rep { color: var(--ink); }
.logo-rush {
  color: var(--lime);
  text-shadow: 0 0 24px rgba(198,255,61,.55), 6px 6px 0 var(--magenta);
}
.tagline {
  max-width: 540px; margin: 28px auto 36px; color: #b9c3b2; font-size: clamp(15px, 2vw, 19px);
  line-height: 1.45;
}

.exercise-pick {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px;
}
.ex-card {
  position: relative; cursor: pointer; text-align: left; color: var(--ink);
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.09); border-radius: 16px; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.4), border-color .18s, background .18s, box-shadow .18s;
}
.ex-card:hover { transform: translateY(-5px) rotate(-.5deg); border-color: rgba(198,255,61,.4); }
.ex-card.active {
  border-color: var(--lime);
  background: linear-gradient(160deg, rgba(198,255,61,.16), rgba(198,255,61,.02));
  box-shadow: 0 0 0 1px var(--lime), 0 18px 50px -20px rgba(198,255,61,.6);
}
/* animated exercise icons */
.ex-icon { width: clamp(48px, 7vw, 64px); height: clamp(48px, 7vw, 64px); display: block;
  color: var(--ink); margin-bottom: 2px; transition: color .18s; }
.ex-icon .ln { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ex-icon circle, .ex-icon .wt { fill: currentColor; }
.ex-card:hover .ex-icon, .ex-card.active .ex-icon { color: var(--lime); }

/* the moving parts animate only while the card is hovered/active */
.ex-icon--curl .curl-fore { transform-box: view-box; transform-origin: 40px 30px; }
.ex-card:hover .ex-icon--curl .curl-fore,
.ex-card.active .ex-icon--curl .curl-fore { animation: curlrep .9s ease-in-out infinite; }
@keyframes curlrep { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-128deg); } }

.ex-icon--squat .squat-body { transform-box: view-box; transform-origin: 32px 56px; }
.ex-card:hover .ex-icon--squat .squat-body,
.ex-card.active .ex-icon--squat .squat-body { animation: squatrep .9s ease-in-out infinite; }
@keyframes squatrep { 0%, 100% { transform: translateY(-4px) scaleY(1.04); } 50% { transform: translateY(5px) scaleY(.88); } }

.ex-icon--press .press-arms { transform-box: view-box; transform-origin: 32px 28px; }
.ex-card:hover .ex-icon--press .press-arms,
.ex-card.active .ex-icon--press .press-arms { animation: pressrep .85s ease-in-out infinite; }
@keyframes pressrep { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  .ex-icon * { animation: none !important; }
}

.ex-name { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.ex-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.start-controls { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.target-row { display: flex; align-items: center; gap: 12px; }
.target-label, .core-label, .depth-label, .stat-label, .combo-label, .sum-lab {
  font-family: var(--font-mono); font-size: 28px; letter-spacing: .2em; color: var(--muted);
}
.stepper {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 8px 14px;
}
.stepper button {
  width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
  background: rgba(255,255,255,.08); color: var(--ink); font-size: 20px; font-family: var(--font-disp);
  transition: background .15s, transform .1s;
}
.stepper button:hover { background: var(--lime); color: #000; }
.stepper button:active { transform: scale(.9); }
#repTarget { font-family: var(--font-disp); font-size: 26px; min-width: 38px; text-align: center; }

.start-btn {
  position: relative; overflow: hidden; cursor: pointer; border: none;
  font-family: var(--font-disp); font-size: 22px; letter-spacing: .06em; text-transform: uppercase;
  color: #06070a; background: var(--lime); padding: 16px 40px; border-radius: 14px;
  transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
  box-shadow: 0 14px 40px -14px rgba(198,255,61,.8);
}
.start-btn:disabled { background: #2a2f25; color: #6b745f; cursor: not-allowed; box-shadow: none; }
.start-btn:not(:disabled):hover { transform: translateY(-3px) scale(1.02); }
.start-btn:not(:disabled):active { transform: translateY(0) scale(.98); }
.start-btn-glow {
  position: absolute; inset: 0; background: linear-gradient(120deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-120%); transition: none;
}
.start-btn:not(:disabled):hover .start-btn-glow { animation: sweep 1s ease; }
@keyframes sweep { to { transform: translateX(120%); } }

.privacy { margin-top: 30px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }

/* ============================ LOADING =========================== */
.loading-screen { flex-direction: column; gap: 26px; }
.loader-core {
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--lime), var(--lime-dim) 55%, transparent 72%);
  box-shadow: 0 0 60px rgba(198,255,61,.6); animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.1); opacity: 1; } }
.loading-text { font-family: var(--font-mono); letter-spacing: .25em; color: var(--lime); font-size: 30px; }

/* ============================ GAME ============================== */
.game-screen { padding: 0; }
.stage {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #000;
}
#video, #glfx, #overlay, #fx {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
/* The WebGL layer (#glfx) renders the camera + shader FX and is what you see.
   #video stays in the DOM (MediaPipe + WebGL read frames from it) but is hidden
   beneath the opaque GL canvas. The skeleton overlay is mirrored once in its
   draw loop to match the GL-mirrored (selfie) camera. */
#video { z-index: 0; visibility: hidden; }
#glfx { z-index: 1; }
#overlay { z-index: 2; filter: drop-shadow(0 0 3px rgba(198,255,61,.5)); }
#fx { z-index: 3; pointer-events: none; }

.flash {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(198,255,61,.5), transparent 60%);
}
.flash.go { animation: flashpop .42s ease-out; }
@keyframes flashpop { 0% { opacity: .9; } 100% { opacity: 0; } }

/* HUD scaffolding */
.hud { position: absolute; z-index: 6; left: 0; right: 0; display: flex; justify-content: space-between;
  padding: clamp(14px, 2.4vw, 26px); pointer-events: none; }
.hud button { pointer-events: auto; }
.hud-top { top: 0; align-items: flex-start; }
.hud-bottom { bottom: 0; align-items: center; }

.hud-left { display: flex; gap: 14px; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(7,8,12,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 16px 28px; min-width: 190px;
}
.stat-val { font-family: var(--font-disp); font-size: 88px; line-height: 1; }

.combo-wrap {
  display: flex; align-items: baseline; gap: 3px; position: relative;
  background: rgba(7,8,12,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,46,136,.4); border-radius: 16px; padding: 16px 30px;
  transition: transform .12s, box-shadow .2s;
}
.combo-wrap.bump { animation: combobump .3s cubic-bezier(.2,1.6,.3,1); }
@keyframes combobump { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-2deg); } 100% { transform: scale(1); } }
.combo-x { font-family: var(--font-disp); font-size: 52px; color: var(--magenta); }
.combo-val { font-family: var(--font-disp); font-size: 96px; line-height: 1; color: var(--magenta);
  text-shadow: 0 0 16px rgba(255,46,136,.7); }
.combo-label { font-family: var(--font-mono); font-size: 26px; letter-spacing: .15em; color: var(--muted); margin-left: 8px; }

/* center rep ring */
.rep-center { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; text-align: center;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.9,.3,1.3); }
/* during calibration the center rep count + set line are hidden; they pop in on lock */
.game-screen.calibrating .rep-center {
  opacity: 0; transform: translate(-50%,-46%) scale(.85); pointer-events: none; }

/* calibration also clears the score/combo HUD and the power core so the frame is
   minimal — these fade back in on lock */
.hud-top, .core-wrap { transition: opacity .45s ease, transform .45s cubic-bezier(.2,.9,.3,1.3); }
.game-screen.calibrating .hud-top { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.game-screen.calibrating .core-wrap { opacity: 0; transform: translateY(-50%) scale(.85); }
.rep-ring { position: relative; width: clamp(280px, 44vh, 420px); aspect-ratio: 1; }
.rep-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.1); stroke-width: var(--ring-w); }
.ring-fg { fill: none; stroke: var(--lime); stroke-width: var(--ring-w); stroke-linecap: round;
  stroke-dasharray: 339.292; stroke-dashoffset: 339.292;
  filter: drop-shadow(0 0 8px rgba(198,255,61,.7)); transition: stroke-dashoffset .5s cubic-bezier(.2,.9,.3,1); }
.rep-numbers { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rep-count { font-family: var(--font-disp); font-size: clamp(120px, 20vh, 200px); line-height: .85;
  text-shadow: 0 0 30px rgba(0,0,0,.6); }
.rep-count.pop { animation: reppop .35s cubic-bezier(.2,1.7,.3,1); }
@keyframes reppop { 0% { transform: scale(1); } 45% { transform: scale(1.35); color: var(--lime); } 100% { transform: scale(1); } }
.rep-target { font-family: var(--font-mono); font-size: 44px; color: var(--muted); letter-spacing: .1em; margin-top: 10px; }
.set-line { font-family: var(--font-mono); font-size: 36px; letter-spacing: .2em; color: #cdd6c6;
  background: rgba(7,8,12,.5); padding: 12px 28px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); }

/* depth meter (left side) */
.depth-meter { position: absolute; z-index: 5; left: clamp(14px,2.4vw,26px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.depth-bar { position: relative; width: 40px; height: clamp(200px, 40vh, 360px);
  background: rgba(255,255,255,.07); border-radius: 999px; border: 1px solid rgba(255,255,255,.1); overflow: hidden; }
.depth-fill { position: absolute; bottom: 0; left: 0; right: 0; height: 0%;
  background: linear-gradient(180deg, var(--lime), var(--cyan)); transition: height .08s linear; }
.depth-zone { position: absolute; left: 0; right: 0; height: 16%; }
.depth-zone.top { top: 0; background: rgba(255,46,136,.18); border-bottom: 1px dashed rgba(255,46,136,.5); }
.depth-zone.bottom { bottom: 0; background: rgba(198,255,61,.12); border-top: 1px dashed rgba(198,255,61,.5); }
.depth-label { writing-mode: vertical-rl; font-size: 30px; }

/* power core (right side) */
.core-wrap { position: absolute; z-index: 5; right: clamp(14px,2.4vw,26px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.core { position: relative; width: clamp(150px, 16vw, 200px); aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.14); overflow: hidden; display: grid; place-items: center;
  background: rgba(7,8,12,.5); }
.core-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: linear-gradient(180deg, var(--magenta), var(--amber)); transition: height .5s cubic-bezier(.2,.9,.3,1); opacity: .85; }
.core.full { animation: corefull .6s ease infinite alternate; }
@keyframes corefull { from { box-shadow: 0 0 0 rgba(255,176,32,.0); } to { box-shadow: 0 0 40px rgba(255,176,32,.9); } }
.core-pct { position: relative; font-family: var(--font-disp); font-size: 60px; }

/* coach toast */
.coach { position: absolute; z-index: 6; left: 50%; bottom: clamp(90px, 14vh, 130px); transform: translateX(-50%) translateY(20px);
  font-family: var(--font-mono); font-size: clamp(40px, 5.5vw, 56px); font-weight: 500; letter-spacing: .08em; padding: 18px 40px; border-radius: 999px;
  background: rgba(7,8,12,.7); border: 1px solid rgba(255,176,32,.5); color: var(--amber);
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  white-space: nowrap; max-width: 92vw; text-align: center; }
.coach.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.coach.good { border-color: rgba(198,255,61,.5); color: var(--lime); }

/* big banner (level up / set clear) */
.banner { position: absolute; z-index: 7; left: 50%; top: 38%; transform: translate(-50%,-50%) scale(.6);
  font-family: var(--font-disp); font-size: clamp(48px, 9vw, 120px); text-transform: uppercase; letter-spacing: .02em;
  text-align: center; opacity: 0; pointer-events: none; line-height: .9; white-space: nowrap; }
.banner.show { animation: bannerpop 1.5s cubic-bezier(.2,1.3,.3,1) forwards; }
@keyframes bannerpop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.5); }
  15% { opacity: 1; transform: translate(-50%,-50%) scale(1.05); }
  78% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-58%) scale(1); }
}

/* calibration overlay */
.calib { position: absolute; inset: 0; z-index: 8; display: grid; place-items: start center;
  padding-top: clamp(24px, 5vh, 60px); pointer-events: none; }
.calib.hidden { display: none; }
.calib-card { pointer-events: auto; text-align: center; width: min(720px, 92%);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: rgba(7,8,12,.4); backdrop-filter: blur(4px);
  border: 1px solid rgba(25,227,255,.22); border-radius: 22px;
  padding: clamp(24px, 4vh, 40px) clamp(22px, 4vw, 44px);
  box-shadow: 0 30px 80px -36px rgba(0,0,0,.8); }
.calib-kicker { font-family: var(--font-mono); font-size: 26px; letter-spacing: .26em; color: var(--cyan); }
.calib-title { font-family: var(--font-disp); font-size: clamp(40px, 6.5vw, 68px); line-height: .95;
  text-transform: uppercase; text-shadow: 0 0 26px rgba(25,227,255,.45); }
.calib-hint { font-family: var(--font-head); font-size: clamp(20px, 2.4vw, 28px); color: #cdd6c6;
  text-shadow: 0 2px 12px rgba(0,0,0,.9); }

/* visual 3-step rep guide ----------------------------------------- */
.calib-steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 2px; }
.cstep { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #aeb8a8;
  opacity: .45; transition: opacity .3s ease, color .3s ease; }
.cstep.active, .cstep.done { opacity: 1; }
.cstep.active { color: var(--cyan); }
.cstep.done { color: var(--lime); }
.cstep-fig { width: clamp(78px, 10vw, 118px); aspect-ratio: 48 / 64; display: grid; place-items: center;
  border-radius: 16px; border: 2px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03);
  transition: border-color .3s, background .3s, box-shadow .3s, transform .3s; }
.cstep-fig svg { width: 86%; height: 86%; }
.cstep-fig .ln { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.cstep-fig circle, .cstep-fig .wt { fill: currentColor; }
.cstep.active .cstep-fig { border-color: var(--cyan); background: rgba(25,227,255,.1); transform: translateY(-2px);
  animation: cstepPulse 1.1s ease-in-out infinite; }
.cstep.done .cstep-fig { border-color: var(--lime); background: rgba(198,255,61,.1); }
@keyframes cstepPulse {
  0%, 100% { box-shadow: 0 0 24px -10px rgba(25,227,255,.5); }
  50% { box-shadow: 0 0 32px -2px rgba(25,227,255,.95); }
}
/* connector fills once both ends are complete */
.cstep-link { width: clamp(16px, 4vw, 46px); height: 3px; border-radius: 2px; align-self: center;
  background: rgba(255,255,255,.16); transition: background .3s, box-shadow .3s; }
.cstep-link.done { background: var(--lime); box-shadow: 0 0 10px rgba(198,255,61,.6); }

.calib-card.flash-ok .calib-title { animation: calibok .5s ease; }
@keyframes calibok { 0%,100% { color: var(--ink); } 40% { color: var(--lime); transform: scale(1.06); } }
#calibSkip { margin-top: 6px; }

/* debug panel */
.debug { position: absolute; z-index: 7; left: clamp(14px,2.4vw,26px); bottom: clamp(70px, 11vh, 96px);
  width: 248px; background: rgba(5,6,9,.82); backdrop-filter: blur(10px);
  border: 1px solid rgba(25,227,255,.4); border-radius: 12px; padding: 12px 14px;
  font-family: var(--font-mono); pointer-events: none; }
.debug.off { display: none; }
.debug-title { font-size: 11px; letter-spacing: .14em; color: var(--cyan); margin-bottom: 9px;
  display: flex; justify-content: space-between; align-items: center; }
.debug-hint { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.debug-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; }
.debug-grid .k { color: var(--muted); }
.debug-grid .val { color: var(--ink); text-align: right; }
.debug-grid .val.hot { color: var(--magenta); }
.debug-grid .val.ok { color: var(--lime); }
.debug-grid .val.dim { color: #5a6356; }
.debug-state { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px; display: flex; align-items: center; gap: 8px; }
.debug-pill { padding: 2px 9px; border-radius: 999px; font-size: 11px; letter-spacing: .1em; }
.debug-pill.down { background: rgba(255,255,255,.1); color: #cdd6c6; }
.debug-pill.up { background: rgba(255,46,136,.25); color: var(--magenta); }
.debug-bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(255,255,255,.1);
  position: relative; overflow: hidden; }
.debug-bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg,var(--lime),var(--cyan)); }

/* bottom controls */
.ghost-btn { font-family: var(--font-mono); font-size: 28px; letter-spacing: .12em; cursor: pointer;
  color: #cdd6c6; background: rgba(7,8,12,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 16px 30px; transition: all .15s; }
.ghost-btn:hover { border-color: var(--lime); color: var(--lime); }
.ghost-btn.big { padding: 20px 40px; font-size: 32px; }

.rhythm { display: flex; gap: 12px; align-items: center; }
.rhythm span { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16); transition: all .15s; }
.rhythm span.lit { background: var(--lime); box-shadow: 0 0 10px var(--lime); transform: scale(1.25); }

/* ===================== SUMMARY (shareable card) =================== */
/* full-bleed: live camera on the right, stats on the left, blended by a veil */
.summary-screen { display: block; padding: 0; overflow: hidden; }

.summary-cam {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1); /* selfie */
  filter: saturate(1.06) contrast(1.04) brightness(.95);
  z-index: 0;
}
/* dark-on-left gradient that dissolves into the camera on the right,
   plus a soft neon wash + vignette so it reads like the in-workout view */
.summary-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(80% 120% at 0% 50%, rgba(198,255,61,.10), transparent 60%),
    radial-gradient(70% 100% at 8% 100%, rgba(255,46,136,.12), transparent 65%),
    linear-gradient(96deg,
      var(--bg) 0%, var(--bg) 30%,
      rgba(7,8,12,.78) 44%, rgba(7,8,12,.35) 56%, transparent 72%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.45)); /* vignette */
}

.summary-panel {
  position: absolute; z-index: 2; left: 0; top: 0; bottom: 0;
  width: min(580px, 54%);
  padding: clamp(28px, 5vw, 68px);
  display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 1.6vh, 18px);
}

.summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-bottom: 4px; }
.summary-logo { font-family: var(--font-disp); font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -.01em; text-transform: uppercase; line-height: 1; }
.summary-logo .logo-rush { text-shadow: 0 0 14px rgba(198,255,61,.5), 3px 3px 0 var(--magenta); }
.summary-meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  color: var(--muted); text-transform: uppercase; text-align: right; }

.summary-title { font-family: var(--font-disp); font-size: clamp(40px, 7vw, 84px); line-height: .92;
  margin: 2px 0 8px; text-transform: uppercase; color: var(--lime);
  text-shadow: 4px 4px 0 var(--magenta); }

.summary-stats { display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 16px); margin: 6px 0; }
.sum-row { display: flex; align-items: baseline; gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: clamp(6px, 1.2vh, 12px); }
.sum-num { font-family: var(--font-disp); font-size: clamp(34px, 5.2vw, 60px); line-height: .9;
  min-width: 2.4ch; text-align: right; }
.sum-lab { font-family: var(--font-mono); letter-spacing: .18em; color: #cdd6c6; }
.sum-row:nth-child(1) .sum-num { color: var(--lime); }
.sum-row:nth-child(2) .sum-num { color: var(--ink); }
.sum-row:nth-child(3) .sum-num { color: var(--magenta); }
.sum-row:nth-child(4) .sum-num { color: var(--cyan); }

.summary-share { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--lime); opacity: .85; margin-top: 2px; }
.summary-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: clamp(8px, 1.6vh, 16px); }

/* ============================ RESPONSIVE ======================= */
@media (max-width: 760px) {
  .exercise-pick { grid-template-columns: 1fr; }
  .hud-left { flex-direction: column; gap: 8px; }
  .depth-meter { display: none; }
  .combo-label { display: none; }
  /* stack: camera on top, stats panel over a bottom-up gradient */
  .summary-panel { width: 100%; top: auto; bottom: 0; height: auto; justify-content: flex-end;
    padding: clamp(20px, 5vw, 36px); }
  .summary-veil {
    background:
      radial-gradient(90% 60% at 50% 100%, rgba(198,255,61,.10), transparent 60%),
      linear-gradient(0deg, var(--bg) 0%, var(--bg) 22%, rgba(7,8,12,.7) 42%, transparent 66%);
  }
  .summary-head { margin-bottom: 0; }
}
