/* ==========================================================================
   PHIGROS WEB — AAA Pigeon Games Aesthetic & Dynamic Theme System
   Zero-clipping slanted geometry, dynamic per-song --song-accent palette,
   frosted obsidian glass, HUD reticles, sheen sweeps, & custom controls.
   ========================================================================== */

:root {
  --bg-deep: #060911;
  --glass-dark: rgba(11, 16, 28, 0.80);
  --glass-light: rgba(255, 255, 255, 0.08);
  --border-crisp: rgba(255, 255, 255, 0.22);
  --border-bright: rgba(255, 255, 255, 0.72);
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --cyan: #38e4ff;
  --song-accent: #38e4ff;
  --blue: #298cff;
  --gold: #ffe57f;
  --crimson: #ff385c;
  --ez-color: #65d654;
  --hd-color: #36a9ff;
  --in-color: #ff385c;
  --at-bg: #232732;
  --slant: -13deg;
  --unslant: 13deg;
  --font-display: 'Exo 2', 'Rajdhani', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-ui: 'Rajdhani', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.26); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--song-accent); }

/* ==========================================================================
   SCREEN SYSTEM & TRANSITIONS
   ========================================================================== */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none !important;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.screen.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
  animation: screenFadeIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 10;
}

@keyframes screenFadeIn {
  from { opacity: 0.25; transform: scale(1.015); }
  to { opacity: 1; transform: scale(1); }
}

/* Signature Phigros Diagonal Geometric Shutter Transition Curtain */
.phi-transition-curtain {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
}

.phi-transition-curtain.sweeping {
  visibility: visible;
  pointer-events: auto;
}

.shutter-blade {
  position: absolute;
  top: -12%;
  bottom: -12%;
  left: -135%;
  width: 130%;
  transform: skewX(-16deg);
}

.shutter-blade.b1 {
  background: var(--song-accent);
  box-shadow: 0 0 40px var(--song-accent);
}

.shutter-blade.b2 {
  background: linear-gradient(105deg, #070b15 0%, #0d1527 60%, #070b15 100%);
  border-left: 3px solid rgba(255, 255, 255, 0.85);
  border-right: 3px solid var(--song-accent);
}

.shutter-blade.b3 {
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
}

.shutter-emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.75);
  font-family: var(--font-display);
  font-size: 84px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 34px var(--song-accent);
  opacity: 0;
}

.phi-transition-curtain.sweeping .shutter-blade.b1 {
  animation: bladeSweep 0.62s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.phi-transition-curtain.sweeping .shutter-blade.b2 {
  animation: bladeSweep 0.62s 0.045s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.phi-transition-curtain.sweeping .shutter-blade.b3 {
  animation: bladeSweep 0.62s 0.09s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.phi-transition-curtain.sweeping .shutter-emblem {
  animation: emblemFlash 0.62s ease forwards;
}

@keyframes bladeSweep {
  0% { transform: translateX(0%) skewX(-16deg); }
  45% { transform: translateX(108%) skewX(-16deg); }
  55% { transform: translateX(108%) skewX(-16deg); }
  100% { transform: translateX(230%) skewX(-16deg); }
}

@keyframes emblemFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  38% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.04); }
  62% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.22); }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   GEOMETRIC SLANTED BUTTONS (WITH HOLOGRAPHIC SHEEN)
   ========================================================================== */
.phi-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  background: rgba(14, 20, 34, 0.88);
  border: 1px solid var(--border-crisp);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  cursor: pointer;
  transform: skewX(var(--slant));
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  overflow: hidden;
  white-space: nowrap;
}

.phi-btn.compact {
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 1px;
}

.phi-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.24), transparent);
  transition: left 0.45s ease;
  pointer-events: none;
}

.phi-btn:hover::before {
  left: 140%;
}

.phi-btn > * {
  transform: skewX(var(--unslant));
}

.phi-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  box-shadow: 0 0 20px color-mix(in srgb, var(--song-accent) 40%, transparent);
  transform: skewX(var(--slant)) translateY(-1px);
}

.phi-btn:active {
  transform: skewX(var(--slant)) scale(0.97);
}

