:root {
  --bg: #14161a;
  --panel: #1e2127;
  --text: #f1f1f3;
  --muted: #9a9ea6;
  --accent: #5b8cff;
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app {
  width: 100%;
  max-width: 860px;
  padding: 32px 24px 40px;
  text-align: center;
}

h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0 0 28px;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch-control {
  cursor: pointer;
}

#rangeSelect {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #2c303a;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: #2c303a;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.play-btn {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 36px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.play-btn:hover { background: #4a7bef; }
.play-btn:active { transform: scale(0.97); }
.play-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.status {
  min-height: 1.4em;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.notes {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 auto;
  overflow-x: auto;
  padding-bottom: 4px;
}

.note-col {
  flex: 1 1 0;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-btn {
  width: 100%;
  padding: 16px 0;
  border-radius: 10px;
  border: 1px solid #2c303a;
  background: var(--panel);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.preview-btn {
  width: 100%;
  padding: 6px 0;
  border-radius: 8px;
  border: 1px solid #2c303a;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.preview-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.preview-btn:active { transform: scale(0.94); }

.note-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.note-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.note-btn:active:not(:disabled) { transform: scale(0.96); }

.note-btn.correct {
  background: var(--green);
  border-color: var(--green);
  color: #06210f;
}

.note-btn.close {
  background: var(--orange);
  border-color: var(--orange);
  color: #2a1400;
}

.note-btn.off {
  background: var(--red);
  border-color: var(--red);
  color: #2a0606;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.green { background: var(--green); }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }
