: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 ---------- */
.screen { padding: 28px 30px; gap: 18px; }
.topbar { display: flex; flex-direction: column; gap: 4px; }
.topbar.row { flex-direction: row; align-items: center; }
.title {
  font-size: 38px; font-weight: 800; letter-spacing: 2px;
  color: var(--text-primary);
}
.title.sm { font-size: 30px; }
.subtitle { font-size: 17px; color: var(--text-secondary); letter-spacing: 0.5px; }

.footer-nav { margin-top: auto; display: flex; gap: 14px; }

.nav-btn {
  flex: 1; min-height: 72px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 19px; font-weight: 700; letter-spacing: 1px;
  border-radius: var(--radius-md);
}
.nav-btn.danger { color: var(--danger); }

/* ---------- home ---------- */
.home-stats { font-size: 16px; color: var(--text-secondary); letter-spacing: 0.5px; }

.dur-picker { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.round-btn {
  width: 72px; height: 72px; flex: 0 0 72px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--accent);
  font-size: 38px; font-weight: 700; line-height: 1;
}
.dur-display { display: flex; flex-direction: column; align-items: center; }
.dur-value { font-size: 64px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.dur-label { font-size: 14px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  min-height: 52px; padding: 0 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 19px; font-weight: 700;
  border-radius: 999px;
}
.chip.active { color: var(--accent); border-color: var(--accent-secondary); }

.start-btn {
  min-height: 96px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #051018;
  font-size: 26px; font-weight: 800; letter-spacing: 2px;
  border-radius: var(--radius-md);
}
.start-btn.slim { min-height: 72px; font-size: 21px; flex: 1; }
.start-btn:focus { box-shadow: 0 0 28px rgba(0, 255, 136, 0.5); border-color: var(--focus-ring); }

/* ---------- timer ---------- */
#timer { align-items: center; justify-content: center; gap: 26px; }
.ring-wrap { position: relative; width: 320px; height: 320px; }
.ring { width: 320px; height: 320px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--bg-tertiary); stroke-width: 16; }
.ring-progress {
  fill: none; stroke: var(--accent); stroke-width: 16; stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.timer-time { font-size: 88px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.timer-state { font-size: 18px; letter-spacing: 4px; color: var(--text-muted); text-transform: uppercase; }

.reminder {
  min-height: 60px; width: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 23px; font-weight: 700; color: var(--accent-secondary);
}
.reminder.flash { animation: cuePop 0.4s ease; color: var(--accent); }
@keyframes cuePop { 0% { transform: scale(0.94); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }

.timer-controls { display: flex; gap: 14px; width: 100%; }

/* ---------- complete ---------- */
#complete { align-items: stretch; justify-content: flex-start; }
.held-block { display: flex; flex-direction: column; align-items: center; margin: 10px 0; }
.held-value { font-size: 96px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.held-label { font-size: 16px; letter-spacing: 4px; color: var(--text-muted); text-transform: uppercase; }

.stat-grid { display: flex; gap: 12px; }
.stat-grid.tight { gap: 10px; }
.stat-cell {
  flex: 1; background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.stat-num { font-size: 30px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat-cap { font-size: 13px; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }

/* ---------- history ---------- */
.hist-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.hist-row {
  min-height: 56px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.hist-date { font-size: 17px; color: var(--text-secondary); }
.hist-dur { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hist-dur.ok { color: var(--accent-secondary); }
.hist-dur.partial { color: var(--text-muted); }
.hist-empty { color: var(--text-muted); font-size: 18px; text-align: center; padding: 40px 0; }

/* ---------- settings ---------- */
.set-list { display: flex; flex-direction: column; gap: 12px; }
.set-row {
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.set-name { font-size: 21px; font-weight: 600; color: var(--text-primary); }
.pill {
  min-width: 64px; text-align: center;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  font-size: 17px; font-weight: 800; letter-spacing: 1px;
  color: var(--accent);
}
.pill.off { color: var(--text-muted); }
.danger-pill { color: var(--danger); }
