:root {
  --bg-primary: #000000; /* pure black = transparent on additive display */
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --accent-warm: #ff9f43;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; }

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 22px; font-weight: 600; flex: 1; }
.header-meta {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: 20px;
}

/* --- Content --- */
.content {
  flex: 1;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* --- Focus states --- */
.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* --- Nav bar --- */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary { background: var(--accent-primary); color: #0a0a0f; }
.nav-item.primary:focus { background: #33ddff; }
.nav-item.playing { background: var(--accent-warm); color: #0a0a0f; }

/* --- Home screen --- */
.home-content { justify-content: center; text-align: center; gap: 20px; }
.home-icon { display: flex; justify-content: center; }
.home-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.6; padding: 0 12px; }

/* --- Beat dots --- */
.beat-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 20px;
  margin-top: 4px;
}
.beat-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--text-muted);
  transition: background 0.08s ease, border-color 0.08s ease, transform 0.08s ease;
}
.beat-dot.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.15);
}
.beat-dot.active.accent {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  transform: scale(1.3);
}

/* --- Pendulum --- */
.pendulum-wrap {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pendulum-track {
  position: relative;
  width: 260px;
  height: 100%;
}
.pendulum-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bg-tertiary);
}
.pendulum-bob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 14px var(--focus-glow);
  transform: translate(-50%, -50%) translateX(0px);
  transition: transform linear 0.5s, box-shadow 0.1s ease, background 0.1s ease;
}
.pendulum-bob.accent-flash {
  background: var(--accent-secondary);
  box-shadow: 0 0 26px rgba(0, 255, 136, 0.7);
}

/* --- BPM readout --- */
.bpm-readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
}
.bpm-value { font-size: 64px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.bpm-label { font-size: 16px; color: var(--text-secondary); font-weight: 600; }

/* --- Controls --- */
.control-row {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.stepper-btn {
  width: 64px;
  height: 56px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:focus { background: var(--bg-card); }
.sig-btn {
  flex: 1;
  max-width: 180px;
  height: 56px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}
.sig-btn:focus { background: var(--bg-card); }

.hidden { display: none !important; }
