:root {
  /* --hit-blue: var(--ring-blue);
  --hit-red: var(--ring-red);
  --hit-yellow: var(--ring-yellow);
  --hit-orange: var(--ring-orange); */

   --hit-blue: #1821c6;
   --hit-purple: #6a00ff;
   --hit-red: #c21010;
   --hit-orangered: #ff3b00;
   --hit-orange: #ff6600;
   --hit-yellow: #ffb700;


  /* --neon-purple: #A259FF;
  --neon-cyan: #00F5FF;
  --neon-green: #39FF14;
  --neon-pink: #FF2DF7; */

  --neon-blue: #1720cd;
  --neon-red: #ff3939;
  --neon-orange: #FF7A00;
  --neon-yellow: #FFE000;

  --ui-text: rgba(255,255,255,0.92);

  --ring-blue: #2F3BFF;
  --ring-blue-dark: #0B1A6B;
  --ring-purple: #6A00FF;
  --ring-red: #FF1A1A;
  --ring-orange: #FF7A00;
  --ring-yellow: #FFE000;
  
  --ringGlowOuterInset: -8%;
  --ringGlowOuterBlur: 18px;
  --ringGlowOuterOpacity: 0.60;
  --ringGlowInnerInset: 5.5%;
  --ringGlowInnerBlur: 14px;
  --ringGlowInnerOpacity: 0.34;
  --ringGradient: conic-gradient(from 0deg,
    var(--ring-blue) 0%,
    var(--ring-blue) 28%,
    #5a2cff 36%,
    #8a1cff 42%,
    var(--ring-red) 54%,
    var(--ring-red) 66%,
    #ff3b00 74%,
    var(--ring-orange) 86%,
    var(--ring-orange) 98%,
    var(--ring-blue) 100%
  );
}

#lp141-game-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  /* min-height: 480px; */
  height: 100vh;
  background:
    radial-gradient(900px 600px at 18% 22%, rgba(47, 59, 255, 0.22), transparent 62%),
    radial-gradient(900px 700px at 82% 30%, rgba(255, 26, 26, 0.18), transparent 64%),
    radial-gradient(1000px 800px at 50% 92%, rgba(255, 122, 0, 0.16), transparent 66%),
    #000;
  font-family: sans-serif;
  color: var(--ui-text);
  user-select: none;
}
#lp141-game-wrapper button,
#lp141-game-wrapper a {
  border-radius: 2rem;
}

#lp141-game-wrapper .panel {
  border-radius: 2.75rem;
}

#lp141-game-wrapper.disco {
  animation: discoBg 0.55s linear infinite;
}

@keyframes discoBg {
  0% {
    background:
      radial-gradient(900px 600px at 20% 20%, rgba(255,224,0,0.55), transparent 60%),
      radial-gradient(800px 600px at 80% 30%, rgba(255,122,0,0.50), transparent 62%),
      radial-gradient(900px 700px at 50% 90%, rgba(255,26,26,0.45), transparent 62%),
      #000;
  }
  50% {
    background:
      radial-gradient(900px 600px at 70% 25%, rgba(255,214,10,0.50), transparent 60%),
      radial-gradient(800px 600px at 25% 70%, rgba(46,154,254,0.55), transparent 62%),
      radial-gradient(900px 700px at 55% 90%, rgba(255,59,48,0.45), transparent 62%),
      #000;
  }
  100% {
    background:
      radial-gradient(900px 600px at 20% 20%, rgba(255,224,0,0.55), transparent 60%),
      radial-gradient(800px 600px at 80% 30%, rgba(255,122,0,0.50), transparent 62%),
      radial-gradient(900px 700px at 50% 90%, rgba(255,26,26,0.45), transparent 62%),
      #000;
  }
}

#lp141-game-wrapper * {
  box-sizing: border-box;
}

#lp141-game-wrapper.css-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  aspect-ratio: unset !important;
  min-height: unset !important;
  z-index: 2147483647 !important; /* Maximaler z-index */
  background: #000 !important;
}

