: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; }

/* ---------- shared buttons ---------- */
.btn {
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.btn-primary {
  min-height: 88px;
  width: 420px;
  font-size: 30px;
  background: linear-gradient(135deg, #0090b8, #00d4ff);
  color: #00171f;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.btn-ghost {
  min-height: 64px;
  font-size: 22px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.btn-danger { color: var(--danger); }

/* ---------- HOME ---------- */
.app-header {
  padding: 40px 0 16px;
  display: flex; flex-direction: column; align-items: center;
}
.eye-icon { width: 64px; height: 64px; fill: var(--accent); filter: drop-shadow(0 0 14px var(--focus-glow)); }
.app-header h1 { font-size: 44px; font-weight: 800; margin-top: 8px; letter-spacing: 0.5px; }
.tagline { font-size: 20px; color: var(--accent-secondary); letter-spacing: 4px; text-transform: uppercase; margin-top: 4px; }

.home-body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  padding: 0 30px;
}
.rule-line { font-size: 24px; color: var(--text-secondary); text-align: center; line-height: 1.5; max-width: 480px; }
.rule-line b { color: var(--text-primary); }
.home-row { display: flex; gap: 20px; }
.home-row .btn-ghost { width: 200px; }

.home-foot {
  padding: 22px;
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  border-top: 1px solid var(--bg-tertiary);
}

/* ---------- TIMER ---------- */
.timer-phase {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 34px 0 10px;
  transition: color 0.3s ease;
}
.ring-wrap {
  position: relative;
  width: 320px; height: 320px;
  margin: 0 auto;
}
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-tertiary); stroke-width: 12; }
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}
.ring-fg.no-anim { transition: stroke 0.3s ease; }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.time-big { font-size: 72px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.phase-sub { font-size: 18px; color: var(--text-secondary); margin-top: 4px; }

.rest-hint {
  text-align: center;
  margin: 18px auto 0;
  display: flex; flex-direction: column; gap: 6px;
  animation: pulse 2.2s ease-in-out infinite;
}
.rest-line { font-size: 26px; font-weight: 700; color: var(--accent-secondary); }
.rest-line-sm { font-size: 18px; color: var(--text-secondary); }
@keyframes pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.timer-controls {
  margin-top: auto;
  display: flex;
  gap: 16px;
  padding: 24px 30px 34px;
}
.btn-ctrl { flex: 1; min-height: 80px; font-size: 22px; }

/* resting state recolors accents to green */
#timer.resting .timer-phase { color: var(--accent-secondary); }
#timer.resting .ring-fg { stroke: var(--accent-secondary); }
#timer.paused .timer-phase { color: var(--text-muted); }

/* ---------- SETTINGS / STATS shared ---------- */
.sub-header {
  padding: 30px 30px 14px;
  border-bottom: 1px solid var(--bg-tertiary);
}
.sub-header h2 { font-size: 34px; font-weight: 800; }

.settings-body {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 22px;
  padding: 28px 30px;
}
.setting-block { display: flex; flex-direction: column; gap: 12px; }
.setting-label { font-size: 20px; color: var(--text-secondary); }
.opt-row { display: flex; gap: 14px; }
.opt {
  flex: 1;
  min-height: 70px;
  font-family: inherit;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.opt-wide { flex: 0 0 200px; }
.opt.active {
  background: linear-gradient(135deg, #0090b8, #00d4ff);
  color: #00171f;
  font-weight: 800;
}
.settings-body .btn-ghost { margin-top: auto; }

/* ---------- STATS ---------- */
.stats-body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 20px;
  padding: 28px 30px;
}
.stat-card {
  width: 100%;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.stat-num { font-size: 60px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-cap { font-size: 18px; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }
.stats-body .btn-ghost { width: 100%; }
.stats-body .btn-ghost:last-child { margin-top: auto; }
