:root {
  --rose-deep: #cc184e;
  --rose-medium: #eb4575;
  --rose-soft: #f76cae;
  --rose-light: #ffe5b3;
  --peach: #ffdab3;
  --lavender: #e8d5f2;
  --mint: #d4f1e8;
  --sky: #d4e9f7;
  --bg-gradient-start: #fff5f7;
  --bg-gradient-end: #ffe8f0;
  --shadow-soft: rgba(235, 69, 117, 0.15);
  --shadow-medium: rgba(235, 69, 117, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-end) 100%
  );
  font-family: "Quicksand", sans-serif;
  overflow: hidden;
  user-select: none;
  min-height: 100vh;
}

button {
  font-family: "Quicksand", sans-serif;
}

/* ---------- CLAYMORPHISM BASE ---------- */
.clay {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  border-radius: 30px;
  box-shadow: 0 8px 32px var(--shadow-soft),
    inset 0 -2px 8px rgba(255, 255, 255, 0.5),
    inset 0 2px 8px rgba(204, 24, 78, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ---------- CONFETTI EFFECT ---------- */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.confetti {
  position: absolute;
  width: 12px;
  height: 12px;
  top: -10px;
  border-radius: 50%;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ---------- SPLASH SCREEN ---------- */
.splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #ffe8f0 0%, #fff5f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeOut 0.8s ease forwards;
  animation-delay: 2s;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.splash-box {
  text-align: center;
  animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
  0% {
    transform: scale(0.3) rotate(-10deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 130px;
  height: 130px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--rose-medium) 0%,
    var(--rose-soft) 100%
  );
  box-shadow: 0 10px 40px var(--shadow-medium),
    inset 0 -3px 10px rgba(204, 24, 78, 0.3),
    inset 0 3px 10px rgba(255, 255, 255, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.8);
}

.mascot-img {
  background-image: url("assets/characters/char1.webp");
  height: 32px;
  width: 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.splash-box h1 {
  color: var(--rose-deep);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Loading Bar */
.loading-container {
  width: 220px;
  height: 35px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  margin: 25px auto 0;
  padding: 4px;
  box-shadow: 0 6px 20px var(--shadow-soft),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  position: relative;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--rose-medium),
    var(--rose-soft),
    var(--rose-light)
  );
  border-radius: 16px;
  box-shadow: 0 0 15px rgba(247, 108, 174, 0.5),
    inset 0 -2px 6px rgba(204, 24, 78, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.4);
  animation: loadBar 1.8s ease-out forwards;
  position: relative;
}

.loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: shimmer 1s infinite;
}

@keyframes loadBar {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.loading-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--rose-deep);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
  z-index: 1;
}

/* ---------- START SCREEN ---------- */
.start-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-end) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 200;
}

.title-main {
  position: absolute;
  top: 3vh;
  font-size: 38px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--rose-deep) 0%,
    var(--rose-medium) 50%,
    var(--rose-soft) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(235, 69, 117, 0.3));
  letter-spacing: 1px;
}

.menu-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 60px;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  padding: 16px 50px;
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: var(--rose-deep);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 6px 20px var(--shadow-soft),
    inset 0 -2px 6px rgba(255, 255, 255, 0.6),
    inset 0 2px 6px rgba(235, 69, 117, 0.1);
  user-select: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.menu-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-soft), var(--rose-light));
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
  opacity: 0.3;
}

.menu-btn:hover::before {
  width: 300px;
  height: 300px;
}

.menu-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 30px var(--shadow-medium),
    inset 0 -2px 10px rgba(255, 255, 255, 0.7),
    inset 0 2px 10px rgba(235, 69, 117, 0.15);
  border-color: rgba(247, 108, 174, 0.5);
}

.menu-btn:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 15px var(--shadow-soft),
    inset 0 2px 8px rgba(235, 69, 117, 0.2);
}

