:root {
  --left: #ff2d95;
  --right: #00f5ff;
  --lime: #c8ff00;
  --void: #000000;
  --ink: #eef6ff;
  --muted: #7a8aa8;
  --panel: rgba(0, 0, 0, 0.78);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Chakra Petch", system-ui, sans-serif;
  background: var(--void);
  display: flex;
  align-items: stretch;
  justify-content: center;
  color: var(--ink);
}

.stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  overflow: hidden;
  background: var(--void);
}

.stage-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 100%, rgba(255, 45, 149, 0.16), transparent 42%),
    radial-gradient(ellipse at 75% 100%, rgba(0, 245, 255, 0.16), transparent 42%),
    radial-gradient(ellipse at 50% 0%, rgba(200, 255, 0, 0.06), transparent 35%),
    linear-gradient(180deg, #120818, #05050c 55%, #000);
  pointer-events: none;
  z-index: 0;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(255, 255, 255, 0.018) 2px 3px
  );
  opacity: 0.55;
  z-index: 2;
}

.stage-scan {
  opacity: 0.22;
  z-index: 3;
}

canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 6px;
  pointer-events: none;
  z-index: 4;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 45, 149, 0.22);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel.right {
  align-items: flex-end;
  justify-self: end;
  border-color: rgba(0, 245, 255, 0.22);
}

.panel b {
  font-size: 18px;
  color: var(--lime);
  text-shadow: 0 0 14px rgba(200, 255, 0, 0.45);
}

.song-name {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--left);
  font-size: 13px;
  text-transform: none;
}

.combo-burst {
  text-align: center;
  min-width: 88px;
  opacity: 0.3;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.combo-burst.on {
  opacity: 1;
  transform: scale(1.1);
}

.combo-burst em {
  display: block;
  font-style: normal;
  font-family: "Bagel Fat One", "Chakra Petch", cursive;
  font-size: 36px;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 18px rgba(0, 245, 255, 0.75),
    0 0 28px rgba(255, 45, 149, 0.55);
}

.combo-burst span {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
}

.lives {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.life {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(200, 255, 0, 0.65);
  transform: rotate(45deg);
}

.life.empty {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.dual-pads {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: max(130px, calc(22% + env(safe-area-inset-bottom)));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 10px max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65) 25%, rgba(0, 0, 0, 0.92));
}

.dual-pads.hidden {
  display: none;
}

.pad {
  appearance: none;
  border: none;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease, box-shadow 0.08s ease;
  min-height: 0;
}

.pad-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.pad-label {
  position: relative;
  z-index: 1;
  font-family: "Bagel Fat One", cursive;
  font-size: clamp(42px, 12vw, 56px);
  line-height: 1;
  pointer-events: none;
}

.pad-left {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 45, 149, 0.98), rgba(180, 20, 100, 0.62)),
    url("assets/pad_left.png") center / cover no-repeat;
  border: 2px solid rgba(255, 45, 149, 0.9);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.35),
    0 0 30px rgba(255, 45, 149, 0.4),
    inset 0 0 40px rgba(255, 255, 255, 0.1);
}

.pad-left .pad-glow {
  background: radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.4), transparent 65%);
}

.pad-right {
  color: #05050c;
  background:
    linear-gradient(180deg, rgba(0, 245, 255, 0.98), rgba(0, 180, 200, 0.55)),
    url("assets/pad_right.png") center / cover no-repeat;
  border: 2px solid rgba(0, 245, 255, 0.9);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.35),
    0 0 30px rgba(0, 245, 255, 0.4),
    inset 0 0 40px rgba(255, 255, 255, 0.14);
}

.pad-right .pad-glow {
  background: radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.5), transparent 65%);
}

.pad:active,
.pad.flash {
  transform: translateY(5px) scale(0.98);
  filter: brightness(1.25);
}

.pad:active .pad-glow,
.pad.flash .pad-glow {
  opacity: 1;
}