body.game-css-fullscreen-active {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* Alle anderen Elemente während CSS-Fullscreen unter das Spiel */
body.game-css-fullscreen-active *:not(#lp141-game-wrapper):not(#lp141-game-wrapper *) {
  z-index: auto !important;
}

#progressRing,
#progressLabel,
#score,
#combo,
#bestCombo,
#pauseBtn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#lp141-game-wrapper.game-active #progressRing,
#lp141-game-wrapper.game-active #progressLabel,
#lp141-game-wrapper.game-active #score,
#lp141-game-wrapper.game-active #combo,
#lp141-game-wrapper.game-active #bestCombo,
#lp141-game-wrapper.game-active #pauseBtn {
  opacity: 1;
  pointer-events: auto;
}

* {
  -webkit-tap-highlight-color: transparent;
}

#lp141-game-wrapper.infinite-mode #progressRing {
  opacity: 0;
  pointer-events: none;
}


#progressRing {
  position: absolute;
  left: 50%;
  top: 56%;
  transition: opacity 0.8s ease;
  transform: translate(-50%, -50%);
  width: min(72vmin, 560px);
  height: min(72vmin, 560px);
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 18px rgba(255,122,0,0.16)) drop-shadow(0 0 22px rgba(255,224,0,0.12));
  opacity: 0.95;
}

#progressRing .base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.07);
}

#progressRing .fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ringGradient);
  -webkit-mask-image: conic-gradient(#000 0 var(--p, 0deg), transparent var(--p, 0deg) 360deg);
  mask-image: conic-gradient(#000 0 var(--p, 0deg), transparent var(--p, 0deg) 360deg);
  isolation: isolate;
  filter:
    drop-shadow(0 0 12px rgba(255,255,255,0.12))
    drop-shadow(0 0 20px rgba(255,224,0,0.14))
    drop-shadow(0 0 24px rgba(255,26,26,0.14));
  animation: ringPulse 2.2s ease-in-out infinite;
}

#progressRing .fill::before {
  content: "";
  position: absolute;
  inset: var(--ringGlowInnerInset);
  border-radius: 50%;
  background: var(--ringGradient);
  -webkit-mask-image: conic-gradient(#000 0 var(--p, 0deg), transparent var(--p, 0deg) 360deg);
  mask-image: conic-gradient(#000 0 var(--p, 0deg), transparent var(--p, 0deg) 360deg);
  filter: blur(var(--ringGlowInnerBlur));
  opacity: var(--ringGlowInnerOpacity);
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

#progressRing .fill::after {
  content: "";
  position: absolute;
  inset: var(--ringGlowOuterInset);
  border-radius: 50%;
  background: var(--ringGradient);
  -webkit-mask-image: conic-gradient(#000 0 var(--p, 0deg), transparent var(--p, 0deg) 360deg);
  mask-image: conic-gradient(#000 0 var(--p, 0deg), transparent var(--p, 0deg) 360deg);
  filter: blur(var(--ringGlowOuterBlur));
  opacity: var(--ringGlowOuterOpacity);
  pointer-events: none;
  z-index: -1;
  transform: translateZ(0);
}

@keyframes ringPulse {
  0% {
    transform: scale(1);
    filter:
      brightness(0.98) saturate(1.06)
      drop-shadow(0 0 12px rgba(255,255,255,0.10))
      drop-shadow(0 0 18px rgba(255,224,0,0.12))
      drop-shadow(0 0 22px rgba(255,122,0,0.12));
    opacity: 0.95;
  }
  50% {
    transform: scale(1.003);
    filter:
      brightness(1.08) saturate(1.22)
      drop-shadow(0 0 16px rgba(255,255,255,0.14))
      drop-shadow(0 0 26px rgba(255,224,0,0.18))
      drop-shadow(0 0 30px rgba(255,122,0,0.17));
    opacity: 1;
  }
  100% {
    transform: scale(1);
    filter:
      brightness(0.98) saturate(1.06)
      drop-shadow(0 0 12px rgba(255,255,255,0.10))
      drop-shadow(0 0 18px rgba(255,224,0,0.12))
      drop-shadow(0 0 22px rgba(255,122,0,0.12));
    opacity: 0.95;
  }
}

@keyframes ringPulseMobile {
  0% {
    transform: scale(1);
    filter:
      brightness(0.99) saturate(1.04)
      drop-shadow(0 0 10px rgba(255,255,255,0.09))
      drop-shadow(0 0 14px rgba(255,224,0,0.10))
      drop-shadow(0 0 16px rgba(255,122,0,0.10));
    opacity: 0.94;
  }
  50% {
    transform: scale(1.002);
    filter:
      brightness(1.05) saturate(1.14)
      drop-shadow(0 0 12px rgba(255,255,255,0.12))
      drop-shadow(0 0 18px rgba(255,224,0,0.14))
      drop-shadow(0 0 20px rgba(255,122,0,0.13));
    opacity: 0.99;
  }
  100% {
    transform: scale(1);
    filter:
      brightness(0.99) saturate(1.04)
      drop-shadow(0 0 10px rgba(255,255,255,0.09))
      drop-shadow(0 0 14px rgba(255,224,0,0.10))
      drop-shadow(0 0 16px rgba(255,122,0,0.10));
    opacity: 0.94;
  }
}

@media (prefers-reduced-motion: reduce) {
  #progressRing .fill {
    animation: none;
  }
}

#progressRing .ringCutout {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: rgb(0, 0, 0);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.06);
}

#progressLabel {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  z-index: 1;
  text-align: center;
}

#progressLabel .pl-label {
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.55);
  text-shadow: 0 0 10px rgba(255,122,0,0.15);
  line-height: 1;
}