@keyframes vibrateWithPause {
  0% {
    transform: translateX(0);
  }
  2% {
    transform: translateX(-2px);
  }
  4% {
    transform: translateX(2px);
  }
  6% {
    transform: translateX(-2px);
  }
  8% {
    transform: translateX(2px);
  }
  10% {
    transform: translateX(-2px);
  }
  12% {
    transform: translateX(2px);
  }
  14% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}

.menu-btn.cta {
  animation: vibrateWithPause 3.5s ease-in-out infinite;
}

.menu-btn.cta:hover {
  animation: none;
}

.version-label {
  position: absolute;
  bottom: 15px;
  font-size: 13px;
  color: var(--rose-medium);
  opacity: 0.7;
  font-weight: 500;
}

/* ---------- POPUP ---------- */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(255, 245, 247, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
}

.popup-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  max-width: 90vw;
  padding: 35px;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 15px 50px var(--shadow-medium),
    inset 0 -3px 12px rgba(255, 255, 255, 0.6),
    inset 0 3px 12px rgba(235, 69, 117, 0.1);
  animation: popBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
}

@keyframes popBounce {
  0% {
    transform: scale(0.5) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.popup-box h3 {
  color: var(--rose-deep);
  font-size: 26px;
  margin: 0 0 15px 0;
  font-weight: 700;
}

.popup-box p {
  color: #666;
  font-size: 16px;
  margin: 10px 0;
}

.popup button {
  margin: 8px 6px;
  padding: 12px 28px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 15px var(--shadow-soft),
    inset 0 -2px 6px rgba(255, 255, 255, 0.6),
    inset 0 2px 6px rgba(235, 69, 117, 0.08);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.popup button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.7),
    inset 0 2px 8px rgba(235, 69, 117, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.popup button:active {
  transform: translateY(-1px) scale(0.98);
}

.popup button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quit {
  background: linear-gradient(
    135deg,
    rgba(235, 69, 117, 0.15),
    rgba(247, 108, 174, 0.1)
  ) !important;
  color: var(--rose-medium) !important;
}

/* Submit Score Button */
#submitScoreBtn {
  background: linear-gradient(
    135deg,
    rgba(212, 241, 232, 0.5),
    rgba(212, 233, 247, 0.4)
  ) !important;
  color: #2d8a7a !important;
  border: 1px solid rgba(247, 108, 174, 0.3);
}

#submitScoreBtn:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 217, 255, 0.3),
    rgba(51, 196, 255, 0.2)
  ) !important;
}

.btn-loader {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Input Styling */
#playerNameInput {
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(247, 108, 174, 0.3) !important;
  box-shadow: 0 4px 15px rgba(235, 69, 117, 0.1),
    inset 0 2px 8px rgba(255, 255, 255, 0.8) !important;
}

#playerNameInput:focus {
  outline: none !important;
  border-color: var(--rose-soft) !important;
  box-shadow: 0 6px 20px rgba(247, 108, 174, 0.25),
    inset 0 2px 10px rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(247, 108, 174, 0.1) !important;
  background: rgba(255, 255, 255, 0.8);
}

/* ---------- BRAINY BUTTON ---------- */
.brainy-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: var(--rose-deep);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  z-index: 210;
  box-shadow: 0 4px 16px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes brainyPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 16px var(--shadow-medium),
      inset 0 -2px 8px rgba(255, 255, 255, 0.6),
      inset 0 2px 8px rgba(235, 69, 117, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 18px rgba(235, 69, 117, 0.4),
      inset 0 -2px 8px rgba(255, 255, 255, 0.7),
      inset 0 2px 8px rgba(235, 69, 117, 0.15);
  }
}

.brainy-btn:hover {
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 6px 20px var(--shadow-medium),
    inset 0 -3px 10px rgba(255, 255, 255, 0.7),
    inset 0 3px 10px rgba(235, 69, 117, 0.15);
  animation: brainyPulse 2s ease-in-out infinite;
}

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

