/* ============================================================
   Ghost Jam: its own look, on purpose the opposite of the rest of
   the site. A basement bar after midnight: brick wall, neon tubes,
   smoke, beer, a CRT arcade cabinet. Loads header.css and
   midi-help.css first; the palette tokens below re-skin them.
   ============================================================ */

:root {
  --ink: #0b0614;
  --paper: #170d26;
  --line: #3b2559;
  --ivory: #f6eaff;
  --ivory-dim: #b9a3d4;
  --gold: #ff2e88;            /* header + shared widgets read --gold as "accent" */
  --gold-bright: #ff7ac0;
  --gold-rgb: 255, 46, 136;
  --gold-bright-rgb: 255, 122, 192;
  --sage: #b6ff3b;
  --crimson: #ff3b3b;

  --pink: #ff2e88;
  --cyan: #18f0ff;
  --orange: #ff9f1c;
  --lime: #b6ff3b;
  --amber: #ffb000;
  --violet: #9b5cff;

  --font-display: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;
  --font-mono: 'Press Start 2P', monospace;
  --font-neon: 'Monoton', 'Press Start 2P', cursive;

  --glow-pink: 0 0 4px #fff, 0 0 10px var(--pink), 0 0 22px var(--pink), 0 0 42px rgba(255, 46, 136, 0.6);
  --glow-cyan: 0 0 4px #fff, 0 0 10px var(--cyan), 0 0 22px var(--cyan), 0 0 40px rgba(24, 240, 255, 0.5);
  --glow-orange: 0 0 4px #fff, 0 0 10px var(--orange), 0 0 24px var(--orange);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { min-height: 100vh; overflow-x: hidden; }

body {
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.25;
  background-color: var(--ink);
  /* Brick wall under a purple wash, darkest at the edges. */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(155, 92, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.75) 100%),
    linear-gradient(rgba(11, 6, 20, 0.86), rgba(11, 6, 20, 0.86)),
    repeating-linear-gradient(0deg, #2a1420 0 2px, transparent 2px 36px),
    repeating-linear-gradient(90deg, #2a1420 0 2px, transparent 2px 72px),
    linear-gradient(#5a2a2a, #3b1a22);
  background-attachment: fixed;
}

/* CRT scanlines over everything. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

/* Drifting smoke. */
.smoke { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.smoke span {
  position: absolute;
  width: 60vmax;
  height: 40vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(210, 190, 255, 0.07), transparent);
  filter: blur(20px);
  animation: drift 38s linear infinite;
}
.smoke span:nth-child(1) { left: -20vmax; top: 10vh; }
.smoke span:nth-child(2) { left: 30vw; top: 50vh; animation-duration: 52s; animation-delay: -20s; }
.smoke span:nth-child(3) { left: 60vw; top: -10vh; animation-duration: 45s; animation-delay: -8s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12vw, -6vh) scale(1.15); }
  100% { transform: translate(0, 0) scale(1); }
}

.app { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 2.4rem 1.4rem 4rem; }
@media (max-width: 600px) { .app { padding: 1.2rem 0.75rem 3rem; } body { font-size: 20px; } }

a { color: var(--cyan); }

/* ---------- shared header, neon edition ---------- */

.site-header { border-bottom-color: rgba(255, 46, 136, 0.35); }
.hd-name { font-family: var(--font-neon); font-size: 1.9rem; color: #fff; text-shadow: var(--glow-pink); letter-spacing: 0.06em; }
.hd-opus { font-family: var(--font-body); font-style: normal; font-size: 1rem; color: var(--cyan); letter-spacing: 0.08em; }
.hd-nav { border-top-color: rgba(24, 240, 255, 0.25); }
.hd-link { font-size: 0.5rem; letter-spacing: 0.12em; gap: 0.7rem; }
.hd-num { font-family: var(--font-body); font-style: normal; font-size: 1.15rem; color: var(--cyan); }
.hd-link.is-active { color: #fff; text-shadow: 0 0 8px var(--pink); }
.hd-link.is-active::after { height: 2px; background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.hd-btn { font-size: 0.5rem; border-color: rgba(24, 240, 255, 0.5); }
.hd-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.hd-btn.is-connected .hd-midi-label { font-family: var(--font-body); font-style: normal; font-size: 1rem; }
.midi-status { font-family: var(--font-body); font-size: 0.85rem; }

/* ---------- buttons, selects ---------- */

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

.arcade-btn {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a0710;
  background: linear-gradient(180deg, #ff6aa8, var(--pink) 55%, #c4115f);
  border: 2px solid #ffd1e6;
  border-radius: 6px;
  padding: 0.95rem 1.4rem;
  box-shadow: 0 5px 0 #7a0838, 0 0 24px rgba(255, 46, 136, 0.55);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.arcade-btn:hover { filter: brightness(1.12); }
.arcade-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #7a0838, 0 0 14px rgba(255, 46, 136, 0.5); }
.arcade-btn.small { font-size: 0.55rem; padding: 0.7rem 1rem; }
.arcade-btn.ghosty {
  color: var(--cyan);
  background: transparent;
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(24, 240, 255, 0.3), inset 0 0 10px rgba(24, 240, 255, 0.15);
}
/* Square icon buttons (restart, favourite). */
.arcade-btn.icon-btn { display: inline-grid; place-items: center; padding: 0; width: 2.6rem; height: 2.6rem; }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.fav-btn[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); box-shadow: 0 0 14px rgba(255, 176, 0, 0.45), inset 0 0 10px rgba(255, 176, 0, 0.2); }
.fav-btn[aria-pressed="true"] path { fill: currentColor; }
.arcade-btn.big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  width: 100%;
  margin-top: 1.6rem;
  font-size: 0.95rem;
  padding: 1.2rem;
  animation: attract 1.6s ease-in-out infinite;
}
@keyframes attract { 50% { box-shadow: 0 5px 0 #7a0838, 0 0 40px rgba(255, 46, 136, 0.9); } }
.coin .sprite { display: block; animation: spin 1.2s steps(6) infinite; }
@keyframes spin { 50% { transform: scaleX(0.2); } }

.arcade-select {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--ivory);
  background: #12091f;
  border: 2px solid var(--violet);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  box-shadow: inset 0 0 10px rgba(155, 92, 255, 0.25);
  max-width: 100%;
}
.arcade-select:focus { outline: none; border-color: var(--cyan); }

input[type="range"] { accent-color: var(--pink); width: 100%; }

.arcade-toggle { display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 1rem; cursor: pointer; color: var(--ivory-dim); }
.arcade-toggle input { accent-color: var(--lime); width: 1.1rem; height: 1.1rem; }

/* Audio sync: a quiet link next to the toggle. Its tap test is a popup (below, with the results). */
.setup-extras { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; }
.sync-link {
  margin-top: 1rem;
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px dotted currentColor;
  color: var(--ivory-dim);
  font: inherit;
  font-size: 0.95rem;
  opacity: 0.7;
  cursor: pointer;
}
.sync-link:hover, .sync-link:focus-visible { opacity: 1; color: var(--cyan); outline: none; }
.sync-link b { color: var(--orange); font-weight: 400; }

/* ---------- marquee ---------- */

.marquee {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  margin: 0.8rem 0 1.4rem;
}
.marquee-sign { text-align: center; }
.neon-open {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
  border: 2px solid var(--orange);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  text-shadow: var(--glow-orange);
  box-shadow: 0 0 14px rgba(255, 159, 28, 0.6), inset 0 0 10px rgba(255, 159, 28, 0.4);
  animation: buzz 3.7s infinite;
}
.neon-title {
  font-family: var(--font-neon);
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 6rem);
  line-height: 1.05;
  color: #fff;
  text-shadow: var(--glow-pink);
  margin: 0.8rem 0 0.4rem;
  letter-spacing: 0.04em;
}
.flick { animation: buzz 2.3s infinite; }
.flick-slow { animation: buzz 5.1s infinite 1.2s; }
@keyframes buzz {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.25; }
}
.marquee-sub { font-size: 1.35rem; color: var(--ivory-dim); }
.marquee-sub strong { color: var(--cyan); font-weight: 400; text-shadow: 0 0 8px rgba(24, 240, 255, 0.7); }
.marquee-props { display: flex; align-items: flex-end; gap: 0.6rem; }
.marquee-left { justify-content: flex-end; }
.marquee-right { justify-content: flex-start; }
.prop-beer { color: #2a1d3d; filter: drop-shadow(0 0 10px rgba(255, 176, 0, 0.45)); }
.prop-beer.two { transform: rotate(-8deg) translateY(4px); }
.ash { position: relative; display: inline-block; }
.prop-ash { color: var(--violet); }
.wisp {
  position: absolute;
  left: 40px;
  bottom: 26px;
  width: 10px;
  height: 46px;
  border-radius: 50%;
  border-left: 3px solid rgba(230, 220, 255, 0.35);
  filter: blur(1.5px);
  animation: wisp 3.2s ease-in-out infinite;
}
.wisp.w2 { left: 34px; animation-delay: -1.6s; height: 38px; }
@keyframes wisp {
  0% { transform: translateY(6px) scaleY(0.6) skewX(0deg); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-34px) scaleY(1.2) skewX(25deg); opacity: 0; }
}
@media (max-width: 700px) {
  .marquee { grid-template-columns: 1fr; }
  .marquee-props { display: none; }
}

/* ---------- ghosts ---------- */

.band-intro, .ghost-band { display: flex; justify-content: center; gap: 2.2rem; }
.band-intro { margin: 0.4rem 0 1.8rem; align-items: flex-end; }
.ghost { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; transition: opacity 0.4s ease, filter 0.4s ease; }
.ghost .sprite { display: block; animation: float 2.4s ease-in-out infinite; }
.ghost-cyan { color: var(--cyan); }
.ghost-pink { color: var(--pink); }
.ghost-orange { color: var(--orange); }
.ghost-cyan .sprite { filter: drop-shadow(0 0 10px var(--cyan)); }
.ghost-pink .sprite { filter: drop-shadow(0 0 10px var(--pink)); animation-delay: -0.8s; }
.ghost-orange .sprite { filter: drop-shadow(0 0 10px var(--orange)); animation-delay: -1.6s; }
@keyframes float { 50% { transform: translateY(-6px); } }

.ghost-lime { color: var(--lime); }
.ghost-lime .sprite { filter: drop-shadow(0 0 10px var(--lime)); }
/* The secret guest on the setup page: a pale, padlocked ghost that
   glitches now and then, with stars twinkling around it. Hover (desktop)
   or tap (phone) opens the guest collection. */
.ghost.is-secret {
  position: relative; color: #e4dcf0; cursor: pointer;
  background: none; border: 0; padding: 0; font: inherit;
}
.secret-body { display: block; animation: float 2.4s ease-in-out infinite -2.2s; }
.secret-body .sprite {
  opacity: 0.45;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 16px rgba(155, 92, 255, 0.7));
  animation: haunt 5s infinite;
  transition: opacity 0.2s;
}
/* Mostly faint, then a glitch: a jolt with a pink and cyan split. */
@keyframes haunt {
  0%, 86%, 100% { opacity: 0.45; transform: none; }
  88% { opacity: 0.85; transform: translateX(-3px) skewX(-6deg); filter: drop-shadow(-3px 0 0 var(--pink)) drop-shadow(3px 0 0 var(--cyan)); }
  90% { opacity: 0.2; transform: translateX(3px); }
  92% { opacity: 0.9; transform: none; filter: drop-shadow(3px 0 0 var(--pink)) drop-shadow(-3px 0 0 var(--cyan)); }
  94% { opacity: 0.45; }
}
.ghost.is-secret:hover .secret-body .sprite, .ghost.is-secret.open .secret-body .sprite,
.ghost.is-secret:focus-visible .secret-body .sprite { opacity: 0.85; animation: none; }
.spark {
  position: absolute; width: 4px; height: 4px; background: #fff;
  box-shadow: 0 0 6px #fff, 0 0 12px var(--violet);
  animation: twinkle 2.2s ease-in-out infinite;
}
.spark.s1 { top: 6%; left: 8%; }
.spark.s2 { top: 30%; right: 4%; animation-delay: -0.8s; }
.spark.s3 { bottom: 10%; left: 2%; animation-delay: -1.5s; width: 3px; height: 3px; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(1); } }
.secret-tip {
  position: absolute; z-index: 20; bottom: calc(100% + 10px); left: 50%; translate: -50% 0;
  width: 290px; max-width: calc(100vw - 2rem); padding: 0.7rem 0.8rem;
  background: var(--paper); border: 2px solid var(--violet); border-radius: 8px;
  box-shadow: 0 0 22px rgba(155, 92, 255, 0.5);
  font-family: var(--font-body); font-size: 1.05rem; line-height: 1.15; color: var(--ivory); text-align: left;
  opacity: 0; visibility: hidden; transition: opacity 0.15s;
}
.secret-tip b { display: block; margin-bottom: 0.3rem; font-family: var(--font-display); font-size: 0.5rem; font-weight: 400; color: var(--violet); text-transform: uppercase; letter-spacing: 0.1em; text-shadow: 0 0 8px var(--violet); }
.secret-lede { display: block; color: var(--ivory-dim); }
.secret-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; margin: 0.6rem 0 0.4rem; }
.sg { display: flex; flex-direction: column; align-items: center; padding: 0.3rem 0.1rem; border: 1px dashed var(--line); border-radius: 6px; color: #8b7aa3; }
.sg .sprite { opacity: 0.5; animation: none; }
.sg em { font-style: normal; font-family: var(--font-display); font-size: 0.4rem; margin-top: 0.15rem; letter-spacing: 0.08em; }
.sg small { font-size: 0.85rem; }
.sg.is-met { border-style: solid; border-color: var(--lime); color: var(--lime); }
.sg.is-met .sprite { opacity: 1; filter: drop-shadow(0 0 4px var(--lime)); }
.secret-count { display: block; text-align: right; font-family: var(--font-display); font-size: 0.45rem; color: var(--amber); letter-spacing: 0.08em; }
@media (hover: hover) { .ghost.is-secret:hover .secret-tip { opacity: 1; visibility: visible; } }
.ghost.is-secret.open .secret-tip, .ghost.is-secret:focus-visible .secret-tip { opacity: 1; visibility: visible; }
@media (max-width: 700px) { .secret-tip { left: auto; right: 0; translate: none; } }

/* On stage, ghosts bob on the beat instead of floating freely, and bob
   harder as the band heats up. */
body { --bob: 4px; --tilt: 3deg; }
body[data-energy="0"] { --bob: 2px; --tilt: 1deg; }
body[data-energy="2"] { --bob: 6px; --tilt: 4deg; }
body[data-energy="3"] { --bob: 11px; --tilt: 7deg; }
.ghost-band .ghost .sprite { animation: none; transition: transform 0.09s ease-out; }
body.beat-odd .ghost-band .ghost .sprite { transform: translateY(calc(-1 * var(--bob))) rotate(calc(-1 * var(--tilt))); }
body.beat-odd .ghost-band .ghost:nth-child(even) .sprite { transform: translateY(calc(-1 * var(--bob))) rotate(var(--tilt)); }
/* The band's heat lights each ghost up from left to right, over a dark
   copy of itself (--fill 0..1, set from main.js). A ghost that is not on
   stage yet, or any more, keeps still and glows less. */
.ghost-band .ghost { position: relative; }
.ghost-dark, .ghost-lit { display: block; }
.ghost-band .ghost-dark .sprite { opacity: 0.16; filter: grayscale(1); }
.ghost-lit {
  position: absolute; inset: 0;
  clip-path: inset(-40px calc((1 - var(--fill, 1)) * (100% + 16px) - 16px) -40px -40px);
  transition: clip-path 0.45s ease-out;
}
.ghost-band .ghost.is-off .ghost-lit .sprite { opacity: 0.6; filter: none; }
body.beat-odd .ghost-band .ghost.is-off .sprite { transform: none; }
.ghost.joins { animation: ghostJoins 0.7s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes ghostJoins { from { transform: translateY(24px) scale(0.4); opacity: 0; } 60% { transform: translateY(-6px) scale(1.25); opacity: 1; } }
.ghost.is-wild .sprite { animation: wild 0.5s ease-in-out infinite alternate; }
@keyframes wild { to { transform: translateY(-14px) scale(1.1) rotate(4deg); } }

/* ---------- MIDI gate (shared widget, neon) ---------- */

.midi-gate { border-color: rgba(24, 240, 255, 0.5); background: rgba(24, 240, 255, 0.05); box-shadow: 0 0 20px rgba(24, 240, 255, 0.12); }
.gate-icon { color: var(--cyan); }
.gate-title { font-size: 1.4rem; font-weight: 400; }
.gate-sub { font-size: 1.1rem; }
.gate-sub a { color: var(--cyan); }

/* ---------- cabinet (setup) ---------- */

.cabinet {
  position: relative;
  padding: 1.6rem 1.6rem 1.8rem;
  border: 3px solid var(--violet);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23, 13, 38, 0.92), rgba(11, 6, 20, 0.95));
  box-shadow: 0 0 0 6px #12091f, 0 0 0 8px rgba(155, 92, 255, 0.45), 0 0 50px rgba(155, 92, 255, 0.3);
}
.step-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  text-shadow: 0 0 8px rgba(182, 255, 59, 0.6);
  margin: 1.5rem 0 0.8rem;
}
.step-label:first-child { margin-top: 0; }
.step-label span {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 2px solid var(--lime);
  border-radius: 50%;
}

