:root {
  --bg: white;
  --fg: #111827;
  --muted: #6b7280;
  --card: #f9fafb;
  --border: #d1d5db;
  --accent: #2563eb;
  --good: #15803d;
  --bad: #dc2626;
}

.dark {
  --bg: rgb(3, 7, 18);
  --fg: rgb(209, 213, 219);
  --muted: #9ca3af;
  --card: #111827;
  --border: #374151;
  --accent: #60a5fa;
  --good: #4ade80;
  --bad: #f87171;
}

* {
  box-sizing: border-box;
}

html {
  display: flex;
  justify-content: center;
  background-color: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  color: var(--fg);
  background-color: var(--bg);
  width: 100%;
  max-width: 600px;
  margin: 0;
  padding: 12px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1 {
  text-align: center;
  font-size: 1.6em;
  font-weight: 800;
  margin: 4px 0;
}

.intro {
  text-align: center;
  color: var(--muted);
  margin: 0 0 12px;
}

.staff {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 8px;
}

.staff svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
  fill: var(--fg);
}

.staff .lines {
  stroke: var(--fg);
  stroke-width: 1;
}

.staff .note {
  stroke: currentColor;
  color: var(--fg);
  fill: currentColor;
}

.staff .note.current {
  color: var(--accent);
}

.staff .note.done {
  color: var(--good);
}

.staff .note.shake {
  color: var(--bad);
  animation: shake 0.3s;
}

.staff .note text {
  stroke: none;
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
}

@keyframes shake {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.message {
  text-align: center;
  min-height: 1.5em;
  margin: 10px 0;
}

.message.bad {
  color: var(--bad);
}

.pad {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.pad button {
  min-height: 64px;
  font-size: 1.6em;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
}

.pad button:active {
  border-color: var(--accent);
  color: var(--accent);
}

.pad button:disabled {
  color: var(--bad);
  border-color: var(--bad);
  opacity: 0.45;
  cursor: default;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  margin: 16px 0;
}

.stats b {
  display: block;
  font-size: 1.2em;
}

.stats span {
  color: var(--muted);
  font-size: 0.8em;
}

.settings {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.settings summary {
  font-weight: 700;
  cursor: pointer;
}

fieldset {
  border: none;
  padding: 0;
  margin: 14px 0;
}

legend {
  padding: 0;
  font-weight: 600;
  margin-bottom: 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips button {
  min-width: 46px;
  min-height: 42px;
  padding: 2px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.2;
}

.chips button small {
  display: block;
  color: var(--muted);
  font-size: 0.7em;
}

.chips button.on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

button.link {
  background: none;
  border: none;
  padding: 6px 0;
  color: var(--accent);
  text-decoration: underline;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.check input {
  width: 20px;
  height: 20px;
}

footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

footer a {
  color: var(--accent);
}

#darkModeBtn::before {
  content: "Change to dark theme";
}

.dark #darkModeBtn::before {
  content: "Change to light theme";
}