/* ---------- BRAINY POPUP ---------- */
.brainy-box {
  max-width: 420px;
  padding: 25px 30px 30px 30px;
}

.brainy-content {
  text-align: left;
}

.brainy-greeting {
  font-size: 18px !important;
  font-weight: 700;
  color: var(--rose-deep);
  margin: 4px 0 18px 0 !important;
  text-align: center;
}

.brainy-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 15px 0;
}

.brainy-divider {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--rose-soft),
    transparent
  );
  margin: 18px 0;
  opacity: 0.3;
}

.brainy-subtitle {
  font-size: 14px;
  color: var(--rose-deep);
  margin: 0 0 8px 0;
}

.brainy-text-small {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  margin: 0 0 8px 0;
}

.brainy-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--rose-medium);
  margin: 18px 0 0 0;
  text-align: center;
  padding: 12px;
  background: linear-gradient(
    135deg,
    rgba(247, 108, 174, 0.1),
    rgba(235, 69, 117, 0.05)
  );
  border-radius: 15px;
  border: 2px solid rgba(247, 108, 174, 0.2);
}

/* ---------- CHARACTER SELECT POPUP ---------- */
.character-box {
  min-width: 340px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 column */
  gap: 18px;
  margin: 25px 0;
}

/* Luffy span 2 column */
.character-card[data-character="luffy"] {
  grid-column: span 2;
  max-width: 200px;
  margin: 0 auto;
}

.character-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px var(--shadow-soft),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.08);
}

.character-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(247, 108, 174, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-card:hover::before {
  opacity: 1;
}

.character-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 35px var(--shadow-medium),
    inset 0 -3px 12px rgba(255, 255, 255, 0.7),
    inset 0 3px 12px rgba(235, 69, 117, 0.12);
  border-color: rgba(247, 108, 174, 0.6);
}

.character-card.selected {
  border-color: var(--rose-medium);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 40px rgba(235, 69, 117, 0.3),
    inset 0 -3px 12px rgba(255, 255, 255, 0.8),
    inset 0 3px 12px rgba(235, 69, 117, 0.15),
    0 0 0 3px rgba(247, 108, 174, 0.2);
}

.character-card.selected .selected-badge {
  opacity: 1;
  transform: scale(1);
}

.character-preview {
  width: 85px;
  height: 85px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--peach);
  box-shadow: 0 6px 20px var(--shadow-soft),
    inset 0 -2px 8px rgba(255, 255, 255, 0.5);
}

.default-char {
  background: linear-gradient(135deg, #f76cae 0%, #eb4575 100%);
}

.naruto-char {
  background: linear-gradient(135deg, #ffb347 0%, #ff8c00 100%);
}

.goku-char {
  background: linear-gradient(135deg, #ff8c42 0%, #ff6600 100%);
}

.ichigo-char {
  background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
}

.luffy-char {
  background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e0 100%);
  box-shadow: 0 4px 15px rgba(200, 200, 200, 0.3),
    inset 0 -2px 6px rgba(212, 212, 206, 0.4);
}

.character-card p {
  margin: 0;
  font-weight: 700;
  color: var(--rose-deep);
  font-size: 15px;
  letter-spacing: 0.3px;
}

.selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--rose-medium), var(--rose-soft));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 15px rgba(235, 69, 117, 0.4);
}

/* ---------- LEADERBOARD POPUP ---------- */
.leaderboard-box {
  min-width: 380px;
  max-width: 90vw;
}

.leaderboard-filters {
  margin: 4px 0 8px 0;
}

