: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 {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 72px;
  padding: 0 24px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 20px; font-weight: 600;
  border-radius: var(--radius-md);
}
.btn:focus { background: #262640; }
.btn-primary {
  background: linear-gradient(135deg, #00d4ff, #00a3cc);
  color: #04141a;
}
.btn-primary:focus { background: linear-gradient(135deg, #2ee0ff, #00b8e6); }

/* ---------- home ---------- */
.home-inner {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 36px; padding: 48px 56px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.brand-mark {
  width: 72px; height: 72px;
  border: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.45);
  animation: boxpulse 8s ease-in-out infinite;
}
@keyframes boxpulse {
  0%, 100% { transform: scale(0.82); opacity: 0.7; }
  50% { transform: scale(1); opacity: 1; }
}
.title { font-size: 40px; font-weight: 700; letter-spacing: 0.5px; }
.subtitle { font-size: 18px; color: var(--text-secondary); letter-spacing: 2px; }
.menu { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.stat {
  font-size: 15px; color: var(--text-muted);
  letter-spacing: 0.5px; text-align: center; min-height: 18px;
}

/* ---------- session ---------- */
#breath-canvas {
  position: absolute; top: 0; left: 0;
  width: 600px; height: 600px;
  transition: opacity 0.3s ease;
}
#session.is-paused #breath-canvas { opacity: 0.35; }
.session-top {
  position: absolute; top: 40px; left: 0; width: 100%;
  text-align: center;
  font-size: 16px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-secondary);
}
.session-center {
  position: absolute; left: 50%; top: 276px;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; text-align: center;
}
.phase-label {
  font-size: 22px; font-weight: 600;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--accent);
}
.phase-count {
  font-size: 76px; font-weight: 700;
  line-height: 1.1; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
}
.session-controls {
  position: absolute; bottom: 32px; left: 0; width: 100%;
  display: flex; gap: 18px; justify-content: center;
  padding: 0 48px;
}
.btn-control { width: auto; min-width: 168px; min-height: 64px; }

/* ---------- sub screens (settings / info) ---------- */
.sub-header {
  padding: 36px 40px 20px;
  border-bottom: 1px solid var(--bg-tertiary);
}
.sub-header h2 { font-size: 28px; font-weight: 700; }
.settings-body, .info-body {
  flex: 1; padding: 32px 40px;
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}
.row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 80px; padding: 0 26px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}
.row:focus { background: var(--bg-tertiary); }
.row-label { font-size: 20px; font-weight: 600; }
.row-value {
  font-size: 20px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hint { font-size: 15px; color: var(--text-muted); line-height: 1.5; }

.info-body p { font-size: 18px; line-height: 1.55; color: var(--text-secondary); }
.info-body .muted { color: var(--text-muted); font-size: 16px; }
.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.steps li {
  display: flex; align-items: center; gap: 14px;
  font-size: 19px; color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 16px 20px; border-radius: var(--radius-md);
}
.steps b { font-weight: 700; }
.step-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 12px currentColor;
}
.step-dot.inhale { background: var(--accent); color: var(--accent); }
.step-dot.exhale { background: var(--accent); color: var(--accent); }
.step-dot.hold { background: var(--accent-secondary); color: var(--accent-secondary); }

.sub-footer {
  padding: 20px 40px 36px;
  border-top: 1px solid var(--bg-tertiary);
}

/* ---------- complete ---------- */
.complete-inner {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px; padding: 48px 56px;
}
.check {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; color: #04141a;
  background: linear-gradient(135deg, #00ff88, #00cc6e);
  box-shadow: 0 0 36px rgba(0, 255, 136, 0.5);
}
.complete-inner .menu { margin-top: 16px; }