#progressLabel .pl-score {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 14px rgba(255,122,0,0.25);
  line-height: 1.1;
}

#progressLabel .pl-target {
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.45);
  line-height: 1;
}

#bestOverlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  pointer-events: auto;
  text-align: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}

#bestOverlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.25), rgba(0,0,0,0.1) 55%, rgba(0,0,0,0.9));
  animation: strobe 0.12s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.9;
}

@keyframes strobe {
  0% { opacity: 0.15; }
  25% { opacity: 0.95; }
  50% { opacity: 0.25; }
  75% { opacity: 1; }
  100% { opacity: 0.15; }
}

#bestOverlay .content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 14px;
}

#bestOverlay .text {
  font-size: clamp(40px, 7vw, 92px);
  color: rgba(255,255,255,0.96);
  text-shadow:
    0 0 18px rgba(255,122,0,0.65),
    0 0 18px rgba(255,224,0,0.55),
    0 0 24px rgba(255,26,26,0.45);
  letter-spacing: 1px;
  padding: 0 18px;
  animation: bestPulse 0.35s ease-in-out infinite alternate;
}

@keyframes bestPulse {
  0% { transform: scale(1); filter: saturate(1); }
  100% { transform: scale(1.04); filter: saturate(1.7); }
}

#bestOverlay .sub {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 10px rgba(255,122,0,0.25);
  max-width: 720px;
  padding: 0 18px;
}

#bestOverlay .closeBtn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.65);
  color: rgba(255,255,255,0.95);
  padding: 10px 14px;
  font-size: 16px;
  cursor: pointer;
  box-shadow:
    0 0 16px rgba(255,224,0,0.35),
    0 0 18px rgba(255,122,0,0.28),
    0 0 18px rgba(255,26,26,0.22);
  touch-action: manipulation;
}

h1 {
  text-align: center;
  font-size: 48px;
  margin: 20px 0 10px;
  color: var(--ui-text);
  text-shadow:
    0 0 12px rgba(255,224,0,0.55),
    0 0 16px rgba(255,122,0,0.45);
}

#score, #combo, #bestCombo {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 20px;
  text-shadow:
    0 0 10px rgba(255,224,0,0.45),
    0 0 10px rgba(255,122,0,0.35);
}
#combo { top: 50px; }
#bestCombo { top: 80px; font-size: 16px; }

h1,
#score,
#combo,
#bestCombo {
  display: none;
}

#pauseBtn {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: rgba(255, 255, 255, 0);
  width: 50px;
  height: 50px;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-text);
  font-size: 45px;
  letter-spacing: 2px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.25s;
  z-index: 1500;
}

.startBtn {
  cursor: pointer;
  touch-action: manipulation;
}

@keyframes scroll-bg-horizontal {
  from {
    background-position: 0% 0%;
  }
  to {
    background-position: -200% 0%; /* Schiebt den Verlauf nach rechts durch */
  }
}


#pauseBtn:hover {
  border-color: rgba(255,255,255,0.75);
  text-shadow: 0 0 32px var(--neon-orange);
}

#pauseBtn:active {
  transform: translateY(1px);
}

#volumeControl {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 150px;
  background: transparent;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ring-blue), var(--ring-red), var(--ring-orange));
  box-shadow:
    0 0 14px rgba(255,122,0,0.22),
    0 0 16px rgba(255,26,26,0.16),
    0 0 18px rgba(47,59,255,0.16);
  touch-action: manipulation;
}

