:root {
  color-scheme: dark light;
  --bg: radial-gradient(circle at 20% 20%, #ff9a9e, #fecfef, #fe99c0);
  --text-color: #2d0033;
  --button-bg: rgba(255, 255, 255, 0.85);
  --button-text: #832161;
  --shadow: 0 1rem 2.5rem rgba(63, 0, 92, 0.35);
  --wrapper-bg: rgba(255, 255, 255, 0.6);
  --scoreboard-bg: rgba(255, 255, 255, 0.95);
  --scoreboard-text: #832161;
  --stats-bg: rgba(255,255,255,0.9);
  --stats-text: #832161;
  --stats-border: rgba(131, 33, 97, 0.1);
}

/* Thème Sombre */
body[data-theme="dark"] {
  --bg: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --text-color: #e0e0e0;
  --button-bg: rgba(80, 80, 100, 0.9);
  --button-text: #b8b8ff;
  --shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.7);
  --wrapper-bg: rgba(30, 30, 50, 0.8);
  --scoreboard-bg: rgba(30, 30, 50, 0.95);
  --scoreboard-text: #b8b8ff;
  --stats-bg: rgba(40, 40, 60, 0.9);
  --stats-text: #e0e0e0;
  --stats-border: rgba(184, 184, 255, 0.2);
}

