/* ═══════════════════════════════════════════════════
   SHADOWBOX PRO — STYLES
   Dark boxing gym: Black · Red · Gold
═══════════════════════════════════════════════════ */

:root {
  --red:       #E8000D;
  --red-bright:#FF3B3B;
  --red-dark:  #9B0009;
  --gold:      #FFD700;
  --gold-dim:  #B8960C;
  --black:     #0A0A0A;
  --dark:      #111111;
  --dark2:     #1A1A1A;
  --dark3:     #222222;
  --white:     #FFFFFF;
  --grey:      #888888;
  --grey-light:#CCCCCC;
  --green:     #00E676;
  --yellow:    #FFD600;

  --font-display: 'Bebas Neue', sans-serif;
  --font-ui:      'Oswald', sans-serif;
  --font-body:    'Inter', sans-serif;

  --glow-red:  0 0 20px rgba(232,0,13,0.7), 0 0 60px rgba(232,0,13,0.3);
  --glow-gold: 0 0 20px rgba(255,215,0,0.7), 0 0 60px rgba(255,215,0,0.3);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── GESTURE INFO BOX (home screen) ── */
.gesture-info-box {
  width: 100%;
  background: rgba(232,0,13,0.08);
  border: 1px solid rgba(232,0,13,0.3);
  border-radius: 16px;
  padding: 16px;
  animation: fadeUp 0.6s 0.6s both;
}
.gi-title {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: 3px;
  color: var(--red-bright);
  text-align: center;
  margin-bottom: 12px;
}
.gi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gi-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--grey-light);
  font-family: var(--font-body);
}
.gi-icon { font-size: 16px; flex-shrink: 0; }

/* ── SCREENS ── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
  overflow: hidden;
}
.screen.active {
  opacity: 1; pointer-events: all;
}

/* ════════════════════════════════════════════════
   HOME SCREEN
════════════════════════════════════════════════ */
#screen-home {
  background: radial-gradient(ellipse at 50% 0%, #2a0000 0%, #0A0A0A 60%);
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px 40px;
}

/* Background rings */
.bg-rings { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(232,0,13,0.15);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: ringPulse 4s ease-in-out infinite;
}
.ring-1 { width: 300px; height: 300px; animation-delay: 0s; }
.ring-2 { width: 600px; height: 600px; animation-delay: 1s; }
.ring-3 { width: 900px; height: 900px; animation-delay: 2s; }

@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 0.7; transform: translate(-50%, -50%) scale(1.05); }
}

/* Particles */
.particles { position: fixed; inset: 0; pointer-events: none; }
.particle {
  position: absolute; width: 3px; height: 3px;
  background: var(--red); border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-20px) scale(1.5); opacity: 0; }
}

/* Home Content */
.home-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  align-items: center; gap: 24px;
  padding-top: 20px;
}