.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
@media (max-width: 700px) { .style-grid { grid-template-columns: repeat(2, 1fr); } }
.style-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon name" "icon blurb";
  align-items: center;
  column-gap: 0.7rem;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.style-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.style-card.is-on { border-color: var(--pink); box-shadow: 0 0 18px rgba(255, 46, 136, 0.5), inset 0 0 14px rgba(255, 46, 136, 0.2); }
.style-icon { grid-area: icon; font-size: 1.8rem; }
.style-name { grid-area: name; font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; }
.style-card.is-on .style-name { color: var(--pink); text-shadow: 0 0 8px var(--pink); }
.style-blurb { grid-area: blurb; font-size: 1rem; line-height: 1.1; color: var(--ivory-dim); }

.tune-row { display: flex; gap: 0.6rem; align-items: center; }
.tune-row .arcade-select { flex: 1; min-width: 0; }
.tune-preview { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin-top: 0.7rem; }
.tp-chords { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tp-chords > span {
  font-family: var(--font-body);
  font-size: 1.35rem;
  padding: 0.05rem 0.55rem;
  border: 1px solid rgba(24, 240, 255, 0.4);
  border-radius: 4px;
  color: var(--cyan);
}
.tp-meta { font-size: 1rem; color: var(--ivory-dim); }
.accent { color: inherit; }

.favs { margin-bottom: 1.4rem; }
.favs-title { font-family: var(--font-display); font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); text-shadow: 0 0 8px rgba(255, 176, 0, 0.55); margin-bottom: 0.6rem; }
.favs-title::before { content: "★ "; }
.fav-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.fav { display: inline-flex; align-items: stretch; border: 1px solid rgba(255, 176, 0, 0.55); border-radius: 6px; background: rgba(0, 0, 0, 0.3); }
.fav.is-on { border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 176, 0, 0.45); }
.fav-go { display: inline-flex; align-items: baseline; gap: 0.45rem; padding: 0.2rem 0.3rem 0.2rem 0.6rem; font-size: 1.1rem; line-height: 1.1; text-align: left; }
.fav-go:hover .fav-tune { color: var(--amber); }
.fav-tune { color: var(--ivory); }
.fav-meta { color: var(--ivory-dim); }
.fav-x { padding: 0 0.5rem; font-size: 1.2rem; color: var(--ivory-dim); }
.fav-x:hover { color: var(--crimson); }