#volumeControl::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--ring-blue), var(--ring-red), var(--ring-orange));
  border-radius: 3px;
  box-shadow:
    0 0 14px rgba(255,122,0,0.22),
    0 0 16px rgba(255,26,26,0.16),
    0 0 18px rgba(47,59,255,0.16);
}
#volumeControl::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, var(--ring-blue), var(--ring-red), var(--ring-orange));
  border-radius: 3px;
  box-shadow:
    0 0 14px rgba(255,122,0,0.22),
    0 0 16px rgba(255,26,26,0.16),
    0 0 18px rgba(47,59,255,0.16);
}

#volumeControl::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.96);
  border: 2px solid rgba(255,255,255,0.80);
  box-shadow:
    0 0 10px rgba(47,59,255,0.28),
    0 0 10px rgba(255,26,26,0.28),
    0 0 10px rgba(255,122,0,0.28);
  margin-top: -4px;
}

#volumeControl::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.96);
  border: 2px solid rgba(255,255,255,0.80);
  box-shadow:
    0 0 10px rgba(47,59,255,0.28),
    0 0 10px rgba(255,26,26,0.28),
    0 0 10px rgba(255,122,0,0.28);
}

.hit-object {
  position: absolute;
  width: 110px;
  height: 110px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.hit-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 25px currentColor;
  /* border: 2px solid rgba(255, 255, 255, 0.373); */
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.496), rgba(255,255,255,0.0) 40%), currentColor;
}

@media (max-width: 500px) {
  .hit-core {
    border: 3px solid rgba(255, 255, 255, 0.25);
  }
}

.approach-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%) scale(2.2);
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 18px rgba(255,255,255,0.35);
  pointer-events: none;
  opacity: 0.95;
  will-change: transform, opacity;
}

/* CSS-Animation Methode: Reine CSS @keyframes (GPU-beschleunigt) */
.approach-ring.anim-css {
  animation: approachRingShrink var(--approach-duration, 1050ms) linear forwards;
}

@keyframes approachRingShrink {
  0%   { transform: translate(-50%, -50%) scale(2.4); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 0.35; }
}

/* CSS Custom Property Methode: JS setzt --progress, CSS interpoliert */
.approach-ring.anim-cssvar {
  --progress: 1;
  transform: translate(-50%, -50%) scale(calc(1 + var(--progress) * 1.4));
  opacity: calc(0.35 + var(--progress) * 0.6);
  transition: none;
}

/* Keine Animation: Statischer Ring */
.approach-ring.anim-none {
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.6;
}

.hit-object.hovered .hit-core {
  outline: 4px solid rgba(255,255,255,0.9);
  outline-offset: 2px;
}

.judgement {
  position: absolute;
  left: 50%;
  top: calc(50% - 80px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-shadow: 0 0 15px currentColor;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  animation: judgementPop 0.55s ease-out forwards;
  white-space: nowrap;
}

.judgement .j-label {
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: 600;
  opacity: 0.9;
}

.judgement .j-points {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}

.milestone-pop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: 0 0 24px var(--neon-blue), 0 0 48px var(--neon-blue);
  pointer-events: none;
  z-index: 3500;
  white-space: nowrap;
  animation: milestonePop 1.8s ease-out forwards;
}

@keyframes milestonePop {
  0%   { transform: translate(-50%, -50%) scale(0.8);  opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  60%  { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(1);    opacity: 0; }
}

@keyframes judgementPop {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(1.05); opacity: 0; }
}

/* ── einheitliches Game Modal (Pause / GameOver / Milestone) ── */
#gameModal {
  position: absolute;
  inset: 0;
  background: hsl(0, 0%, 1%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 20px;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
}

#gameModal .panel {
  width: min(480px, 100%);
  background: black;
  box-shadow: 0 0 100px rgba(143, 85, 193, 0.738);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-eyebrow {
  margin: 0;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a07cff;
  text-shadow: 0 0 10px var(--neon-blue);
  text-align: center;
}

#gameModalTitle {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  color: var(--ui-text);
  text-align: center;
  letter-spacing: 1px;
  animation: titlePulse 4s ease-in-out infinite;
  line-height: 1.1;
}