/* Logo */
.logo-wrap {
  display: flex; align-items: center; gap: 14px;
  animation: logoEntrance 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes logoEntrance {
  from { transform: scale(0.5) translateY(-30px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.logo-icon svg { width: 64px; height: 64px; filter: drop-shadow(var(--glow-red)); }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-main {
  font-family: var(--font-display);
  font-size: clamp(36px, 8vw, 52px);
  color: var(--white);
  letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(232,0,13,0.5);
}
.logo-sub {
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 26px);
  color: var(--red);
  letter-spacing: 8px;
  text-shadow: var(--glow-red);
}

/* Tagline */
.home-tagline {
  font-family: var(--font-ui);
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 300;
  color: var(--grey-light);
  text-align: center;
  letter-spacing: 2px;
  line-height: 1.6;
  animation: fadeUp 0.6s 0.3s both;
}

/* High Score Banner */
.highscore-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 50px;
  padding: 8px 20px;
  animation: fadeUp 0.6s 0.4s both;
}
.hs-label { font-family: var(--font-ui); font-size: 13px; color: var(--gold); letter-spacing: 1px; }
.hs-value { font-family: var(--font-display); font-size: 22px; color: var(--gold); text-shadow: var(--glow-gold); }

/* Section Label */
.section-label {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: 4px;
  color: var(--grey); text-align: center;
  margin-bottom: -8px;
}

/* Difficulty Cards */
.difficulty-section { width: 100%; animation: fadeUp 0.6s 0.5s both; }
.difficulty-cards {
  display: flex; gap: 10px;
  width: 100%;
}
.diff-card {
  flex: 1; position: relative;
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  text-align: center;
}
.diff-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.2); }
.diff-card.selected {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(232,0,13,0.15), var(--dark2));
  box-shadow: 0 0 20px rgba(232,0,13,0.3), inset 0 0 20px rgba(232,0,13,0.05);
}
.diff-glow {
  position: absolute; inset: 0; border-radius: 16px;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.diff-card.selected .diff-glow { opacity: 1; }
.beginner-glow { background: radial-gradient(circle at 50% 0%, rgba(0,230,118,0.15), transparent 70%); }
.hard-glow     { background: radial-gradient(circle at 50% 0%, rgba(255,214,0,0.15), transparent 70%); }
.pro-glow      { background: radial-gradient(circle at 50% 0%, rgba(232,0,13,0.2), transparent 70%); }

.diff-badge { font-size: 22px; }
.diff-name {
  font-family: var(--font-display);
  font-size: clamp(16px, 4vw, 22px);
  letter-spacing: 1px;
  color: var(--white);
}
.diff-stats { display: flex; gap: 6px; width: 100%; justify-content: center; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-val { font-family: var(--font-display); font-size: clamp(11px, 2.5vw, 14px); color: var(--gold); }
.stat-lbl { font-size: 9px; color: var(--grey); letter-spacing: 0.5px; text-transform: uppercase; }
.diff-moves {
  font-size: 9px; color: var(--grey);
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* Start Button */
.btn-start {
  position: relative; overflow: hidden;
  width: 100%; max-width: 320px;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: none; border-radius: 50px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  letter-spacing: 3px;
  color: var(--white);
  box-shadow: var(--glow-red), 0 8px 32px rgba(232,0,13,0.4);
  transition: all 0.2s ease;
  animation: fadeUp 0.6s 0.7s both, btnPulse 2s 1.5s ease-in-out infinite;
}
.btn-start:hover { transform: scale(1.04); box-shadow: 0 0 40px rgba(232,0,13,0.8), 0 12px 40px rgba(232,0,13,0.5); }
.btn-start:active { transform: scale(0.97); }
.btn-icon { font-size: 24px; }
.btn-shine {
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shine 3s 2s ease-in-out infinite;
}
@keyframes shine {
  0%   { left: -100%; }
  30%  { left: 150%; }
  100% { left: 150%; }
}
@keyframes btnPulse {
  0%, 100% { box-shadow: var(--glow-red), 0 8px 32px rgba(232,0,13,0.4); }
  50%       { box-shadow: 0 0 40px rgba(232,0,13,0.9), 0 12px 50px rgba(232,0,13,0.6); }
}

/* How to play */
.how-to {
  font-size: 11px; color: var(--grey);
  text-align: center; letter-spacing: 0.5px;
  animation: fadeUp 0.6s 0.9s both;
}

/* ════════════════════════════════════════════════
   ARENA SCREEN
════════════════════════════════════════════════ */
#screen-arena {
  background: var(--black);
  flex-direction: column;
}

/* Camera */
#camera-feed {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
  z-index: 0;
}
.camera-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.2) 30%,
    rgba(0,0,0,0.2) 60%,
    rgba(0,0,0,0.85) 100%
  );
  z-index: 1;
}
.no-camera {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, #1a0000, #0A0A0A);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
}
.no-cam-icon { font-size: 48px; opacity: 0.4; }
.no-camera p { color: var(--grey); text-align: center; font-size: 14px; }

/* Top Bar */
.top-bar {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.top-item { display: flex; flex-direction: column; align-items: flex-start; min-width: 80px; }
.top-item.right { align-items: flex-end; }
.top-label { font-family: var(--font-ui); font-size: 10px; letter-spacing: 2px; color: var(--grey); }
.top-value { font-family: var(--font-display); font-size: 28px; color: var(--white); line-height: 1; }
.streak-val { color: var(--gold); text-shadow: var(--glow-gold); }

/* Timer Ring */
.top-center { display: flex; align-items: center; justify-content: center; }
.timer-ring { position: relative; width: 70px; height: 70px; }
.timer-ring svg { width: 70px; height: 70px; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 4; }
.timer-progress {
  fill: none; stroke: var(--red); stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s;
}
.timer-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px; color: var(--white);
}