.filter-btn {
  margin: 8px 16px;
  padding: 10px 24px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 12px var(--shadow-soft),
    inset 0 -2px 6px rgba(255, 255, 255, 0.6),
    inset 0 2px 6px rgba(235, 69, 117, 0.06);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--rose-medium), var(--rose-soft));
  color: white;
  border-color: var(--rose-soft);
  box-shadow: 0 6px 20px rgba(235, 69, 117, 0.35),
    inset 0 -2px 8px rgba(204, 24, 78, 0.3),
    inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.filter-btn:hover {
  transform: translateY(-3px) scale(1.05);
  color: var(--rose-deep);
  box-shadow: 0 8px 20px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.7),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
}

.leaderboard-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 20px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow-x: hidden;
}

.leaderboard-list::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--rose-soft), var(--rose-medium));
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(235, 69, 117, 0.3);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  border-left: 4px solid var(--rose-soft);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 15px var(--shadow-soft),
    inset 0 -2px 6px rgba(255, 255, 255, 0.6),
    inset 0 2px 6px rgba(235, 69, 117, 0.06);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.leaderboard-item:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 25px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.7),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  border-color: rgba(247, 108, 174, 0.5);
}

.leaderboard-item.top1 {
  border-left-color: #ffd700;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15),
    rgba(255, 255, 255, 0.75)
  );
}

.leaderboard-item.top2 {
  border-left-color: #c0c0c0;
  background: linear-gradient(
    135deg,
    rgba(192, 192, 192, 0.15),
    rgba(255, 255, 255, 0.75)
  );
}

.leaderboard-item.top3 {
  border-left-color: #cd7f32;
  background: linear-gradient(
    135deg,
    rgba(205, 127, 50, 0.15),
    rgba(255, 255, 255, 0.75)
  );
}

.leaderboard-rank {
  font-weight: 700;
  font-size: 17px;
  color: var(--rose-medium);
  width: 28px;
}

.leaderboard-item.top1 .leaderboard-rank,
.leaderboard-item.top2 .leaderboard-rank,
.leaderboard-item.top3 .leaderboard-rank {
  font-size: 20px;
}

.leaderboard-name {
  flex: 1;
  font-weight: 600;
  color: #444;
  margin: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  padding-left: 8px;
  font-weight: 700;
  color: var(--rose-deep);
  font-size: 17px;
}

.leaderboard-character {
  font-size: 12px;
  background: linear-gradient(135deg, var(--lavender), var(--mint));
  color: #5a3d6b;
  backdrop-filter: blur(3px);
  padding: 4px 10px;
  border-radius: 10px;
  margin-left: 10px;
  font-weight: 600;
  border: 1px solid rgba(247, 108, 174, 0.3);
}

/* ---------- TUTORIAL POPUP ---------- */
.tutorial-box {
  min-width: 350px;
  max-width: 90vw;
  padding: 30px 20px;
}

.tutorial-scroll-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 20px 10px 40px 10px;
  margin: 20px 0;
  scroll-snap-type: x mandatory;
}

.tutorial-scroll-container::-webkit-scrollbar {
  height: 8px;
}

.tutorial-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  margin: 0 20px;
}

.tutorial-scroll-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--rose-soft), var(--rose-medium));
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(235, 69, 117, 0.3);
}

.tutorial-step {
  min-width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 20px var(--shadow-soft),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.08);
  scroll-snap-align: center;
}

.tutorial-element {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
}

.tutorial-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 15px;
  box-shadow: 0 4px 15px var(--shadow-soft);
}

.tutorial-fallback {
  width: 100px;
  height: 100px;
  border-radius: 15px;
  background: radial-gradient(circle, #ff99cc, #ff66b3);
  box-shadow: 0 4px 15px var(--shadow-soft);
}

.tutorial-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.tutorial-control-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 55px;
  height: 55px;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  font-size: 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: var(--rose-medium);
  box-shadow: 0 6px 20px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  font-weight: 600;
  cursor: default;
  transition: all 0.3s ease;
}

.tutorial-control-btn:hover {
  transform: scale(1.05);
}

.tutorial-step h4 {
  color: var(--rose-deep);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.tutorial-step p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  max-width: 240px;
}