.modal-subtitle {
  margin: 0;
  font-size: 15px;
  color: hsla(0, 0%, 100%, 0.54);
  line-height: 1.4;
  text-align: center;
}

.modal-stats {
  display: flex;
  gap: 24px;
  margin: 4px 0;
  text-align: center;
  justify-content: center;
}

.modal-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-stats .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.45);
}

.modal-stats .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ui-text);
  text-shadow: 0 0 12px rgba(255,122,0,0.3);
}

.modal-form {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-form .form-intro {
  margin: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

.modal-form label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.modal-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,224,0,0.6);
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.95);
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  touch-action: manipulation;
}

.modal-form input[type="email"]:focus {
  border-color: rgba(255,224,0,0.95);
  box-shadow: 0 0 10px rgba(255,224,0,0.25);
}

.modal-form button[type="submit"] {
  align-self: flex-end;
  background: transparent;
  border: 1px solid rgba(255,224,0,0.75);
  padding: 8px 16px;
  color: var(--ui-text);
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: box-shadow 0.15s;
}

.modal-form button[type="submit"]:hover {
  box-shadow: 0 0 14px rgba(255,224,0,0.4);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  width: 100%;
}

.modal-actions .modal-btn {
  flex: 1;
}

.modal-actions .modal-btn.primary {
  background: linear-gradient(110deg, var(--neon-blue), var(--neon-red), var(--neon-orange), var(--neon-yellow), var(--neon-orange), var(--neon-red), var(--neon-blue), var(--neon-blue));
  background-size: 200% 100%;
  animation: scroll-bg-horizontal 12s linear infinite;
  color: white;
  font-weight: bold;
  border: none;
}

.modal-btn {
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  touch-action: manipulation;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  transform: scale(1);
  transition: transform ease-in-out 0.5s;
}

.modal-btn.primary {
  padding: 15px 0;
  font-weight: bold;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.65);
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.modal-btn.primary:hover {
  border-color: white;
  color: white;
}

.modal-actions .modal-btn.primary:hover {
  transform: scale(1.05);
}

.modal-actions .modal-btn.primary:active {
  transform: translateY(1px);
}

.modal-btn.primary:active {
  transform: translateY(1px);
}

.modal-btn.secondary {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.25);
}

.modal-btn.secondary:hover {
  color: white;
  border-color: white;
  box-shadow: 0 0 12px white;
}

.start-modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.start-modal-footer .startBtn {
  flex: 1;
}

.mute-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mute-btn:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
}

.mute-btn.active {
  border-color: white;
  color: white;
  box-shadow: 0 0 12px rgba(255,26,26,0.28);
}

.modal-volume {
  /* display: flex;
  justify-content: flex-end; */
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.hit-effect {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow:
    0 0 16px currentColor,
    0 0 22px rgba(255,255,255,0.12);
  pointer-events: none;
  animation: pop 0.4s ease-out forwards;
  z-index: 999;
}

@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

#countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 72px;
  text-shadow: 0 0 15px var(--neon-yellow);
  display: none;
  z-index: 99;
}

#startModal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  background:
    radial-gradient(900px 600px at 18% 22%, rgba(47, 59, 255, 0.15), transparent 62%),
    radial-gradient(900px 700px at 82% 30%, rgba(255, 0, 25, 0.15), transparent 64%),
    radial-gradient(1000px 800px at 50% 92%, rgba(251, 0, 255, 0.15), transparent 66%),
    #000;
  backdrop-filter: blur(4px);
  padding: 20px;
}

.hidden {
  display: none !important;
}

#startModal .panel {
  width: min(540px, 100%);
  background: black;
  box-shadow: 0 0 100px rgba(90, 85, 193, 0.738);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#startModal h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  text-align: center;
  color: var(--ui-text);
  letter-spacing: 1px;
  animation: titlePulse 4s ease-in-out infinite;
}



#startModal .intro-text{
  text-align: center;
  margin: 0;
  color: hsla(0, 0%, 100%, 0.54);
  font-weight: bolder;
  letter-spacing: 0.1px;
}

.panel hr {
  border: 1px solid rgba(255, 255, 255, 0.10);
  margin: 0 0 0.75rem 0;
  width: 100%;
}

#startModal .explanation {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#startModal .explanation .instructionsImg {
  max-height: 90px;
  width: auto;
}