/* Pause Button */
.btn-pause {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%; width: 40px; height: 40px;
  font-size: 16px; color: var(--white); cursor: pointer;
  display: none; /* shown after countdown */
}

/* Punch Arena */
.punch-arena {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}

/* Phase Label */
.phase-label {
  font-family: var(--font-display);
  font-size: clamp(14px, 3vw, 18px);
  letter-spacing: 4px;
  color: var(--grey-light);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
}
.phase-label.visible { opacity: 1; }

/* Punch Card */
.punch-card {
  position: relative;
  background: rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 28px 40px 20px;
  min-width: 260px; max-width: 340px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: scale(0.8) translateY(30px);
  transition: opacity 0.3s, transform 0.3s;
  overflow: hidden;
}
.punch-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.punch-card.defend-card {
  border-color: var(--red-bright);
  box-shadow: var(--glow-red), inset 0 0 30px rgba(232,0,13,0.1);
}
.punch-card.attack-card {
  border-color: var(--gold);
  box-shadow: var(--glow-gold), inset 0 0 30px rgba(255,215,0,0.1);
}

/* Incoming direction arrow */
.punch-direction {
  font-size: 32px;
  animation: directionPulse 0.5s ease-in-out infinite alternate;
}
@keyframes directionPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.2); }
}

.punch-icon { font-size: 52px; line-height: 1; }
.punch-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 42px);
  letter-spacing: 2px;
  color: var(--white);
  text-align: center;
}
.punch-sub {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: 3px;
  color: var(--grey-light);
  text-align: center;
}

/* Reaction Bar */
.reaction-bar-wrap {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
  margin-top: 8px;
}
.reaction-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  border-radius: 3px;
  transform-origin: left;
  transition: transform linear;
}

/* Combo Display */
.combo-display {
  font-family: var(--font-display);
  font-size: clamp(20px, 5vw, 32px);
  color: var(--gold);
  text-shadow: var(--glow-gold);
  letter-spacing: 2px;
  min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  animation: comboPop 0.3s ease;
}
@keyframes comboPop {
  0%   { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Points Popup */
.points-popup {
  position: absolute;
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--gold);
  text-shadow: var(--glow-gold);
  pointer-events: none;
  opacity: 0;
}
.points-popup.animate {
  animation: pointsFloat 1s ease-out forwards;
}
@keyframes pointsFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

/* Screen Flash */
.screen-flash {
  position: absolute; inset: 0; z-index: 50;
  pointer-events: none; opacity: 0;
}
.screen-flash.red-flash {
  background: rgba(232,0,13,0.4);
  animation: flashAnim 0.3s ease-out forwards;
}
.screen-flash.gold-flash {
  background: rgba(255,215,0,0.3);
  animation: flashAnim 0.3s ease-out forwards;
}
@keyframes flashAnim {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Screen Shake */
@keyframes screenShake {
  0%,100% { transform: translate(0,0) rotate(0); }
  20%      { transform: translate(-6px, 4px) rotate(-0.5deg); }
  40%      { transform: translate(6px, -4px) rotate(0.5deg); }
  60%      { transform: translate(-4px, 6px) rotate(-0.3deg); }
  80%      { transform: translate(4px, -2px) rotate(0.3deg); }
}
.shake { animation: screenShake 0.4s ease-out; }

/* Mobile Controls */
.mobile-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 10;
  padding: 12px 16px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  display: flex; flex-direction: column; gap: 8px;
}
.ctrl-row { display: flex; justify-content: center; gap: 10px; }
.ctrl-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px;
  padding: 12px 20px;
  color: var(--white);
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  min-width: 70px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.25); }
.hit-btn {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: var(--red-bright);
  box-shadow: var(--glow-red);
  min-width: 90px;
}
.hit-btn:active { background: var(--red-bright); }
.ctrl-icon { font-size: 20px; }
.ctrl-lbl { font-family: var(--font-ui); font-size: 10px; letter-spacing: 1px; }

