:root {
  --acid: #f4ff00;
  --lime: #b7ff00;
  --gold: #ffd447;
  --bg: #070806;
  --panel: rgba(14, 16, 11, 0.86);
  --panel-solid: #11130e;
  --border: rgba(244, 255, 0, 0.24);
  --text: #f7f9f2;
  --muted: #aeb5a3;
  --radius-lg: 22px;
  --radius-md: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

img {
  -webkit-user-drag: none;
  user-select: none;
  display: block;
}

.is-hidden {
  display: none !important;
}

/* =========================================================
   BACKGROUND WALL + FX LAYER
   ========================================================= */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-wall {
  position: absolute;
  inset: -4%;
  background-image: url("/assets/bg-wall.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.34;
  transform: translate3d(0, 0, 0) scale(1.04);
  will-change: transform;
  transition: opacity 0.5s ease;
}

body.perf-low .bg-wall {
  opacity: 0.24;
  will-change: auto;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(244, 255, 0, 0.14), transparent 55%),
    radial-gradient(circle at 50% 60%, rgba(7, 8, 6, 0.35), rgba(7, 8, 6, 0.94) 80%);
}

.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* =========================================================
   FLOATING INTERACTIVE STICKERS
   ========================================================= */
.floating-sticker {
  position: fixed;
  z-index: 4;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  will-change: transform;
  transition: filter 0.3s ease, opacity 0.4s ease;
}

.floating-sticker img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.65));
}

body.perf-low .floating-sticker img {
  filter: none;
}

.sticker-left {
  width: clamp(76px, 19vw, 150px);
  left: clamp(6px, 2.5vw, 38px);
  bottom: calc(12px + var(--safe-bottom));
  animation: floatLeft 5.6s ease-in-out infinite;
}

.sticker-right {
  width: clamp(76px, 19vw, 150px);
  right: clamp(6px, 2.5vw, 38px);
  top: calc(56px + var(--safe-top));
  animation: floatRight 6.2s ease-in-out infinite;
  opacity: 0.92;
}

body[data-phase="2"] .sticker-right {
  animation: celebrateBounce 1.8s ease-in-out infinite;
  opacity: 1;
}

.floating-sticker.is-booped {
  animation: none !important;
  transform: scale(1.22) rotate(-8deg) !important;
}

@keyframes floatLeft {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-6deg); }
  50% { transform: translate3d(4px, -12px, 0) rotate(4deg); }
}

@keyframes floatRight {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(7deg); }
  50% { transform: translate3d(-5px, 11px, 0) rotate(-4deg); }
}

@keyframes celebrateBounce {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.04) rotate(8deg); }
  50% { transform: translate3d(0, -14px, 0) scale(1.12) rotate(-6deg); }
}

@media (max-width: 520px) {
  .sticker-left {
    width: 72px;
    left: 4px;
    bottom: calc(6px + var(--safe-bottom));
    opacity: 0.86;
  }
  .sticker-right {
    width: 72px;
    right: 4px;
    top: calc(52px + var(--safe-top));
  }
}

/* =========================================================
   MAIN STAGE LAYOUT
   ========================================================= */
.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 470px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.artist-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--acid);
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  height: 30px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.chip-btn.chip-accent {
  color: var(--acid);
  border-color: rgba(244, 255, 0, 0.5);
}

.chip-btn:active {
  transform: scale(0.93);
}

.logo-wrap {
  width: clamp(190px, 58vw, 270px);
  aspect-ratio: 640 / 332;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0 0;
}

.logo-acido {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(244, 255, 0, 0.28));
}

body.perf-low .logo-acido {
  filter: none;
}

/* Steps Bar */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 360px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.step-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
}

.step-pill.is-active {
  color: #080907;
  background: var(--acid);
  border-color: var(--acid);
  box-shadow: 0 0 16px rgba(244, 255, 0, 0.35);
}

.step-pill.is-active span {
  background: rgba(0, 0, 0, 0.2);
  color: #080907;
}

.step-pill.is-done {
  color: var(--lime);
  border-color: rgba(183, 255, 0, 0.45);
  background: rgba(183, 255, 0, 0.12);
}

.step-pill.is-done span {
  background: var(--lime);
  color: #080907;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* =========================================================
   INTERACTIVE COVER / PUZZLE CARD
   ========================================================= */
.card-shell {
  width: min(90vw, 404px);
  aspect-ratio: 1 / 1;
  perspective: 950px;
  position: relative;
}

.tilt-card {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
}

body.perf-low .tilt-card {
  transition: none;
  will-change: auto;
}

.cover-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(244, 255, 0, 0.48);
  background: #14160e;
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.72),
    0 0 34px rgba(244, 255, 0, 0.16);
}

