:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* Header */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
  flex-shrink: 0;
}
.hdr-title { font-size: 28px; font-weight: 700; letter-spacing: 0.5px; }
.hdr-pace {
  font-size: 18px; color: var(--accent); font-weight: 600;
  padding: 6px 12px; border-radius: 8px; background: var(--bg-tertiary);
}

/* Timer */
.timer-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  min-height: 0;
}
.timer {
  font-size: 110px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.timer.running { color: var(--accent-secondary); }
.timer-status {
  font-size: 22px; color: var(--text-secondary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 3px;
}

/* Stats row */
.stats {
  display: flex; gap: 12px; padding: 0 24px 16px;
  flex-shrink: 0;
}
.stat {
  flex: 1; background: var(--bg-secondary);
  border-radius: var(--radius-md); padding: 16px 8px;
  text-align: center;
}
.stat-val {
  font-size: 34px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-lbl {
  font-size: 16px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1px; margin-top: 4px;
}

/* Controls */
.controls {
  display: flex; gap: 12px; padding: 0 24px 16px;
  flex-shrink: 0;
}
.btn {
  flex: 1; min-height: 88px;
  border-radius: var(--radius-md);
  font-size: 26px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--bg-tertiary); color: var(--accent); }
.btn-primary.is-running { color: var(--danger); }
.btn-ghost { background: var(--bg-secondary); color: var(--text-secondary); }

/* Bottom nav */
.navbar {
  display: flex; gap: 12px; padding: 0 24px 24px;
  flex-shrink: 0;
}
.navitem {
  flex: 1; min-height: 64px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; color: var(--text-secondary);
}

/* Scroll area (pace, history) */
.scroll {
  flex: 1; overflow-y: auto; padding: 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }

.section-lbl {
  font-size: 16px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 2px;
  margin-top: 8px; font-weight: 700;
}
.section-lbl:first-child { margin-top: 0; }

/* Pace options */
.opt {
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 0 20px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
}
.opt-name { font-size: 24px; font-weight: 700; flex: 1; }
.opt-meta { font-size: 20px; color: var(--text-secondary); }
.opt-check {
  font-size: 24px; color: var(--accent-secondary);
  width: 28px; text-align: center; opacity: 0;
}
.opt.selected { background: var(--bg-tertiary); }
.opt.selected .opt-check { opacity: 1; }

/* Stepper */
.stepper {
  display: flex; align-items: center; gap: 12px;
}
.step-btn {
  width: 88px; min-height: 72px;
  background: var(--bg-tertiary); border-radius: var(--radius-md);
  font-size: 40px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.step-val {
  flex: 1; text-align: center; font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* History list */
.hist-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 76px; padding: 12px 20px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
}
.hist-main { flex: 1; min-width: 0; }
.hist-date { font-size: 20px; font-weight: 700; }
.hist-sub { font-size: 17px; color: var(--text-secondary); margin-top: 2px; }
.hist-dist {
  font-size: 30px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hist-dist small { font-size: 16px; color: var(--text-secondary); font-weight: 600; }
.empty {
  text-align: center; color: var(--text-muted);
  font-size: 22px; padding: 60px 20px; line-height: 1.6;
}
