:root {
  --bg: #f2f1ee;
  --card-bg: #ffffff;
  --ink: #111111;
  --muted: #8a8a8f;
  --line: #e9e8e4;
  --glow-1: #7c6cff;
  --glow-2: #4f8cff;
  --danger: #ff5c5c;
  --salad: #92d84a;
  --shadow-card: 0 1px 2px rgba(20, 20, 20, 0.04), 0 10px 24px rgba(20, 20, 20, 0.06);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-pill: 999px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
}

.app-container.with-nav {
  padding-bottom: 104px;
}

/* ===== Главный экран ===== */

.app-header {
  text-align: center;
  margin-bottom: 28px;
}

.app-header h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--salad);
  text-shadow: 0 0 10px rgba(146, 216, 74, 0.55), 0 0 26px rgba(146, 216, 74, 0.3), 0 0 46px rgba(146, 216, 74, 0.16);
}

.local-clock {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.home-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.level-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.level-emoji {
  font-size: 60px;
  margin-bottom: 14px;
}

.level-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}

.level-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.stats-row {
  display: flex;
  gap: 12px;
}

.stat-box {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.primary-btn {
  background: var(--ink);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.primary-btn:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.secondary-btn {
  background: var(--card-bg);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease;
}

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

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  width: 100%;
}

.btn-row .secondary-btn {
  flex: 1;
  padding: 12px 8px;
  font-size: 13px;
}

/* ===== Каталог уровней ===== */

.catalog-title {
  font-size: 15px;
  font-weight: 800;
}

.catalog-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.catalog-card.locked {
  opacity: 0.5;
}

.catalog-emoji {
  font-size: 32px;
  flex-shrink: 0;
}

.locked-emoji {
  font-size: 24px;
}

.catalog-info {
  flex: 1;
}

.catalog-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-name-locked {
  color: var(--muted);
}

.catalog-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.current-badge {
  background: var(--ink);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.catalog-card.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.catalog-card.clickable:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 4px 10px rgba(20, 20, 20, 0.06);
}

.catalog-arrow {
  font-size: 22px;
  color: var(--muted);
  flex-shrink: 0;
}

.catalog-exercises {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.exercise-chip {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* ===== Нижний таб-бар (Home / Exercises) ===== */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
}

.bottom-nav-inner {
  max-width: 480px;
  width: 100%;
  display: flex;
  padding: 0 20px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  transition: color 0.12s ease, transform 0.12s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-item.active {
  color: var(--ink);
}

/* ===== Preview-режим на экране тренировки ===== */

.preview-banner {
  background: #fdf1cf;
  color: #8a6a10;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.complete-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 8px;
}

/* ===== Экран тренировки ===== */

.workout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.progress-dots {
  display: flex;
  gap: 6px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.progress-dot.active {
  background: var(--ink);
}

.progress-dot.done {
  background: var(--muted);
}

.workout-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase-block {
  width: 100%;
  text-align: center;
}

.hidden {
  display: none;
}

.phase-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}

.exercise-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 16px;
}

.exercise-cue {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

.big-timer {
  position: relative;
  font-size: 84px;
  font-weight: 800;
  letter-spacing: -3px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  isolation: isolate;
}

.big-timer::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow-1) 0%, var(--glow-2) 55%, transparent 75%);
  filter: blur(38px);
  opacity: 0.28;
  z-index: -1;
}

.complete-emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

#done-reps-btn {
  margin-top: 28px;
  width: 100%;
}

#finish-btn {
  margin-top: 24px;
  width: 100%;
}
