@font-face {
  font-family: 'Russo One';
  src: url('../fonts/RussoOne-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --app-vw: 100vw;
  --app-vh: 100vh;
  --ui-scale: 1;
  --hud-compact: 1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: var(--app-vw);
  height: var(--app-vh);
  min-width: 100%;
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  background-color: #000;
  background-image: url('../images/background.jpg?v=20260401-menufix');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: 'Russo One', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

@supports (height: 100dvh) {
  :root {
    --app-vh: 100dvh;
  }
}

body.game-active {
  cursor: none;
}

body.game-active.settings-open {
  cursor: default;
}

/* Smooth menu -> game transition (opacity fade handled by JS hideMenuFast) */
#startScreen {
  transition: opacity 280ms ease;
}

/* Defer HUD paint cost until visible -- reduces INP presentation delay */
#gameHud,
#gameUIOverlay {}

canvas {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  width: var(--app-vw);
  height: var(--app-vh);
  touch-action: none;
  z-index: 2;
}

#gameParallelLayer,
#gameParallelForeground,
#gameAmbientBubbles,
#gameUIOverlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  pointer-events: none;
  overflow: hidden;
}

#gameParallelLayer {
  z-index: 0;
}

#gameParallelForeground {
  z-index: 1;
}

#gameAmbientBubbles {
  z-index: 3;
}

#gameUIOverlay {
  z-index: 10;
}

body.game-active #gameParallelLayer,
body.game-active #gameAmbientBubbles,
body.game-active #gameUIOverlay {
  display: block;
}

body.game-active.area2-parallel #gameParallelForeground {
  display: none;
}

body.game-active #gameParallelLayer .game-parallel-bg,
body.game-active #gameParallelLayer .game-parallel-underwater,
body.game-active #gameParallelLayer .game-parallel-light-rays,
body.game-active #gameParallelLayer .game-parallel-caustics,
body.game-active #gameParallelLayer .game-parallel-depth-fog {
  display: none;
}

body.game-active.area2-parallel #gameParallelLayer .game-parallel-bg,
body.game-active.area2-parallel #gameParallelLayer .game-parallel-underwater,
body.game-active.area2-parallel #gameParallelLayer .game-parallel-light-rays,
body.game-active.area2-parallel #gameParallelLayer .game-parallel-caustics,
body.game-active.area2-parallel #gameParallelLayer .game-parallel-depth-fog {
  display: block;
}

.game-parallel-bg {
  position: absolute;
  top: -10%;
  right: -10%;
  bottom: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  will-change: transform;
}

.game-parallel-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(0.5px) brightness(0.9) saturate(1.1);
}

.game-parallel-underwater {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 150, 200, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse at 30% 20%, rgba(0, 110, 160, 0.16) 0%, transparent 34%),
    linear-gradient(to bottom, rgba(0, 58, 110, 0.16) 0%, rgba(0, 40, 90, 0.08) 24%, rgba(0, 20, 60, 0.42) 100%);
}

.game-parallel-light-rays {
  --px: 0px;
  --py: 0px;
  position: absolute;
  top: -20%;
  left: -20%;
  right: -20%;
  height: 80%;
  background:
    repeating-linear-gradient(105deg,
      transparent 0px,
      rgba(225, 245, 255, 0.014) 12px,
      rgba(225, 245, 255, 0.032) 32px,
      rgba(225, 245, 255, 0.014) 58px,
      transparent 86px,
      rgba(210, 235, 250, 0.018) 118px,
      transparent 168px);
  animation: gameParallelLightShift 8s ease-in-out infinite;
  filter: blur(4px);
  opacity: 0.9;
}

.game-parallel-caustics {
  --px: 0px;
  --py: 0px;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(100, 200, 255, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 70%, rgba(100, 200, 255, 0.045) 0%, transparent 35%),
    radial-gradient(ellipse at 50% 50%, rgba(150, 220, 255, 0.028) 0%, transparent 50%);
  animation: gameParallelCausticsMove 6s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity: 0.84;
}

.game-parallel-bubbles {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 0;
  display: block;
}

.game-parallel-bubble {
  position: absolute;
  bottom: -24px;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.16));
  border-radius: 50%;
  animation: gameParallelBubbleRise 10s infinite ease-in;
  opacity: 0.45;
}

.game-parallel-depth-fog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(4, 16, 28, 0.72) 0%, rgba(5, 22, 38, 0.28) 48%, transparent 100%);
}

.game-parallel-fg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1%;
  width: 100%;
  overflow: hidden;
  will-change: transform;
}

.game-parallel-fg img {
  display: block;
  width: min(100vw, calc(var(--app-vh) * 1.7777778));
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

@keyframes gameParallelLightShift {

  0%,
  100% {
    transform: translate(calc(var(--px) - 22px), var(--py)) rotate(-1.4deg);
    opacity: 0.52;
  }

  50% {
    transform: translate(calc(var(--px) + 22px), var(--py)) rotate(1.4deg);
    opacity: 0.72;
  }
}

@keyframes gameParallelCausticsMove {

  0%,
  100% {
    transform: scale(1) translate(var(--px), var(--py));
  }

  33% {
    transform: scale(1.03) translate(calc(var(--px) - 8px), calc(var(--py) + 4px));
  }

  66% {
    transform: scale(0.97) translate(calc(var(--px) + 8px), calc(var(--py) - 4px));
  }
}

@keyframes gameParallelBubbleRise {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 0.45;
  }

  90% {
    opacity: 0.45;
  }

  100% {
    transform: translateY(-120vh) translateX(20px);
    opacity: 0;
  }
}

#playerfishOverlay {
  position: fixed;
  left: 0;
  top: 0;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform, width, height;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

#gameDecorLayer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

body.game-active.decor-enabled #gameDecorLayer {
  display: block;
}

.game-seabed-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22vh;
  background: linear-gradient(to top, rgba(6, 14, 20, 0.78), rgba(6, 14, 20, 0.34) 42%, rgba(6, 14, 20, 0) 100%);
}

.game-decor {
  position: absolute;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0.5;
  filter: blur(1px);
  animation: gameDecorSway 8s ease-in-out infinite;
  transform-origin: center center;
}

.game-decor.d1 {
  left: -3vw;
  bottom: -2vh;
  width: min(25vw, 340px);
  animation-duration: 9.2s;
}

.game-decor.d2 {
  right: -1vw;
  bottom: -3vh;
  width: min(23vw, 300px);
  animation-duration: 7.4s;
  animation-delay: -1.8s;
}

.game-decor.d3 {
  left: 22vw;
  bottom: -3vh;
  width: min(27vw, 360px);
  animation-duration: 10.4s;
  animation-delay: -3.2s;
}

.game-decor.d4 {
  right: 18vw;
  bottom: -2vh;
  width: min(26vw, 340px);
  animation-duration: 8.6s;
  animation-delay: -2.1s;
}

#playerShieldOverlay {
  position: fixed;
  left: 0;
  top: 0;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: 50%;
  border: 3px solid rgba(224, 250, 255, 0.96);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.52) 0%, rgba(214, 247, 255, 0.28) 16%, rgba(140, 231, 255, 0.2) 30%, rgba(112, 196, 255, 0.12) 52%, rgba(84, 160, 255, 0.05) 72%, rgba(84, 160, 255, 0) 100%),
    linear-gradient(135deg, rgba(145, 255, 236, 0.22), rgba(107, 214, 255, 0.2) 45%, rgba(122, 158, 255, 0.16) 100%);
  box-shadow:
    inset 0 0 26px rgba(255, 255, 255, 0.34),
    inset -12px -16px 24px rgba(88, 170, 255, 0.14),
    0 0 34px rgba(126, 225, 255, 0.34),
    0 0 58px rgba(112, 181, 255, 0.18);
  will-change: transform, width, height, opacity;
}

#playerThoughtBubble {
  position: fixed;
  left: 0;
  top: 0;
  display: none;
  min-width: clamp(56px, 15vmin, 90px);
  min-height: clamp(44px, 12vmin, 70px);
  padding: clamp(4px, 1vmin, 8px) clamp(6px, 1.5vmin, 10px);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  overflow: visible;
  transform: translate(0, 0) scale(0.7);
  transform-origin: center center;
  transition: opacity 180ms ease, transform 220ms ease;
  border-radius: clamp(20px, 5vmin, 36px);
  border: 2px solid rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9) 38%, rgba(244, 249, 255, 0.82) 68%, rgba(225, 238, 248, 0.72) 100%);
  box-shadow:
    inset 0 -8px 16px rgba(188, 215, 232, 0.2),
    inset 0 4px 10px rgba(255, 255, 255, 0.58),
    0 12px 26px rgba(0, 0, 0, 0.18);
  isolation: isolate;
}

#playerThoughtBubble.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

#playerThoughtBubble .bubble-tail,
#playerThoughtBubble .bubble-tail::before,
#playerThoughtBubble .bubble-tail::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.96), rgba(240, 248, 255, 0.78) 72%, rgba(220, 235, 246, 0.66) 100%);
  border: 2px solid rgba(255, 255, 255, 0.92);
  z-index: 0;
}

#playerThoughtBubble .bubble-tail {
  width: 18px;
  height: 18px;
  right: 24px;
  bottom: -16px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
}

#playerThoughtBubble .bubble-tail::before {
  width: 12px;
  height: 12px;
  right: 12px;
  bottom: -15px;
}

#playerThoughtBubble .bubble-tail::after {
  width: 8px;
  height: 8px;
  right: 22px;
  bottom: -23px;
}

/* Adjust tail position when facing right (bubble is to the right of player) */
#playerThoughtBubble.facing-right .bubble-tail {
  right: auto;
  left: 24px;
}

#playerThoughtBubble.facing-right .bubble-tail::before {
  right: auto;
  left: 12px;
}

#playerThoughtBubble.facing-right .bubble-tail::after {
  right: auto;
  left: 22px;
}

/* Area 2 specific styling for better emerald zone contrast */
#playerThoughtBubble.area2-bubble {
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.96) 38%, rgba(244, 255, 252, 0.9) 68%, rgba(225, 248, 244, 0.82) 100%);
  border: 2px solid rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 -8px 16px rgba(188, 232, 226, 0.25),
    inset 0 4px 10px rgba(255, 255, 255, 0.7),
    0 12px 26px rgba(0, 48, 42, 0.22);
}

.player-thought-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.8vmin, 5px);
}

.player-thought-content>*+* {
  margin-top: 5px;
}