/* Pause Overlay */
.pause-overlay {
  position: absolute; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.pause-box {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  padding: 40px;
}
.pause-title {
  font-family: var(--font-display);
  font-size: 56px; letter-spacing: 4px;
  color: var(--white);
}
.pause-btn {
  width: 220px; padding: 14px;
  background: var(--red); border: none; border-radius: 50px;
  font-family: var(--font-display); font-size: 20px; letter-spacing: 2px;
  color: var(--white); cursor: pointer;
  transition: all 0.2s;
}
.pause-btn:hover { transform: scale(1.05); }
.pause-btn.secondary { background: var(--dark3); border: 1px solid rgba(255,255,255,0.2); }

/* Countdown Overlay */
.countdown-overlay {
  position: absolute; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  backdrop-filter: blur(4px);
}
.countdown-num {
  font-family: var(--font-display);
  font-size: clamp(100px, 25vw, 160px);
  color: var(--red);
  text-shadow: var(--glow-red);
  animation: countPop 0.8s ease-out;
  line-height: 1;
}
@keyframes countPop {
  0%   { transform: scale(2); opacity: 0; }
  50%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.countdown-label {
  font-family: var(--font-display);
  font-size: clamp(20px, 5vw, 28px);
  letter-spacing: 6px;
  color: var(--grey-light);
}

/* ════════════════════════════════════════════════
   RESULTS SCREEN
════════════════════════════════════════════════ */
#screen-results {
  background: radial-gradient(ellipse at 50% 30%, #1a0000, #0A0A0A 70%);
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
  padding: 30px 16px 40px;
}
.results-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.results-ring {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(232,0,13,0.2);
  animation: ringPulse 3s ease-in-out infinite;
}

.results-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  align-items: center; gap: 24px;
}

.results-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 10vw, 64px);
  letter-spacing: 3px;
  color: var(--white);
  text-shadow: var(--glow-red);
  animation: fadeUp 0.5s both;
}
.results-subtitle {
  font-family: var(--font-ui);
  font-size: 14px; letter-spacing: 3px;
  color: var(--grey);
  animation: fadeUp 0.5s 0.1s both;
}

/* Stats Grid */
.results-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 100%;
  animation: fadeUp 0.5s 0.2s both;
}
.result-stat {
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  transition: transform 0.3s;
}
.result-stat:hover { transform: translateY(-3px); }
.result-stat.highlight {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255,215,0,0.1), var(--dark2));
  box-shadow: 0 0 20px rgba(255,215,0,0.2);
}
.rs-icon { font-size: 28px; }
.rs-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 40px);
  color: var(--white);
  line-height: 1;
}
.result-stat.highlight .rs-value { color: var(--gold); text-shadow: var(--glow-gold); }
.rs-label {
  font-family: var(--font-ui);
  font-size: 11px; letter-spacing: 2px;
  color: var(--grey);
}

/* New High Score */
.new-hs-banner {
  width: 100%;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-dim));
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 3px;
  color: var(--black);
  animation: hsBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) both, hsGlow 1.5s ease-in-out infinite;
}
@keyframes hsBounce {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes hsGlow {
  0%,100% { box-shadow: 0 0 20px rgba(255,215,0,0.5); }
  50%      { box-shadow: 0 0 40px rgba(255,215,0,0.9); }
}

/* Results Buttons */
.results-buttons {
  display: flex; flex-direction: column;
  gap: 10px; width: 100%;
  animation: fadeUp 0.5s 0.4s both;
}
.res-btn {
  width: 100%; padding: 16px;
  border: none; border-radius: 50px;
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 22px);
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.res-btn:hover { transform: scale(1.03); }
.res-btn:active { transform: scale(0.97); }
.res-btn.primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  box-shadow: var(--glow-red);
}
.res-btn.secondary {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
}
.res-btn.tertiary {
  background: var(--dark2);
  color: var(--grey-light);
  border: 1px solid rgba(255,255,255,0.1);
}
.res-btn.share-btn {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--black);
}

/* ════════════════════════════════════════════════
   TOAST
════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,30,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 12px 24px;
  font-family: var(--font-ui);
  font-size: 14px; letter-spacing: 1px;
  color: var(--white);
  z-index: 999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════
   FIRE ANIMATION (combo streak)
════════════════════════════════════════════════ */
.fire-wrap {
  display: inline-flex; align-items: center; gap: 8px;
}
.fire-emoji {
  display: inline-block;
  animation: fireDance 0.3s ease-in-out infinite alternate;
}
@keyframes fireDance {
  from { transform: scale(1) rotate(-5deg); }
  to   { transform: scale(1.2) rotate(5deg); }
}

