:root {
  --bg: #12151c;
  --panel: #1c2130;
  --line: #2b3244;
  --text: #f3f5f9;
  --muted: #9aa5b8;
  --accent: #c8f04b;
  --warm: #ffb347;
  --figure: #dfe5f0;
  --figure-far: #65708a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

h1, h2, p { margin: 0; }

small { color: var(--muted); }

button {
  font: inherit;
  font-weight: 650;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
  padding: 0 16px;
  cursor: pointer;
}

button.primary {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: #171b12;
}

button.ghost { background: transparent; }

button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #171b12;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero { padding: 12px 0 20px; }
.hero h1 { font-size: 38px; line-height: 1.1; margin-top: 4px; }
.week { color: var(--muted); margin-top: 6px; }

.exercise-list {
  list-style: none;
  counter-reset: item;
  margin: 0 0 16px;
  padding: 0;
  background: var(--panel);
  border-radius: 16px;
}

.exercise-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.exercise-list li:last-child { border-bottom: 0; }
.exercise-list strong, .exercise-list small { display: block; }
.exercise-list b { color: var(--accent); white-space: nowrap; }

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.choices { display: flex; gap: 8px; }
.choices button { min-width: 56px; }
.volume { flex: 1; min-width: 0; accent-color: var(--accent); }

.duration { text-align: center; color: var(--muted); margin: 10px 0 20px; }

.advice { color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; font-size: 15px; }
.advice h2 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.advice p + p { margin-top: 8px; }

.topbar { display: flex; align-items: center; justify-content: space-between; }
.total-time { font-size: 34px; font-weight: 750; font-variant-numeric: tabular-nums; margin-right: 10px; }

.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar div { height: 100%; width: 0; background: var(--accent); }
.bar.step div { background: var(--warm); }
.count-done { color: var(--muted); font-size: 14px; margin-top: 6px; }

.stage {
  position: relative;
  margin-top: 12px;
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
}

.stage svg, .stage img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }

.paused-label {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgb(18 21 28 / 0.6);
  font-size: 22px;
  font-weight: 700;
}

.paused .paused-label { display: flex; }

.bone { stroke: var(--figure); stroke-linecap: round; }
.bone.far { stroke: var(--figure-far); }
.bone.active { stroke: var(--accent); }
.bone.far.active { stroke: #7f9a35; }
.head { fill: var(--figure); }
.floor { stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.view-label { fill: var(--muted); font-size: 14px; }

.state { color: var(--muted); margin-top: 14px; }
[data-step="rest"] .state, [data-step="prep"] .state { color: var(--warm); font-weight: 650; }
.name { font-size: 24px; line-height: 1.2; }

.counter { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.counter span { font-size: 64px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }

.step-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; margin-top: 6px; }

.controls { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 16px 0; }

.cues { margin: 0; padding-left: 20px; }
.cues li + li { margin-top: 4px; }
.easier { color: var(--muted); margin-top: 10px; }
.source { display: inline-block; color: var(--muted); font-size: 14px; margin: 8px 0 16px; }

.done-card { padding-top: 22vh; text-align: center; }
.done-time { font-size: 72px; font-weight: 800; font-variant-numeric: tabular-nums; }
.done-card .primary { margin-top: 28px; }
