:root {
  --bg-0:      #000000;
  --bg-1:      #06080f;
  --bg-2:      #0c1322;
  --bg-3:      #131c30;
  --ink:       #f5efe0;        /* warm off-white, vinyl sleeve */
  --ink-2:     #b9b3a4;
  --ink-dim:   #6a6f80;
  --ink-faint: #2a3142;

  --spot:      #fff8dc;        /* hot stage spot, cream */
  --spot-glow: rgba(255, 248, 220, 0.55);
  --indigo:    #4a6cff;        /* stage indigo */
  --indigo-2:  #2238a8;
  --indigo-glow: rgba(74, 108, 255, 0.55);
  --amber:     #ffa84c;        /* warm stage amber */
  --amber-glow: rgba(255, 168, 76, 0.65);

  --prism-r:   #ff4a5b;
  --prism-c:   #4ad9ff;

  --pad-l:  14px;
  --pad-r:  14px;
  --pad-t:  14px;
  --pad-b:  14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

#app {
  position: relative;
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000000;
}

/* ============================================================
   PARTICLE CANVAS — black void by default, rainbow on play
   Sits on top of everything with screen blending so particles
   add light over the UI without obscuring text.
   ============================================================ */
#particles {
  position: absolute;
  inset: 0;
  width: 600px;
  height: 600px;
  pointer-events: none;
  z-index: 20;
  mix-blend-mode: screen;
}

/* ============================================================
   PANEL
   ============================================================ */
.panel {
  position: absolute;
  top: var(--pad-t);
  right: var(--pad-r);
  bottom: var(--pad-b);
  left: var(--pad-l);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 22px 18px;
  border-radius: 0 0 16px 16px;
  background: #000000;
  border-top:    3px solid transparent;       /* covered by ::before rainbow */
  border-left:   3px solid rgba(245, 239, 224, 0.92);
  border-right:  3px solid rgba(245, 239, 224, 0.92);
  border-bottom: 3px solid rgba(245, 239, 224, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(245, 239, 224, 0.10),
    0 8px 36px rgba(0, 0, 0, 0.85);
}
.panel::before {
  /* rainbow top border — 3px high, spans the full panel width including over the side borders */
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  height: 3px;
  background: linear-gradient(90deg,
    #ff4a5b 0%, #ffa64a 17%, #ffe24a 34%,
    #57e08a 50%, #4ad9ff 67%, #4a6cff 84%, #a96cff 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

/* ============================================================
   HEADER — prism + centered title stack
   ============================================================ */
.hdr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 0 8px;
  border-bottom: 1px solid rgba(245, 239, 224, 0.06);
}
.prism {
  width: 56px;
  height: 24px;
  margin-bottom: 0;
  filter: drop-shadow(0 0 6px rgba(255, 248, 220, 0.35));
}
.hdr-sub {
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--ink-dim);
  text-transform: uppercase;
  text-align: center;
}
.hdr-main {
  position: relative;
  font-family: "Georgia", "Didot", "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-align: center;
  line-height: 1.05;
  text-shadow: 0 0 18px rgba(255, 248, 220, 0.25);
}
/* chromatic aberration on the title — Dark Side prism split */
.hdr-main::before,
.hdr-main::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.6;
}
.hdr-main::before { color: var(--prism-r); transform: translate(-1.2px, 0.4px); }
.hdr-main::after  { color: var(--prism-c); transform: translate( 1.2px,-0.4px); }

/* ============================================================
   STAGE / NOW PLAYING
   ============================================================ */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 0;
}
.spot {
  position: absolute;
  top: 50%; left: 50%;
  width: 240px; height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center,
      rgba(255, 248, 220, 0.40) 0%,
      rgba(255, 168, 76, 0.18) 30%,
      rgba(74, 108, 255, 0.08) 55%,
      transparent 75%);
  filter: blur(6px);
  opacity: 0.25;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  z-index: 0;
}
.stage.ringing .spot {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
}

.now-note {
  position: relative;
  z-index: 2;
  font-family: "Georgia", "Didot", "Times New Roman", serif;
  font-size: 54px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 0 22px rgba(255, 248, 220, 0.45);
}
/* chromatic split on the played note */
.now-note::before,
.now-note::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  font: inherit;
  letter-spacing: inherit;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.55;
}
.now-note::before { color: var(--prism-r); transform: translate(-1.4px, 0.5px); }
.now-note::after  { color: var(--prism-c); transform: translate( 1.4px,-0.5px); }

.now-sub {
  position: relative;
  z-index: 2;
  font-size: 9px;
  letter-spacing: 0.36em;
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber-glow);
  margin-top: 2px;
}

.scope {
  width: 100%;
  height: 36px;
  display: block;
  margin-top: 4px;
  opacity: 1;
}

/* ============================================================
   PADS
   ============================================================ */
.pads {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}
.pad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  height: 100%;
  max-width: 500px;
}
.pad-up    { grid-column: 2; grid-row: 1; }
.pad-left  { grid-column: 1; grid-row: 2; }
.pad-enter { grid-column: 2; grid-row: 2; }
.pad-right { grid-column: 3; grid-row: 2; }
.pad-down  { grid-column: 2; grid-row: 3; }

.pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid rgba(74, 108, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(19, 28, 48, 0.7), rgba(6, 8, 15, 0.7));
  color: var(--ink-2);
  padding: 4px;
  overflow: hidden;
  transition: all 0.18s ease;
}
.pad::before {
  /* internal spotlight glow when active */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center,
      rgba(255, 248, 220, 0.0) 0%,
      transparent 60%);
  transition: background 0.18s ease;
  pointer-events: none;
}
.pad-arrow {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1;
}
.pad-note {
  font-family: "Georgia", "Didot", serif;
  font-style: italic;
  font-size: 60px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}
.pad-deg {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}

.pad.active {
  border-color: var(--amber);
  box-shadow:
    0 0 18px var(--amber-glow),
    inset 0 0 14px rgba(255, 248, 220, 0.22);
  transform: translateY(-1px);
  color: var(--ink);
}
.pad.active::before {
  background:
    radial-gradient(ellipse at center,
      rgba(255, 248, 220, 0.35) 0%,
      rgba(255, 168, 76, 0.18) 35%,
      transparent 70%);
}
.pad.active .pad-arrow { color: var(--spot); text-shadow: 0 0 6px var(--spot-glow); }
.pad.active .pad-note  { color: var(--spot); text-shadow: 0 0 14px var(--spot-glow); }
.pad.active .pad-deg   { color: var(--amber); }

.focusable {
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.focusable:focus-visible {
  border-color: var(--spot);
  box-shadow: 0 0 14px var(--spot-glow);
}