.phi-btn.primary {
  background: linear-gradient(110deg, #ffffff 0%, #eaf9ff 100%);
  color: #080d18;
  border-color: #ffffff;
  box-shadow: 0 0 28px color-mix(in srgb, var(--song-accent) 45%, transparent);
}

.phi-btn.primary:hover {
  background: linear-gradient(110deg, #ffffff 0%, #c8f5ff 100%);
  box-shadow: 0 0 38px color-mix(in srgb, var(--song-accent) 75%, transparent);
}

.phi-btn.accent-gold {
  border-color: rgba(255, 229, 127, 0.58);
  color: var(--gold);
}

.phi-btn.accent-gold:hover {
  background: rgba(255, 229, 127, 0.16);
  box-shadow: 0 0 22px rgba(255, 229, 127, 0.35);
}

.phi-btn.accent-crimson {
  border-color: rgba(255, 56, 92, 0.62);
  color: #ff859b;
}

.phi-btn.accent-crimson:hover {
  background: rgba(255, 56, 92, 0.18);
  box-shadow: 0 0 22px rgba(255, 56, 92, 0.38);
}

/* ==========================================================================
   SCREEN 1: ICONIC PHIGROS TITLE SCREEN
   ========================================================================== */
#screen-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.title-bg-layer {
  position: absolute;
  inset: -3%;
  background: url('../assets/jackets/title-bg.jpg') center/cover no-repeat;
  animation: slowBreathe 18s ease-in-out infinite alternate;
  filter: brightness(0.75) saturate(1.12);
}

@keyframes slowBreathe {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.09) translate(-1%, -1%); }
}

.title-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(10, 22, 42, 0.14) 0%, rgba(5, 8, 16, 0.80) 100%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.40) 0%, transparent 45%, rgba(6, 10, 18, 0.86) 100%);
}

.title-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, transparent 49.65%, rgba(255,255,255,0.06) 50%, transparent 50.35%),
    linear-gradient(-25deg, transparent 49.7%, rgba(56,228,255,0.05) 50%, transparent 50.3%);
  background-size: 260px 260px;
  pointer-events: none;
}

.title-side-hud {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.42);
  z-index: 3;
  pointer-events: none;
}

.title-side-hud.left { left: 26px; }
.title-side-hud.right { right: 26px; }
.title-side-hud .hud-line {
  width: 1px;
  height: 110px;
  background: linear-gradient(180deg, transparent, rgba(56, 228, 255, 0.6), transparent);
}

.title-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.title-center-box {
  position: relative;
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.title-emblem-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.title-emblem-orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(56, 228, 255, 0.42);
  transform: rotate(45deg);
  animation: orbitSpin 16s linear infinite;
}

.title-emblem-orbit::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 7px;
  height: 7px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

@keyframes orbitSpin {
  0% { transform: rotate(45deg); }
  100% { transform: rotate(405deg); }
}

.title-emblem-ring {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: rgba(10, 18, 34, 0.45);
  backdrop-filter: blur(8px);
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(56, 228, 255, 0.45), inset 0 0 18px rgba(56, 228, 255, 0.3);
  animation: diamondFloat 4.2s ease-in-out infinite;
}

.title-emblem-ring span {
  transform: rotate(-45deg);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 18px var(--cyan);
}

@keyframes diamondFloat {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(-5px); }
}

.title-logo-wordmark {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(58px, 10vw, 118px);
  font-weight: 800;
  letter-spacing: 14px;
  padding-left: 14px;
  background: linear-gradient(115deg, #ffffff 30%, #a5f3fc 48%, #ffffff 66%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 28px rgba(56, 228, 255, 0.28));
  animation: logoSweep 4.8s ease-in-out infinite;
  line-height: 1;
}

@keyframes logoSweep {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

.title-logo-wordmark::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -12px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #fff 28%, var(--cyan) 50%, #fff 72%, transparent 100%);
  box-shadow: 0 0 16px var(--cyan);
}

.title-subtitle {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 6px;
  color: rgba(230, 244, 255, 0.84);
  text-transform: uppercase;
}

.title-touch-prompt {
  margin-top: 46px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 5px;
  color: #ffffff;
  animation: pulseTouch 2.1s ease-in-out infinite;
}

.title-touch-prompt::before,
.title-touch-prompt::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--cyan);
}

@keyframes pulseTouch {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

.title-footer {
  position: absolute;
  bottom: 20px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.56);
  z-index: 3;
}

/* ==========================================================================
   SCREEN 2: ICONIC PHIGROS SONG SELECT (ZERO CLIPPING + AAA ART UPGRADE)
   ========================================================================== */