/* Thème Cyberpunk */
body[data-theme="cyberpunk"] {
  --bg: linear-gradient(135deg, #0a0a0a, #1a001a, #330033);
  --text-color: #00ff9f;
  --button-bg: rgba(0, 255, 159, 0.2);
  --button-text: #ff00ff;
  --shadow: 0 1rem 2.5rem rgba(255, 0, 255, 0.5);
  --wrapper-bg: rgba(10, 10, 10, 0.8);
  --scoreboard-bg: rgba(10, 10, 10, 0.95);
  --scoreboard-text: #00ff9f;
  --stats-bg: rgba(10, 10, 10, 0.9);
  --stats-text: #00ff9f;
  --stats-border: rgba(255, 0, 255, 0.3);
}

body[data-theme="cyberpunk"] .wrapper {
  border: 2px solid #00ff9f;
  box-shadow: 0 0 30px rgba(0, 255, 159, 0.5), inset 0 0 30px rgba(255, 0, 255, 0.2);
}

body[data-theme="cyberpunk"] h1 {
  text-shadow: 0 0 20px #ff00ff, 0 0 40px #00ff9f;
}

body[data-theme="cyberpunk"] .scoreboard-left {
  border: 2px solid #ff00ff;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

body[data-theme="cyberpunk"] .scoreboard-left h2 {
  text-shadow: 0 0 10px #00ff9f;
}

/* Thème Liquid Glass */
body[data-theme="glass"] {
  --bg: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --text-color: #2d3436;
  --button-bg: rgba(255, 255, 255, 0.25);
  --button-text: #2d3436;
  --shadow: 0 8px 32px rgba(168, 237, 234, 0.3);
  --wrapper-bg: rgba(255, 255, 255, 0.25);
  --scoreboard-bg: rgba(255, 255, 255, 0.3);
  --scoreboard-text: #2d3436;
  --stats-bg: rgba(255, 255, 255, 0.25);
  --stats-text: #2d3436;
  --stats-border: rgba(45, 52, 54, 0.1);
}

body[data-theme="glass"]::before {
  content: "";
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(168, 237, 234, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(254, 214, 227, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 40%);
  animation: glassFloat 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes glassFloat {
  0%, 100% { 
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  33% { 
    transform: translate(50px, -30px) scale(1.1);
    opacity: 0.8;
  }
  66% { 
    transform: translate(-30px, 40px) scale(0.9);
    opacity: 0.7;
  }
}

body[data-theme="glass"] .wrapper,
body[data-theme="glass"] .scoreboard-left {
  backdrop-filter: blur(25px) saturate(150%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(168, 237, 234, 0.3),
              inset 0 0 20px rgba(255, 255, 255, 0.2);
  position: relative;
}

body[data-theme="glass"] .wrapper::before,
body[data-theme="glass"] .scoreboard-left::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

body[data-theme="glass"] button {
  background: rgba(255, 255, 255, 0.3) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  color: #2d3436 !important;
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 15px rgba(168, 237, 234, 0.2) !important;
}

/* Thème DVD Screensaver */
body[data-theme="dvd"] {
  --bg: #000000;
  --text-color: #ffffff;
  --button-bg: rgba(255, 255, 255, 0.1);
  --button-text: #ffffff;
  --shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  --wrapper-bg: rgba(0, 0, 0, 0.8);
  --scoreboard-bg: rgba(0, 0, 0, 0.9);
  --scoreboard-text: #ffffff;
  --stats-bg: rgba(0, 0, 0, 0.8);
  --stats-text: #ffffff;
  --stats-border: rgba(255, 255, 255, 0.2);
}

body[data-theme="dvd"]::before {
  content: "DVD";
  position: fixed;
  font-size: 4rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(45deg, #ff0080, #00ff00, #0080ff, #ffff00, #ff0080);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 1rem 2rem;
  border: 3px solid currentColor;
  border-radius: 1rem;
  animation: dvdBounce 10s linear infinite, dvdColor 3s ease infinite;
  z-index: 1000;
  pointer-events: none;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

@keyframes dvdBounce {
  0% { left: 0; top: 0; }
  25% { left: calc(100vw - 200px); top: calc(100vh - 150px); }
  50% { left: 0; top: calc(100vh - 150px); }
  75% { left: calc(100vw - 200px); top: 0; }
  100% { left: 0; top: 0; }
}

@keyframes dvdColor {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(360deg); }
}

/* Thème Glitch */
body[data-theme="glitch"] {
  --bg: linear-gradient(135deg, #1a0033, #330066);
  --text-color: #00ffff;
  --button-bg: rgba(0, 255, 255, 0.1);
  --button-text: #ff00ff;
  --shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  --wrapper-bg: rgba(26, 0, 51, 0.8);
  --scoreboard-bg: rgba(51, 0, 102, 0.9);
  --scoreboard-text: #00ffff;
  --stats-bg: rgba(26, 0, 51, 0.8);
  --stats-text: #00ffff;
  --stats-border: rgba(0, 255, 255, 0.3);
}

body[data-theme="glitch"] h1 {
  animation: glitch 1s infinite;
  position: relative;
}

body[data-theme="glitch"] h1::before,
body[data-theme="glitch"] h1::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

body[data-theme="glitch"] h1::before {
  animation: glitchTop 0.5s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

body[data-theme="glitch"] h1::after {
  animation: glitchBottom 0.7s infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  -webkit-clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitchTop {
  0%, 100% { transform: translate(0); }
  50% { transform: translate(-5px, -5px); color: #ff00ff; }
}

@keyframes glitchBottom {
  0%, 100% { transform: translate(0); }
  50% { transform: translate(5px, 5px); color: #00ffff; }
}

/* Thème Aquarium */
body[data-theme="aquarium"] {
  --bg: linear-gradient(180deg, #001f3f 0%, #003d5c 50%, #005580 100%);
  --text-color: #e0f7ff;
  --button-bg: rgba(0, 85, 128, 0.5);
  --button-text: #ffffff;
  --shadow: 0 1rem 2rem rgba(0, 85, 128, 0.5);
  --wrapper-bg: rgba(0, 61, 92, 0.6);
  --scoreboard-bg: rgba(0, 31, 63, 0.8);
  --scoreboard-text: #e0f7ff;
  --stats-bg: rgba(0, 61, 92, 0.6);
  --stats-text: #e0f7ff;
  --stats-border: rgba(224, 247, 255, 0.2);
}

body[data-theme="aquarium"]::after {
  content: "";
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
  animation: bubbles 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes bubbles {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-100px); opacity: 0.7; }
}

/* Thème Rave Party */
body[data-theme="rave"] {
  --bg: #000000;
  --text-color: #ffffff;
  --button-bg: rgba(255, 255, 255, 0.1);
  --button-text: #ffffff;
  --shadow: 0 0 30px rgba(255, 0, 255, 0.8);
  --wrapper-bg: rgba(0, 0, 0, 0.7);
  --scoreboard-bg: rgba(0, 0, 0, 0.8);
  --scoreboard-text: #ffffff;
  --stats-bg: rgba(0, 0, 0, 0.7);
  --stats-text: #ffffff;
  --stats-border: rgba(255, 255, 255, 0.2);
  animation: raveBackground 0.5s infinite;
}

@keyframes raveBackground {
  0% { background: linear-gradient(135deg, #ff0000, #000000); }
  16% { background: linear-gradient(135deg, #00ff00, #000000); }
  33% { background: linear-gradient(135deg, #0000ff, #000000); }
  50% { background: linear-gradient(135deg, #ff00ff, #000000); }
  66% { background: linear-gradient(135deg, #ffff00, #000000); }
  83% { background: linear-gradient(135deg, #00ffff, #000000); }
  100% { background: linear-gradient(135deg, #ff0000, #000000); }
}

body[data-theme="rave"] .wrapper,
body[data-theme="rave"] .scoreboard-left {
  animation: ravePulse 0.5s infinite;
  box-shadow: 0 0 30px currentColor;
}

@keyframes ravePulse {
  0%, 100% { box-shadow: 0 0 20px #ff0000; }
  16% { box-shadow: 0 0 20px #00ff00; }
  33% { box-shadow: 0 0 20px #0000ff; }
  50% { box-shadow: 0 0 20px #ff00ff; }
  66% { box-shadow: 0 0 20px #ffff00; }
  83% { box-shadow: 0 0 20px #00ffff; }
}

/* Thème Vaporwave */
body[data-theme="vaporwave"] {
  --bg: linear-gradient(135deg, #ff71ce 0%, #01cdfe 50%, #05ffa1 100%);
  --text-color: #ffffff;
  --button-bg: rgba(255, 113, 206, 0.3);
  --button-text: #ffffff;
  --shadow: 0 1rem 2rem rgba(255, 113, 206, 0.5);
  --wrapper-bg: rgba(178, 128, 255, 0.3);
  --scoreboard-bg: rgba(255, 113, 206, 0.4);
  --scoreboard-text: #ffffff;
  --stats-bg: rgba(178, 128, 255, 0.3);
  --stats-text: #ffffff;
  --stats-border: rgba(255, 255, 255, 0.3);
}

body[data-theme="vaporwave"]::before {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: repeating-linear-gradient(
    0deg,
    #ff71ce 0px,
    #ff71ce 2px,
    transparent 2px,
    transparent 20px
  );
  animation: vaporwaveGrid 2s linear infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
}

@keyframes vaporwaveGrid {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(20px); }
}

body[data-theme="vaporwave"] h1 {
  text-shadow: 3px 3px 0 #ff71ce, 6px 6px 0 #01cdfe, 9px 9px 0 #05ffa1;
  animation: vaporwaveFloat 3s ease-in-out infinite;
}

@keyframes vaporwaveFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Thème Fireflies */
body[data-theme="fireflies"] {
  --bg: linear-gradient(180deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
  --text-color: #f0f0f0;
  --button-bg: rgba(26, 26, 46, 0.8);
  --button-text: #ffeb3b;
  --shadow: 0 1rem 2rem rgba(255, 235, 59, 0.3);
  --wrapper-bg: rgba(26, 26, 46, 0.7);
  --scoreboard-bg: rgba(10, 14, 39, 0.9);
  --scoreboard-text: #f0f0f0;
  --stats-bg: rgba(26, 26, 46, 0.7);
  --stats-text: #f0f0f0;
  --stats-border: rgba(255, 235, 59, 0.2);
}

body[data-theme="fireflies"]::before {
  content: "";
  position: fixed;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, #ffeb3b, transparent),
    radial-gradient(2px 2px at 60% 70%, #ffeb3b, transparent),
    radial-gradient(3px 3px at 50% 50%, #ffeb3b, transparent),
    radial-gradient(2px 2px at 80% 10%, #ffeb3b, transparent),
    radial-gradient(2px 2px at 90% 60%, #ffeb3b, transparent),
    radial-gradient(3px 3px at 33% 80%, #ffeb3b, transparent),
    radial-gradient(2px 2px at 10% 90%, #ffeb3b, transparent);
  background-size: 200% 200%;
  animation: firefliesMove 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes firefliesMove {
  0%, 100% { 
    background-position: 0% 0%, 50% 50%, 100% 100%, 25% 75%, 75% 25%, 60% 40%, 40% 60%;
    opacity: 0.8;
  }
  50% { 
    background-position: 100% 100%, 0% 0%, 50% 50%, 75% 25%, 25% 75%, 40% 60%, 60% 40%;
    opacity: 1;
  }
}

/* Thème Disco Ball */
body[data-theme="disco"] {
  --bg: linear-gradient(135deg, #2c003e, #1a0033);
  --text-color: #ffffff;
  --button-bg: rgba(255, 255, 255, 0.1);
  --button-text: #ffffff;
  --shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  --wrapper-bg: rgba(42, 0, 62, 0.8);
  --scoreboard-bg: rgba(26, 0, 51, 0.9);
  --scoreboard-text: #ffffff;
  --stats-bg: rgba(42, 0, 62, 0.8);
  --stats-text: #ffffff;
  --stats-border: rgba(255, 255, 255, 0.2);
}

body[data-theme="disco"]::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  background: 
    linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.8) 49%, rgba(255,255,255,0.8) 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.8) 49%, rgba(255,255,255,0.8) 51%, transparent 52%);
  border-radius: 50%;
  animation: discoSpin 3s linear infinite;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 100px 50px rgba(255, 255, 255, 0.3);
  filter: brightness(1.5);
}

@keyframes discoSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

/* Thème Personnalisé */
body[data-theme="custom"] {
  --text-color: #ffffff;
  --button-bg: rgba(0, 0, 0, 0.5);
  --button-text: #ffffff;
  --shadow: 0 1rem 2rem rgba(0, 0, 0, 0.7);
  --wrapper-bg: rgba(0, 0, 0, 0.7);
  --scoreboard-bg: rgba(0, 0, 0, 0.8);
  --scoreboard-text: #ffffff;
  --stats-bg: rgba(0, 0, 0, 0.7);
  --stats-text: #ffffff;
  --stats-border: rgba(255, 255, 255, 0.2);
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}

body[data-theme="custom"] .wrapper,
body[data-theme="custom"] .scoreboard-left {
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

body[data-theme="custom"] button {
  backdrop-filter: blur(10px);
}

/* Thème Matrix */
body[data-theme="matrix"] {
  --bg: #000000;
  --text-color: #00ff00;
  --button-bg: rgba(0, 255, 0, 0.1);
  --button-text: #00ff00;
  --shadow: 0 0 20px rgba(0, 255, 0, 0.5);
  --wrapper-bg: rgba(0, 20, 0, 0.9);
  --scoreboard-bg: rgba(0, 20, 0, 0.95);
  --scoreboard-text: #00ff00;
  --stats-bg: rgba(0, 30, 0, 0.9);
  --stats-text: #00ff00;
  --stats-border: rgba(0, 255, 0, 0.3);
}

body[data-theme="matrix"]::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background-image: 
    linear-gradient(transparent 0%, #00ff00 100%);
  background-size: 20px 100%;
  background-repeat: repeat-x;
  opacity: 0;
  animation: matrixRain 20s linear infinite;
}

body[data-theme="matrix"] .wrapper,
body[data-theme="matrix"] .scoreboard-left {
  border: 2px solid #00ff00;
  text-shadow: 0 0 5px #00ff00;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.matrix-char {
  position: fixed;
  color: #00ff00;
  font-family: "Courier New", monospace;
  font-size: 20px;
  text-shadow: 0 0 8px #00ff00;
  pointer-events: none;
  z-index: 1;
  animation: matrixFall linear forwards;
  opacity: 0;
}

.matrix-char.bright {
  color: #ffffff;
  text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

@keyframes matrixFall {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}



* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  background: var(--bg);
  color: var(--text-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}

.wrapper > div[style*="background"] {
  background: var(--stats-bg) !important;
  color: var(--stats-text) !important;
}

.wrapper > div[style*="background"] * {
  color: var(--stats-text) !important;
}

#next-level-info {
  background: var(--stats-bg) !important;
  color: var(--stats-text) !important;
  border-left-color: var(--button-text) !important;
}

.wrapper {
  max-width: 40rem;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(6px);
  background-color: var(--wrapper-bg);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  color: var(--text-color);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1rem;
}

p {
  font-size: 1.125rem;
  line-height: 1.5;
}

button {
  margin-top: 2rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.25);
}

button.active {
  background: linear-gradient(135deg, #ffde59, #ff7eb3);
  color: #4a004f;
}

.poop {
  position: fixed;
  top: -6rem;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  animation: fall 2.2s cubic-bezier(0.33, 0, 0.67, 1) forwards;
  pointer-events: none;
  filter: drop-shadow(0 0.75rem 1rem rgba(0, 0, 0, 0.35));
  transform: rotate(calc(var(--spin, 0) * 1deg));
}

.poop::after {
  content: "💩";
}

.poop.no-rotate {
  animation: fallNoRotate 2.2s cubic-bezier(0.33, 0, 0.67, 1) forwards;
}

@keyframes fall {
  0% {
    transform: translateY(-20vh) rotate(0deg);
    opacity: 0.9;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes fallNoRotate {
  0% {
    transform: translateY(-20vh);
    opacity: 0.9;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  top: -10vh;
  width: 0.5rem;
  height: 1.4rem;
  background: linear-gradient(135deg, #ff007b, #ffda2d);
  animation: sprinkle 2.4s ease-in forwards;
  pointer-events: none;
  transform: rotate(45deg);
}

@keyframes sprinkle {
  0% {
    opacity: 0.8;
    transform: translateY(-10vh) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) rotate(720deg);
  }
}

.perf-toggle-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem !important;
  margin: 0 !important;
  font-size: 1rem !important;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.95));
  color: #832161;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3), 0 0 20px rgba(131, 33, 97, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.perf-toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35), 0 0 30px rgba(131, 33, 97, 0.4);
  border-color: rgba(255, 255, 255, 0.8);
}

.theme-selector {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.theme-toggle-btn {
  padding: 0.75rem 1.25rem !important;
  margin: 0 !important;
  font-size: 1rem !important;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.95));
  color: #832161;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3), 0 0 20px rgba(131, 33, 97, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.theme-toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35), 0 0 30px rgba(131, 33, 97, 0.4);
  border-color: rgba(255, 255, 255, 0.8);
}

.theme-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
  overflow: hidden;
  backdrop-filter: blur(10px);
  min-width: 12rem;
}

.theme-dropdown.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-dropdown button {
  width: 100%;
  padding: 0.75rem 1rem !important;
  margin: 0 !important;
  border: none;
  border-bottom: 1px solid rgba(131, 33, 97, 0.1);
  background: transparent;
  color: #832161;
  font-size: 0.95rem !important;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
}

.theme-dropdown button:last-child {
  border-bottom: none;
}

.theme-dropdown button:hover {
  background: rgba(131, 33, 97, 0.1);
  transform: translateX(5px);
  box-shadow: none;
}

.theme-dropdown button.active {
  background: linear-gradient(90deg, rgba(131, 33, 97, 0.15), transparent);
  font-weight: 700;
}

.scoreboard-left {
  position: fixed;
  top: 5rem;
  left: 1rem;
  z-index: 99;
  background: var(--scoreboard-bg);
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  max-width: 18rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  backdrop-filter: blur(8px);
  color: var(--text-color);
}

.scoreboard-left h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem 0;
  color: var(--scoreboard-text);
  text-align: center;
}

.scoreboard-left #update-timer {
  font-size: 0.7em;
  color: #666;
  display: block;
  margin-top: 0.25rem;
}

#scores-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#scores-list li {
  padding: 0.5rem;
  border-bottom: 1px solid var(--stats-border);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-color);
}

#scores-list li:last-child {
  border-bottom: none;
}

.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--button-bg);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  max-width: 20rem;
  width: 90%;
}

#pseudo-input {
  padding: 0.5rem;
  margin: 1rem 0;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

input, textarea {
  user-select: text;
}

#submit-pseudo {
  padding: 0.5rem 1rem;
  background: var(--button-bg);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

/* Admin styles */
#admin-modal .modal-content {
  max-width: 50rem;
  width: 90%;
  text-align: left;
}

.admin-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.5rem;
}

.admin-section h3 {
  margin-top: 0;
  color: var(--text-color);
}

.admin-field {
  margin-bottom: 1rem;
}

.admin-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.admin-field input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  width: 100%;
  box-sizing: border-box;
}

.admin-field button {
  padding: 0.5rem 1rem;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

.admin-field button:hover {
  background: #45a049;
}

#admin-users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#admin-users-table th, #admin-users-table td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: left;
}

#admin-users-table th {
  background: rgba(0, 0, 0, 0.1);
}

#admin-users-table button {
  background: #f44336;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

#admin-users-table button:hover {
  background: #d32f2f;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}

.admin-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
}

.admin-tab:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.05);
}

.admin-tab.active {
  color: #4CAF50;
  border-bottom-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.admin-tab-content {
  padding: 1rem 0;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#whitelist-display {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
}

.whitelist-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid #4CAF50;
  border-radius: 0.25rem;
}

.whitelist-group h5 {
  margin: 0 0 0.75rem 0;
  color: #4CAF50;
  font-size: 1.1rem;
}

.whitelist-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.whitelist-user {
  background: white;
  padding: 0.4rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  color: #333;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