#startModal .explanation p {
  margin: 0 0 10px;
  color: hsla(0, 0%, 100%, 0.6);
  line-height: 1.4;
}

#startModal .explanation ul {
  margin: 0 0 10px;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#startModal .explanation li {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#startModal .tag {
  font-size: 12px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  border: 1px solid rgba(255,122,0,0.45);
  color: #FF7A00;
  background: rgba(255,122,0,0.18);
}

#startModal .tag.perfect {
  background: rgba(255,122,0,0.18);
  color: #FF7A00;
  border: 1px solid rgba(255,122,0,0.45);
}

#startModal .tag.good {
  background: rgba(255,214,10,0.15);
  color: #FFD60A;
  border: 1px solid rgba(255,214,10,0.40);
}

#startModal .tag.ok {
  background: rgba(255,26,26,0.15);
  color: var(--neon-red);
  border: 1px solid rgba(255,26,26,0.40);
}

#gameModalMilestoneBlock p,
#gameModalGameOverBlock p,
#startModal .hint {
  font-size: 13px;
  color: rgba(255,255,255,0.50);
  margin: 0 !important;
  text-align: center;
}

#gameModalMilestoneBlock p,
#gameModalGameOverBlock p {
  text-align: left;
}

#startModal kbd {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: monospace;
}

.instructionsImg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  object-fit: cover;
}

#startModal .highscore {
  position: relative;
  /* border-top: 1px solid rgba(255,255,255,0.10); */
  padding-top: 0.5rem;
}

#startModal .highscore h3,
#startModal .difficulty h3,
#startModal .volume-slider-section h3,
#gameModal .volume-slider-section h3,
#gameModalMilestoneBlock h3,
#gameModalGameOverBlock h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: sans-serif;
  /* color: rgba(255,255,255,0.45); */
}

#startModal .scoreTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#startModal .scoreTable thead th {
  text-align: left;
  color: rgba(255,255,255,0.40);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

#startModal .scoreTable thead th:first-child {
  width: 32px;
  padding-left: 0;
}

#startModal .scoreTable thead th:last-child,
#startModal .scoreTable tbody td:last-child {
  text-align: right;
}

#startModal .scoreTable tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

#startModal .scoreTable tbody tr:last-child {
  border-bottom: none;
}

#startModal .scoreTable tbody td {
  padding: 0px 8px;
  color: rgba(255,255,255,0.80);
}

#startModal .scoreTable tbody td:first-child,
#startModal .scoreTable tbody td:nth-child(2) {
  font-size: 12px;
}

#startModal .scoreTable tbody td:first-child {
  padding-left: 0;
  color: rgba(255,255,255,0.30);
  width: 32px;
}

#startModal .scoreTable tbody tr:first-child td {
  font-weight: bold;
  color: white;
  animation: titlePulse 4s ease-in-out infinite;
}

#startModal .scoreTable tbody tr:first-child td:first-child {
  color: white;
  animation: titlePulse 4s ease-in-out infinite;
}

#startModal .scoreTable tbody tr:nth-child(n+4) {
  display: none;
}

#startModal .highscore.expanded .scoreTable tbody tr:nth-child(n+4) {
  display: table-row;
}

#gameModalMilestoneBlock .col-6,
#gameModalGameOverBlock .col-6 {
  flex-direction: column;
  justify-content: space-between;
  display: flex;
  gap: 15px;
}

.score-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.35);
  padding: 6px 0 0;
  cursor: pointer;
  transition: color 0.15s;
}

.score-toggle:hover {
  color: rgba(255,255,255,0.8);
}

.score-toggle svg {
  transition: transform 0.2s ease;
}

#startModal .highscore.expanded .score-toggle svg {
  transform: rotate(180deg);
}

#startModal .diffBtns {
  display: flex;
  gap: 8px;
}

#startModal .diffBtn {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.65);
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
}

#startModal .diffBtn:hover,
.mute-btn:hover,
#volumeControl::-webkit-slider-thumb:hover,
.volume-range::-webkit-slider-thumb:hover{
  border-color: white;
  color: white;
  box-shadow: 0 0 12px white;
}

#volumeControl::-moz-range-thumb:hover,
.volume-range::-moz-range-thumb:hover {
    border-color: white;
  color: white;
  box-shadow: 0 0 12px white;
}