#screen-select {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.select-bg-blur {
  position: absolute;
  inset: -34px;
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.40) saturate(1.28);
  transition: background-image 0.55s ease;
  transform: scale(1.08);
  z-index: 0;
}

.select-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 42%, color-mix(in srgb, var(--song-accent) 16%, transparent) 0%, transparent 55%),
    linear-gradient(108deg, rgba(6, 9, 17, 0.90) 0%, rgba(10, 15, 26, 0.58) 46%, rgba(7, 11, 20, 0.84) 100%);
  transition: background 0.5s ease;
  z-index: 1;
}

/* Architectural Phigros Geometric Background Slashes & Watermark */
.select-geo-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.geo-slash {
  position: absolute;
  top: -18%;
  bottom: -18%;
  width: 2px;
  transform: rotate(13deg);
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.22) 22%, color-mix(in srgb, var(--song-accent) 72%, #fff) 50%, rgba(255,255,255,0.18) 78%, transparent 100%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--song-accent) 45%, transparent);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

.geo-slash.s1 { left: 40.5%; }
.geo-slash.s2 { left: 41.6%; width: 1px; opacity: 0.48; box-shadow: none; }

.geo-watermark {
  position: absolute;
  right: -24px;
  bottom: -26px;
  font-family: var(--font-display);
  font-size: clamp(90px, 14vw, 190px);
  font-weight: 900;
  letter-spacing: 14px;
  color: rgba(255, 255, 255, 0.028);
  line-height: 0.85;
}

/* Fixed Unclipped Top Navigation Bar */
.select-topbar {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  min-height: 76px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(6, 9, 17, 0.92) 0%, rgba(6, 9, 17, 0.45) 100%);
  backdrop-filter: blur(14px);
}

.select-topbar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34%;
  height: 2px;
  background: linear-gradient(90deg, var(--song-accent), transparent);
  transition: background 0.4s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chapter-tag {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.chapter-tag .ch-label {
  font-size: 9px;
  letter-spacing: 2.6px;
  color: var(--song-accent);
  font-weight: 700;
  transition: color 0.35s ease;
}

.chapter-tag .ch-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Iconic Phigros RKS Player Plate */
.player-rks-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 12px;
  background: rgba(15, 21, 35, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-right: 4px solid var(--song-accent);
  transform: skewX(var(--slant));
  backdrop-filter: blur(12px);
  transition: border-color 0.35s ease;
}

.player-rks-card > * {
  transform: skewX(var(--unslant));
}

.player-avatar {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--song-accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--song-accent) 28%, transparent), rgba(20, 30, 50, 0.7));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.player-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.player-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.player-challenge-pill {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

.rks-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rks-mini-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-sub);
}

.rks-badge {
  background: #ffffff;
  color: #080d18;
  padding: 2px 9px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

/* Main Song Select Two-Column Stage */
.select-main {
  position: relative;
  z-index: 4;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 44%) 1fr;
  gap: 16px;
  padding: 18px 36px 24px 20px;
  overflow: hidden;
  align-items: center;
}

/* Left Diagonal Rail Song List Column — Hugs the Giant 13° Slash! */
.song-list-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 100%;
  min-height: 0;
  overflow: visible;
}

.song-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 42px 12px 92px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-sub);
}

.sl-counter {
  font-family: var(--font-display);
  color: var(--song-accent);
  font-size: 14px;
}

.song-list-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  /* Generous horizontal room so 7-step 13° diagonal rail + active popout NEVER clip */
  padding: 10px 44px 24px 18px;
}

