:root {
  --bg: #07070b;
  --bg2: #11121a;
  --fg: #f4f4f7;
  --dim: #6c6e80;
  --accent: #ff2266;
  --accent2: #22e0ff;
  --on: #22ff88;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: radial-gradient(ellipse at top, #161827 0%, var(--bg) 70%);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex; flex-direction: column;
  min-height: 100vh;
  gap: 28px;
}
header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: env(safe-area-inset-top, 0);
}
.logo {
  font-weight: 800; font-size: 22px; letter-spacing: 0.5px;
  color: var(--accent);
}
.logo span { color: var(--dim); font-weight: 500; }
.bpm { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 700; }
.bpm small { font-size: 13px; color: var(--dim); margin-left: 4px; }

.play-row { display: flex; justify-content: center; }
.play {
  width: 168px; height: 168px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; font-size: 64px; cursor: pointer;
  box-shadow: 0 0 60px rgba(255,34,102,.45), inset 0 0 0 4px rgba(255,255,255,.08);
  transition: transform .08s, background .15s;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding-left: 8px;
  -webkit-tap-highlight-color: transparent;
}
.play:active { transform: scale(.96); }
.play.playing { background: #1a1a26; color: var(--accent); padding-left: 0; }
.play.playing::before, .play.playing::after { content: ""; display: block; width: 18px; height: 60px; background: var(--accent); border-radius: 4px; margin: 0 6px; }
.play.playing { font-size: 0; }

.tempo-row { padding: 0 4px; }
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 56px; background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 14px; border-radius: 7px;
  background: linear-gradient(to right, var(--accent2), var(--accent));
}
input[type=range]::-moz-range-track {
  height: 14px; border-radius: 7px;
  background: linear-gradient(to right, var(--accent2), var(--accent));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; margin-top: -13px;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  border: none;
}
input[type=range]::-moz-range-thumb {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: none;
}

.layers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.layer {
  height: 76px; border-radius: 14px;
  font-size: 20px; font-weight: 700; letter-spacing: 1px;
  background: var(--bg2); color: var(--dim);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.layer.on {
  color: var(--fg);
  border-color: var(--on);
  background: linear-gradient(180deg, #1a2418 0%, #11121a 100%);
  box-shadow: 0 0 18px rgba(34,255,136,.18);
}
.layer:active { transform: scale(.97); }

footer {
  margin-top: auto;
  display: flex; justify-content: space-between;
  color: var(--dim); font-size: 12px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 520px) {
  .layers { grid-template-columns: repeat(4, 1fr); }
}