.knobs { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; gap: 0.9rem; align-items: end; }
@media (max-width: 700px) { .knobs { grid-template-columns: 1fr 1fr; } .knob-wide { grid-column: 1 / -1; } }
.knob { display: flex; flex-direction: column; gap: 0.35rem; }
.knob-label { font-size: 1.05rem; color: var(--ivory-dim); }
.knob-label b { color: var(--orange); font-weight: 400; }

/* ---------- hall of fame + rules ---------- */

.hall, .rules { margin-top: 2rem; }
.hall-title, .rules-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  text-shadow: 0 0 8px rgba(255, 159, 28, 0.6);
  margin-bottom: 0.8rem;
}
.hall-list { list-style: none; border: 2px dashed var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; }
.hall-list li { display: grid; grid-template-columns: 2rem 1fr auto 2rem 6rem; gap: 0.6rem; align-items: baseline; padding: 0.15rem 0; }
.hall-pos { color: var(--cyan); }
.hall-style { color: var(--ivory-dim); }
.hall-rank { color: var(--lime); text-align: center; }
.hall-score { font-family: var(--font-display); font-size: 0.6rem; text-align: right; color: var(--amber); }
.hall-empty { display: block !important; color: var(--ivory-dim); }
.rules ul { padding-left: 1.2rem; color: var(--ivory-dim); }
.rules li { margin-bottom: 0.3rem; }
.rules b { color: var(--ivory); font-weight: 400; }
.g-perfect { color: var(--lime) !important; }
.g-good { color: var(--cyan) !important; }
.g-late { color: var(--orange) !important; }
.g-miss { color: var(--crimson) !important; }