.song-card {
  position: relative;
  width: calc(100% - 118px);
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(12, 18, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 4px solid rgba(255, 255, 255, 0.25);
  border-right: 2px solid rgba(255, 255, 255, 0.18);
  transform: translateX(var(--diag-x, 0px)) skewX(var(--slant));
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

/* Subtle diagonal jacket texture strip inside each song card */
.song-card-bg-thumb {
  position: absolute;
  top: 0;
  right: 0;
  width: 48%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  mask-image: linear-gradient(90deg, transparent 0%, black 75%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 75%);
  transform: skewX(var(--unslant)) scale(1.12);
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.song-card:hover .song-card-bg-thumb {
  opacity: 0.32;
}

.song-card.selected .song-card-bg-thumb {
  opacity: 0.16;
}

.song-card > *:not(.song-card-bg-thumb) {
  position: relative;
  z-index: 2;
  transform: skewX(var(--unslant));
}

.song-card-idx {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  opacity: 0.45;
  margin-right: 12px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.song-card.selected .song-card-idx {
  color: var(--song-accent);
  opacity: 1;
}

.song-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateX(calc(var(--diag-x, 0px) + 8px)) skewX(var(--slant));
}

.song-card.selected {
  background: linear-gradient(98deg, rgba(255, 255, 255, 0.98) 0%, rgba(235, 246, 255, 0.94) 100%);
  color: #090e1a;
  border-color: #ffffff;
  border-left: 6px solid var(--song-accent);
  border-right: 4px solid var(--song-accent);
  transform: translateX(calc(var(--diag-x, 0px) + 16px)) skewX(var(--slant));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 28px color-mix(in srgb, var(--song-accent) 48%, transparent);
}

.song-card-left-group {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.song-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-right: 12px;
}

.song-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card-sub {
  font-size: 11px;
  opacity: 0.72;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.song-card-dots {
  display: inline-flex;
  gap: 3px;
}

.song-card-dots i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
}

.song-card-dots i.d-EZ { background: var(--ez-color); }
.song-card-dots i.d-HD { background: var(--hd-color); }
.song-card-dots i.d-IN { background: var(--in-color); }
.song-card-dots i.d-AT { background: #94a3b8; border: 1px solid #fff; }

.song-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.song-card-score {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.song-card-grade {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  width: 28px;
  text-align: center;
  line-height: 1;
}

.grade-phi { color: #f5b800; text-shadow: 0 0 12px rgba(255, 215, 0, 0.7); }
.grade-blue-v { color: #00c8ff; text-shadow: 0 0 12px rgba(0, 200, 255, 0.7); }
.grade-v { color: #ffffff; }
.song-card.selected .grade-v { color: #1e293b; }

/* Right Showcase Stage */
.song-showcase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  gap: 14px;
  min-height: 0;
}

.jacket-stage-wrap {
  position: relative;
  width: min(100%, 660px);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1100px;
}

/* Signature Phigros Offset Wireframe Back-Plate */
.jacket-back-plate {
  position: absolute;
  width: 92%;
  height: 92%;
  transform: skewX(-7deg) translate(14px, 12px);
  border: 1px solid color-mix(in srgb, var(--song-accent) 55%, rgba(255,255,255,0.25));
  background: linear-gradient(135deg, color-mix(in srgb, var(--song-accent) 12%, transparent), transparent);
  pointer-events: none;
  transition: border-color 0.4s ease;
}

.jacket-frame {
  position: relative;
  width: 92%;
  height: 92%;
  transform: skewX(-7deg);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.70), 0 0 42px color-mix(in srgb, var(--song-accent) 26%, transparent);
  transition: transform 0.22s ease-out, box-shadow 0.35s ease;
  will-change: transform;
}

.jacket-frame img {
  width: 118%;
  height: 100%;
  margin-left: -9%;
  object-fit: cover;
  transform: skewX(7deg);
  display: block;
}

.jacket-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.16) 50%, transparent 65%);
  background-size: 260% 100%;
  background-position: 120% 0;
  pointer-events: none;
  transition: background-position 0.7s ease;
}

.jacket-frame:hover .jacket-sheen {
  background-position: -40% 0;
}

/* Luminous L-Shaped HUD Reticle Corners */
.jacket-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--song-accent);
  border-style: solid;
  pointer-events: none;
  z-index: 4;
  transition: border-color 0.35s ease;
}
.jacket-corner.tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.jacket-corner.tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.jacket-corner.bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.jacket-corner.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.jacket-caption-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 46px 26px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 16, 0.72) 45%, rgba(4, 7, 15, 0.96) 100%);
  transform: skewX(7deg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.jacket-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.jacket-chapter-tag {
  display: inline-block;
  padding: 2px 9px;
  background: rgba(6, 10, 20, 0.72);
  border-left: 2px solid var(--song-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: var(--song-accent);
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.jacket-song-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 800;
  letter-spacing: 0.8px;
  text-shadow: 0 4px 16px rgba(0,0,0,0.85);
}

.jacket-song-composer {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.85);
  letter-spacing: 1px;
}

.jacket-bpm-pill {
  padding: 5px 13px;
  background: rgba(10, 15, 28, 0.72);
  border: 1px solid color-mix(in srgb, var(--song-accent) 65%, rgba(255,255,255,0.4));
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

/* Real-Time Ambient Visualizer Strip */
.select-visualizer-bar {
  width: min(100%, 660px);
  height: 22px;
  opacity: 0.72;
}

#select-vis-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Song Metadata + Difficulty + Play Controls Deck */
.song-control-deck {
  width: min(100%, 690px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credits-row {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  color: var(--text-sub);
  letter-spacing: 1.2px;
}

.credits-row strong {
  color: #e2e8f0;
  font-weight: 700;
}

.diff-and-play-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}

.diff-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
}

.diff-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 8px;
  background: rgba(15, 21, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transform: skewX(var(--slant));
  cursor: pointer;
  transition: all 0.2s ease;
}

.diff-pill > * {
  transform: skewX(var(--unslant));
}

.diff-pill .diff-code {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  opacity: 0.85;
}

.diff-pill .diff-lv {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 900;
  line-height: 1.05;
}

.diff-pill.EZ.active { background: var(--ez-color); color: #051608; border-color: #a8f59d; box-shadow: 0 0 24px rgba(101, 214, 84, 0.5); }
.diff-pill.HD.active { background: var(--hd-color); color: #051226; border-color: #9dd6ff; box-shadow: 0 0 24px rgba(54, 169, 255, 0.5); }
.diff-pill.IN.active { background: var(--in-color); color: #ffffff; border-color: #ff99ac; box-shadow: 0 0 24px rgba(255, 56, 92, 0.55); }
.diff-pill.AT.active { background: var(--at-bg); color: #ffffff; border: 2px solid #ffffff; box-shadow: 0 0 26px rgba(255, 255, 255, 0.45); }

.diff-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}

.play-launch-btn {
  min-width: 190px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 4px;
}

/* Modifiers Bar */
.mods-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(11, 16, 28, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-left: 3px solid var(--song-accent);
  backdrop-filter: blur(10px);
  transition: border-color 0.35s ease;
}

.mods-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mod-toggle {
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.16s ease;
}

.mod-toggle:hover {
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}

.mod-toggle.on {
  background: color-mix(in srgb, var(--song-accent) 20%, transparent);
  border-color: var(--song-accent);
  color: #ffffff;
  box-shadow: 0 0 12px color-mix(in srgb, var(--song-accent) 30%, transparent);
}

.mod-toggle.gold-on.on {
  background: rgba(255, 229, 127, 0.22);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 229, 127, 0.3);
}

.best-record-inline {
  font-size: 12px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

.best-record-inline strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 14px;
}

/* ==========================================================================
   SCREEN 3: IN-GAME PLAY STAGE & AUTHENTIC PHIGROS HUD
   ========================================================================== */
#screen-play {
  background: #05070e;
  touch-action: none;
}

#play-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 2;
}

.hud-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 15;
  pointer-events: none;
}

.hud-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffffff 0%, var(--song-accent) 100%);
  box-shadow: 0 0 12px var(--song-accent);
}