body.perf-low .cover-frame {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.foil-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    125deg,
    transparent 20%,
    rgba(255, 255, 255, 0.22) 45%,
    rgba(244, 255, 0, 0.18) 52%,
    transparent 75%
  );
  mix-blend-mode: screen;
  transition: opacity 0.35s ease;
}

body.perf-high[data-phase="2"] .foil-sheen {
  opacity: 0.7;
}

/* =========================================================
   PHASE 0: REGISTRATION OVERLAY
   ========================================================= */
.phase-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 18px;
  background: rgba(9, 11, 7, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.perf-low .phase-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(9, 11, 7, 0.93);
}

.seal-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--acid);
  border: 1px solid rgba(244, 255, 0, 0.42);
  background: rgba(244, 255, 0, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.start-title {
  margin: 0 0 4px;
  font-family: "Syne", sans-serif;
  font-size: clamp(22px, 6.2vw, 28px);
  line-height: 1.05;
}

.start-title span {
  color: var(--acid);
}

.start-sub {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.38;
  color: #d6dccb;
  max-width: 290px;
}

.player-form {
  width: 100%;
  max-width: 296px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-left: 4px;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(244, 255, 0, 0.16);
}

.form-error {
  font-size: 11px;
  font-weight: 700;
  color: #ff6b8b;
  text-align: center;
  padding: 2px 4px;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  margin-top: 2px;
  background: var(--acid);
  color: #080907;
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(244, 255, 0, 0.34);
  transition: transform 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.65) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: shimmerBtn 2.6s ease-in-out infinite;
}

@keyframes shimmerBtn {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}