.pad-left:active,
.pad-left.flash {
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    0 0 48px rgba(255, 45, 149, 0.8);
}

.pad-right:active,
.pad-right.flash {
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    0 0 48px rgba(0, 245, 255, 0.8);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 245, 255, 0.12), transparent 38%),
    radial-gradient(circle at 70% 20%, rgba(255, 45, 149, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.97), rgba(0, 0, 0, 0.99));
}

.overlay.hidden {
  display: none;
}

.hero-art {
  position: relative;
  width: min(42vw, 168px);
  height: min(42vw, 168px);
  object-fit: cover;
  border-radius: 22px;
  margin-bottom: 10px;
  box-shadow:
    0 0 0 3px rgba(200, 255, 0, 0.28),
    0 0 24px rgba(255, 45, 149, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.6);
}

.badge {
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, var(--left), var(--right));
  color: #000;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.35);
}

.badge.soft {
  background: linear-gradient(90deg, var(--lime), var(--left));
  box-shadow: 0 0 24px rgba(200, 255, 0, 0.35);
}

h1 {
  position: relative;
  margin: 0;
  font-family: "Bagel Fat One", "Chakra Petch", cursive;
  font-weight: 400;
  font-size: clamp(38px, 11vw, 54px);
  color: #fff;
  text-shadow:
    0 0 20px rgba(0, 245, 255, 0.55),
    0 0 40px rgba(255, 45, 149, 0.35);
}

.overlay > p {
  position: relative;
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}

.overlay > p b {
  color: var(--lime);
}

.song-box {
  position: relative;
  width: min(100%, 340px);
  margin-bottom: 12px;
  border: 1px solid rgba(0, 245, 255, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.song-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.song-head #pick-label {
  color: var(--right);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-list {
  max-height: min(28vh, 180px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  text-align: left;
  padding: 6px;
}

.song-item {
  width: 100%;
  appearance: none;
  border: none;
  background: transparent;
  color: #d0e8ff;
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.song-item:hover,
.song-item.on {
  background: linear-gradient(90deg, rgba(0, 245, 255, 0.18), rgba(255, 45, 149, 0.14));
}

.song-item .meta {
  color: var(--lime);
  font-size: 11px;
  flex-shrink: 0;
}

.controls {
  position: relative;
  margin-bottom: 10px;
}

.pad-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(220px, 60vw);
  margin: 0 auto;
}

.pad-preview i {
  display: block;
  height: 36px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.pad-preview .left {
  background: rgba(255, 45, 149, 0.55);
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.45);
}

.pad-preview .right {
  background: rgba(0, 245, 255, 0.55);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.45);
}

.sub {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.btn {
  position: relative;
  appearance: none;
  border: none;
  border-radius: 6px;
  padding: 14px 40px;
  font: inherit;
  font-family: "Bagel Fat One", cursive;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: #000;
  background: linear-gradient(90deg, var(--lime), var(--left) 45%, var(--right));
  box-shadow:
    0 6px 0 rgba(120, 160, 0, 0.55),
    0 0 28px rgba(200, 255, 0, 0.35);
  cursor: pointer;
  margin-top: 4px;
}

.btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 rgba(120, 160, 0, 0.45),
    0 0 18px rgba(200, 255, 0, 0.25);
}

.btn.ghost {
  margin-top: 10px;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(0, 245, 255, 0.35);
  box-shadow: none;
  font-family: "Chakra Petch", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

a {
  position: relative;
  margin-top: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

@media (min-width: 520px) {
  body {
    align-items: center;
    background:
      radial-gradient(circle at 50% 20%, rgba(0, 245, 255, 0.08), transparent 40%),
      #000;
  }

  .stage {
    height: min(100dvh, 780px);
    border-radius: 20px;
    border: 1px solid rgba(0, 245, 255, 0.15);
    box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.85),
      0 0 60px rgba(255, 45, 149, 0.08);
  }
}