#startModal .diffBtn.active {
  border-color: white;
  color: white;
  box-shadow: 0 0 12px rgba(255,26,26,0.28);
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.6rem;
}

.settings-row.compact {
  flex-direction: row;
  gap: 20px;
}

.settings-row.compact > .difficulty,
.settings-row.compact > .volume-slider-section {
  flex: 1;
  border-top: none;
  padding-top: 0;
}

.volume-slider-section {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 14px;
}

.volume-slider-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  /* color: rgba(255,255,255,0.45); */
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.5);
}

.volume-row svg {
  flex-shrink: 0;
}

.volume-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  /* background: linear-gradient(90deg, var(--ring-blue), var(--ring-red), var(--ring-orange), var(--ring-yellow)); */
  background-color: rgba(255, 255, 255, 0);
  outline: none;
  cursor: pointer;
  touch-action: manipulation;
}

.volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.96);
  border: 2px solid rgb(255, 255, 255);
  box-shadow:
    0 0 10px rgba(47,59,255,0.28),
    0 0 10px rgba(255,26,26,0.28),
    0 0 10px rgba(255,122,0,0.28);
  cursor: pointer;
  margin-top: -5px;
}

.volume-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.96);
  border: 2px solid rgb(255,255,255);
  box-shadow:
    0 0 10px rgba(47,59,255,0.28),
    0 0 10px rgba(255,26,26,0.28),
    0 0 10px rgba(255,122,0,0.28);
  cursor: pointer;
}

.volume-range::-webkit-slider-runnable-track {
  height: 6px;
  /* background: linear-gradient(90deg, var(--ring-blue), var(--ring-red), var(--ring-orange)); */
  background-color: hsl(0, 0%, 25%);

  border-radius: 3px;
}

.volume-range::-moz-range-track {
  height: 6px;
  /* background: linear-gradient(90deg, var(--ring-blue), var(--ring-red), var(--ring-orange)); */
  background-color: hsl(0, 0%, 25%);
  border-radius: 3px;
}

.volume-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  min-width: 36px;
  text-align: right;
}

/* #startModal .startBtn {

  border: none;
  color: var(--ui-text);
  font-size: 18px;
  text-transform: uppercase;
  padding: 12px;
  cursor: pointer;
  letter-spacing: 0.5px;

  transform: scale(1);
  touch-action: manipulation;
  transition: transform ease-in-out 0.5s;
} */

#gameModalFormBtn,
#startModal .startBtn {
  /* 1. Hintergrund breiter machen (200% Breite) */
  /* Verlauf: Farbe A -> Farbe B -> Farbe A */
  background: linear-gradient(110deg, var(--neon-blue), var(--neon-red), var(--neon-orange), var(--neon-yellow),var(--neon-orange), var(--neon-red), var(--neon-blue), var(--neon-blue));
  background-size: 200% 100%;
  
  /* 2. Animation der Hintergrund-Position */
  animation: scroll-bg-horizontal 12s linear infinite;

  /* Styling */
  border: none;
  padding: 15px 30px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: all ease-in-out 0.5s;
  
  /* iOS Safari touch fix */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  z-index: 10;
}




#gameModalFormBtn:hover,
#startModal .startBtn:hover {
  transform: scale(1.05);
  /* box-shadow:
    0 0 26px rgba(0, 247, 255, 0.827),
    0 0 26px rgba(106, 6, 237, 0.989); */
}

#gameModalFormBtn:active,
#startModal .startBtn:active {
  transform: translateY(1px);
}

@media (max-width: 767px) {
  .settings-row.compact {
    flex-direction: column;
    gap: 0;
    
  }
  .settings-row.compact>div {
    margin-bottom: 0.6rem;
  }

}

@media (max-width: 520px) {
  #startModal .panel {
    padding: 20px 16px 16px;
    gap: 0.75rem;
  }

  /* #startModal .diffBtns {
    flex-direction: column;
  } */
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
}

#debugOverlay {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: rgba(255,26,26,0.9);
  font-family: monospace;
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid rgba(255,26,26,0.35);
  pointer-events: none;
  z-index: 9999;
  display: none;
  white-space: nowrap;
}