/* ---------- play view ---------- */

.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 0.8rem; }
.hud-cell { text-align: center; padding: 0.6rem; border: 2px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.35); }
.hud-lbl { font-family: var(--font-display); font-size: 0.45rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-dim); margin-bottom: 0.45rem; }
.hud-val { font-family: var(--font-display); font-size: clamp(0.85rem, 3vw, 1.3rem); color: var(--amber); text-shadow: 0 0 10px rgba(255, 176, 0, 0.6); }
.hud-val small { font-size: 0.6em; margin-left: 0.4rem; color: var(--pink); }
.hud-combo.is-hot .hud-val { color: var(--pink); text-shadow: var(--glow-pink); }
.hud-combo.is-blazing { border-color: var(--pink); animation: blaze 0.5s ease-in-out infinite alternate; }
@keyframes blaze { to { box-shadow: 0 0 26px rgba(255, 46, 136, 0.8); } }

/* Tune on the left, Restart and Stop on the right: always in reach, no scrolling. */
.tune-bar { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.tune-info { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; align-items: baseline; }
#tuneTitle { color: #fff; font-size: 1.4rem; }
.tune-meta { color: var(--ivory-dim); }
.tune-chorus { font-family: var(--font-display); font-size: 0.5rem; color: var(--lime); text-transform: uppercase; letter-spacing: 0.1em; }

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 1.4rem 1rem 1.2rem;
  border: 3px solid var(--violet);
  border-radius: 14px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(255, 46, 136, 0.14), transparent 70%),
    rgba(11, 6, 20, 0.9);
  box-shadow: 0 0 40px rgba(155, 92, 255, 0.25), inset 0 0 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  min-height: 21rem;
}
.stage.flash-perfect { animation: flashGood 0.5s ease-out; }
.stage.flash-miss { animation: flashBad 0.5s ease-out; }
@keyframes flashGood { from { box-shadow: 0 0 60px rgba(182, 255, 59, 0.7), inset 0 0 60px rgba(182, 255, 59, 0.25); } }
@keyframes flashBad { from { box-shadow: 0 0 60px rgba(255, 59, 59, 0.8), inset 0 0 60px rgba(255, 59, 59, 0.3); } 30% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }

.beat-bulbs { display: flex; gap: 0.9rem; }
.beat-bulbs i {
  width: 16px; height: 16px; border-radius: 50%;
  background: #2b1840;
  border: 2px solid #4d2f72;
  transition: background 0.05s, box-shadow 0.05s;
}
.beat-bulbs i.on { background: var(--cyan); border-color: #fff; box-shadow: 0 0 14px var(--cyan); }
.beat-bulbs i.on.down { background: var(--pink); box-shadow: 0 0 18px var(--pink); }

.now-playing { text-align: center; }
.chord-big {
  font-family: var(--font-body);
  font-size: clamp(5rem, 22vw, 10rem);
  line-height: 0.95;
  color: #fff;
  text-shadow: var(--glow-pink);
  white-space: nowrap;
}
.chord-big .accent { color: #fff; }
.chord-big .count { color: var(--orange); text-shadow: var(--glow-orange); }
.chord-big.pop { animation: chordPop 0.28s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes chordPop { from { transform: scale(0.7); opacity: 0.3; } }
.chord-tones { display: flex; justify-content: center; gap: 0.5rem; min-height: 1.6rem; color: var(--ivory-dim); font-size: 1.3rem; }
.chord-tones span { color: var(--deg, var(--ivory-dim)); opacity: 0.6; }
.chord-tones .req { opacity: 1; text-shadow: 0 0 8px var(--deg); }

.next-chords { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.6rem 1rem; min-height: 4.6rem; color: var(--ivory-dim); }
.nx-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 1.1rem 0.45rem;
  border: 2px solid var(--cyan);
  border-radius: 10px;
  background: rgba(24, 240, 255, 0.08);
  box-shadow: 0 0 14px rgba(24, 240, 255, 0.35);
  transition: background 0.1s, box-shadow 0.1s, border-color 0.1s;
}
.nx-lbl { font-family: var(--font-display); font-size: 0.5rem; color: var(--orange); text-transform: uppercase; letter-spacing: 0.12em; }
.nx-chord { font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: 1; color: var(--cyan); text-shadow: 0 0 10px rgba(24, 240, 255, 0.7); white-space: nowrap; }
.nx-card.soon { border-color: #fff; background: rgba(24, 240, 255, 0.2); box-shadow: 0 0 28px var(--cyan); animation: nxSoon 0.35s ease-in-out infinite alternate; }
.nx-card.soon .nx-chord { color: #fff; }
@keyframes nxSoon { to { transform: scale(1.07); } }
.nx-then { display: flex; align-items: baseline; gap: 0.6rem; font-size: 1.5rem; white-space: nowrap; }
.nx { opacity: calc(1 - var(--i) * 0.25); }
.nx-arrow { color: var(--line); }

.slot-bar { width: min(480px, 90%); height: 6px; border-radius: 3px; background: #24143a; overflow: hidden; }
.slot-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform-origin: left; transform: scaleX(0); }

/* Timing gauge: early on the left, late on the right, the downbeat in the
   lime band. */
.gauge { width: min(480px, 90%); }
.gauge-track { position: relative; height: 18px; border-radius: 4px; background: #1a0f2b; border: 1px solid #4d2f72; overflow: hidden; }
.gz { position: absolute; top: 0; bottom: 0; }
.gz-early { background: rgba(255, 159, 28, 0.28); }
.gz-perfect { background: rgba(182, 255, 59, 0.45); box-shadow: 0 0 10px rgba(182, 255, 59, 0.5); }
.gz-good { background: rgba(24, 240, 255, 0.25); }
.gz-late { background: rgba(255, 46, 136, 0.22); }
.gz-center { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; opacity: 0.8; }
.gauge-ticks { position: absolute; inset: 0; }
.gt { position: absolute; top: 1px; bottom: 1px; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff; opacity: 0.35; }
.gt:last-child { opacity: 1; top: -1px; bottom: -1px; animation: tickIn 0.35s ease-out; }
.gt-perfect { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.gt-early { background: var(--orange); }
.gt-good { background: var(--cyan); }
.gt-late { background: var(--pink); }
@keyframes tickIn { from { transform: scaleY(2.4); } }
.gauge-cursor { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px #fff, 0 0 14px var(--cyan); }
.gauge-legend { display: flex; justify-content: space-between; align-items: baseline; margin-top: 0.25rem; font-family: var(--font-display); font-size: 0.42rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ivory-dim); }
.gauge-readout { font-size: 0.55rem; }
.gr-perfect { color: var(--lime); text-shadow: 0 0 8px var(--lime); }
.gr-early { color: var(--orange); }
.gr-good { color: var(--cyan); }
.gr-late { color: var(--pink); }

/* The current chord lights up the moment you land it. */
.chord-big.hit { animation: chordHit 0.35s ease-out; }
.chord-big.hit-perfect { animation: chordHitPerfect 0.45s ease-out; }
@keyframes chordHit { from { color: var(--cyan); text-shadow: var(--glow-cyan); transform: scale(1.06); } }
@keyframes chordHitPerfect { from { color: var(--lime); text-shadow: 0 0 4px #fff, 0 0 14px var(--lime), 0 0 34px var(--lime); transform: scale(1.12); } }

/* Band tier changes, announced across the stage. */
.tier-banner {
  position: absolute;
  left: 50%;
  top: -1rem;
  z-index: 3;
  padding: 0.45rem 0.9rem;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: rgba(11, 6, 20, 0.85);
  font-family: var(--font-display);
  font-size: clamp(0.6rem, 2.6vw, 0.9rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: tierBanner 1.8s ease-out forwards;
}
.tier-banner.is-up { color: var(--lime); text-shadow: 0 0 10px var(--lime); box-shadow: 0 0 20px rgba(182, 255, 59, 0.45); }
.tier-banner.is-down { color: var(--ivory-dim); }
@keyframes tierBanner {
  0% { transform: translateX(120%); opacity: 0; }
  14% { transform: translateX(-50%); opacity: 1; }
  80% { transform: translateX(-50%); opacity: 1; }
  100% { transform: translateX(-200%); opacity: 0; }
}

/* The whole room pulses on the beat, harder on the one and as the band
   heats up. */
.beat-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 46, 136, 0.5), rgba(155, 92, 255, 0.2) 55%, transparent 80%);
  --glow: 0.25;
}
body[data-energy="0"] .beat-glow { --glow: 0.12; }
body[data-energy="2"] .beat-glow { --glow: 0.32; }
body[data-energy="3"] .beat-glow { --glow: 0.55; }
.beat-glow.pulse { animation: beatGlow 0.32s ease-out; }
.beat-glow.pulse.down { animation: beatGlowDown 0.45s ease-out; }
@keyframes beatGlow { from { opacity: var(--glow); } }
@keyframes beatGlowDown { from { opacity: calc(var(--glow) * 1.6); } }
#viewPlay > :not(.beat-glow) { position: relative; z-index: 1; }
.beat-glow.in-stage { position: absolute; z-index: -1; background: radial-gradient(ellipse 70% 55% at 50% 35%, rgba(255, 46, 136, 0.45), rgba(24, 240, 255, 0.12) 60%, transparent 85%); }

.shout-layer { position: absolute; inset: 0; pointer-events: none; }
.shout {
  position: absolute;
  left: 50%;
  top: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transform: translate(-50%, 0) rotate(-6deg);
  animation: shout 1.2s ease-out forwards;
}
.shout-word { font-family: var(--font-display); font-size: clamp(0.9rem, 3.4vw, 1.5rem); text-transform: uppercase; text-shadow: 0 0 12px currentColor, 3px 3px 0 #000; white-space: nowrap; }
.shout-pts { font-family: var(--font-display); font-size: 0.75rem; color: var(--amber); text-shadow: 2px 2px 0 #000; }
.shout-spicy { font-family: var(--font-display); font-size: 0.55rem; color: var(--orange); text-shadow: 0 0 10px var(--orange); }
.shout-voicing { font-family: var(--font-display); font-size: 0.5rem; color: var(--cyan); text-shadow: 0 0 10px currentColor; white-space: nowrap; }
@keyframes shout {
  0% { transform: translate(-50%, 20px) rotate(-6deg) scale(0.6); opacity: 0; }
  15% { transform: translate(-50%, 0) rotate(-6deg) scale(1.15); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%, -50px) rotate(-6deg) scale(1); opacity: 0; }
}

.bandstand { display: flex; align-items: flex-end; justify-content: center; gap: 2rem; margin: 1.2rem 0; flex-wrap: wrap; }

/* Keyboard strip: neon keys, coloured by what they mean for the chord. */
.kb-frame { overflow-x: auto; border: 3px solid var(--violet); border-radius: 10px; background: #000; padding: 6px; box-shadow: 0 0 24px rgba(155, 92, 255, 0.3); }
.kb { position: relative; height: 120px; min-width: 700px; }
.kw, .kbk { position: absolute; top: 0; border-radius: 0 0 4px 4px; transition: background 0.06s, box-shadow 0.06s; }
.kw { height: 100%; background: #1d1230; border: 1px solid #3b2559; }
.kbk { height: 62%; background: #07030d; border: 1px solid #3b2559; z-index: 2; }

/* Colour code by what the note does in the chord. Major is warm, minor
   is cool: the 3rds are the pure colours (yellow, blue), the 7ths their
   deeper cousins (orange, violet). Root white, 5th green, any other
   extension pink, a wrong note red. Same colours on the keys to play
   (faint), the keys you hold (full) and the note names. */
.deg-root { --deg: #ffffff; } .hint-root { --hint: #ffffff; }
.deg-M3 { --deg: #ffe14a; } .hint-M3 { --hint: #ffe14a; }
.deg-m3 { --deg: #3d8bff; } .hint-m3 { --hint: #3d8bff; }
.deg-P5 { --deg: var(--lime); } .hint-P5 { --hint: var(--lime); }
.deg-M7 { --deg: var(--orange); } .hint-M7 { --hint: var(--orange); }
.deg-m7 { --deg: #b06bff; } .hint-m7 { --hint: #b06bff; }
.deg-ext { --deg: var(--pink); } .hint-ext { --hint: var(--pink); }
.deg-wrong { --deg: var(--crimson); }
.is-free { --deg: var(--cyan); }

.kw.is-hint { background: color-mix(in srgb, var(--hint) 22%, #1d1230); box-shadow: inset 0 -10px 14px color-mix(in srgb, var(--hint) 35%, transparent); }
.kbk.is-hint { background: color-mix(in srgb, var(--hint) 26%, #07030d); box-shadow: inset 0 -6px 10px color-mix(in srgb, var(--hint) 40%, transparent); }
.kw.is-down, .kbk.is-down { background: var(--deg); box-shadow: 0 0 16px var(--deg); }
.is-down.deg-wrong { box-shadow: 0 0 20px var(--crimson), inset 0 0 0 2px #fff; }


.play-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ---------- results ---------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: rgba(5, 2, 10, 0.82); backdrop-filter: blur(3px); }
.modal-box {
  width: min(520px, 100%);
  text-align: center;
  padding: 2rem 1.6rem;
  border: 3px solid var(--pink);
  border-radius: 14px;
  background: #0f0719;
  box-shadow: 0 0 50px rgba(255, 46, 136, 0.5);
}
.result-eyebrow { color: var(--ivory-dim); }
.result-rank { font-family: var(--font-neon); font-size: 6rem; line-height: 1.1; color: #fff; text-shadow: var(--glow-cyan); }
.result-rank[data-rank="S"] { text-shadow: var(--glow-orange); }
.result-score { font-family: var(--font-display); font-size: 1.4rem; color: var(--amber); text-shadow: 0 0 12px rgba(255, 176, 0, 0.7); }
.result-hi { margin-top: 0.6rem; font-family: var(--font-display); font-size: 0.65rem; color: var(--pink); animation: buzz 1s infinite; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.4rem 0; }
.result-grid div { padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px; }
.result-grid b { display: block; font-family: var(--font-display); font-size: 0.9rem; font-weight: 400; margin-bottom: 0.3rem; }
.result-grid span { font-size: 1rem; color: var(--ivory-dim); }
.result-actions { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }

/* The key picker: a circle of fifths. The tune's mode is the outer ring, its
   relative keys sit inside, Random in the middle. */
.key-btn { width: 100%; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; }
.key-btn::after { content: '◎'; color: var(--cyan); font-size: 1rem; }
.key-btn:hover { border-color: var(--cyan); }
.kw-box { width: min(440px, 100%); padding: 1rem 1.2rem 1.2rem; border-color: var(--cyan); box-shadow: 0 0 50px rgba(24, 240, 255, 0.35); }
.kw-head { display: flex; justify-content: space-between; align-items: center; }
.kw-title { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--cyan); }
.kw-wheel { display: block; width: min(100%, 360px); margin: 0.4rem auto 0; overflow: visible; font-family: var(--font-body); user-select: none; }
.kw-seg { cursor: pointer; outline: none; }
.kw-seg text { text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.kw-out { fill: #1a0e2c; stroke: var(--violet); stroke-width: 0.8; transition: fill 0.12s; }
.kw-in { fill: #110820; stroke: var(--line); stroke-width: 0.6; }
.kw-name { font-size: 15px; fill: var(--ivory); }
.kw-sig { font-size: 8px; fill: var(--ivory-dim); }
.kw-rel { font-size: 9.5px; fill: var(--ivory-dim); opacity: 0.75; }
.kw-seg:focus-visible .kw-out { fill: #251443; stroke: var(--cyan); stroke-width: 1.4; }
@media (hover: hover) { .kw-seg:not(.is-on):hover .kw-out { fill: #251443; stroke: var(--cyan); stroke-width: 1.4; } }
.kw-seg.is-on .kw-out { fill: var(--pink); stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 0 5px var(--pink)); }
.kw-seg.is-on .kw-name { fill: #fff; }
.kw-seg.is-on .kw-sig { fill: #ffd3ea; }
.kw-seg.is-on .kw-in { fill: #2a0f24; stroke: var(--pink); }
.kw-seg.is-on .kw-rel { fill: var(--gold-bright); opacity: 1; }
.kw-seg.is-picked .kw-out { animation: kw-flash 0.38s ease-out; }
@keyframes kw-flash { 0% { fill: #fff; } 100% { fill: var(--pink); } }
.kw-random circle { fill: #0f0719; stroke: var(--violet); stroke-width: 1; stroke-dasharray: 3 2.5; transition: fill 0.12s; }
.kw-random:hover circle, .kw-random:focus-visible circle { stroke: var(--cyan); fill: #1a0e2c; }
.kw-random.is-on circle { fill: var(--pink); stroke: #fff; stroke-dasharray: none; }
.kw-die { font-family: var(--font-display); font-size: 13px; fill: var(--cyan); }
.kw-rand { font-size: 9.5px; fill: var(--ivory-dim); }
.kw-random.is-on .kw-die, .kw-random.is-on .kw-rand { fill: #fff; }
.kw-hint { margin: 0.6rem 0 0; color: var(--ivory-dim); font-size: 1.05rem; }

/* The audio sync popup. */
.sync-box { border-color: var(--cyan); box-shadow: 0 0 50px rgba(24, 240, 255, 0.35); }
.sync-big { margin: 0.4rem 0 0.8rem; font-family: var(--font-neon); font-size: 3.6rem; line-height: 1.1; color: #fff; text-shadow: var(--glow-cyan); }
.sync-big.is-wait { color: var(--ivory-dim); text-shadow: none; }
.sync-pips { display: flex; justify-content: center; gap: 0.35rem; margin-bottom: 1rem; }
.sync-pips i { width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 1px solid var(--line); }
.sync-pips i.warm { border-style: dashed; }
.sync-pips i.on { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 8px var(--lime); }
.sync-msg { margin: 0 auto 1.4rem; max-width: 26rem; font-size: 1.1rem; line-height: 1.45; color: var(--ivory); }
.sync-msg b { color: var(--orange); font-weight: 400; }

/* ---------- achievements: a trophy case behind the bar ---------- */

.ach-box { width: min(720px, 100%); max-height: 88vh; overflow-y: auto; text-align: left; border-color: var(--cyan); box-shadow: 0 0 50px rgba(24, 240, 255, 0.35); }
.ach-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.4rem; }
.ach-title { margin: 0; font-family: var(--font-display); font-size: 0.85rem; font-weight: 400; color: #fff; text-shadow: var(--glow-cyan); }
.ach-count { margin-left: 0.5rem; font-size: 0.6rem; color: var(--ivory-dim); text-shadow: none; }
.ach-close { background: none; border: 0; color: var(--ivory-dim); font-size: 2rem; line-height: 1; cursor: pointer; }
.ach-close:hover { color: var(--pink); }
.ach-section + .ach-section { margin-top: 1rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.ach-section-header { display: flex; justify-content: space-between; align-items: baseline; }
.ach-section-label { font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber); }
.ach-section-count { font-family: var(--font-display); font-size: 0.55rem; color: var(--ivory-dim); }
.ach-section-blurb { color: var(--ivory-dim); font-size: 1.05rem; margin: 0.2rem 0 0.6rem; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.ach-tile { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: #140a22; }
.ach-tile-icon { flex: none; width: 1.8rem; text-align: center; font-size: 1.5rem; line-height: 1.2; }
.ach-tile-name { font-family: var(--font-display); font-size: 0.55rem; line-height: 1.5; color: #fff; }
.ach-tile-desc { font-size: 1rem; line-height: 1.1; color: var(--ivory-dim); margin-top: 0.2rem; }
.ach-tile.is-unlocked { border-color: var(--lime); box-shadow: 0 0 12px rgba(182, 255, 59, 0.25); }
.ach-tile.is-unlocked .ach-tile-name { color: var(--lime); }
.ach-tile.is-locked .ach-tile-icon { filter: grayscale(1); opacity: 0.5; }
.ach-tile.is-secret .ach-tile-icon, .ach-tile.is-ultra .ach-tile-icon { filter: none; opacity: 1; font-family: var(--font-display); font-size: 1rem; color: var(--violet); }
.ach-tile.is-ultra { border-color: var(--violet); animation: ultraGlow 3s ease-in-out infinite; }
@keyframes ultraGlow { 50% { box-shadow: 0 0 16px rgba(155, 92, 255, 0.55); } }
.ach-tile-progress { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.35rem; font-size: 0.9rem; color: var(--ivory-dim); }
.ach-tile-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ach-tile-fill { height: 100%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.ach-reset { display: block; margin: 1.2rem auto 0; background: none; border: 0; color: var(--ivory-dim); font-family: var(--font-body); font-size: 1rem; text-decoration: underline; cursor: pointer; }
.ach-reset.armed { color: var(--crimson); }

.ach-toast {
  position: fixed; top: 1rem; right: 1rem; z-index: 80;
  display: flex; align-items: center; gap: 0.8rem;
  max-width: min(340px, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border: 2px solid var(--lime); border-radius: 10px;
  background: #0f0719;
  box-shadow: 0 0 24px rgba(182, 255, 59, 0.4);
  opacity: 0; transform: translateY(-12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.ach-toast.visible { opacity: 1; transform: translateY(0); }
.ach-toast.is-rare { border-color: var(--pink); box-shadow: var(--glow-pink); }
.ach-toast-icon { font-size: 2rem; line-height: 1; }
.ach-toast-tier { font-family: var(--font-display); font-size: 0.5rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime); }
.ach-toast.is-rare .ach-toast-tier { color: var(--pink); }
.ach-toast-name { font-family: var(--font-display); font-size: 0.65rem; line-height: 1.6; color: #fff; margin-top: 0.2rem; }
.ach-toast-desc { font-size: 1rem; line-height: 1.1; color: var(--ivory-dim); }

.page-footer { margin-top: 3rem; text-align: center; color: var(--ivory-dim); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Phones: compact groove cards, slimmer cabinet. */
.style-card { min-width: 0; }
@media (max-width: 600px) {
  .cabinet { padding: 1.1rem 0.9rem 1.3rem; }
  .style-grid { gap: 0.5rem; }
  .style-card { grid-template-areas: "icon name"; padding: 0.6rem; }
  .style-blurb { display: none; }
  .hall-list li { grid-template-columns: 1.4rem 1fr auto 4.5rem; }
  .hall-style { display: none; }
  .band-intro, .ghost-band { gap: 1.2rem; }
  .ghost .sprite { width: 74px; height: auto; }
  .sg .sprite { width: auto; }
}

/* A groove tip (Funk: switch to a Clav). Slides in at the bottom, leaves on its own. */
.groove-tip {
  position: fixed; left: 50%; bottom: 1.2rem; z-index: 70;
  display: flex; align-items: center; gap: 0.7rem;
  width: max-content; max-width: calc(100vw - 2rem);
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--orange); border-radius: 10px;
  background: #0f0719;
  box-shadow: 0 0 20px rgba(255, 159, 28, 0.35);
  font-size: 1.1rem; line-height: 1.15;
  opacity: 0; transform: translate(-50%, 12px);
  transition: opacity 0.35s, transform 0.35s;
  cursor: pointer;
}
.groove-tip.visible { opacity: 1; transform: translate(-50%, 0); }
.groove-tip-icon { font-size: 1.6rem; line-height: 1; }
.groove-tip b { font-family: var(--font-display); font-size: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); font-weight: 400; display: block; margin-bottom: 0.2rem; }

/* Piano remote: the keys around middle C and what they do. */
.remote { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.remote-title { font-family: var(--font-display); font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 8px rgba(24, 240, 255, 0.5); margin-bottom: 0.7rem; }
.remote-sub { font-size: 1rem; color: var(--ivory-dim); margin: 0.6rem 0 0; }
.remote-sub b { color: var(--ivory); font-weight: 400; }
.remote-how { margin: 0.7rem 0 0; padding-left: 1.2rem; font-size: 1rem; color: var(--ivory-dim); }
.remote-keys { display: grid; grid-template-rows: 1.9rem 1.5rem; gap: 0; max-width: 420px; }
.rk { display: grid; place-items: end center; padding-bottom: 0.2rem; font-family: var(--font-display); font-size: 0.5rem; min-width: 0; }
.rk-white { grid-row: 1 / span 2; background: rgba(246, 234, 255, 0.1); border: 1px solid rgba(246, 234, 255, 0.35); border-radius: 0 0 4px 4px; color: var(--ivory-dim); }
.rk-black { grid-row: 1; z-index: 1; margin: 0 18%; background: #07030d; border: 1px solid var(--violet); border-radius: 0 0 3px 3px; color: #fff; }
.rk-home { color: var(--ivory); background: rgba(246, 234, 255, 0.22); }
.rk-down, .rk-up { background: rgba(24, 240, 255, 0.28); border-color: var(--cyan); color: #fff; }
.rk-black.rk-down, .rk-black.rk-up { background: #0b4a52; }
.rk-select { background: rgba(255, 46, 136, 0.35); border-color: var(--pink); color: #fff; }
.result-remote { margin-top: 1rem; font-size: 1rem; color: var(--ivory-dim); text-align: center; }
.result-remote b { color: var(--cyan); font-weight: 400; }

/* The menu cursor: dashed cyan on the row, solid pink once it is selected. */
.nav-focus, .nav-edit { outline-offset: 5px; border-radius: 8px; transition: outline-color 0.15s; }
.nav-focus { outline: 2px dashed var(--cyan); }
.nav-edit { outline: 2px solid var(--pink); box-shadow: 0 0 22px rgba(255, 46, 136, 0.45); }