/* ════════════════════════════════════════════════
   PUNCH CARD ENTRANCE ANIMATIONS
════════════════════════════════════════════════ */
.from-left  { animation: slideFromLeft  0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.from-right { animation: slideFromRight 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.from-top   { animation: slideFromTop   0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.from-center{ animation: popFromCenter  0.4s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes slideFromLeft {
  from { transform: translateX(-120%) scale(0.8); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes slideFromRight {
  from { transform: translateX(120%) scale(0.8); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes slideFromTop {
  from { transform: translateY(-100%) scale(0.8); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes popFromCenter {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ════════════════════════════════════════════════
   UTILITY
════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .diff-card { padding: 12px 6px; }
  .diff-stats { flex-direction: column; gap: 2px; }
  .punch-card { min-width: 220px; padding: 20px 24px 16px; }
  .ctrl-btn { min-width: 60px; padding: 10px 14px; }
}

@media (min-width: 768px) {
  .mobile-controls { display: none; }
  .btn-pause { display: block; }
}

@media (max-width: 767px) {
  .btn-pause { display: none; }
}

/* ── FEEDBACK LABEL (PERFECT / GOOD / WRONG / TOO SLOW) ── */
.feedback-label {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 44px);
  letter-spacing: 3px;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  z-index: 20;
  text-shadow: 0 0 20px currentColor;
}
@keyframes feedbackPop {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.6) translateY(10px); }
  20%  { opacity: 1; transform: translateX(-50%) scale(1.1) translateY(0); }
  60%  { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(-20px); }
}

/* Neon text effect for big moments */
.neon-text {
  animation: neonFlicker 0.1s ease-in-out 3;
}
@keyframes neonFlicker {
  0%,100% { text-shadow: var(--glow-red); }
  50%      { text-shadow: none; }
}

/* ════════════════════════════════════════════════
   CALIBRATION SCREEN
════════════════════════════════════════════════ */
#screen-calibration {
  background: var(--black);
  flex-direction: column;
}

#calib-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 0;
  opacity: 0.5;
}

#calib-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: scaleX(-1);
  z-index: 1;
  pointer-events: none;
}

.calib-overlay {
  position: absolute; inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.calib-box {
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(12px);
}

.calib-icon {
  font-size: 52px;
  margin-bottom: 12px;
  display: block;
  animation: calib-bounce 1s ease-in-out infinite alternate;
}
@keyframes calib-bounce {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

.calib-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: 2px;
  color: var(--white);
  margin-bottom: 8px;
}

.calib-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--grey-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.calib-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.calib-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Silhouette guide */
.silhouette-guide {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(200px, 35vw);
  height: min(400px, 70vh);
  z-index: 5;
  pointer-events: none;
  animation: silhouettePulse 2s ease-in-out infinite;
}
@keyframes silhouettePulse {
  0%,100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* Pose quality bar */
.pose-quality {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}
.pq-label {
  font-family: var(--font-ui);
  font-size: 11px; letter-spacing: 2px;
  color: var(--grey);
  white-space: nowrap;
}
.pq-bar-wrap {
  flex: 1; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
}
.pq-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s;
}
.pq-text {
  font-family: var(--font-ui);
  font-size: 11px; color: var(--grey-light);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════
   POSE CANVAS (arena overlay)
════════════════════════════════════════════════ */
#pose-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: scaleX(-1);
  z-index: 2;
  pointer-events: none;
}

/* ════════════════════════════════════════════════
   GESTURE HUD
════════════════════════════════════════════════ */
.gesture-hud {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gesture-hud.detected {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255,215,0,0.4);
}
.gesture-hud.correct {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(0,230,118,0.5);
}
.gesture-hud.wrong {
  border-color: var(--red-bright);
  box-shadow: 0 0 20px rgba(232,0,13,0.5);
}
.gh-label {
  font-family: var(--font-ui);
  font-size: 10px; letter-spacing: 3px;
  color: var(--grey);
}
.gh-value {
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: 1px;
  color: var(--white);
  transition: color 0.2s;
}
.gesture-hud.detected .gh-value { color: var(--gold); }
.gesture-hud.correct  .gh-value { color: var(--green); }
.gesture-hud.wrong    .gh-value { color: var(--red-bright); }