.player-thought-frame {
  position: relative;
  width: clamp(22px, 6vmin, 36px);
  height: clamp(22px, 6vmin, 36px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#playerThoughtFish {
  position: relative;
  /* Size controlled by JS */



  display: block;
  margin: 0;
  /* filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.16)); removed for mobile */
  user-select: none;
  -webkit-user-drag: none;
}

#playerThoughtLabel {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 900;
  font-size: clamp(8px, 1.9vmin, 11px);
  line-height: 1.1;
  color: #ff8a2a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  display: none;
}

@media (min-width: 768px) {
  #playerThoughtLabel { display: block; }
}

.friendlyGifOverlay {
  position: fixed;
  left: 0;
  top: 0;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
  object-fit: contain;
  transform-origin: center center;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.2));
}

.enemyGifOverlay {
  position: fixed;
  left: 0;
  top: 0;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 4;
  object-fit: contain;
  transform-origin: center center;
  /* Removed will-change to fix GIF animation freezing */
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.24));
}

#gameHud {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--app-vw) / var(--hud-compact));
  height: calc(var(--app-vh) / var(--hud-compact));
  display: none;
  pointer-events: none;
  z-index: 6;
  transform: scale(var(--hud-compact));
  transform-origin: top left;
}

body.game-active #gameHud {
  display: block;
}

.game-text {
  font-weight: 800;
  color: #fff;
  text-shadow:
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000,
    0 2px 4px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
}

.hud-evolution {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: calc(var(--safe-left) + 8px);
  width: 320px;
  max-width: calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 24px);
  display: flex;
  flex-direction: column;
  transform-origin: top left;
}

.hud-evolution>*+* {
  margin-top: 4px;
}

.evolution-row {
  position: relative;
  width: 100%;
  height: 44px;
}

.evo-fish {
  position: absolute;
  top: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  transition: opacity 160ms ease, transform 180ms ease, filter 180ms ease;
}

.evo-fish:nth-child(1) {
  left: 8.333%;
}

.evo-fish:nth-child(2) {
  left: 25%;
}

.evo-fish:nth-child(3) {
  left: 41.667%;
}

.evo-fish:nth-child(4) {
  left: 58.333%;
}

.evo-fish:nth-child(5) {
  left: 75%;
}

.evo-fish:nth-child(6) {
  left: 91.667%;
}

.evo-fish img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.48));
}

.evo-fish--complete img {
  filter:
    drop-shadow(0 0 4px rgba(126, 240, 255, 0.35)) drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.48));
}

.evo-fish--active {
  transform: translateX(-50%) scale(1.12);
}

.evo-fish--active img {
  filter:
    drop-shadow(0 0 8px rgba(255, 215, 0, 0.78)) drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.5));
}

.evo-fish--locked {
  opacity: 0.35;
}

.evo-fish--locked img {
  filter: grayscale(1) saturate(0.2) drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.28));
}

.evo-fish__dot {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 11px;
  height: 9px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.28);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.32);
}

.evo-fish--complete .evo-fish__dot,
.evo-fish--active .evo-fish__dot {
  background: #ffd700;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.78);
}

.xp-bar {
  position: relative;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 -1px 1px rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.28);
}

.xp-bar::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.24), transparent);
  z-index: 2;
  pointer-events: none;
}

.xp-bar__markers {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.xp-bar__marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.xp-bar__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00ff88, #00d4aa, #00b894);
  box-shadow:
    0 0 10px rgba(0, 255, 136, 0.52),
    inset 0 1px 1px rgba(255, 255, 255, 0.28);
  transition: width 180ms ease;
  z-index: 1;
}

#gameHud.is-max-level .xp-bar__fill {
  background: linear-gradient(90deg, #ffd86a, #ffb347, #ff8c42);
  box-shadow:
    0 0 12px rgba(255, 196, 74, 0.56),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.hud-area {
  position: fixed;
  top: calc(var(--safe-top) + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  animation: hudFloat 3s ease-in-out infinite;
  transform-origin: top center;
}

.area-badge {
  position: relative;
  padding: 3px 16px 5px;
  border: 2px solid #5a3a1a;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5e34 0%, #a0722b 40%, #6b4226 100%);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.area-badge::before,
.area-badge::after {
  content: '';
  position: absolute;
  top: -8px;
  width: 2px;
  height: 8px;
  background: linear-gradient(to bottom, #5a3a1a, #8b5e34);
  border-radius: 1px;
}

.area-badge::before {
  left: 20%;
}

.area-badge::after {
  right: 20%;
}

.hud-resources {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  right: calc(var(--safe-right) + 84px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 1;
  transform-origin: top right;
}

.hud-resources>*+* {
  margin-top: 6px;
}

.resource,
.fish-counter {
  display: flex;
  align-items: center;
}

.resource>*+*,
.fish-counter>*+* {
  margin-left: 6px;
}

.resource__icon,
.fish-counter__icon-wrap {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.42));
}

.resource__label {
  min-width: 42px;
  font-size: clamp(9px, 2.4vmin, 13px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resource__value,
.fish-counter__value {
  min-width: 24px;
  font-size: clamp(11px, 3.2vmin, 16px);
}

.fish-counter__icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.45));
}

@keyframes hudFloat {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

@media (max-width: 900px) {
  .hud-evolution {
    width: min(300px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 108px));
  }

  .hud-resources {
    right: calc(var(--safe-right) + 84px);
    gap: 4px;
  }

  .resource__value,
  .fish-counter__value {
    font-size: 14px;
  }
}

@media (max-width: 680px) {
  .hud-evolution {
    left: 50%;
    transform: translateX(-50%);
    width: min(320px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 24px));
  }

  .hud-area {
    top: calc(var(--safe-top) + 64px);
  }

  .hud-resources {
    top: calc(var(--safe-top) + 96px);
    right: calc(var(--safe-right) + 84px);
    align-items: flex-end;
  }

  .evolution-row {
    height: 40px;
  }

  .evo-fish {
    width: 36px;
    height: 36px;
  }
}

@keyframes gameDecorSway {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }

  50% {
    transform: translate3d(0, -8px, 0) rotate(1.1deg) scale(1.015);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

#assetLoadingScreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: var(--app-vh);
  padding:
    calc(var(--safe-top) + 24px) calc(var(--safe-right) + 18px) calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 18px);
  z-index: 220;
  background-color: #06111d;
  background-image:
    linear-gradient(180deg,
      rgba(2, 10, 30, 0.65) 0%,
      rgba(0, 40, 80, 0.45) 40%,
      rgba(0, 80, 120, 0.3) 70%,
      rgba(0, 30, 60, 0.6) 100%),
    url('../images/background.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
}

body.assets-loading #assetLoadingScreen {
  display: flex;
}

body.assets-loading #startScreen {
  display: none;
}

.asset-loading-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
}

.asset-loading-subtitle {
  font-size: 16px;
  color: rgba(223, 242, 255, 0.88);
  max-width: 560px;
  line-height: 1.5;
}

.asset-loading-progress {
  width: 320px;
  max-width: calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 36px);
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 10px rgba(0, 212, 255, 0.2);
}

.asset-loading-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00d4ff 0%, #00ff88 58%, #b8ffda 100%);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.28);
  transition: width 0.22s ease;
}

.asset-loading-percent {
  font-size: 20px;
  font-weight: 800;
  color: #9dffd5;
  letter-spacing: 0.08em;
}

.asset-loading-tip {
  max-width: 520px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(224, 241, 255, 0.82);
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(4, 19, 35, 0.34);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

@media (max-width: 480px) {
  .asset-loading-progress {
    height: 12px;
  }

  .asset-loading-percent {
    font-size: 18px;
  }

  .asset-loading-tip {
    font-size: 13px;
  }
}

/* Start Screen */
#startScreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* Lifted up from center */
  gap: 0;
  min-height: var(--app-vh);
  padding:
    calc(var(--safe-top) + 4vh) calc(var(--safe-right) + 18px) calc(var(--safe-bottom) + 60px) calc(var(--safe-left) + 18px);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
  background-color: #06111d;
  background-image:
    /* Top: deep dark blue like deep water */
    linear-gradient(180deg,
      rgba(2, 10, 30, 0.65) 0%,
      rgba(0, 40, 80, 0.45) 40%,
      rgba(0, 80, 120, 0.3) 70%,
      rgba(0, 30, 60, 0.6) 100%),
    url('../images/background.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

#startScreen::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(30, 144, 255, 0.18) 0%, transparent 60%);
  pointer-events: none;
}

.menu-bubbles,
.menu-fish {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}

.menu-bubbles {
  z-index: 0;
}

.menu-fish {
  z-index: 1;
}

.menu-bubble {
  position: absolute;
  bottom: -12vh;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.08) 58%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.12), 0 0 18px rgba(130, 220, 255, 0.12);
  animation: menuBubbleRise linear infinite;
}

.menu-fish-item {
  position: absolute;
  left: -25vw;
  top: 0;
  width: 210px;
  /* REDUCED: Half size */
  height: 115px;
  /* REDUCED: Half size */
  opacity: 0.56;
  --fish-scale: 1;
  animation: menuFishSwim linear infinite;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
  transform-origin: center center;
  will-change: transform;
  /* Smoothness optimization */
  backface-visibility: hidden;
}

.menu-fish-item.reverse {
  left: auto;
  right: -18vw;
  transform: scaleX(-1);
  animation-name: menuFishSwimReverse;
}

.menu-fish-item.is-scripted {
  left: 0;
  right: auto;
  animation: none;
}

.menu-fish-item.is-chaser {
  z-index: 2;
  opacity: 0.68;
  filter:
    drop-shadow(0 16px 28px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 16px rgba(120, 220, 255, 0.12));
}

.menu-fish-item.is-chasing {
  opacity: 0.98;
}

.menu-fish-body {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.menu-fish-sprite {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.menu-fish-body::before,
.menu-fish-body::after {
  content: '';
  position: absolute;
}

.menu-fish-body::before {
  left: 22px;
  top: 14px;
  width: 76px;
  height: 42px;
  border-radius: 45% 55% 55% 45%;
  background: linear-gradient(135deg, rgba(130, 246, 255, 0.8), rgba(46, 134, 193, 0.45));
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.12);
}

.menu-fish-body::after {
  left: 0;
  top: 20px;
  width: 34px;
  height: 26px;
  background: linear-gradient(135deg, rgba(130, 246, 255, 0.62), rgba(46, 134, 193, 0.28));
  clip-path: polygon(100% 50%, 0 0, 0 100%);
}

.menu-fish-fin,
.menu-fish-eye {
  position: absolute;
}

.menu-fish-fin {
  left: 58px;
  top: 5px;
  width: 22px;
  height: 18px;
  background: rgba(160, 255, 236, 0.45);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.menu-fish-eye {
  left: 80px;
  top: 28px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(7, 25, 39, 0.8);
}

#startScreen>div.start-title {
  display: none;
}

.start-title {
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, #00d4ff, #00ff88, #ffdd00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  margin-bottom: 8px;
  letter-spacing: 2px;
  animation: none;
}

.title-image {
  display: block;
  width: min(554px, 62vw);
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
  order: -1;
  animation: none;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.slogan-image {
  display: block;
  width: min(356px, 62vw);
  max-width: 100%;
  height: auto;
  margin-bottom: 26px;
  order: -1;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.38));
}

