/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --secondary: #8B5CF6;
  --accent: #F97316;
  --accent-light: #FB923C;
  --accent-glow: rgba(249, 115, 22, 0.3);
  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger: #EF4444;
  --bg: #0A0A1B;
  --bg-card: rgba(26, 26, 50, 0.8);
  --bg-card-solid: #1A1A32;
  --bg-card-hover: rgba(34, 34, 66, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(99, 102, 241, 0.2);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --gradient-accent: linear-gradient(135deg, #F97316, #EF4444);
  --gradient-success: linear-gradient(135deg, #10B981, #059669);
  --gradient-bg: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--primary-glow);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Nunito', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: var(--gradient-bg);
  background-attachment: fixed;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 100px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

.hidden { display: none !important; }

/* ===== ANIMATIONS ===== */
.screen {
  animation: screenIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
  50% { box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(139, 92, 246, 0.15); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes countPop {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ===== HEADER ===== */
header {
  padding: 20px 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 30px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  opacity: 0.5;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  transition: var(--transition);
  cursor: default;
}

.streak-badge:hover {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 0 20px var(--accent-glow);
}

.streak-fire {
  font-size: 20px;
  animation: float 2s ease-in-out infinite;
}

.streak-label {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
}

.header-info {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  align-items: center;
}

.day-name {
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
}

.date-display {
  font-size: 13px;
}

/* ===== LOADING ===== */
.loading-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--bg-card-solid);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 30vh auto 20px;
}

#loading p {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  animation: breathe 2s ease-in-out infinite;
}

/* ===== REST DAY ===== */
.rest-day-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin-top: 24px;
  animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rest-emoji {
  font-size: 72px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.rest-day-card h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
}

.rest-day-card > p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 15px;
}

.rest-tips {
  text-align: left;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.rest-tips h3 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rest-tips li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  list-style: none;
  padding-left: 24px;
  position: relative;
}

.rest-tips li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 10px;
  top: 2px;
}

.rest-motivation {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== WORKOUT PREVIEW ===== */
.workout-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}

.workout-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
}

.category-badge {
  display: inline-block;
  background: var(--gradient);
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px var(--primary-glow);
  letter-spacing: 0.3px;
}

.workout-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.workout-motivation {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
  font-weight: 600;
}

.workout-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.stat { text-align: center; }

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-top: 4px;
  display: block;
}

.exercise-list {
  margin-bottom: 28px;
}

.exercise-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: default;
}

.exercise-preview:hover {
  background: var(--bg-glass);
  transform: translateX(4px);
}

.exercise-preview-number {
  width: 32px;
  height: 32px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.exercise-preview-info { flex: 1; }

.exercise-preview-name {
  font-weight: 800;
  font-size: 15px;
}

.exercise-preview-detail {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
}

.exercise-preview-target {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== BUTTONS ===== */
.btn-start {
  width: 100%;
  padding: 20px;
  background: var(--gradient-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 24px var(--accent-glow);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.btn-start::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 3s infinite;
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.45);
}

.btn-start:active {
  transform: translateY(-1px);
}

.btn-action {
  width: 100%;
  padding: 18px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--primary-glow);
}

.btn-finish {
  background: var(--gradient-accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-finish:hover {
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-complete-set {
  width: 100%;
  padding: 20px;
  background: var(--gradient-success);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 24px var(--success-glow);
  position: relative;
  overflow: hidden;
}

.btn-complete-set::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: shimmer 3s infinite;
}

.btn-complete-set:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.45);
}

.btn-complete-set:active {
  transform: scale(0.97);
}

.btn-skip {
  padding: 12px 28px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  border-radius: 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-skip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-muted);
  background: var(--bg-glass);
}

/* ===== WEEK CALENDAR ===== */
.week-calendar {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  flex: 1;
  max-width: 56px;
  cursor: default;
  transition: var(--transition);
  border: 2px solid transparent;
}

.week-day.today {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 20px var(--primary-glow);
}

.week-day.completed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.week-day-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.week-day-number {
  font-size: 17px;
  font-weight: 900;
}

.week-day-status {
  font-size: 12px;
  height: 16px;
}

/* ===== WORKOUT PROGRESS BAR ===== */
.workout-progress {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-card-solid);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
  box-shadow: 0 0 8px var(--primary-glow);
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 700;
}