.privacy-note {
  margin: 2px 0 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* =========================================================
   PHASE 1: 4x4 PUZZLE BOARD (16 TILES)
   ========================================================= */
.puzzle-board {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  background: #0b0d08;
  touch-action: manipulation;
}

.puzzle-tile {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  background-color: #1a1d10;
  background-image: url("/assets/cover-acido.webp");
  background-size: 400% 400%;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 0.16s ease, filter 0.16s ease;
  box-shadow: inset 0 0 0 2.5px rgba(8, 9, 7, 0.85), inset 0 0 0 4px rgba(255, 255, 255, 0.65);
  filter: brightness(0.92) saturate(0.92);
}

/* Clear badge on unsolved tiles so yellow edge pieces are NEVER confusing */
.puzzle-tile::after {
  content: "⇄";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(8, 9, 7, 0.84);
  border: 1.5px solid var(--acid);
  color: var(--acid);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

body.perf-low .puzzle-tile {
  background-image: url("/assets/cover-acido-sm.webp");
}

.puzzle-tile:active {
  transform: scale(0.94);
}

.puzzle-tile.is-selected {
  z-index: 3;
  transform: scale(0.92);
  box-shadow:
    inset 0 0 0 3.5px #080907,
    inset 0 0 0 6px var(--acid),
    0 0 22px rgba(244, 255, 0, 0.85);
  filter: brightness(1.12);
}

.puzzle-tile.is-locked {
  cursor: default;
  border-radius: 3px;
  box-shadow: none;
  filter: brightness(1.02) saturate(1.04);
}

.puzzle-tile.is-locked::after {
  display: none;
}

.puzzle-tile.is-snap {
  animation: tileSnap 0.36s ease;
}

@keyframes tileSnap {
  0% { transform: scale(1.09); filter: brightness(1.4); }
  100% { transform: scale(1); filter: brightness(1); }
}

.hint-peek {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  animation: fadeHint 1.8s ease forwards;
}

.hint-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.hint-peek span {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 9, 7, 0.86);
  border: 1px solid var(--acid);
  color: var(--acid);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

@keyframes fadeHint {
  0% { opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* PHASE 2: Unlocked Pill */
.unlocked-pill {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(8, 9, 7, 0.86);
  border: 1px solid rgba(244, 255, 0, 0.65);
  color: var(--acid);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

/* =========================================================
   PUZZLE HUD & STATS
   ========================================================= */
.hud-panel {
  width: min(90vw, 404px);
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.perf-high .hud-panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hud-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
}

.stat-k {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-box strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-box strong.accent {
  color: var(--acid);
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--acid));
  transition: width 0.2s ease-out;
}

.hud-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-tip {
  font-size: 11px;
  color: var(--muted);
}

.btn-hint {
  border: 1px solid rgba(244, 255, 0, 0.45);
  background: rgba(244, 255, 0, 0.1);
  color: var(--acid);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-hint:active {
  transform: scale(0.95);
}

/* =========================================================
   PROTECTED EXCLUSIVE AUDIO PLAYER
   ========================================================= */
.player-panel {
  width: min(90vw, 404px);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1.5px solid rgba(244, 255, 0, 0.42);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  animation: slideUpIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

body.perf-high .player-panel {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.perf-low .player-panel {
  background: var(--panel-solid);
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.track-title {
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--acid);
}

.track-artist {
  color: var(--text);
  font-weight: 700;
}

.stream-badge {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}

.viz-canvas {
  width: 100%;
  height: 52px;
  display: block;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.play-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--acid);
  color: #080907;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(244, 255, 0, 0.35);
}

.play-btn:active {
  transform: scale(0.92);
}

.scrub-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scrub-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  touch-action: none;
}

.scrub-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--acid));
}

.scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--acid);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(244, 255, 0, 0.7);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.player-rank-banner {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(244, 255, 0, 0.12);
  border: 1px solid rgba(244, 255, 0, 0.38);
  color: var(--acid);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.player-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
}

.btn-secondary,
.btn-ghost {
  border-radius: 12px;
  padding: 11px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.btn-secondary {
  border: 0;
  background: var(--acid);
  color: #080907;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* =========================================================
   LEADERBOARD / RANKING PANEL
   ========================================================= */
.ranking-panel {
  width: min(90vw, 404px);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--border);
}

body.perf-high .ranking-panel {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ranking-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 15px;
  color: var(--acid);
  letter-spacing: 0.04em;
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.rank-item.is-me {
  background: rgba(244, 255, 0, 0.14);
  border-color: rgba(244, 255, 0, 0.55);
}

.rank-pos {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  color: var(--acid);
  text-align: center;
}

.rank-name {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-pts {
  display: block;
  font-weight: 700;
  color: var(--acid);
  font-size: 13px;
}

.rank-sub {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.footer-note {
  margin-top: auto;
  padding-top: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .floating-sticker,
  .dot-live,
  .btn-glow {
    animation: none !important;
  }
}

/* =========================================================
   CONSENT + HIDDEN COVER (the fans must DISCOVER the cover)
   ========================================================= */
.consent {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 9.5px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}
.consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--acid);
}
.consent a {
  color: var(--acid);
}
.btn-primary:disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Cover stays hidden (blurred) until the puzzle is solved */
body[data-phase="0"] .cover-img {
  filter: blur(22px) saturate(1.2) brightness(0.55);
  transform: scale(1.15);
}
body[data-phase="1"] .cover-img {
  visibility: hidden;
}
body[data-phase="2"] .cover-img {
  animation: coverReveal 0.9s ease-out both;
}
@keyframes coverReveal {
  from { filter: blur(14px) brightness(1.6); transform: scale(1.08); }
  to { filter: none; transform: none; }
}

/* Compact registration so it fits inside the square cover on phones */
.overlay-start {
  overflow-y: auto;
  justify-content: safe center;
  padding: 12px 16px;
}
.overlay-start .player-form { gap: 6px; }
.overlay-start .btn-primary { padding: 10px 16px; font-size: 12.5px; }
@media (max-width: 520px) {
  .overlay-start .start-sub { display: none; }
  .overlay-start .seal-badge { margin-bottom: 6px; font-size: 8.5px; }
  .overlay-start .start-title { margin-bottom: 8px; }
  .overlay-start .field input { height: 36px; font-size: 16px; } /* 16px avoids iOS zoom */
  .overlay-start .field span { font-size: 10px; }
}

/* =========================================================
   AMBIENT YELLOW HEARTS (TikTok-live style, GPU-only)
   ========================================================= */
.heart-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.fly-heart {
  position: absolute;
  width: var(--sz, 24px);
  height: var(--sz, 24px);
  margin: calc(var(--sz, 24px) / -2) 0 0 calc(var(--sz, 24px) / -2);
  background: no-repeat center / contain;
  will-change: transform, opacity;
  animation: heartFly var(--dur, 2.6s) cubic-bezier(.25,.6,.4,1) forwards;
}
.fly-heart.h1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f4ff00' stroke='%23080907' stroke-width='1.2' d='M12 21s-7.5-4.6-9.6-9.1C.8 8.4 2.9 4.5 6.6 4.5c2.1 0 3.6 1.2 4.4 2.6.8-1.4 2.3-2.6 4.4-2.6 3.7 0 5.8 3.9 4.2 7.4C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
.fly-heart.h2 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffd400' stroke='%23080907' stroke-width='1.2' d='M12 21s-7.5-4.6-9.6-9.1C.8 8.4 2.9 4.5 6.6 4.5c2.1 0 3.6 1.2 4.4 2.6.8-1.4 2.3-2.6 4.4-2.6 3.7 0 5.8 3.9 4.2 7.4C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
.fly-heart.h3 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b7ff00' stroke='%23080907' stroke-width='1.2' d='M12 21s-7.5-4.6-9.6-9.1C.8 8.4 2.9 4.5 6.6 4.5c2.1 0 3.6 1.2 4.4 2.6.8-1.4 2.3-2.6 4.4-2.6 3.7 0 5.8 3.9 4.2 7.4C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
@keyframes heartFly {
  0%   { transform: translate3d(0, 0, 0) scale(.3) rotate(0deg); opacity: 0; }
  12%  { transform: translate3d(calc(var(--dx) * .15), -20px, 0) scale(1.05) rotate(calc(var(--rot) * .3)); opacity: 1; }
  40%  { transform: translate3d(calc(var(--dx) * -.35), calc(var(--rise) * .4), 0) scale(1) rotate(calc(var(--rot) * -.4)); }
  70%  { transform: translate3d(calc(var(--dx) * .6), calc(var(--rise) * .72), 0) scale(.95) rotate(calc(var(--rot) * .6)); opacity: .9; }
  100% { transform: translate3d(var(--dx), var(--rise), 0) scale(.8) rotate(var(--rot)); opacity: 0; }
}
body.perf-low .fly-heart { animation-timing-function: linear; }

/* =========================================================
   VOLUME PROMPT + TAP-TO-PLAY
   ========================================================= */
.vol-toast {
  position: fixed;
  left: 50%;
  top: calc(14px + var(--safe-top));
  z-index: 50;
  transform: translate(-50%, -140%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 380px);
  padding: 10px 16px 10px 12px;
  border-radius: 16px;
  background: var(--acid);
  color: #080907;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55), 0 0 0 3px rgba(8, 9, 7, .9);
  transition: transform .45s cubic-bezier(.2, 1.3, .4, 1);
}
.vol-toast.is-on { transform: translate(-50%, 0); }
.vol-toast small { display: block; font-weight: 600; font-size: 11px; opacity: .8; margin-top: 2px; }
.vol-icon { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.vol-icon i { width: 5px; border-radius: 2px; background: #080907; animation: volBar 0.9s ease-in-out infinite; }
.vol-icon i:nth-child(1) { height: 30%; animation-delay: 0s; }
.vol-icon i:nth-child(2) { height: 55%; animation-delay: .12s; }
.vol-icon i:nth-child(3) { height: 80%; animation-delay: .24s; }
.vol-icon i:nth-child(4) { height: 100%; animation-delay: .36s; }
@keyframes volBar { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.tap-play {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: rgba(8, 9, 7, .62);
  color: var(--acid);
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .05em;
  cursor: pointer;
}
.tap-play .big-play {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--acid);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 10px rgba(244, 255, 0, .18), 0 10px 30px rgba(0, 0, 0, .5);
  animation: pulsePlay 1.4s ease-in-out infinite;
}
@keyframes pulsePlay { 50% { box-shadow: 0 0 0 20px rgba(244, 255, 0, .06), 0 10px 30px rgba(0, 0, 0, .5); } }

.net-note {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}

/* =========================================================
   ONE-LISTEN LOCK
   ========================================================= */
.player-panel.is-locked .transport,
.player-panel.is-locked .viz-canvas,
.player-panel.is-locked #btn-mute { display: none; }
.heard-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  margin: 4px 0 8px;
  border-radius: 14px;
  border: 1px solid rgba(244, 255, 0, .4);
  background: rgba(244, 255, 0, .08);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
}
.heard-note strong { color: var(--acid); font-family: "Syne", sans-serif; letter-spacing: .04em; font-size: 14px; }
body[data-phase="2"] .scrub-track { cursor: default; }
.ts-box { display: flex; justify-content: center; }
.ts-box:empty { display: none; }