/* Global Copyright Footer */
.global-copyright {
  position: fixed;
  right: 20px;
  /* Default: Right on PC */
  bottom: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: right;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 20px;
  border-radius: 30px 30px 30px 30px;
  margin-bottom: 5px;
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  z-index: 12;
  pointer-events: auto;
  max-width: 90vw;
  transition: all 0.3s ease;
}

/* Underwater Ambient Decoration Styling */
.underwater-bg-decor {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  opacity: 0.6;
}

.water-ray {
  position: absolute;
  top: -100px;
  width: 30vw;
  height: 200vh;
  background: linear-gradient(to right, transparent, rgba(135, 233, 255, 0.08), transparent);
  transform: rotate(-25deg);
  filter: blur(100px);
  animation: rayPulse 12s infinite alternate ease-in-out;
}

.ray-1 {
  left: 10%;
  animation-delay: -2s;
}

.ray-2 {
  left: 55%;
  animation-delay: -7s;
}

@keyframes rayPulse {
  0% {
    opacity: 0.2;
    transform: rotate(-25deg) translateX(-20px);
  }

  100% {
    opacity: 0.8;
    transform: rotate(-22deg) translateX(20px);
  }
}

.water-particle {
  position: absolute;
  background: white;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.3;
  animation: floatUp 25s infinite linear;
}

.p1 {
  width: 40px;
  height: 40px;
  left: 15%;
  bottom: -50px;
  animation-duration: 28s;
}

.p2 {
  width: 60px;
  height: 60px;
  left: 80%;
  bottom: -70px;
  animation-duration: 35s;
  animation-delay: -5s;
}

.p3 {
  width: 30px;
  height: 30px;
  left: 45%;
  bottom: -40px;
  animation-duration: 22s;
  animation-delay: -12s;
}

.p4 {
  width: 50px;
  height: 50px;
  left: 70%;
  bottom: -90px;
  animation-duration: 40s;
  animation-delay: -20s;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }

  20% {
    opacity: 0.4;
  }

  80% {
    opacity: 0.4;
  }

  100% {
    transform: translateY(-110vh) translateX(50px) scale(1.2);
    opacity: 0;
  }
}

/* ── Menu Decoration: Plants & Rocks ── */
.menu-decor {
  position: absolute;
  bottom: 0;
  pointer-events: none;
  transform-origin: bottom center;
  will-change: transform;
  z-index: 2;
  opacity: 0.5;
  filter: blur(1px);
}

/* Left plant */
.decor-plant-l {
  left: -20px;
  width: 180px;
  animation: plantSway 9s ease-in-out infinite;
  animation-delay: -2s;
}

/* Right plant */
.decor-plant-r {
  right: -20px;
  width: 200px;
  animation: plantSwayReverse 11s ease-in-out infinite;
  animation-delay: -5s;
}

/* Left rock */
.decor-rock-l {
  left: 60px;
  width: 140px;
  animation: rockSway 16s ease-in-out infinite;
  animation-delay: -4s;
}

/* Right rock */
.decor-rock-r {
  right: 60px;
  width: 150px;
  animation: rockSway 13s ease-in-out infinite;
  animation-delay: -9s;
}

@keyframes plantSway {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

@keyframes plantSwayReverse {

  0%,
  100% {
    transform: rotate(5deg);
  }

  50% {
    transform: rotate(-5deg);
  }
}

@keyframes rockSway {

  0%,
  100% {
    transform: rotate(-1deg);
  }

  50% {
    transform: rotate(1deg);
  }
}

body.assets-loading .global-copyright {
  display: none !important;
}

body.game-active .global-copyright {
  display: none !important;
}

.global-copyright a {
  color: #7ef0ff;
  text-decoration: none;
  font-weight: 700;
}

.global-copyright a:hover {
  text-decoration: underline;
  color: #b4f7ff;
}

#startScreen>*:not(.menu-bubbles):not(.menu-fish) {
  position: relative;
  z-index: 2;
}

@keyframes titlePulse {

  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.04);
    filter: brightness(1.2);
  }
}

@keyframes menuBubbleRise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.85);
    opacity: 0;
  }

  10% {
    opacity: 0.7;
  }

  100% {
    transform: translate3d(var(--drift, 0px), -118vh, 0) scale(1.15);
    opacity: 0;
  }
}

@keyframes menuFishSwim {
  0% {
    transform: scale(var(--fish-scale)) translateX(0) translateY(var(--drift-y-start, 0px));
    opacity: 0;
  }

  10% {
    opacity: 0.2;
  }

  50% {
    transform: scale(var(--fish-scale)) translateX(62vw) translateY(var(--drift-y-mid, 10px));
    opacity: 0.3;
  }

  100% {
    transform: scale(var(--fish-scale)) translateX(132vw) translateY(var(--drift-y-end, -8px));
    opacity: 0;
  }
}

@keyframes menuFishSwimReverse {
  0% {
    transform: scaleX(-1) scale(var(--fish-scale)) translateX(0) translateY(var(--drift-y-start, 0px));
    opacity: 0;
  }

  10% {
    opacity: 0.18;
  }

  50% {
    transform: scaleX(-1) scale(var(--fish-scale)) translateX(-62vw) translateY(var(--drift-y-mid, -10px));
    opacity: 0.28;
  }

  100% {
    transform: scaleX(-1) scale(var(--fish-scale)) translateX(-132vw) translateY(var(--drift-y-end, 8px));
    opacity: 0;
  }
}

.start-subtitle {
  display: none;
}

.option-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 22px 28px;
  margin-bottom: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  width: min(380px, 100%);
  min-width: 0;
}

#startScreen>.option-box {
  display: none;
}

#startScreen>.option-box.merged-settings {
  display: none;
}

.option-box h3 {
  color: #7ec8e3;
  font-size: 16px;
  margin-bottom: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.setting-row strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: 1px;
}

.setting-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.toggle-label {
  color: #ccc;
  font-size: 15px;
}

.toggle-label.active {
  color: #00ff88;
  font-weight: 700;
}



.start-btn {
  display: grid;
  place-items: center;
  width: 240px;
  max-width: 55vw;
  min-width: 180px;
  height: 120px;
  padding: 0;
  font-size: 0;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: transparent url('../images/button.webp?v=20260401-menufix') center center / contain no-repeat;
  color: #fff;
  letter-spacing: 2px;
  transition: all 0.3s;
  box-shadow: none;
  margin-top: 2px;
  font-family: 'Press Start 2P', 'VT323', 'Courier New', monospace;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(7, 25, 39, 0.85);
  touch-action: manipulation;
}

.start-btn::after {
  content: '';
}

.start-btn:hover {
  transform: translateY(-3px) scale(1.05);
  filter: drop-shadow(0 10px 26px rgba(0, 206, 201, 0.35));
}

.start-btn.is-loading {
  cursor: progress;
  opacity: 0.72;
  filter: saturate(0.7) brightness(0.92);
  transform: none;
}

.start-btn.is-loading:hover {
  transform: none;
  filter: saturate(0.7) brightness(0.92);
}

.start-status {
  min-height: 24px;
  margin-top: 6px;
  color: rgba(232, 248, 255, 0.9);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 8px rgba(4, 17, 29, 0.55);
  line-height: 1.45;
  max-width: min(340px, 100%);
}

.start-status.ready {
  color: #9dffd5;
}

@media (max-width: 768px) {
  #startScreen {
    justify-content: flex-start;
    padding-top: calc(var(--safe-top) + 6vh);
    padding-bottom: calc(var(--safe-bottom) + 80px);
    /* Space for bottom words */
  }

  .title-image {
    width: min(480px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right)));
    height: auto;
    margin-top: 6px;
    margin-bottom: 10px;
    filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.4));
  }

  .option-box {
    padding: 20px 16px;
    margin-bottom: 20px;
  }

  .option-box h3 {
    font-size: 14px;
    letter-spacing: 1px;
  }

  .toggle-container {
    gap: 10px;
    flex-wrap: wrap;
  }

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .setting-row strong {
    font-size: 14px;
  }

  .toggle-label {
    font-size: 14px;
  }

  .start-btn {
    width: min(300px, 100%);
    margin-top: 2px;
  }

  #startSettingsBtn {
    width: 128px;
    height: 62px;
    margin-bottom: 12px;
  }

  .start-status {
    margin-top: 10px;
  }

  /* Copyright centered on mobile */
  .global-copyright {
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    bottom: 0;
    margin-bottom: 0;
    font-size: 12px;
    border-radius: 20px 20px 0 0;
  }
}

@media (max-width: 480px) {
  #startScreen {
    padding:
      calc(var(--safe-top) + 14px) calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 12px);
  }

  .slogan-image {
    width: min(280px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 24px));
    margin-bottom: 14px;
  }

  .option-box {
    border-radius: 14px;
  }

  .start-btn {
    width: min(280px, 100%);
    min-width: 0;
  }

  .start-copyright {
    font-size: 13px;
    white-space: normal;
    width: min(100%, 360px);
    max-width: 100%;
    padding: 6px 12px;
  }

  .go-title {
    font-size: 36px;
  }

  .go-stats div {
    font-size: 16px;
  }

  .go-stats span {
    font-size: 20px;
  }

  .restart-btn {
    padding: 8px 24px;
    font-size: 14px;
  }

  #gameSettingsBtn,
  #gameSettingsBtn.btn-circular,
  #gameSettingsBtn.btn-pause-new {
    top: calc(var(--safe-top) + 6px);
    right: calc(var(--safe-right) + 6px);
    width: clamp(26px, 8vw, 34px) !important;
    height: clamp(26px, 8vw, 34px) !important;
    min-width: clamp(26px, 8vw, 34px) !important;
    min-height: clamp(26px, 8vw, 34px) !important;
    font-size: 16px;
  }

  #gameSettingsBtn .pause-icon,
  #gameSettingsBtn.btn-pause-new .pause-icon {
    gap: 2px;
  }

  #gameSettingsBtn .pause-bar,
  #gameSettingsBtn.btn-pause-new .pause-bar {
    width: 2px;
    height: 8px;
  }

  #gameSettingsBtn .play-icon,
  #gameSettingsBtn.btn-pause-new .play-icon {
    border-left-width: 6px;
    border-top-width: 4px;
    border-bottom-width: 4px;
    margin-left: 1px;
  }
}