.hud-overlay {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  padding: 18px 28px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}

.hud-pause-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-pause-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
}

.hud-pause-btn span {
  width: 3px;
  height: 15px;
  background: #fff;
  display: block;
}

.hud-combo-wrap {
  text-align: center;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.hud-combo-wrap.visible {
  opacity: 1;
  transform: scale(1);
}

.hud-combo-num {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
  font-variant-numeric: tabular-nums;
  transition: transform 0.08s ease-out;
}

.hud-combo-num.pop {
  transform: scale(1.12);
}

.hud-combo-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

.hud-combo-label.autoplay-tag {
  color: var(--gold);
}

.hud-score-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-score-num {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.78);
}

.hud-sub-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}

.hud-acc-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(226, 232, 240, 0.78);
  font-variant-numeric: tabular-nums;
}

.hud-fps-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(56, 228, 255, 0.65);
  font-variant-numeric: tabular-nums;
}

.hud-challenge-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  background: rgba(255, 56, 92, 0.25);
  border: 1px solid var(--crimson);
  color: #ff99ac;
}

.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.hud-song-name {
  border-left: 3px solid var(--song-accent);
  padding-left: 10px;
}

.hud-diff-label {
  font-family: var(--font-display);
  letter-spacing: 2px;
}

/* Pre-Play Phigros Intro Card Overlay */
.play-intro-card {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  background: rgba(5, 8, 16, 0.78);
  pointer-events: none;
  transition: opacity 0.42s ease, transform 0.42s ease, visibility 0s linear 0.42s;
}

