:root {
  --bg: #060607;
  --bg-panel: #0e0b0c;
  --line: #2a1418;
  --fg: #f2e4e6;
  --dim: #7a6468;
  --accent: #ff2f4e;
  --accent2: #ff8a3d;
  --black-key: #1a0e10;
  --white-key: #f2e4e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px 64px;
}

main {
  width: 100%;
  max-width: 760px;
}

.cat {
  text-align: center;
  color: var(--accent);
  font-size: 15px;
  line-height: 1.3;
  margin: 0 auto 6px;
  text-shadow: 0 0 12px rgba(255, 47, 78, 0.4);
  transition: text-shadow 0.08s ease, color 0.08s ease, transform 0.35s ease-out;
  will-change: transform;
}
.cat.meow {
  color: var(--accent2);
  text-shadow: 0 0 18px rgba(255, 138, 61, 0.65);
}

.title {
  text-align: center;
  font-size: 28px;
  letter-spacing: 2px;
  margin: 0;
  transition: transform 0.35s ease-out;
  will-change: transform;
}
.blink { animation: blink 1.1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.tagline {
  text-align: center;
  color: var(--dim);
  margin: 6px 0 28px;
  font-size: 13px;
}

.start {
  text-align: center;
  margin: 48px 0;
}
.start-btn {
  background: var(--accent);
  color: #1a0004;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.start-btn:hover { filter: brightness(1.08); }
.start-btn:active { transform: translateY(1px); }
.hint {
  color: var(--dim);
  font-size: 12px;
  margin-top: 12px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: 10px;
  padding: 20px;
}

.row { margin-bottom: 22px; }
.row:last-child { margin-bottom: 0; }

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dim);
  margin: 0 0 10px;
  font-weight: 600;
}
.section-label .dim { text-transform: none; letter-spacing: 0; color: #4a3236; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.knob-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 100px;
  min-width: 100px;
}
.knob-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 47, 78, 0.55);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 47, 78, 0.55);
}

.octave-group { flex: 0 0 auto; align-items: center; }
.octave-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.oct-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #150a0c;
  color: var(--fg);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.oct-btn:hover { border-color: var(--accent); color: var(--accent); }
#octLabel { min-width: 14px; text-align: center; color: var(--accent); font-weight: 700; }

/* keyboard */
.keyboard {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.key {
  flex: 1 0 34px;
  min-width: 34px;
  height: 92px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--white-key);
  color: #180a0c;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.04s ease, background 0.06s ease;
}
.key.black {
  background: var(--black-key);
  color: var(--dim);
  height: 60px;
  align-self: flex-start;
  border-color: #000;
}
.key:active, .key.active {
  background: var(--accent);
  color: #1a0004;
  transform: translateY(2px);
}
.key.black.active, .key.black:active {
  background: var(--accent2);
  color: #200a02;
}

/* pads */
.pads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}
.pad {
  border: 1px solid var(--line);
  background: #150a0c;
  color: var(--fg);
  border-radius: 7px;
  padding: 14px 8px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.04s ease, background 0.06s ease, border-color 0.06s ease;
}
.pad .num { display: block; font-size: 10px; color: var(--dim); margin-bottom: 4px; }
.pad .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.pad:hover { border-color: var(--accent); }
.pad:active, .pad.active {
  background: var(--accent2);
  color: #200a02;
  border-color: var(--accent2);
  transform: translateY(2px) scale(0.98);
}

.instructions {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: #d9c3c6;
}
.instructions summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.instructions ul { margin: 10px 0 0; padding-left: 18px; }
.instructions li { margin-bottom: 8px; line-height: 1.5; }

footer {
  text-align: center;
  color: var(--dim);
  font-size: 11.5px;
  margin-top: 28px;
  line-height: 1.6;
}
footer a { color: var(--dim); }
footer a:hover { color: var(--accent); }

@media (max-width: 480px) {
  .cat { font-size: 12px; }
  .title { font-size: 22px; }
  .key { height: 72px; }
  .key.black { height: 46px; }
}