@media (max-width: 768px) {

  #gameSettingsBtn,
  #gameSettingsBtn.btn-circular,
  #gameSettingsBtn.btn-pause-new {
    top: calc(var(--safe-top) + 6px);
    right: calc(var(--safe-right) + 6px);
    width: clamp(24px, 7vw, 34px) !important;
    height: clamp(24px, 7vw, 34px) !important;
    min-width: clamp(24px, 7vw, 34px) !important;
    min-height: clamp(24px, 7vw, 34px) !important;
  }

  #gameSettingsBtn .pause-icon,
  #gameSettingsBtn.btn-pause-new .pause-icon {
    gap: 2px;
  }

  #gameSettingsBtn .pause-bar,
  #gameSettingsBtn.btn-pause-new .pause-bar {
    width: 2px;
    height: 7px;
  }

  #gameSettingsBtn .play-icon,
  #gameSettingsBtn.btn-pause-new .play-icon {
    border-left-width: 5px;
    border-top-width: 3px;
    border-bottom-width: 3px;
    margin-left: 1px;
  }
}

@media (max-width: 480px) {

  .btn-close-new,
  .btn-settings-menu {
    padding: 8px 12px;
    min-width: 90px;
    font-size: 13px;
    margin: 4px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  #startScreen {
    justify-content: flex-start;
    padding:
      calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 16px);
  }

  .title-image {
    width: min(360px, 42vw);
    margin-bottom: 6px;
  }

  .slogan-image {
    width: min(220px, 28vw);
    margin-bottom: 12px;
  }

  #startSettingsBtn {
    width: 116px;
    height: 56px;
    margin-bottom: 8px;
  }

  .start-btn {
    width: min(240px, 54vw);
  }
}

html.is-compact-landscape {
  --hud-compact: 0.85;
}

html.is-compact-landscape .hud-evolution {
  top: calc(var(--safe-top) + 6px);
  left: calc(var(--safe-left) + 8px);
  width: min(292px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 136px));
  transform: none;
}

html.is-compact-landscape .hud-area {
  top: calc(var(--safe-top) + 6px);
  transform: translateX(-50%);
  animation: none;
}

html.is-compact-landscape .hud-resources {
  top: calc(var(--safe-top) + 8px);
  right: calc(var(--safe-right) + 84px);
  transform: none;
  gap: 4px;
}

html.is-compact-landscape #gameSettingsBtn,
html.is-compact-landscape #gameSettingsBtn.btn-circular,
html.is-compact-landscape #gameSettingsBtn.btn-pause-new {
  top: calc(var(--safe-top) + 4px);
  right: calc(var(--safe-right) + 4px);
  width: clamp(24px, 8vh, 32px) !important;
  height: clamp(24px, 8vh, 32px) !important;
  min-width: clamp(24px, 8vh, 32px) !important;
  min-height: clamp(24px, 8vh, 32px) !important;
}

html.is-ultra-compact-landscape {
  --hud-compact: 0.72;
}

html.is-ultra-compact-landscape .hud-evolution {
  width: min(250px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 118px));
}

html.is-ultra-compact-landscape .evolution-row {
  height: 36px;
}

html.is-ultra-compact-landscape .evo-fish {
  width: 34px;
  height: 34px;
}

html.is-ultra-compact-landscape .xp-bar {
  height: 11px;
}

html.is-ultra-compact-landscape .area-badge {
  padding: 2px 10px 4px;
  font-size: 11px;
}

html.is-ultra-compact-landscape .resource__label {
  display: none;
}

html.is-compact-landscape #startScreen {
  justify-content: center;
  gap: clamp(4px, 1.2vh, 10px);
  min-height: var(--app-vh);
  padding:
    calc(var(--safe-top) + max(8px, 2vh)) calc(var(--safe-right) + max(10px, 2vw)) calc(var(--safe-bottom) + max(8px, 2vh)) calc(var(--safe-left) + max(10px, 2vw));
}

html.is-compact-landscape .title-image {
  width: min(320px, 36vw, calc(var(--app-vh) * 0.76));
  margin-bottom: clamp(2px, 0.8vh, 6px);
}

html.is-compact-landscape .slogan {
  font-size: clamp(16px, 3.5vw, 28px);
  letter-spacing: clamp(0.5px, 0.3vw, 2px);
  margin-bottom: clamp(4px, 1.4vh, 10px);
  animation: none;
}

html.is-compact-landscape .main-menu-actions {
  gap: clamp(12px, 3.8vw, 24px);
  margin-top: clamp(4px, 1.5vh, 12px);
}

html.is-compact-landscape .btn-start-new {
  width: clamp(74px, 20vh, 98px) !important;
  height: clamp(74px, 20vh, 98px) !important;
  min-width: clamp(74px, 20vh, 98px) !important;
}

html.is-compact-landscape .btn-settings-new {
  width: clamp(54px, 15vh, 72px) !important;
  height: clamp(54px, 15vh, 72px) !important;
  min-width: clamp(54px, 15vh, 72px) !important;
}

html.is-compact-landscape .play-icon-css {
  border-left-width: clamp(22px, 5.8vh, 30px);
  border-top-width: clamp(14px, 3.8vh, 19px);
  border-bottom-width: clamp(14px, 3.8vh, 19px);
  margin-left: clamp(4px, 1.1vh, 7px);
}

html.is-compact-landscape .btn-settings-new .btn-icon {
  width: clamp(26px, 7.2vh, 38px);
  height: clamp(26px, 7.2vh, 38px);
  min-width: clamp(26px, 7.2vh, 38px);
}

html.is-compact-landscape .menu-fish-item {
  width: clamp(124px, 17vw, 170px);
  height: clamp(68px, 9.5vw, 94px);
  opacity: 0.42;
}

html.is-compact-landscape .menu-decor {
  opacity: 0.4;
}

html.is-compact-landscape .decor-plant-l {
  width: clamp(96px, 13vw, 160px);
}

html.is-compact-landscape .decor-plant-r {
  width: clamp(104px, 14vw, 176px);
}

html.is-compact-landscape .decor-rock-l {
  width: clamp(70px, 9vw, 124px);
}

html.is-compact-landscape .decor-rock-r {
  width: clamp(78px, 10vw, 132px);
}

html.is-compact-landscape .game-decor {
  opacity: 0.42;
}

html.is-compact-landscape .game-decor.d1 {
  width: clamp(92px, 14vw, 180px);
  bottom: -1vh;
}

html.is-compact-landscape .game-decor.d2 {
  width: clamp(104px, 15vw, 190px);
  bottom: -2vh;
}

html.is-compact-landscape .game-decor.d3 {
  width: clamp(112px, 16vw, 210px);
  bottom: -2vh;
}

html.is-compact-landscape .game-decor.d4 {
  width: clamp(118px, 17vw, 220px);
  bottom: -1vh;
}

html.is-compact-landscape .global-copyright {
  left: auto;
  right: calc(var(--safe-right) + 8px);
  bottom: calc(var(--safe-bottom) + 4px);
  transform: none;
  font-size: 11px;
  padding: 4px 10px;
  max-width: 44vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.is-ultra-compact-landscape .title-image {
  width: min(270px, 32vw, calc(var(--app-vh) * 0.64));
}

html.is-ultra-compact-landscape .slogan {
  font-size: clamp(14px, 3vw, 22px);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

html.is-ultra-compact-landscape .main-menu-actions {
  gap: 10px;
  margin-top: 2px;
}

html.is-ultra-compact-landscape .btn-start-new {
  width: clamp(66px, 17vh, 84px) !important;
  height: clamp(66px, 17vh, 84px) !important;
  min-width: clamp(66px, 17vh, 84px) !important;
}

html.is-ultra-compact-landscape .btn-settings-new {
  width: clamp(48px, 13vh, 62px) !important;
  height: clamp(48px, 13vh, 62px) !important;
  min-width: clamp(48px, 13vh, 62px) !important;
}

html.is-ultra-compact-landscape .play-icon-css {
  border-left-width: clamp(18px, 5vh, 24px);
  border-top-width: clamp(12px, 3.2vh, 16px);
  border-bottom-width: clamp(12px, 3.2vh, 16px);
}

html.is-ultra-compact-landscape .btn-settings-new .btn-icon {
  width: clamp(22px, 6vh, 30px);
  height: clamp(22px, 6vh, 30px);
  min-width: clamp(22px, 6vh, 30px);
}

html.is-ultra-compact-landscape .menu-fish-item {
  width: clamp(108px, 14vw, 142px);
  height: clamp(58px, 7.8vw, 78px);
  opacity: 0.34;
}

html.is-ultra-compact-landscape .menu-decor {
  opacity: 0.32;
}

html.is-ultra-compact-landscape .game-decor.d1 {
  width: clamp(84px, 12vw, 150px);
}

html.is-ultra-compact-landscape .game-decor.d2 {
  width: clamp(92px, 13vw, 165px);
}

html.is-ultra-compact-landscape .game-decor.d3 {
  width: clamp(100px, 14vw, 178px);
}

html.is-ultra-compact-landscape .game-decor.d4 {
  width: clamp(104px, 14.5vw, 188px);
}

html.is-compact-landscape #gameOverScreen {
  padding:
    calc(var(--safe-top) + 12px) calc(var(--safe-right) + 14px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 14px);
}

html.is-compact-landscape .go-title {
  font-size: clamp(34px, 7vh, 48px);
  margin-bottom: 6px;
}

html.is-compact-landscape .go-stats {
  margin: 14px 0 16px;
}

html.is-compact-landscape .go-stats div {
  font-size: clamp(14px, 3vh, 18px);
  margin: 5px 0;
}

html.is-compact-landscape .go-stats span {
  font-size: clamp(18px, 3.6vh, 22px);
}

html.is-compact-landscape .btn-playagain,
html.is-compact-landscape .btn-gomenu {
  padding: 13px 28px !important;
  min-width: 180px;
  font-size: clamp(15px, 3.2vh, 18px);
  margin-bottom: 16px;
}

html.is-ultra-compact-landscape .btn-playagain,
html.is-ultra-compact-landscape .btn-gomenu {
  padding: 11px 24px !important;
  min-width: 164px;
  font-size: clamp(14px, 2.9vh, 16px);
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .go-title {
    font-size: 44px;
  }

  .go-stats div {
    font-size: 18px;
  }

  .go-stats span {
    font-size: 22px;
  }

  .restart-btn {
    padding: 14px 44px;
    font-size: 18px;
  }
}

/* Game Over */
#gameOverScreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--safe-top) + 18px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 18px) calc(var(--safe-left) + 20px);
  overflow-y: auto;
  z-index: 100;
  background: rgba(5, 10, 25, 0.92);
  backdrop-filter: blur(12px);
}