.tutorial-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 15px 0 10px 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(235, 69, 117, 0.3);
  transition: all 0.3s ease;
}

.dot.active {
  width: 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--rose-medium), var(--rose-soft));
  box-shadow: 0 2px 8px rgba(235, 69, 117, 0.4);
}

/* ---------- SETTINGS POPUP ---------- */
.settings-box {
  min-width: 280px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(247, 108, 174, 0.15);
  font-size: 16px;
  color: var(--rose-deep);
  font-weight: 600;
}

.settings-row:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  padding: 10px 20px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 14px;
  min-width: 65px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 12px var(--shadow-soft),
    inset 0 -2px 6px rgba(255, 255, 255, 0.6),
    inset 0 2px 6px rgba(235, 69, 117, 0.06);
}

.toggle-btn.off {
  background: rgba(200, 200, 200, 0.3);
  color: #888;
  border-color: rgba(200, 200, 200, 0.5);
}

.toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.7),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
}

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

/* ---------- DARK MODE OVERLAY ---------- */
.dark-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 40, 0.5);
  pointer-events: none;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.dark-overlay.active {
  opacity: 1;
}

/* ---------- MOBILE CONTROLS ---------- */
.controls-mobile {
  display: flex;
  position: fixed;
  bottom: 40px;
  left: 0;
  right: 0;
  justify-content: center;
  gap: 80px;
  z-index: 100;
}

.controls-mobile button {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  font-size: 28px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: var(--rose-medium);
  box-shadow: 0 8px 25px var(--shadow-medium),
    inset 0 -3px 10px rgba(255, 255, 255, 0.6),
    inset 0 3px 10px rgba(235, 69, 117, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-weight: 600;
}

.controls-mobile button:active {
  transform: scale(0.92);
  box-shadow: 0 4px 15px var(--shadow-soft),
    inset 0 2px 10px rgba(235, 69, 117, 0.2);
}

.controls-mobile button:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 35px var(--shadow-medium),
    inset 0 -4px 12px rgba(255, 255, 255, 0.7),
    inset 0 4px 12px rgba(235, 69, 117, 0.12);
}

/* Score Display */
.score-display {
  position: fixed;
  top: 40px;
  right: 40px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  padding: 12px 24px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 150;
  animation: scoreEntrance 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.score-display.active {
  display: flex;
}

@keyframes scoreEntrance {
  0% {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.score-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--rose-medium);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose-medium));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* Exit Button */
.exit-btn {
  position: fixed;
  top: 40px;
  left: 40px;
  width: 55px;
  height: 55px;
  color: #f76cae;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-family: serif;
  cursor: pointer;
  z-index: 150;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: scoreEntrance 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.exit-btn:hover {
  box-shadow: 0 8px 25px var(--shadow-medium),
    inset 0 -3px 10px rgba(255, 255, 255, 0.7),
    inset 0 3px 10px rgba(235, 69, 117, 0.12);
}

/* Pause Button */
.pause-btn {
  position: fixed;
  top: 112px;
  left: 40px;
  width: 55px;
  height: 55px;
  color: #f76cae;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px var(--shadow-medium),
    inset 0 -2px 8px rgba(255, 255, 255, 0.6),
    inset 0 2px 8px rgba(235, 69, 117, 0.1);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-family: serif;
  cursor: pointer;
  z-index: 150;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: scoreEntrance 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pause-btn.active {
  display: flex;
}

.pause-btn:hover {
  box-shadow: 0 8px 25px var(--shadow-medium),
    inset 0 -3px 10px rgba(255, 255, 255, 0.7),
    inset 0 3px 10px rgba(235, 69, 117, 0.12);
}

#gameCanvas {
  display: block;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  border-radius: 25px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 50px var(--shadow-medium),
    inset 0 -4px 15px rgba(255, 255, 255, 0.6),
    inset 0 4px 15px rgba(235, 69, 117, 0.08);
}