@media (max-width: 520px) {
  h1 {
    font-size: 34px;
    margin: 14px 0 8px;
  }
  #score, #combo, #bestCombo {
    left: 12px;
    top: 12px;
    font-size: 16px;
  }
  #combo { top: 34px; }
  #bestCombo { top: 54px; font-size: 14px; }

  .hit-object {
    width: 96px;
    height: 96px;
  }
  .hit-core {
    width: 88px;
    height: 88px;
  }
  .approach-ring {
    width: 88px;
    height: 88px;
  }

  #countdown, #gameover {
    font-size: 56px;
  }

  #progressRing {
    top: 58%;
    width: min(82vmin, 520px);
    height: min(82vmin, 520px);
  }
  #progressLabel {
    font-size: 16px;
    top: 58%;
  }

  #progressRing .fill {
    animation: ringPulseMobile 2.8s ease-in-out infinite;
  }

  :root {
    --ringGlowOuterInset: -6.5%;
    --ringGlowOuterBlur: 14px;
    --ringGlowOuterOpacity: 0.45;
    --ringGlowInnerInset: 6.5%;
    --ringGlowInnerBlur: 11px;
    --ringGlowInnerOpacity: 0.26;
  }

  #bestOverlay .sub {
    font-size: 14px;
  }
}


@keyframes titlePulse {
  0%, 100% {
    text-shadow:
      0 0 8px rgba(255,224,0,0.4),
      0 0 16px rgba(255,122,0,0.3);
  }
  50% {
    text-shadow:
      0 0 18px rgba(255,224,0,0.95),
      0 0 32px rgba(255,122,0,0.8),
      0 0 48px rgba(255,57,57,0.4);
  }
}

/* ── Performance-Diagnose-Modus ── */

.perf-mode {
  background: #000 !important;
}

.perf-mode .hit-object .hit-core,
.perf-mode .hit-object .approach-ring {
  box-shadow: none !important;
}

.perf-mode .hit-object .hit-core::after {
  display: none !important;
}

.perf-mode #progressRing {
  display: none !important;
}

.perf-mode #score,
.perf-mode #combo,
.perf-mode #bestCombo {
  text-shadow: none !important;
}

.perf-mode h1 {
  text-shadow: none !important;
  animation: none !important;
}

.perf-mode .hit-effect {
  display: none !important;
}

.perf-mode .judgement {
  text-shadow: none !important;
}

.perf-mode .milestone-pop {
  display: none !important;
}

.perf-mode #particleCanvas {
  display: none !important;
}

/* ── Einzelne Performance-Toggles ── */

.perf-no-glow .hit-object .hit-core,
.perf-no-glow .hit-object .approach-ring {
  box-shadow: none !important;
}

.perf-no-glow .hit-object .hit-core::after {
  display: none !important;
}

.perf-no-glow #score,
.perf-no-glow #combo,
.perf-no-glow #bestCombo,
.perf-no-glow h1 {
  text-shadow: none !important;
}

.perf-no-glow .judgement {
  text-shadow: none !important;
}

.perf-no-bg {
  background: #000 !important;
}

.perf-no-particles #particleCanvas {
  display: none !important;
}

.perf-no-ring .hit-effect {
  display: none !important;
}

.perf-no-judgements .judgement {
  display: none !important;
}

.perf-no-progress #progressRing {
  display: none !important;
}

.perf-no-combo-flash h1 {
  animation: none !important;
}

#gameModalFormBtn,
#gameModalMilestoneContinueBtn,
#gameOverFormBtn,
#gameOverLeftBtn,
#gameOverRetryBtn {
  width: 100%;
}

#gameModalFormBtn,
#gameOverFormBtn,
#gameOverRetryBtn {
  background: linear-gradient(110deg, var(--neon-blue), var(--neon-red), var(--neon-orange), var(--neon-yellow), var(--neon-orange), var(--neon-red), var(--neon-blue), var(--neon-blue));
  background-size: 200% 100%;
  animation: scroll-bg-horizontal 12s linear infinite;
  color: white;
  font-weight: bold;
  border: none;
}

#form-141 {
  display: none;
}

#form-141.visible {
  display: block;
}

/* ── Landscape Switch Hinweis ── */
#landscapeSwitch {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10000;
  background: #000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#landscapeSwitch img {
  max-width: 220px;
  width: 100%;
  height: auto;
  opacity: 0.85;
}

@media (orientation: landscape) and (max-height: 500px) {
  #landscapeSwitch {
    display: flex;
  }

  #landscapeSwitch ~ * {
    display: none !important;
  }
}