.go-title {
  font-size: 64px;
  font-weight: 900;
  color: #ff4757;
  margin-bottom: 10px;
  text-shadow: 0 0 40px rgba(255, 71, 87, 0.5);
}

.go-stats {
  text-align: center;
  margin: 24px 0;
}

.go-stats div {
  font-size: 20px;
  color: #a0b0cc;
  margin: 8px 0;
}

.go-stats span {
  color: #ffdd57;
  font-weight: 700;
  font-size: 26px;
}

.restart-btn {
  padding: 16px 60px;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  letter-spacing: 2px;
  transition: all 0.3s;
  box-shadow: 0 6px 30px rgba(108, 92, 231, 0.4);
  margin-top: 10px;
  touch-action: manipulation;
}

.restart-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 40px rgba(108, 92, 231, 0.6);
}

/* Old settings button styling removed - now uses btn-settings-new class */

#gameSettingsBtn,
#gameSettingsBtn.btn-circular,
#gameSettingsBtn.btn-pause-new {
  position: fixed;
  top: calc(var(--safe-top) + 6px);
  right: calc(var(--safe-right) + 6px);
  width: clamp(26px, 7vw, 38px) !important;
  height: clamp(26px, 7vw, 38px) !important;
  min-width: clamp(26px, 7vw, 38px) !important;
  min-height: clamp(26px, 7vw, 38px) !important;
  display: none !important;
  z-index: 120;
  touch-action: manipulation;
  background: linear-gradient(180deg, #ffc107 0%, #ffb300 30%, #ff8f00 50%, #ff6f00 100%) !important;
  box-shadow:
    0 0 0 3px #ffe082,
    0 0 0 4.5px #e65100,
    0 3.5px 0 #bf360c,
    0 5px 10px rgba(0, 0, 0, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2) !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#gameSettingsBtn:hover {
  transform: scale(1.08) translateY(-1px);
  box-shadow:
    0 0 0 3px #ffecb3,
    0 0 0 4.5px #ff8f00,
    0 4.5px 0 #bf360c,
    0 7px 15px rgba(0, 0, 0, 0.35);
}

#gameSettingsBtn:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 3px #ffe082,
    0 0 0 4.5px #e65100,
    0 1px 0 #bf360c,
    0 2px 6px rgba(0, 0, 0, 0.35);
}

body.game-active #gameSettingsBtn {
  display: flex !important;
}

body.game-active.settings-open #gameSettingsBtn {
  background: linear-gradient(180deg, #00e676 0%, #00c853 100%) !important;
  box-shadow:
    0 0 0 3px #b2fab4,
    0 0 0 4.5px #00814a,
    0 3.5px 0 #006032,
    0 5px 10px rgba(0, 0, 0, 0.35);
}

#settingsOverlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px;
  z-index: 2500;
  background: rgba(1, 43, 77, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#settingsOverlay.open {
  display: flex !important;
}