/* ===== PHASES ===== */
.phase {
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.phase-icon {
  font-size: 28px;
  animation: float 2.5s ease-in-out infinite;
}

.phase-header h2 {
  flex: 1;
  font-size: 22px;
  font-weight: 900;
}

.phase-time {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 16px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
}

/* ===== WARMUP/COOLDOWN LIST ===== */
.warmup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.warmup-item {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  align-items: center;
  transition: var(--transition);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.warmup-item:nth-child(1) { animation-delay: 0.05s; }
.warmup-item:nth-child(2) { animation-delay: 0.1s; }
.warmup-item:nth-child(3) { animation-delay: 0.15s; }
.warmup-item:nth-child(4) { animation-delay: 0.2s; }
.warmup-item:nth-child(5) { animation-delay: 0.25s; }
.warmup-item:nth-child(6) { animation-delay: 0.3s; }

.warmup-item:hover {
  border-color: var(--border-glow);
  transform: translateX(4px);
}

.warmup-item-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.warmup-item-thumb svg {
  width: 100%;
  height: 100%;
}

.warmup-item-content {
  flex: 1;
  min-width: 0;
}

.warmup-item-name {
  font-weight: 800;
  font-size: 15px;
}

.warmup-item-time {
  font-size: 13px;
  color: var(--accent);
  font-weight: 800;
  background: rgba(249, 115, 22, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
}

.warmup-item-instructions {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
}

/* ===== EXERCISE ACTIVE ===== */
.exercise-active {
  padding-bottom: 24px;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.exercise-number {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 16px;
  font-weight: 800;
  border: 1px solid var(--border-subtle);
}

.exercise-name-active {
  font-size: 24px;
  font-weight: 900;
  flex: 1;
  letter-spacing: -0.3px;
}

.exercise-visual {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  position: relative;
  animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.exercise-gif {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.exercise-illustration {
  width: 100%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-illustration svg {
  width: 100%;
  max-height: 260px;
}

.exercise-gif-placeholder {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-dim);
}

.exercise-gif-placeholder .placeholder-icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
  animation: float 2s ease-in-out infinite;
}

.set-info {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.set-badge {
  background: var(--gradient);
  padding: 10px 24px;
  border-radius: 24px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.rep-info {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 10px 24px;
  border-radius: 24px;
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
}

.exercise-instructions {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.exercise-instructions ol {
  padding-left: 22px;
}

.exercise-instructions li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.exercise-instructions li::marker {
  color: var(--primary);
  font-weight: 800;
}

.modification-tip {
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--accent-light);
  margin-bottom: 16px;
  font-weight: 600;
}

/* ===== VIDEO SECTION ===== */
.video-section { margin-bottom: 20px; }

.btn-video-toggle {
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}

.btn-video-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

.video-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-container iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: var(--radius-md);
}

.video-no-key {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ===== TIMER / REST ===== */
.rest-screen {
  text-align: center;
  padding: 24px 0;
  animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.rest-title {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-weight: 700;
}

.timer-circle {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 32px;
  animation: glow 3s ease-in-out infinite;
  border-radius: 50%;
}

.timer-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.timer-bg {
  fill: none;
  stroke: var(--bg-card-solid);
  stroke-width: 5;
}

.timer-progress {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

.timer-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 56px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -2px;
}

.timer-number.pop {
  animation: countPop 0.3s ease;
}

.rest-message {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 700;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== COMPLETED SCREEN ===== */
.completed-card {
  text-align: center;
  padding: 40px 0 20px;
  position: relative;
  z-index: 2;
  animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.completed-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  animation: float 2s ease-in-out infinite;
}

.completed-card h2 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.completed-subtitle {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 32px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.completed-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 32px;
  padding: 24px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.completed-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.completed-stat-icon { font-size: 28px; }

.completed-stat-value {
  font-size: 36px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.completed-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.rating-section {
  margin-bottom: 32px;
}

.rating-section p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.star {
  background: none;
  border: none;
  font-size: 36px;
  cursor: pointer;
  transition: var(--transition);
  filter: grayscale(100%) brightness(0.4);
}

.star.active {
  filter: none;
  transform: scale(1.15);
}

.star:hover {
  transform: scale(1.25);
  filter: none;
}

/* ===== CONFETTI ===== */
.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confettiFall var(--fall-duration, 3s) ease-in forwards;
  animation-delay: var(--fall-delay, 0s);
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% { opacity: 1; }
  100% {
    transform: translateY(100vh) rotate(var(--spin, 720deg)) scale(0.5);
    opacity: 0;
  }
}

/* ===== EXERCISE SET COMPLETION FLASH ===== */
.set-flash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 185, 129, 0.1);
  pointer-events: none;
  z-index: 999;
  animation: flash 0.4s ease-out forwards;
}

@keyframes flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-card-hover); border-radius: 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 380px) {
  #app { padding: 0 12px 80px; }
  .workout-title { font-size: 20px; }
  .stat-number { font-size: 26px; }
  .exercise-name-active { font-size: 20px; }
  .timer-number { font-size: 44px; }
  .timer-circle { width: 160px; height: 160px; }
  .btn-start, .btn-complete-set { font-size: 17px; padding: 18px; }
}

/* ===== SAFE AREA (iPhone notch) ===== */
@supports (padding-top: env(safe-area-inset-top)) {
  header {
    padding-top: calc(20px + env(safe-area-inset-top));
  }
  #app {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}