.play-intro-card.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
}

.intro-jacket-box {
  width: min(38vw, 390px);
  aspect-ratio: 16 / 9;
  transform: skewX(-9deg);
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.75), 0 0 32px color-mix(in srgb, var(--song-accent) 30%, transparent);
}

.intro-jacket-box img {
  width: 118%;
  height: 100%;
  margin-left: -9%;
  object-fit: cover;
  transform: skewX(9deg);
}

.intro-info-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 440px;
}

.intro-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--song-accent);
}

.intro-info-col .intro-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  border-bottom: 2px solid #fff;
  padding-bottom: 8px;
}

.intro-info-col .intro-meta {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.88);
  letter-spacing: 1px;
}

.intro-info-col .intro-tip {
  margin-top: 8px;
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 1.2px;
}

/* ==========================================================================
   SCREEN 4: ICONIC PHIGROS SETTLEMENT / RESULT SCREEN
   ========================================================================== */
#screen-result {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: hidden;
}

.result-bg-blur {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.36) saturate(1.2);
  transform: scale(1.08);
  z-index: 0;
}

.result-container {
  position: relative;
  z-index: 4;
  width: min(1140px, 96vw);
  display: grid;
  grid-template-columns: 1.05fr 1.25fr;
  gap: 28px;
  align-items: center;
}

.result-left-card {
  position: relative;
  transform: skewX(-7deg);
  border: 2px solid rgba(255, 255, 255, 0.85);
  overflow: hidden;
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.72), 0 0 38px color-mix(in srgb, var(--song-accent) 26%, transparent);
  aspect-ratio: 16 / 10;
}

.result-left-card img {
  width: 118%;
  height: 100%;
  margin-left: -9%;
  object-fit: cover;
  transform: skewX(7deg);
}

.result-left-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 24px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 7, 15, 0.94) 100%);
  transform: skewX(7deg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.result-song-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.result-diff-tag {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.45);
}

