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

:root {
  --bg: #0a0a0f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.3);
  --accent-glow: rgba(249, 115, 22, 0.4);
  --reverse: #06b6d4;
  --reverse-glow: rgba(6, 182, 212, 0.4);
  --core: rgba(255, 255, 255, 0.95);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.1);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#app { height: 100%; position: relative; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  padding-top: env(safe-area-inset-top, 24px);
  padding-bottom: env(safe-area-inset-bottom, 24px);
}

.screen.active { display: flex; }

/* ── Home Screen ── */
.home { justify-content: center; gap: 32px; }

.home__phase {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.home__session {
  font-size: 20px;
  font-weight: 600;
}

.home__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.home__outline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: 280px;
}

.home__outline-exercise {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.home__outline-preview {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home__outline-preview-aura {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.home__outline-preview-core {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--core);
  z-index: 2;
}

.home__outline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home__outline-name {
  font-size: 14px;
  font-weight: 600;
}

.home__outline-params {
  font-size: 11px;
  color: var(--text-muted);
}

.home__outline-rest {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 22px;
  padding: 2px 0;
  opacity: 0.6;
}

.home__start {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 30px var(--accent-glow);
  transition: transform 0.15s;
}

.home__start:active { transform: scale(0.95); }

.home__streak {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.home__nav {
  position: absolute;
  bottom: 40px;
  font-size: 14px;
}

.home__version {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 10px;
  color: rgba(148, 163, 184, 0.4);
}

.home__nav a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 2px;
}

/* ── Exercise Screen ── */
.exercise {
  justify-content: space-between;
  padding-top: 48px;
  padding-bottom: 48px;
}

.exercise__name {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.exercise__circle-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise__aura {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(249, 115, 22, 0.2);
  transition: none;
  will-change: transform;
}

.exercise__core {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--core);
  z-index: 2;
}

.exercise__info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise__phase-label {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.exercise__phase-label--squeeze { color: var(--accent); }
.exercise__phase-label--reverse { color: var(--reverse); }
.exercise__phase-label--relax { color: var(--text-muted); }

.exercise__timer {
  font-size: 48px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.exercise__counter {
  font-size: 13px;
  color: var(--text-muted);
}

.exercise__next {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  min-height: 20px;
}

.exercise__last-rep {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4ade80;
  opacity: 0;
  transition: opacity 0.3s;
}

.exercise__last-rep--visible {
  opacity: 1;
}

.exercise__aura--reverse {
  background: var(--reverse);
  box-shadow: 0 0 20px var(--reverse-glow), 0 0 40px rgba(6, 182, 212, 0.2);
}

.exercise__aura--last-rep {
  background: #4ade80;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.5), 0 0 60px rgba(74, 222, 128, 0.25) !important;
}

.exercise__top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exercise__session-time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.exercise__top-buttons {
  display: flex;
  gap: 8px;
}

.exercise__pause,
.exercise__skip {
  background: none;
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
}

/* ── Rest Between Exercises ── */
.rest-between {
  justify-content: center;
  gap: 16px;
}

.rest-between__label {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rest-between__next {
  font-size: 24px;
  font-weight: 600;
}

.rest-between__timer {
  font-size: 48px;
  font-weight: 300;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Session Complete ── */
.complete { justify-content: center; gap: 24px; }

.complete__title {
  font-size: 28px;
  font-weight: 700;
}

.complete__stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  color: var(--text-muted);
  font-size: 15px;
}

.complete__streak {
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
}

.complete__done {
  padding: 12px 48px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

.complete__done:active { background: var(--surface-border); }

.complete__feedback {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.complete__feedback-btn {
  padding: 10px 20px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.complete__feedback-btn:active { background: var(--surface-border); }
.complete__feedback-btn--easy { border-color: #4ade80; color: #4ade80; }
.complete__feedback-btn--hard { border-color: #f87171; color: #f87171; }

/* ── Level Picker Screen ── */
.level-picker { justify-content: center; gap: 32px; }

.level-picker__title {
  font-size: 22px;
  font-weight: 700;
}

.level-picker__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  max-width: 300px;
}

.level-picker__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.level-picker__option {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.level-picker__option:active { background: var(--surface-border); }

.level-picker__option-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.level-picker__option-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Progress Screen ── */
.progress {
  gap: 24px;
  overflow-y: auto;
  padding-bottom: 60px;
}

.progress__title {
  font-size: 22px;
  font-weight: 700;
  width: 100%;
}

.progress__section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress__label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress__bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress__bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress__value {
  font-size: 15px;
  font-weight: 600;
}

.progress__streaks {
  display: flex;
  gap: 24px;
}

.progress__streak-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress__heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100%;
}

.progress__heatmap-day {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface);
}

.progress__heatmap-day--active {
  background: var(--accent);
}

.progress__params {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.progress__back {
  position: fixed;
  bottom: 24px;
  font-size: 14px;
  background: none;
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  padding: 8px 24px;
  border-radius: 20px;
  cursor: pointer;
}