.settings-modal {
  width: 100%;
  max-width: 480px;
  background: rgba(1, 87, 155, 0.9);
  border-radius: 25px;
  padding: 35px;
  border: 3px solid rgba(79, 195, 247, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 30px rgba(3, 169, 244, 0.2);
  margin: auto;
  position: relative;
}

.settings-title {
  color: #4fc3f7;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
  text-align: center;
  font-family: 'Russo One', sans-serif;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid rgba(79, 195, 247, 0.2);
}

.setting-row:last-of-type {
  border-bottom: none;
  margin-bottom: 25px;
}

.setting-label {
  color: #e1f5fe;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.setting-value {
  color: #81d4fa;
  font-size: 14px;
  min-width: 65px;
  text-align: center;
  font-weight: 600;
  opacity: 0.5;
}

.setting-value.active {
  color: #00e676;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
  opacity: 1;
}

.toggle-switch {
  position: relative;
  width: 64px;
  height: 32px;
  background: linear-gradient(180deg, #002b4d 0%, #001a33 100%);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  border: 1px solid rgba(79, 195, 247, 0.2);
}

.toggle-switch.active {
  background: linear-gradient(180deg, #00e676 0%, #00c853 100%);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #e1f5fe;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(31px);
}

.button-row {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.footer-text {
  margin-top: 25px;
  color: rgba(225, 245, 254, 0.5);
  font-size: 12px;
  text-align: center;
}


/* Main menu container */
.main-menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  z-index: 1;
  margin-top: 60px;
}

/* Slogan styling */
.slogan {
  font-family: 'Russo One', 'Arial Black', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  margin-bottom: 20px;
  text-shadow:
    3px 3px 0px #01579b,
    -1px -1px 0px #01579b,
    1px -1px 0px #01579b,
    -1px 1px 0px #01579b,
    0px 4px 0px #014377,
    0px 8px 15px rgba(0, 0, 0, 0.4);
  animation: none;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {

  0%,
  100% {
    text-shadow: 0 0 20px rgba(255, 82, 82, 0.6), 0 0 40px rgba(255, 82, 82, 0.4);
    transform: scale(1);
  }

  50% {
    text-shadow: 0 0 30px rgba(255, 82, 82, 0.9), 0 0 60px rgba(255, 82, 82, 0.6);
    transform: scale(1.02);
  }
}

.slogan-word {
  display: inline-block;
  margin: 0 8px;
}

.slogan-word.coral {
  color: #ffccbc;
  text-shadow:
    3px 3px 0px #bf360c,
    -1px -1px 0px #bf360c,
    1px -1px 0px #bf360c,
    -1px 1px 0px #bf360c,
    0px 4px 0px #870000,
    0px 8px 15px rgba(0, 0, 0, 0.4);
}

/* Start screen styling removed - let original CSS handle it */

.setting-row:last-of-type {
  border-bottom: none;
  margin-bottom: 25px;
}

.setting-label {
  color: #e1f5fe;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.setting-value {
  color: #81d4fa;
  font-size: 14px;
  min-width: 60px;
  text-align: right;
  font-weight: 600;
}

.setting-value.active {
  color: #00e676;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

/* Toggle Switch - newui2.html style */
.toggle-switch {
  position: relative;
  width: 60px;
  height: 32px;
  background: linear-gradient(180deg, #002b4d 0%, #001a33 100%);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(79, 195, 247, 0.2);
}

.toggle-switch.active {
  background: linear-gradient(180deg, #00e676 0%, #00c853 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 230, 118, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: linear-gradient(180deg, #e1f5fe 0%, #b3e5fc 100%);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(28px);
}

/* Footer text */
.footer-text {
  text-align: center;
  color: #4fc3f7;
  font-size: 13px;
  margin-top: 20px;
  opacity: 0.7;
}

/* Level Complete Screen */
#levelCompleteScreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--safe-top) + 18px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 18px) calc(var(--safe-left) + 20px);
  overflow-y: auto;
  z-index: 100;
  background: rgba(0, 20, 40, 0.88);
  backdrop-filter: blur(14px);
}

.lc-title {
  font-size: 58px;
  font-weight: 900;
  background: linear-gradient(135deg, #00ff88, #00d4ff, #ffdd00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  animation: lcPulse 2s ease-in-out infinite;
  text-align: center;
}

@keyframes lcPulse {

  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.06);
    filter: brightness(1.3);
  }
}

.lc-stage {
  font-size: 26px;
  color: #a0b0cc;
  margin-bottom: 18px;
  text-align: center;
}

.lc-stage span {
  color: #ffdd57;
  font-weight: 700;
}

.lc-stats {
  text-align: center;
  margin: 18px 0;
}

.lc-stats div {
  font-size: 20px;
  color: #a0b0cc;
  margin: 8px 0;
}

.lc-stats span {
  color: #00ff88;
  font-weight: 700;
  font-size: 24px;
}

.lc-next-btn {
  padding: 16px 60px;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: #fff;
  letter-spacing: 2px;
  transition: all 0.3s;
  box-shadow: 0 6px 30px rgba(0, 206, 201, 0.4);
  margin-top: 14px;
  touch-action: manipulation;
}

.lc-next-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 40px rgba(0, 206, 201, 0.6);
}

.lc-victory {
  font-size: 28px;
  color: #ffdd57;
  margin-top: 12px;
  margin-bottom: 18px;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(255, 221, 87, 0.5);
}

@media (max-width: 480px) {
  .lc-title {
    font-size: 36px;
  }

  .lc-stage {
    font-size: 20px;
  }

  .lc-stats div {
    font-size: 16px;
  }

  .lc-stats span {
    font-size: 20px;
  }

  .lc-next-btn {
    padding: 12px 36px;
    font-size: 16px;
  }
}

/* Tutorial Screen */
#tutorialScreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 200;
  background: rgba(0, 10, 30, 0.4);
  /* More transparent background */
  backdrop-filter: blur(8px);
  /* Subtle blur behind the div */
  padding:
    calc(var(--safe-top) + 20px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 20px) calc(var(--safe-left) + 20px);
}

.tutorial-box {
  max-width: min(720px, 95vw);
  width: 95%;
  max-height: calc(var(--app-vh) - var(--safe-top) - var(--safe-bottom) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  /* Glassmorphism styling */
  background: rgba(10, 30, 60, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: clamp(16px, 4vw, 24px);
  padding: clamp(16px, 4vw, 30px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tutorial-title {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  /* Smaller title */
  text-align: center;
  margin-bottom: clamp(12px, 3vw, 20px);
  background: linear-gradient(135deg, #00d4ff, #00ff88);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tutorial-visual-sequence {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.5vw, 15px);
  width: 100%;
  margin-bottom: clamp(12px, 3vw, 20px);
}

/* -- Tutorial Carousel -- */
.tut-carousel {
  gap: 0;
  overflow: hidden;
}

.tut-carousel-viewport {
  width: 100%;
  overflow: hidden;
  border-radius: clamp(12px, 3vw, 16px);
}

.tut-carousel-track {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.tut-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tut-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: clamp(8px, 2vw, 14px) 0 0;
}

.tut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1.5px solid rgba(0, 212, 255, 0.35);
  cursor: pointer;
  transition: all 0.25s ease;
  touch-action: manipulation;
}

.tut-dot.active {
  background: #00d4ff;
  border-color: #00d4ff;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.55);
  transform: scale(1.25);
}

.tut-dot:hover {
  background: rgba(0, 212, 255, 0.5);
}

/* Tutorial close button */
.tut-close-btn {
  position: absolute;
  top: clamp(10px, 2vw, 16px);
  right: clamp(10px, 2vw, 16px);
  width: clamp(30px, 6vw, 38px);
  height: clamp(30px, 6vw, 38px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 71, 87, 0.18);
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(14px, 3vw, 18px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  touch-action: manipulation;
  z-index: 10;
}

.tut-close-btn:hover {
  background: rgba(255, 71, 87, 0.55);
  border-color: #ff4757;
  color: #fff;
}

/* Tutorial nav row */
.tut-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: clamp(10px, 2.5vw, 16px);
  gap: 8px;
}

/* Tutorial nav buttons (Back / Next) */
.tut-nav-btn {
  width: clamp(38px, 8vw, 50px);
  height: clamp(38px, 8vw, 50px);
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.45);
  background: rgba(0, 212, 255, 0.12);
  color: #00d4ff;
  font-size: clamp(18px, 4vw, 24px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  touch-action: manipulation;
  flex-shrink: 0;
}

.tut-nav-btn:hover {
  background: rgba(0, 212, 255, 0.3);
  border-color: #00d4ff;
  transform: scale(1.08);
}

.tut-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}

/* Continue button visibility control */
.tut-continue-hidden {
  display: none !important;
}

.tut-continue-visible {
  display: inline-flex !important;
  margin-top: clamp(10px, 2.5vw, 16px);
}

.tut-row {
  display: flex;
  align-items: center;
  background: rgba(0, 40, 80, 0.4);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(10px, 2.5vw, 15px) clamp(12px, 3vw, 20px);
  gap: clamp(12px, 3vw, 24px);
}

.tut-scene {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: clamp(160px, 35vw, 240px);
  min-width: clamp(140px, 30vw, 200px);
  background: rgba(0, 0, 0, 0.3);
  padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 20px);
  border-radius: clamp(8px, 2vw, 12px);
}

.tut-fish {
  height: clamp(28px, 7vw, 40px);
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.tut-fish.tut-enemy {
  height: clamp(38px, 10vw, 55px);
  transform: scaleX(-1);
}

.tut-fish.tut-target {
  height: clamp(18px, 5vw, 25px);
  transform: scaleX(-1);
}

.tut-fish.tut-phase2 {
  height: clamp(38px, 10vw, 55px);
}

.tut-badge {
  font-size: clamp(10px, 2.5vw, 13px);
  font-weight: 800;
  padding: clamp(3px, 1vw, 4px) clamp(6px, 1.5vw, 8px);
  border-radius: clamp(4px, 1.5vw, 6px);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tut-badge.eat {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  border: 1px solid #00ff88;
}

.tut-badge.avoid {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border: 1px solid #ff4757;
}

.tut-badge.evolve {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  border: 1px solid #00d4ff;
}

.tut-text {
  text-align: left;
}

.tut-text h4 {
  margin: 0 0 clamp(4px, 1vw, 6px) 0;
  color: #fff;
  font-size: clamp(14px, 4vw, 19px);
}

.tut-text p {
  margin: 0;
  color: #a0b0cc;
  font-size: clamp(12px, 3vw, 15px);
  line-height: 1.4;
}

.tutorial-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.tutorial-steps li {
  font-size: 17px;
  color: #c0d0e0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.tutorial-steps li:last-child {
  border-bottom: none;
}

.tutorial-steps .step-icon {
  font-size: 24px;
  min-width: 36px;
  text-align: center;
}

.tutorial-steps .step-text b {
  color: #00ff88;
}

.tutorial-dontshow {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 10px);
  margin: clamp(10px, 2.5vw, 18px) 0 clamp(16px, 3vw, 24px) 0;
  cursor: pointer;
  color: #7ef0ff;
  font-size: clamp(12px, 3vw, 15px);
  margin-top: clamp(6px, 1.5vw, 10px);
  font-weight: 600;
}

.tutorial-dontshow input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00d4ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0px;
  color: #00ff88;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}

.tutorial-dontshow input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tutorial-start-btn {
  background: linear-gradient(135deg, #00ff88, #00d4ff);
  color: #0c1a2d;
  border: none;
  padding: 16px 48px;
  border-radius: 30px;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  touch-action: manipulation;
}

.tutorial-start-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

@media (max-width: 480px) {
  .tutorial-title {
    font-size: 26px;
  }

  .tutorial-box {
    padding: 24px 18px;
  }
}

@media (max-height: 760px) {

  #levelCompleteScreen,
  #tutorialScreen,
  #settingsOverlay {
    justify-content: flex-start;
  }

  #gameOverScreen {
    justify-content: center;
  }

  .settings-modal,
  .tutorial-box {
    border-radius: 18px;
  }

  .settings-modal {
    padding: 18px 16px;
  }

  .settings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-resume {
    min-width: 0;
    width: 100%;
  }

  .go-title,
  .lc-title {
    font-size: 42px;
  }

  /* Tutorial mobile adjustments */
  .tut-row {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .tut-scene {
    width: 100%;
    min-width: auto;
    justify-content: center;
  }

  .go-stats,
  .lc-stats {
    margin: 14px 0;
  }

  .go-stats div,
  .lc-stats div {
    font-size: 16px;
    margin: 6px 0;
  }

  .go-stats span,
  .lc-stats span {
    font-size: 20px;
  }

  .restart-btn,
  .lc-next-btn,
  .tutorial-start-btn {
    padding: 14px 30px;
    font-size: 17px;
  }

  .tutorial-box {
    width: min(100%, 720px);
    padding: 22px 16px;
  }

  .tutorial-title {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .tutorial-visual-sequence {
    margin-bottom: 16px;
  }

  .tut-row {
    flex-direction: column;
    text-align: center;
    padding: 12px;
    gap: 12px;
  }

  .tut-scene {
    width: 100%;
    justify-content: center;
    gap: 15px;
  }

  .tut-text {
    text-align: center;
  }

  .tutorial-steps li {
    font-size: 15px;
    padding: 8px 0;
  }

  .tutorial-dontshow {
    margin-bottom: 18px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {

  #gameOverScreen,
  #levelCompleteScreen,
  #tutorialScreen,
  #settingsOverlay {
    justify-content: center;
    padding:
      calc(var(--safe-top) + 10px) calc(var(--safe-right) + 10px) calc(var(--safe-bottom) + 10px) calc(var(--safe-left) + 10px);
  }

  .settings-modal {
    width: min(420px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 20px));
    max-height: calc(var(--app-vh) - var(--safe-top) - var(--safe-bottom) - 20px);
    padding: 16px 14px;
    overflow: hidden;
  }

  .settings-title {
    font-size: 24px;
    margin-bottom: 14px;
  }

  .setting-row {
    padding: 12px 0;
  }

  .setting-row:last-of-type {
    margin-bottom: 14px;
  }

  .setting-label {
    font-size: 15px;
  }

  .setting-control {
    gap: 8px;
  }

  .setting-value {
    min-width: 44px;
    font-size: 12px;
  }

  .toggle-switch {
    width: 54px;
    height: 28px;
  }

  .toggle-slider {
    top: 2px;
    left: 3px;
    width: 22px;
    height: 22px;
  }

  .toggle-switch.active .toggle-slider {
    transform: translateX(25px);
  }

  .button-row {
    gap: 10px;
    margin-top: 4px;
  }

  .btn-close-new,
  .btn-settings-menu {
    padding: 10px 16px;
    min-width: 100px;
    font-size: 14px;
    margin: 6px 0 0;
  }

  .footer-text {
    margin-top: 12px;
    font-size: 11px;
  }

  .tutorial-box {
    width: min(100%, 860px);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .settings-modal {
    width: min(400px, calc(var(--app-vw) - var(--safe-left) - var(--safe-right) - 16px));
    max-height: calc(var(--app-vh) - var(--safe-top) - var(--safe-bottom) - 16px);
    padding: 14px 12px;
    border-radius: 16px;
  }

  .settings-title {
    font-size: 21px;
    margin-bottom: 10px;
  }

  .setting-row {
    padding: 10px 0;
  }

  .setting-label {
    font-size: 14px;
  }

  .toggle-switch {
    width: 50px;
    height: 26px;
  }

  .toggle-slider {
    width: 20px;
    height: 20px;
  }

  .toggle-switch.active .toggle-slider {
    transform: translateX(23px);
  }

  .btn-close-new,
  .btn-settings-menu {
    padding: 8px 14px;
    min-width: 90px;
    font-size: 13px;
  }

  .footer-text {
    margin-top: 8px;
    font-size: 10px;
  }
}

/* Danger indicator for rocket shark */
.danger-indicator {
  position: fixed;
  z-index: 50;
  pointer-events: none;
}

.danger-indicator.left {
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, rgba(255, 0, 0, 0.8), transparent);
  animation: dangerPulse 0.3s ease-in-out infinite alternate;
}

.danger-indicator.right {
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(-90deg, rgba(255, 0, 0, 0.8), transparent);
  animation: dangerPulse 0.3s ease-in-out infinite alternate;
}

.danger-indicator.bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: linear-gradient(0deg, rgba(255, 71, 87, 0.96), rgba(255, 71, 87, 0.24), transparent);
  box-shadow: 0 -8px 28px rgba(255, 71, 87, 0.34);
  animation: jellyDangerPulse 0.34s ease-in-out infinite alternate;
}

.jelly-warning-marker {
  position: fixed;
  bottom: 14px;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 28px solid rgba(255, 71, 87, 0.95);
  filter:
    drop-shadow(0 0 10px rgba(255, 71, 87, 0.55)) drop-shadow(0 -6px 16px rgba(255, 71, 87, 0.28));
  transform: translateX(-50%);
  z-index: 51;
  pointer-events: none;
  animation: jellyMarkerPulse 0.34s ease-in-out infinite alternate;
}

.jelly-warning-marker::after {
  content: "!";
  position: absolute;
  left: 50%;
  top: 11px;
  transform: translateX(-50%);
  color: #fff4f4;
  font: 900 14px/1 sans-serif;
}

@keyframes dangerPulse {
  0% {
    opacity: 0.4;
    width: 6px;
  }

  100% {
    opacity: 1;
    width: 14px;
  }
}

@keyframes jellyDangerPulse {
  0% {
    opacity: 0.42;
    height: 12px;
  }

  100% {
    opacity: 1;
    height: 22px;
  }
}

@keyframes jellyMarkerPulse {
  0% {
    opacity: 0.48;
    transform: translateX(-50%) translateY(0) scale(0.92);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px) scale(1.08);
  }
}

/* ============================================
   NEW UI BUTTON STYLES (from newui2.html)
   ============================================ */


/* Start Button - Deep Sea Purple */
.btn-start-new {
  padding: 14px 45px;
  font-size: 28px;
  color: #ede7f6;
  text-shadow: 2px 2px 0px #4527a0, -1px -1px 0px #4527a0, 0px 4px 0px #4527a0, 0px 6px 2px rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #7c4dff 0%, #651fff 30%, #512da8 50%, #4527a0 100%);
  box-shadow: 0 0 0 8px #b388ff, 0 0 0 10px #311b92, 0 12px 0 #1a237e, 0 12px 20px rgba(0, 0, 0, 0.4), inset 0 -4px 10px rgba(0, 0, 0, 0.2), inset 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-start-new:hover {
  background: linear-gradient(180deg, #b388ff 0%, #7c4dff 30%, #651fff 50%, #512da8 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 8px #d1c4e9, 0 0 0 10px #4527a0, 0 14px 0 #1a237e, 0 14px 25px rgba(0, 0, 0, 0.4), inset 0 -4px 10px rgba(0, 0, 0, 0.2), inset 0 4px 15px rgba(255, 255, 255, 0.4);
}

.btn-start-new:active {
  transform: translateY(10px);
  box-shadow: 0 0 0 8px #b388ff, 0 0 0 10px #311b92, 0 2px 0 #1a237e, 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

/* Settings Button - Teal */
.btn-settings-new {
  padding: 12px 40px;
  font-size: 24px;
  color: #e0f7fa;
  text-shadow: 1px 1px 0px #006064, -1px -1px 0px #006064, 0px 3px 0px #006064, 0px 4px 2px rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #00bcd4 0%, #00acc1 30%, #0097a7 50%, #00838f 100%);
  box-shadow: 0 0 0 6px #4dd0e1, 0 0 0 8px #00838f, 0 8px 0 #006064, 0 8px 15px rgba(0, 0, 0, 0.4), inset 0 -3px 8px rgba(0, 0, 0, 0.2), inset 0 3px 10px rgba(255, 255, 255, 0.3);
}

.btn-settings-new:hover {
  background: linear-gradient(180deg, #4dd0e1 0%, #00bcd4 30%, #00acc1 50%, #0097a7 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 6px #80deea, 0 0 0 8px #0097a7, 0 10px 0 #006064, 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 -3px 8px rgba(0, 0, 0, 0.2), inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

.btn-settings-new:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 6px #4dd0e1, 0 0 0 8px #00838f, 0 2px 0 #006064, 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

/* Pause Button - Amber/Gold */
.btn-pause-new {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffc107 0%, #ffb300 30%, #ff8f00 50%, #ff6f00 100%);
  box-shadow: 0 0 0 6px #ffe082, 0 0 0 8px #e65100, 0 8px 0 #bf360c, 0 8px 15px rgba(0, 0, 0, 0.4), inset 0 -3px 8px rgba(0, 0, 0, 0.2), inset 0 3px 10px rgba(255, 255, 255, 0.3);
}

.btn-pause-new:hover {
  background: linear-gradient(180deg, #ffe082 0%, #ffc107 30%, #ffb300 50%, #ff8f00 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 6px #ffecb3, 0 0 0 8px #ff8f00, 0 10px 0 #bf360c, 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 -3px 8px rgba(0, 0, 0, 0.2), inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

.btn-pause-new:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 6px #ffe082, 0 0 0 8px #e65100, 0 2px 0 #bf360c, 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

/* Continue Button (Tutorial) - Deep Sea Purple */
.btn-continue {
  padding: clamp(12px, 3vw, 18px) clamp(30px, 8vw, 50px);
  font-size: clamp(16px, 4vw, 22px);
  color: #ede7f6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #7c4dff 0%, #651fff 30%, #4527a0 100%);
  box-shadow:
    0 0 0 clamp(4px, 1vw, 5px) #b388ff,
    0 0 0 clamp(5px, 1.2vw, 7px) #311b92,
    0 clamp(5px, 1.5vw, 8px) 0 #1a237e,
    0 12px 25px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.btn-continue:hover {
  background: linear-gradient(180deg, #b388ff 0%, #7c4dff 30%, #651fff 50%, #512da8 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px #d1c4e9, 0 0 0 6px #4527a0, 0 10px 0 #1a237e, 0 14px 30px rgba(0, 0, 0, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.2), inset 0 2px 8px rgba(255, 255, 255, 0.35);
}

.btn-continue:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 4px #b388ff, 0 0 0 6px #311b92, 0 2px 0 #1a237e, 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 -1px 4px rgba(0, 0, 0, 0.3);
}

/* Play Again Button - Vibrant Green */
.btn-playagain {
  width: 280px;
  padding: 18px 40px;
  font-size: 20px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #00e676 0%, #00c853 30%, #00814a 100%);
  box-shadow:
    0 0 0 5px #76ff03,
    0 0 0 7px #2e7d32,
    0 8px 0 #1b5e20,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  margin-bottom: 25px;
}

.btn-playagain:hover {
  background: linear-gradient(180deg, #69f0ae 0%, #00e676 30%, #00c853 50%, #00a040 100%);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 5px #b9f6ca,
    0 0 0 7px #00a040,
    0 10px 0 #006030,
    0 14px 30px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

.btn-playagain:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 5px #69f0ae,
    0 0 0 7px #00814a,
    0 2px 0 #006030,
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

/* Game Over Main Menu Button - Alert Red */
.btn-gomenu {
  width: 280px;
  padding: 18px 40px;
  font-size: 20px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #ff5252 0%, #ff1744 30%, #b71c1c 100%);
  box-shadow:
    0 0 0 5px #ff5252,
    0 0 0 7px #b71c1c,
    0 6px 0 #7f0000,
    0 12px 25px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.btn-gomenu:hover {
  background: linear-gradient(180deg, #ff8a80 0%, #ff5252 30%, #ff1744 50%, #d50000 100%);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 5px #ff9e80,
    0 0 0 7px #d50000,
    0 10px 0 #7f0000,
    0 14px 30px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

.btn-gomenu:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 5px #ff8a80,
    0 0 0 7px #b71c1c,
    0 2px 0 #7f0000,
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

/* Next Region Button - Vibrant Green */
.btn-next-region {
  width: 280px;
  padding: 18px 40px;
  font-size: 20px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #00e676 0%, #00c853 30%, #00814a 100%);
  box-shadow:
    0 0 0 5px #76ff03,
    0 0 0 7px #2e7d32,
    0 8px 0 #1b5e20,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  margin-bottom: 25px;
}

.btn-next-region:hover {
  background: linear-gradient(180deg, #69f0ae 0%, #00e676 30%, #00c853 50%, #00a040 100%);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 5px #b9f6ca,
    0 0 0 7px #00a040,
    0 10px 0 #006030,
    0 14px 30px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

.btn-next-region:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 5px #69f0ae,
    0 0 0 7px #00814a,
    0 2px 0 #006030,
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

/* Level Complete Main Menu Button - Alert Red */
.btn-lc-menu {
  width: 280px;
  padding: 18px 40px;
  font-size: 20px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #ff5252 0%, #ff1744 30%, #d50000 50%, #b71c1c 100%);
  box-shadow:
    0 0 0 5px #ff8a80,
    0 0 0 7px #b71c1c,
    0 6px 0 #7f0000,
    0 12px 25px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.3);
}

.btn-lc-menu:hover {
  background: linear-gradient(180deg, #ff8a80 0%, #ff5252 30%, #ff1744 50%, #d50000 100%);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 5px #ff9e80,
    0 0 0 7px #d50000,
    0 10px 0 #7f0000,
    0 14px 30px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

.btn-lc-menu:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 5px #ff8a80,
    0 0 0 7px #b71c1c,
    0 2px 0 #7f0000,
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

/* Close Button (Settings) - Vibrant Green */
.btn-close-new {
  flex: 1;
  padding: 16px 30px;
  font-size: 16px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #00e676 0%, #00c853 30%, #00814a 100%);
  box-shadow:
    0 0 0 5px #76ff03,
    0 0 0 7px #2e7d32,
    0 8px 0 #1b5e20,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  /* Specular top tip fix */
}

.btn-close-new:hover {
  background: linear-gradient(180deg, #69f0ae 0%, #00e676 30%, #00c853 50%, #00a040 100%);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 5px #b9f6ca,
    0 0 0 7px #00a040,
    0 10px 0 #006030,
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.25);
}

.btn-close-new:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 5px #69f0ae,
    0 0 0 7px #00814a,
    0 2px 0 #006030,
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 -1px 4px rgba(0, 0, 0, 0.3);
}

/* Settings Main Menu Button - Alert Red */
.btn-settings-menu {
  flex: 1;
  padding: 16px 30px;
  font-size: 16px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #ff5252 0%, #ff1744 30%, #b71c1c 100%);
  box-shadow:
    0 0 0 5px #ff5252,
    0 0 0 7px #b71c1c,
    0 6px 0 #7f0000,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  /* Specular top tip fix */
}

.btn-settings-menu:hover {
  background: linear-gradient(180deg, #ff8a80 0%, #ff5252 30%, #ff1744 50%, #d50000 100%);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 5px #ff9e80,
    0 0 0 7px #d50000,
    0 10px 0 #7f0000,
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.25);
}

.btn-settings-menu:active {
  transform: translateY(6px);
  box-shadow:
    0 0 0 5px #ff8a80,
    0 0 0 7px #b71c1c,
    0 2px 0 #7f0000,
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 -1px 4px rgba(0, 0, 0, 0.3);
}

/* Pause Button internals logic */
.btn-pause-new .btn-inner {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

.pause-icon {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: center;
}

.btn-pause-new .pause-bar {
  width: 3px;
  height: 12px;
  background: #fff3e0;
  border-radius: 2px;
  box-shadow: 1px 1px 0px #bf360c;
}

.play-icon {
  display: none;
  width: 0;
  height: 0;
  border-left: 10px solid #fff3e0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(1px 1px 0px #bf360c);
  margin-left: 2px;
}

.btn-pause-new[data-state="paused"] .pause-icon {
  display: none !important;
}

.btn-pause-new[data-state="paused"] .play-icon {
  display: block !important;
}

/* ============================================================
   MODERNIZED MAIN MENU ACTIONS
   ============================================================ */

/* SLOGAN STYLING */
.slogan {
  font-family: 'Russo One', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  margin-bottom: 25px;
  text-shadow:
    3px 3px 0px #01579b,
    -1px -1px 0px #01579b,
    1px -1px 0px #01579b,
    -1px 1px 0px #01579b,
    0px 4px 0px #014377,
    0px 8px 15px rgba(0, 0, 0, 0.4);
  animation: none;
  z-index: 10;
}

@keyframes sloganFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.slogan-word {
  display: inline-block;
  margin: 0 4px;
}

.slogan-word.coral {
  color: #ffccbc;
  text-shadow:
    3px 3px 0px #bf360c,
    -1px -1px 0px #bf360c,
    1px -1px 0px #bf360c,
    -1px 1px 0px #bf360c,
    0px 4px 0px #870000,
    0px 8px 15px rgba(0, 0, 0, 0.4);
}

/* Circular Icon Button Utility - NO-STRETCH VERSION */
.btn-circular {
  flex-shrink: 0 !important;
  /* Prevents being squeezed into an oval */
  border-radius: 50% !important;
  width: 90px;
  height: 90px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* If no specific size is provided, default to 90px */
.btn-circular:not(.btn-start-new) {
  width: 90px;
  height: 90px;
}

.main-menu-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  z-index: 10;
  width: 100%;
}

/* Base Game Button - Premium 3D Look */
.game-button-new {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border-radius: 50px;
  outline: none;
  box-sizing: border-box;
  overflow: hidden;
  /* CRITICAL: clips the ::before gloss */
  font-family: 'Russo One', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Common Gloss effect (Glassy Highlight) */
.game-button-new::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* Covers exactly the top half */
  height: 50%;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0.25) 50%,
      rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Inner overlay rim from newui2.html */
.game-button-new::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  /* Thin white rim on the absolute top profile */
  border-top: 1.5px solid rgba(255, 255, 255, 0.65);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: none;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  /* Surface Glow Layer */
  background-image: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 70%);
}

.main-menu-actions .game-button-new::after {
  border-radius: 50% !important;
}

/* Play Button - Green */
.btn-start-new {
  width: 130px !important;
  height: 130px !important;
  min-width: 130px !important;
  background: linear-gradient(180deg, #00e676 0%, #00c853 30%, #00a040 50%, #00814a 100%);
  animation: startButtonPulse 2.1s ease-in-out infinite;
  box-shadow:
    0 0 0 6px #b2fab4,
    0 0 0 8px #00c853,
    0 10px 0 #006032,
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.3);
}

.play-icon-css {
  width: 0;
  height: 0;
  border-left: 38px solid #ffffff;
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
  filter: drop-shadow(2px 2px 0px #006032);
  z-index: 10;
  margin-left: 10px;
  transition: transform 0.3s ease;
}

.btn-start-new:hover .play-icon-css {
  transform: scale(1.15);
}

.btn-start-new:hover {
  background: linear-gradient(180deg, #b2fab4 0%, #00e676 30%, #00c853 50%, #00a040 100%);
  transform: translateY(-5px) scale(1.05);
  animation-play-state: paused;
  box-shadow:
    0 0 0 6px #d1ffd3,
    0 0 0 10px #00a040,
    0 15px 0 #006032,
    0 20px 30px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.4);
}

@keyframes startButtonPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 6px #b2fab4,
      0 0 0 8px #00c853,
      0 10px 0 #006032,
      0 10px 20px rgba(0, 0, 0, 0.4),
      inset 0 -3px 8px rgba(0, 0, 0, 0.2),
      inset 0 3px 10px rgba(255, 255, 255, 0.3);
  }

  50% {
    transform: scale(1.05);
    box-shadow:
      0 0 0 6px #d4ffd6,
      0 0 0 10px #00d65b,
      0 12px 0 #006032,
      0 16px 26px rgba(0, 0, 0, 0.42),
      inset 0 -3px 8px rgba(0, 0, 0, 0.18),
      inset 0 3px 12px rgba(255, 255, 255, 0.34);
  }
}

/* Settings Button - Orange (Main Menu Start Icons) */
.btn-settings-new {
  width: 90px !important;
  height: 90px !important;
  min-width: 90px !important;
  background: linear-gradient(180deg, #ffc107 0%, #ffb300 30%, #ff8f00 50%, #ff6f00 100%);
  box-shadow:
    0 0 0 6px #ffe082,
    0 0 0 8px #e65100,
    0 8px 0 #bf360c,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    inset 0 3px 10px rgba(255, 255, 255, 0.3);
}

.btn-settings-new .btn-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  z-index: 3;
  filter: drop-shadow(1px 2px 0px #bf360c);
  transition: transform 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.btn-settings-new:hover .btn-icon {
  transform: rotate(90deg);
}

.btn-settings-new:hover {
  background: linear-gradient(180deg, #ffe082 0%, #ffc107 30%, #ffb300 50%, #ff8f00 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 0 0 6px #ffecb3,
    0 0 0 8px #ff8f00,
    0 10px 0 #bf360c,
    0 12px 25px rgba(0, 0, 0, 0.4);
}

/* Modal / Menu Buttons (Rectangular Rounded) */
.btn-close-new,
.btn-settings-menu {
  padding: 12px 24px;
  min-width: 120px;
  font-size: 15px;
  margin: 8px;
}

/* Resume/Close - Green Rectangle */
.btn-close-new {
  color: #ffffff;
  background: linear-gradient(180deg, #00e676 0%, #00c853 30%, #00a040 50%, #00814a 100%);
  box-shadow:
    0 0 0 5px #b2fab4,
    0 0 0 7px #00814a,
    0 8px 0 #006032,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.btn-close-new:hover {
  background: linear-gradient(180deg, #b2fab4 0%, #00e676 30%, #00c853 50%, #00a040 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 5px #d1ffd3, 0 0 0 7px #00a040, 0 10px 0 #006032, 0 12px 20px rgba(0, 0, 0, 0.4);
}

/* Main Menu (Settings Modal) - Red Rectangle */
.btn-settings-menu {
  color: #ffffff;
  background: linear-gradient(180deg, #ff5252 0%, #ff1744 30%, #d50000 50%, #b71c1c 100%);
  box-shadow:
    0 0 0 5px #ff8a80,
    0 0 0 7px #b71c1c,
    0 6px 0 #7f0000,
    0 8px 15px rgba(0, 0, 0, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.btn-settings-menu:hover {
  background: linear-gradient(180deg, #ff8a80 0%, #ff5252 30%, #ff1744 50%, #d50000 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 0 5px #ff9e80, 0 0 0 7px #d50000, 0 8px 0 #7f0000, 0 10px 20px rgba(0, 0, 0, 0.4);
}

.game-button-new:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.05s;
}

/* Specific Active Depth Compression for premium buttons */
.btn-start-new:active {
  box-shadow:
    0 0 0 6px #b2fab4,
    0 0 0 8px #00c853,
    0 4px 0 #006032,
    0 5px 10px rgba(0, 0, 0, 0.4),
    inset 0 -1px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 6px rgba(255, 255, 255, 0.3) !important;
}

.btn-settings-new:active {
  box-shadow:
    0 0 0 6px #ffccbc,
    0 0 0 8px #ff5722,
    0 4px 0 #e64a19,
    0 5px 10px rgba(0, 0, 0, 0.4),
    inset 0 -1px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 6px rgba(255, 255, 255, 0.3) !important;
}

/* Tutorial / Other Game Over Buttons cleanup */
.btn-continue,
.btn-playagain,
.btn-gomenu,
.btn-next-region,
.btn-lc-menu {
  border-radius: 50px !important;
  width: auto !important;
  padding: 18px 45px;
  min-width: 220px;
}

/* Loading State cleanup */
.btn-start-new.is-loading {
  opacity: 0.7;
  cursor: wait;
  transform: none !important;
  filter: grayscale(0.5);
}

.pause-bar {
  width: 6px;
  height: 24px;
  background: #fff3e0;
  border-radius: 2px;
  box-shadow: 1px 1px 0px #bf360c;
}

.play-icon {
  display: none;
  width: 0;
  height: 0;
  border-left: 20px solid #fff3e0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  filter: drop-shadow(1px 1px 0px #bf360c);
  margin-left: 4px;
}

.btn-pause-new[data-state="paused"] .pause-icon {
  display: none !important;
}

.btn-pause-new[data-state="paused"] .play-icon {
  display: block !important;
}

@media (max-width: 600px) {
  #gameHud {
    transform: scale(0.8);
    transform-origin: top left;
  }

  .hud-resources {
    transform: scale(0.85);
    transform-origin: top right;
  }

  .global-copyright {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: 5px;
    padding: 6px 16px;
    font-size: 12px;
  }

  .btn-start-new {
    width: clamp(74px, 18vmin, 110px) !important;
    height: clamp(74px, 18vmin, 110px) !important;
    min-width: clamp(74px, 18vmin, 110px) !important;
  }

  #playerThoughtBubble.is-visible {
    transform: scale(0.7) !important;
  }
}

/* Optimization: GIF Overlays - reduces Main Thread 'Recalculate Style' cost */
.enemyGifOverlay,
.friendlyGifOverlay {
  will-change: transform;
  /* Contain keeps style changes local to these elements */
  contain: layout style paint;
}

#loadingOverlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at center, rgba(13, 45, 84, 0.95) 0%, rgba(5, 12, 28, 0.98) 100%);
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  /* Removed Russo One to match the 'Segoe UI' style used in initial loading */
  overflow: hidden;
}

#loadingOverlay::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(0, 230, 118, 0.05) 0%, transparent 60%);
  animation: bgPulse 8s ease-in-out infinite;
  pointer-events: none;
}

.loader-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.loader-container>*+* {
  margin-top: 30px;
}

.loader-spinner-outer {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(0, 230, 118, 0.1);
  border-top: 4px solid #00e676;
  border-right: 4px solid #00e676;
  border-radius: 50%;
  animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.2);
}

.loader-bubble {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: bubblePulse 2s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader-bubble::after {
  content: '🐟';
  font-size: 20px;
  filter: brightness(0) invert(1) opacity(0.6);
  animation: swimmingFish 3s linear infinite;
}

#loadingText {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  margin: 0;
}

.loading-subtext {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: -10px;
  letter-spacing: 1px;
}

@keyframes loaderSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes bubblePulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
  }
}

@keyframes bgPulse {

  0%,
  100% {
    transform: scale(1) translate(0, 0);
  }

  50% {
    transform: scale(1.2) translate(5%, 5%);
  }
}

@keyframes swimmingFish {
  0% {
    transform: translateX(-30px) scaleX(1);
  }

  45% {
    transform: translateX(30px) scaleX(1);
  }

  50% {
    transform: translateX(30px) scaleX(-1);
  }

  95% {
    transform: translateX(-30px) scaleX(-1);
  }

  100% {
    transform: translateX(-30px) scaleX(1);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


/* Developer Secret Menu */
.dev-secret-menu {
  display: none;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 12px;
  margin-top: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.dev-secret-menu h3 {
  font-size: 14px;
  color: #00d4ff;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dev-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-dev {
  padding: 8px 12px;
  font-size: 12px;
  background: #34495e;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-dev:hover {
  background: #2c3e50;
}