.result-right-panel {
  background: rgba(10, 14, 24, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 3px solid var(--song-accent);
  padding: 26px 30px;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.result-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 16px;
}

.result-score-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-new-best {
  display: inline-block;
  padding: 2px 10px;
  background: var(--gold);
  color: #0b0f19;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
}

.result-rks-chip {
  padding: 2px 9px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.result-big-score {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.8vw, 56px);
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.result-score-delta {
  font-size: 13px;
  color: var(--song-accent);
  font-weight: 700;
  letter-spacing: 1px;
}

.result-grade-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
}

.result-grade-flare {
  position: absolute;
  width: 108px;
  height: 108px;
  border: 1px solid color-mix(in srgb, var(--song-accent) 45%, rgba(255,255,255,0.2));
  transform: rotate(45deg);
  opacity: 0.5;
  animation: orbitSpin 22s linear infinite;
}

.result-grade-emblem {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 86px;
  font-weight: 900;
  line-height: 0.85;
  padding: 0 10px;
  animation: gradePop 0.55s cubic-bezier(0.22, 1.4, 0.36, 1);
}

@keyframes gradePop {
  0% { opacity: 0; transform: scale(1.7); }
  100% { opacity: 1; transform: scale(1); }
}

.result-grade-emblem.phi {
  background: linear-gradient(180deg, #fffbe0 0%, #ffe57f 48%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.72));
}

.result-grade-emblem.blue-v {
  background: linear-gradient(180deg, #ffffff 0%, #52e5ff 55%, #008cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(56, 228, 255, 0.72));
}

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

.stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-box.perf { border-top-color: var(--gold); }
.stat-box.good { border-top-color: var(--cyan); }
.stat-box.bad { border-top-color: var(--crimson); }

.stat-box .s-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-sub);
  font-weight: 700;
}

.stat-box .s-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-box.perf .s-val { color: var(--gold); }
.stat-box.good .s-val { color: var(--cyan); }
.stat-box.bad .s-val { color: #ff6b81; }
.stat-box.miss .s-val { color: #94a3b8; }

.result-sub-metrics {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.result-sub-metrics strong {
  color: #fff;
  font-family: var(--font-display);
}

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

.histogram-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-sub);
}

#result-histogram {
  width: 100%;
  height: 74px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 4px;
}

/* ==========================================================================
   MODALS & SLEEK CUSTOM TOGGLE SWITCHES
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 7, 14, 0.78);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: min(680px, 95vw);
  max-height: 88vh;
  background: rgba(11, 16, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top: 3px solid var(--song-accent);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.modal-close-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: #fff;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-title {
  font-size: 14px;
  font-weight: 700;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-sub);
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-control input[type="range"] {
  width: 150px;
  accent-color: var(--song-accent);
}

.setting-val {
  min-width: 58px;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--song-accent);
  font-variant-numeric: tabular-nums;
}

/* Custom Sleek Phigros Toggle Switches */
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.phi-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.phi-switch:hover {
  border-color: rgba(255, 255, 255, 0.32);
}

.phi-switch input {
  display: none;
}

.phi-switch .sw-track {
  position: relative;
  width: 34px;
  height: 18px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  transform: skewX(-12deg);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.phi-switch .sw-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #cbd5e1;
  transition: transform 0.2s ease, background 0.2s ease;
}

.phi-switch input:checked + .sw-track {
  background: color-mix(in srgb, var(--song-accent) 32%, transparent);
  border-color: var(--song-accent);
}

.phi-switch input:checked + .sw-track::after {
  transform: translateX(16px);
  background: #ffffff;
  box-shadow: 0 0 8px var(--song-accent);
}

.phi-switch .sw-label {
  font-size: 13px;
  font-weight: 700;
}

/* Calibration Box */
.calib-panel {
  padding: 14px 16px;
  background: rgba(56, 228, 255, 0.08);
  border: 1px solid rgba(56, 228, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calib-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.calib-dot {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  transform: rotate(45deg);
  transition: all 0.12s ease;
}

.calib-dot.filled {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

/* Custom Dropzone */
.dropzone {
  border: 2px dashed rgba(56, 228, 255, 0.48);
  background: rgba(56, 228, 255, 0.06);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  background: rgba(56, 228, 255, 0.16);
  border-color: #ffffff;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.phi-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
}

.phi-input:focus {
  outline: none;
  border-color: var(--song-accent);
}

/* Lore / Collection Cards */
.lore-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--song-accent);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lore-card.locked {
  opacity: 0.52;
  border-left-color: #475569;
}

.lore-code {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--song-accent);
}

.lore-title {
  font-size: 16px;
  font-weight: 800;
}

.lore-text {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

/* Challenge Course Slots */
.challenge-slot {
  display: grid;
  grid-template-columns: 76px 1fr 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.challenge-slot select {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 7px 10px;
  color: #fff;
  font-size: 13px;
}

/* Pause Overlay */
.pause-box {
  width: min(440px, 90vw);
  text-align: center;
  padding: 32px 28px;
  gap: 16px;
}

.pause-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 6px;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* Toast Notification */
.phi-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 90;
  padding: 10px 24px;
  background: rgba(12, 18, 32, 0.95);
  border: 1px solid var(--gold);
  border-left: 5px solid var(--gold);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.phi-toast.show {
  transform: translate(-50%, 0);
}

/* Loading Overlay */
.loading-bar-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 8, 16, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-diamond {
  width: 44px;
  height: 44px;
  border: 2px solid var(--song-accent);
  animation: spinDiamond 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 24px color-mix(in srgb, var(--song-accent) 55%, transparent);
}

@keyframes spinDiamond {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.18); }
  100% { transform: rotate(360deg) scale(1); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 4px;
  color: #e2e8f0;
}

/* Responsive Adjustments */
@media (max-width: 1120px) {
  .topbar-nav-group .btn-label-hide {
    display: none;
  }
  .chapter-tag .ch-name {
    font-size: 16px;
  }
}

@media (max-width: 960px) {
  .select-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 14px 16px;
  }
  .song-list-panel {
    max-height: 230px;
  }
  .song-card {
    width: 100%;
    --diag-x: 0px !important;
  }
  .song-list-header {
    padding: 0 24px 8px 24px;
  }
  .geo-slash { display: none; }
  .result-container {
    grid-template-columns: 1fr;
  }
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}
