* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #f8fbff;
  background:
    radial-gradient(circle at 22% 14%, rgba(122, 230, 255, 0.22), transparent 28%),
    linear-gradient(180deg, #0b7fc2 0%, #06406f 100%);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 32px;
  align-items: center;
  justify-content: center;
}

.screen-active {
  display: flex;
}

.start-screen {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 78%, rgba(90, 248, 255, 0.78), transparent 15%),
    radial-gradient(circle at 14% 69%, rgba(255, 154, 222, 0.42), transparent 17%),
    radial-gradient(circle at 86% 69%, rgba(255, 221, 103, 0.34), transparent 18%),
    radial-gradient(circle at 50% 18%, rgba(231, 255, 255, 0.5), transparent 31%),
    radial-gradient(circle at 8% 34%, rgba(77, 239, 255, 0.36), transparent 26%),
    radial-gradient(circle at 95% 39%, rgba(73, 155, 255, 0.36), transparent 24%),
    linear-gradient(180deg, #8cecff 0%, #34c8f1 36%, #1590d5 66%, #0c4d99 100%);
}

.start-screen::before,
.start-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.start-screen::before {
  z-index: 0;
  background:
    linear-gradient(104deg, transparent 4%, rgba(255, 255, 255, 0.34) 10%, transparent 23%),
    linear-gradient(78deg, transparent 29%, rgba(255, 255, 255, 0.2) 37%, transparent 50%),
    linear-gradient(112deg, transparent 57%, rgba(255, 255, 255, 0.18) 64%, transparent 76%),
    radial-gradient(ellipse at 48% -12%, rgba(255, 255, 255, 0.42), transparent 38%),
    radial-gradient(circle at 50% 104%, rgba(171, 255, 241, 0.48), transparent 30%),
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(255, 255, 255, 0.06) 45px 47px);
  opacity: 0.9;
}

.start-screen::after {
  z-index: 1;
  background:
    radial-gradient(ellipse at 16% 100%, rgba(13, 68, 119, 0.72), transparent 23%),
    radial-gradient(ellipse at 85% 102%, rgba(15, 74, 127, 0.72), transparent 24%),
    radial-gradient(circle at 9% 82%, rgba(255, 151, 207, 0.52), transparent 10%),
    radial-gradient(circle at 91% 80%, rgba(255, 224, 120, 0.4), transparent 11%),
    radial-gradient(circle at 68% 91%, rgba(83, 75, 255, 0.26), transparent 13%),
    radial-gradient(circle at 34% 92%, rgba(255, 110, 150, 0.28), transparent 9%),
    linear-gradient(180deg, transparent 66%, rgba(4, 45, 97, 0.22));
  opacity: 0.84;
}

.title-ocean-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.title-content {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: clamp(54px, 7vw, 66px);
  width: min(1080px, 96vw);
  text-align: center;
  transform: translateY(1vh);
}

.game-logo {
  display: grid;
  gap: 1px;
  width: 100%;
  margin: 0;
  color: #d7fbff;
  font-family: "Cooper Black", "Arial Rounded MT Bold", "Arial Black", "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: clamp(3.75rem, 9.6vw, 7.6rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.72;
  filter: drop-shadow(0 22px 18px rgba(2, 27, 83, 0.34));
  isolation: isolate;
  transform: rotate(-1deg);
}

.logo-line {
  --shine: #dffcff;
  --front: #5af5ff;
  --middle: #12bdeb;
  --deep: #075482;
  --rim: #053f8d;
  position: relative;
  display: inline-block;
  justify-self: center;
  padding: 0 0.14em 0.1em;
  color: var(--front);
  background:
    radial-gradient(ellipse at 30% 18%, rgba(255, 255, 255, 0.34) 0 12%, transparent 24%),
    linear-gradient(180deg, var(--shine) 0 10%, var(--front) 28%, var(--middle) 68%, var(--deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: clamp(5px, 0.8vw, 10px) var(--rim);
  paint-order: stroke fill;
  transform: scaleX(1.12);
  white-space: nowrap;
  text-shadow:
    0 4px 0 var(--middle),
    0 8px 0 var(--deep),
    0 14px 10px rgba(2, 25, 76, 0.28);
}

.logo-line::before {
  position: absolute;
  inset: 0.02em 0 0;
  z-index: -1;
  color: transparent;
  content: attr(data-text);
  -webkit-text-stroke: clamp(8px, 1vw, 12px) rgba(2, 48, 111, 0.86);
  text-shadow:
    0 9px 0 rgba(3, 48, 101, 0.62),
    0 15px 14px rgba(1, 23, 75, 0.26);
}

.logo-line::after {
  display: none;
}

.ocean-line {
  --shine: #bfffff;
  --front: #39efff;
  --middle: #08bff1;
  --deep: #057bd0;
  --rim: #0451a5;
  font-size: 0.94em;
  text-shadow:
    0 4px 0 #05a7de,
    0 8px 0 #0569b0,
    0 14px 12px rgba(2, 25, 76, 0.28);
}

.trash-line {
  --shine: #f8ffff;
  --front: #f8ffff;
  --middle: #bceeff;
  --deep: #2c92d7;
  --rim: #075ba8;
  font-size: 0.76em;
  z-index: 1;
}

.hunter-line {
  --shine: #ffed88;
  --front: #ffdc4f;
  --middle: #ffac28;
  --deep: #d46113;
  --rim: #7e4204;
  font-size: 0.94em;
  z-index: 2;
  text-shadow:
    0 4px 0 #f29422,
    0 8px 0 #c65e14,
    0 15px 12px rgba(2, 25, 76, 0.28);
}

.logo-drop {
  position: absolute;
  z-index: 3;
  border-radius: 52% 48% 60% 40%;
  background:
    radial-gradient(circle at 34% 24%, #ffffff 0 14%, transparent 16%),
    linear-gradient(145deg, #bafcff, #1fc3ff 64%, #087ec5);
  box-shadow: 0 5px 0 #07699e, 0 9px 12px rgba(0, 47, 97, 0.24);
}

.drop-one {
  right: -0.24em;
  top: -0.02em;
  width: 0.2em;
  height: 0.27em;
  transform: rotate(20deg);
}

.drop-two {
  right: -0.4em;
  top: 0.25em;
  width: 0.13em;
  height: 0.17em;
  transform: rotate(-12deg);
}

.logo-wave {
  position: absolute;
  left: -0.5em;
  bottom: 0.04em;
  color: #d6fbff;
  font-size: 0.5em;
  -webkit-text-fill-color: #d6fbff;
  -webkit-text-stroke: 3px #0876bd;
  text-shadow:
    0 4px 0 #075482,
    0 8px 10px rgba(1, 26, 82, 0.28);
  transform: rotate(-10deg);
}

.logo-tail {
  position: absolute;
  right: -0.54em;
  bottom: 0.06em;
  display: inline-grid;
  width: 0.5em;
  height: 0.42em;
  place-items: center;
  color: #7bf7ff;
  font-size: 0.62em;
  line-height: 1;
  -webkit-text-fill-color: #7bf7ff;
  -webkit-text-stroke: 0;
  text-shadow:
    0 3px 0 #0b8ecb,
    0 7px 0 #065178,
    -2px -2px 0 rgba(255, 255, 255, 0.8);
  transform: rotate(-18deg);
}

.logo-tail::before,
.logo-tail::after {
  position: absolute;
  width: 0.2em;
  height: 0.32em;
  border-radius: 65% 35% 65% 35%;
  background: linear-gradient(145deg, #c8ffff, #17bcec);
  box-shadow: 0 4px 0 #076695;
  content: "";
}

.logo-tail::before {
  left: 0.08em;
  transform: rotate(35deg);
}

.logo-tail::after {
  right: 0.08em;
  transform: rotate(-35deg) scaleX(-1);
}

.logo-crab {
  position: absolute;
  right: -0.56em;
  bottom: -0.04em;
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  -webkit-text-fill-color: initial;
  -webkit-text-stroke: 0;
  text-shadow:
    0 4px 0 rgba(129, 44, 11, 0.62),
    0 10px 12px rgba(2, 28, 76, 0.28);
  animation: logo-crab-dance 2.8s ease-in-out infinite;
}

.start-game-button {
  position: relative;
  min-width: min(330px, 72vw);
  min-height: 78px;
  padding: 0 58px;
  border: 4px solid #08769c;
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #63f8ff 0%, #09c5de 54%, #0095bd 100%);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.24),
    inset 0 -10px 0 rgba(0, 77, 126, 0.32),
    0 10px 0 #06577e,
    0 22px 34px rgba(4, 31, 76, 0.34);
  font-family: "Arial Black", "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(0, 67, 110, 0.54);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.start-game-button::before {
  display: none;
}

.start-game-button::after {
  position: absolute;
  right: 34px;
  top: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 18px 14px 0 rgba(255, 255, 255, 0.52);
  content: "";
}

.start-game-button:hover {
  filter: brightness(1.08);
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.24),
    inset 0 -10px 0 rgba(0, 77, 126, 0.32),
    0 13px 0 #06577e,
    0 27px 38px rgba(4, 31, 76, 0.38);
}

.start-game-button:active {
  transform: translateY(6px) scale(0.98);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.22),
    inset 0 -5px 0 rgba(0, 77, 126, 0.36),
    0 4px 0 #06577e,
    0 12px 22px rgba(4, 31, 76, 0.32);
}

.start-game-button:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.88);
  outline-offset: 5px;
}

.title-bubble {
  position: absolute;
  bottom: -60px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.55;
  animation: title-bubble-rise 10s ease-in infinite;
}

.bubble-one {
  left: 18%;
}

.bubble-two {
  left: 42%;
  width: 15px;
  height: 15px;
  animation-delay: -3s;
}

.bubble-three {
  right: 24%;
  width: 30px;
  height: 30px;
  animation-delay: -5.5s;
}

.bubble-four {
  right: 11%;
  width: 13px;
  height: 13px;
  animation-delay: -7s;
}

.bubble-five {
  left: 7%;
  width: 18px;
  height: 18px;
  animation-delay: -8s;
  animation-duration: 12.5s;
}

.bubble-six {
  right: 37%;
  width: 11px;
  height: 11px;
  animation-delay: -1.6s;
  animation-duration: 8.5s;
}

.title-fish,
.title-coral,
.title-seaweed,
.title-fish-school,
.title-seahorse,
.title-jelly,
.title-turtle,
.title-shell,
.title-starfish {
  position: absolute;
  filter: drop-shadow(0 8px 10px rgba(0, 43, 94, 0.22));
}

.title-fish {
  opacity: 0.82;
  font-size: clamp(2.6rem, 5.7vw, 5.4rem);
  animation: title-fish-swim 13s ease-in-out infinite;
}

.title-fish-one {
  left: 6%;
  top: 30%;
}

.title-fish-two {
  right: 8%;
  top: 30%;
  animation-delay: -4s;
  animation-direction: reverse;
}

.title-fish-three {
  left: 12%;
  bottom: 25%;
  animation-delay: -7s;
}

.title-fish-four {
  right: 15%;
  top: 48%;
  font-size: clamp(2.2rem, 4.8vw, 4.6rem);
  animation-delay: -2s;
}

.title-fish-five {
  left: 21%;
  top: 52%;
  font-size: clamp(2rem, 4.5vw, 4.1rem);
  animation-delay: -9s;
  animation-direction: reverse;
}

.title-puffer {
  left: 19%;
  top: 14%;
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  animation-delay: -5s;
}

.title-fish-school {
  color: rgba(255, 247, 167, 0.86);
  font-family: "Courier New", monospace;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 900;
  opacity: 0.78;
  text-shadow: 0 4px 8px rgba(0, 49, 112, 0.26);
  animation: title-school-swim 12s ease-in-out infinite;
}

.title-school-left {
  left: 3%;
  top: 18%;
}

.title-school-right {
  right: 4%;
  top: 18%;
  color: rgba(255, 192, 115, 0.86);
  animation-delay: -6s;
  animation-direction: reverse;
}

.title-seahorse {
  right: 18%;
  bottom: 25%;
  color: #ffb269;
  font-size: clamp(2.5rem, 5.2vw, 5rem);
  opacity: 0.82;
  transform: rotate(10deg);
  animation: title-seahorse-bob 4.8s ease-in-out infinite;
}

.title-jelly {
  color: rgba(244, 216, 255, 0.86);
  font-size: clamp(3rem, 6.8vw, 6.4rem);
  opacity: 0.72;
  animation: title-jelly-float 5.8s ease-in-out infinite;
}

.title-jelly-one {
  left: 29%;
  top: 20%;
}

.title-jelly-two {
  right: 27%;
  top: 16%;
  color: rgba(197, 240, 255, 0.78);
  animation-delay: -2.6s;
}

.title-turtle {
  right: 27%;
  top: 51%;
  font-size: clamp(2.2rem, 4.6vw, 4.3rem);
  opacity: 0.76;
  animation: title-turtle-glide 9s ease-in-out infinite;
}

.title-coral {
  bottom: 5%;
  color: rgba(255, 157, 214, 0.82);
  font-size: clamp(4rem, 12vw, 9rem);
  opacity: 0.8;
}

.title-coral,
.title-seaweed {
  mix-blend-mode: screen;
}

.title-coral-left {
  left: 6%;
}

.title-coral-right {
  right: 8%;
  color: rgba(255, 220, 127, 0.76);
}

.title-coral-mid {
  left: 42%;
  bottom: 4%;
  color: rgba(255, 122, 158, 0.78);
  font-size: clamp(3.5rem, 9vw, 7.4rem);
}

.title-seaweed {
  bottom: 2%;
  color: rgba(38, 171, 130, 0.82);
  font-size: clamp(5rem, 14vw, 11rem);
  transform-origin: bottom center;
  animation: title-seaweed-sway 3.4s ease-in-out infinite;
  opacity: 0.7;
}

.title-seaweed-left {
  left: 18%;
}

.title-seaweed-right {
  right: 22%;
  animation-delay: -1.7s;
}

.title-seaweed-mid {
  left: 55%;
  bottom: 1%;
  color: rgba(95, 214, 108, 0.76);
  font-size: clamp(4rem, 11vw, 8.5rem);
  animation-delay: -0.7s;
}

.title-rock {
  position: absolute;
  bottom: -2%;
  width: clamp(140px, 20vw, 280px);
  height: clamp(62px, 8vw, 110px);
  border-radius: 54% 46% 0 0 / 76% 70% 0 0;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(145deg, rgba(145, 199, 226, 0.86), rgba(50, 93, 147, 0.86));
  box-shadow: inset -18px -18px 28px rgba(12, 48, 101, 0.22), 0 12px 22px rgba(0, 39, 92, 0.2);
  opacity: 0.82;
}

.title-rock-left {
  left: 2%;
  transform: rotate(2deg);
}

.title-rock-right {
  right: 7%;
  width: clamp(170px, 24vw, 330px);
  transform: rotate(-3deg);
}

.title-shell {
  bottom: 8%;
  color: rgba(255, 229, 176, 0.86);
  font-size: clamp(2.1rem, 4.6vw, 4.1rem);
  text-shadow: 0 4px 0 rgba(144, 90, 55, 0.28);
}

.title-shell-left {
  left: 28%;
  transform: rotate(-18deg);
}

.title-shell-right {
  right: 33%;
  color: rgba(255, 197, 220, 0.86);
  transform: rotate(16deg);
}

.title-starfish {
  left: 73%;
  bottom: 11%;
  color: #ffc15b;
  font-size: clamp(2rem, 4vw, 3.4rem);
  opacity: 0.84;
  text-shadow: 0 4px 0 rgba(135, 72, 27, 0.3);
  transform: rotate(14deg);
}

@keyframes title-bubble-rise {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.7);
  }
  18% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateY(-112vh) translateX(28px) scale(1.18);
  }
}

@keyframes title-fish-swim {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateX(44px) translateY(-12px) rotate(5deg);
  }
}

@keyframes title-seaweed-sway {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

@keyframes title-school-swim {
  0%,
  100% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(54px) translateY(-10px);
  }
}

@keyframes title-jelly-float {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-22px) scaleY(1.08);
  }
}

@keyframes title-turtle-glide {
  0%,
  100% {
    transform: translate(0, 0) rotate(-4deg);
  }
  50% {
    transform: translate(-38px, -10px) rotate(4deg);
  }
}

@keyframes title-seahorse-bob {
  0%,
  100% {
    transform: translateY(0) rotate(10deg);
  }
  50% {
    transform: translateY(-18px) rotate(4deg);
  }
}

@keyframes logo-crab-dance {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-7px) rotate(6deg);
  }
}

.start-layout {
  display: grid;
  width: min(1040px, 100%);
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
  align-items: stretch;
}

#nickname-screen {
  --nickname-game-font: "Bagel Fat One", "Jua", "Do Hyeon", "ONE Mobile POP", "Arial Rounded MT Bold", "Trebuchet MS", Arial, Helvetica, sans-serif;
  position: relative;
  overflow: hidden;
  padding: 34px;
  background:
    radial-gradient(circle at 48% 8%, rgba(255, 255, 255, 0.44), transparent 28%),
    radial-gradient(circle at 16% 78%, rgba(255, 145, 218, 0.32), transparent 18%),
    radial-gradient(circle at 86% 76%, rgba(255, 214, 91, 0.26), transparent 18%),
    radial-gradient(circle at 50% 96%, rgba(126, 244, 255, 0.34), transparent 26%),
    linear-gradient(180deg, #6de5ff 0%, #19a9e7 42%, #0866b2 76%, #063777 100%);
}

#nickname-screen::before,
#nickname-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

#nickname-screen::before {
  z-index: 0;
  background:
    linear-gradient(104deg, transparent 9%, rgba(255, 255, 255, 0.28) 15%, transparent 29%),
    linear-gradient(78deg, transparent 38%, rgba(255, 255, 255, 0.18) 45%, transparent 58%),
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.48), transparent 38%),
    repeating-linear-gradient(0deg, transparent 0 48px, rgba(255, 255, 255, 0.05) 49px 51px);
  opacity: 0.86;
}

#nickname-screen::after {
  z-index: 1;
  background:
    radial-gradient(ellipse at 12% 105%, rgba(10, 69, 111, 0.72), transparent 24%),
    radial-gradient(ellipse at 88% 104%, rgba(8, 71, 112, 0.72), transparent 24%),
    radial-gradient(circle at 14% 90%, rgba(255, 132, 211, 0.36), transparent 11%),
    radial-gradient(circle at 82% 90%, rgba(255, 200, 92, 0.26), transparent 12%),
    linear-gradient(180deg, transparent 68%, rgba(2, 34, 77, 0.24));
}

#nickname-screen .start-layout {
  position: relative;
  z-index: 3;
  width: min(960px, 100%);
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(18px, 2.4vw, 28px);
  align-items: stretch;
}

.nickname-ocean-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.nickname-bubble,
.nickname-fish,
.nickname-seaweed,
.nickname-coral {
  position: absolute;
  filter: drop-shadow(0 8px 10px rgba(0, 43, 94, 0.22));
}

.nickname-bubble {
  bottom: -44px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  animation: nickname-bubble-rise 9s ease-in infinite;
}

.nickname-bubble-one {
  left: 8%;
}

.nickname-bubble-two {
  left: 28%;
  width: 15px;
  height: 15px;
  animation-delay: -2.8s;
}

.nickname-bubble-three {
  right: 24%;
  width: 30px;
  height: 30px;
  animation-delay: -5.4s;
}

.nickname-bubble-four {
  right: 8%;
  width: 17px;
  height: 17px;
  animation-delay: -7s;
}

.nickname-fish {
  font-size: clamp(2.2rem, 4vw, 4rem);
  opacity: 0.82;
  animation: nickname-fish-swim 10s ease-in-out infinite;
}

.nickname-fish-one {
  left: 7%;
  top: 25%;
}

.nickname-fish-two {
  right: 8%;
  top: 30%;
  animation-delay: -4s;
  animation-direction: reverse;
}

.nickname-fish-three {
  right: 12%;
  bottom: 26%;
  animation-delay: -7s;
}

.nickname-seaweed {
  bottom: 1%;
  color: rgba(80, 218, 130, 0.68);
  font-size: clamp(4.8rem, 12vw, 9rem);
  transform-origin: bottom center;
  animation: nickname-seaweed-sway 3.2s ease-in-out infinite;
}

.nickname-seaweed-left {
  left: 8%;
}

.nickname-seaweed-right {
  right: 10%;
  animation-delay: -1.4s;
}

.nickname-coral {
  bottom: 4%;
  color: rgba(255, 134, 202, 0.72);
  font-size: clamp(4rem, 10vw, 8rem);
  mix-blend-mode: screen;
  opacity: 0.76;
}

.nickname-coral-left {
  left: 20%;
}

.nickname-coral-right {
  right: 22%;
  color: rgba(255, 216, 102, 0.68);
}

@keyframes nickname-bubble-rise {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.72);
  }
  18% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: translateY(-110vh) translateX(26px) scale(1.14);
  }
}

@keyframes nickname-fish-swim {
  0%,
  100% {
    transform: translate(0, 0) rotate(-4deg);
  }
  50% {
    transform: translate(44px, -10px) rotate(5deg);
  }
}

@keyframes nickname-seaweed-sway {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

.hero-panel,
.info-panel {
  width: min(640px, 100%);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(2, 35, 55, 0.72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
}

.start-layout .hero-panel {
  width: 100%;
}

.ranking-panel {
  width: 100%;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(2, 35, 55, 0.72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
}

#nickname-screen .hero-panel,
#nickname-screen .ranking-panel {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  border: 2px solid rgba(196, 252, 255, 0.52);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(80, 220, 255, 0.38), rgba(0, 125, 196, 0.58)),
    rgba(4, 133, 203, 0.46);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.62),
    inset 0 -12px 28px rgba(0, 73, 145, 0.24),
    0 22px 0 rgba(3, 66, 133, 0.28),
    0 28px 42px rgba(2, 31, 88, 0.32);
  backdrop-filter: blur(14px);
  animation: nickname-card-in 520ms ease both;
  font-family: var(--nickname-game-font);
}

#nickname-screen .hero-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(42px, 4.6vw, 62px);
  text-align: center;
}

#nickname-screen .ranking-panel {
  display: grid;
  align-content: center;
  padding: clamp(38px, 4vw, 56px);
  animation-delay: 110ms;
}

#nickname-screen .hero-panel::before,
#nickname-screen .ranking-panel::before {
  display: none;
}

#nickname-screen .eyebrow {
  margin-bottom: 12px;
  color: #e9ffff;
  font-family: var(--nickname-game-font);
  font-size: clamp(0.8rem, 1.45vw, 0.95rem);
  font-weight: 900;
  letter-spacing: 0;
  -webkit-text-stroke: 0.35px rgba(15, 94, 164, 0.36);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.24);
}

#nickname-screen h2 {
  display: block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  color: #ffffff;
  font-family: var(--nickname-game-font);
  font-size: clamp(1.45rem, 2.72vw, 2.12rem);
  line-height: 1.2;
  overflow-wrap: normal;
  text-align: center;
  word-break: keep-all;
  -webkit-text-stroke: 0.45px rgba(17, 90, 160, 0.36);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.26);
}

#nickname-title {
  width: min(100%, 10.8em);
}

#nickname-screen .ranking-panel h2 {
  margin-bottom: 28px;
  text-align: center;
  font-size: clamp(1.1rem, 1.82vw, 1.48rem);
  line-height: 1.18;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #8ee8d8;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  line-height: 1.05;
}

#nickname-screen,
#camera-screen,
.game-end-overlay,
.result-screen,
.hand-guide,
.primary-button {
  overflow-wrap: normal;
  word-break: keep-all;
  line-break: strict;
  hyphens: none;
}

h1 {
  font-size: clamp(3rem, 10vw, 6.5rem);
}

h2 {
  font-size: clamp(2rem, 7vw, 4rem);
}

.description {
  max-width: 560px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  line-height: 1.65;
  color: #dff7ff;
}

.nickname-field {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  color: #dff7ff;
  font-weight: 700;
}

#nickname-screen .nickname-field {
  position: relative;
  display: grid;
  width: min(560px, 100%);
  min-height: 78px;
  margin-top: 44px;
  align-items: center;
  gap: 0;
}

#nickname-screen .nickname-icon {
  position: absolute;
  left: 10px;
  z-index: 2;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #5df5ff 0%, #0cc6ec 62%, #0788c5 100%);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.22),
    0 8px 0 rgba(3, 101, 166, 0.34),
    0 13px 18px rgba(2, 53, 119, 0.24);
  font-size: 1.8rem;
}

.nickname-field input {
  width: min(360px, 100%);
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(1, 17, 28, 0.54);
  font: inherit;
  outline: 0;
}

#nickname-screen .nickname-field input {
  width: 100%;
  min-height: 78px;
  padding: 0 78px 0 86px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #245179;
  background:
    linear-gradient(180deg, #ffffff 0%, #ecfbff 62%, #cceeff 100%);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.82),
    inset 0 -7px 0 rgba(142, 199, 230, 0.3),
    0 10px 18px rgba(3, 50, 118, 0.2);
  font-family: var(--nickname-game-font);
  font-size: clamp(1.08rem, 2.1vw, 1.42rem);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: none;
}

.nickname-field input::placeholder {
  color: rgba(248, 251, 255, 0.58);
}

#nickname-screen .nickname-field input::placeholder {
  color: rgba(72, 109, 150, 0.7);
  font-family: var(--nickname-game-font);
  font-weight: 900;
  text-shadow: none;
}

.nickname-field input:focus {
  border-color: #73f0c5;
  box-shadow: 0 0 0 3px rgba(115, 240, 197, 0.22);
}

#nickname-screen .nickname-field input:focus {
  border-color: #ffffff;
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.82),
    inset 0 -7px 0 rgba(142, 199, 230, 0.3),
    0 0 0 5px rgba(112, 255, 235, 0.28),
    0 12px 20px rgba(3, 50, 118, 0.24);
}

.nickname-count {
  position: absolute;
  right: 24px;
  color: rgba(72, 112, 154, 0.68);
  font-family: var(--nickname-game-font);
  font-size: 1.1rem;
  font-weight: 900;
  text-shadow: none;
}

.nickname-help {
  margin: 24px 0 0;
  color: #e9fdff;
  font-family: var(--nickname-game-font);
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 800;
  -webkit-text-stroke: 0.35px rgba(9, 94, 166, 0.24);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.22);
}

.nickname-message {
  min-height: 24px;
  margin: 8px 0 0;
  color: #ffd9b3;
  font-size: 0.95rem;
}

#nickname-screen .nickname-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: #ffffff;
  font-family: var(--nickname-game-font);
  font-weight: 900;
  -webkit-text-stroke: 0.35px rgba(8, 96, 170, 0.28);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.22);
}

.ranking-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.ranking-list {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style-position: inside;
}

#nickname-screen .ranking-list {
  gap: 11px;
  margin-top: 0;
  list-style: none;
}

.ranking-list li {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ecfbff;
}

#nickname-screen .ranking-list li {
  min-height: 58px;
  padding: 10px 18px;
  border: 1px solid rgba(164, 239, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 75, 159, 0.42);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.16),
    0 7px 14px rgba(1, 39, 103, 0.16);
  color: #f3fdff;
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 900;
  font-family: var(--nickname-game-font);
  letter-spacing: 0;
  -webkit-text-stroke: 0.35px rgba(8, 96, 170, 0.24);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.2);
}

#nickname-screen .ranking-list .ranking-rank-1 {
  background: linear-gradient(90deg, rgba(255, 204, 65, 0.3), rgba(4, 75, 159, 0.42));
}

#nickname-screen .ranking-list .ranking-rank-2 {
  background: linear-gradient(90deg, rgba(222, 237, 255, 0.24), rgba(4, 75, 159, 0.42));
}

#nickname-screen .ranking-list .ranking-rank-3 {
  background: linear-gradient(90deg, rgba(226, 148, 76, 0.26), rgba(4, 75, 159, 0.42));
}

.ranking-list strong {
  color: #8ee8d8;
}

#nickname-screen .ranking-list strong {
  color: #fff06f;
  font-family: var(--nickname-game-font);
  font-size: 1.18em;
  -webkit-text-stroke: 0.35px rgba(128, 105, 0, 0.22);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.18);
}

.ranking-list .ranking-empty {
  justify-content: center;
  color: rgba(248, 251, 255, 0.7);
  text-align: center;
}

#nickname-screen .ranking-list .ranking-empty {
  min-height: 170px;
  border-radius: 22px;
  color: rgba(244, 253, 255, 0.88);
  font-family: var(--nickname-game-font);
  font-size: 1.18rem;
  -webkit-text-stroke: 0.35px rgba(8, 96, 170, 0.24);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.2);
}

.primary-button {
  margin-top: 34px;
  min-width: 160px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  color: #052b38;
  background: #73f0c5;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

#nickname-screen .primary-button {
  position: relative;
  min-width: min(360px, 78vw);
  min-height: 76px;
  margin-top: 26px;
  border: 4px solid #08769c;
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #63f8ff 0%, #09c5de 54%, #0095bd 100%);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.24),
    inset 0 -10px 0 rgba(0, 77, 126, 0.32),
    0 10px 0 #06577e,
    0 22px 30px rgba(4, 31, 76, 0.28);
  font-family: var(--nickname-game-font);
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  font-weight: 900;
  letter-spacing: 0;
  -webkit-text-stroke: 0.45px rgba(8, 91, 165, 0.32);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

#nickname-screen .primary-button::before {
  display: none;
}

#nickname-screen .primary-button::after {
  position: absolute;
  right: 34px;
  top: 20px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 18px 14px 0 rgba(255, 255, 255, 0.48);
  content: "";
}

.primary-button:hover {
  background: #9ff7d9;
  transform: translateY(-2px);
}

#nickname-screen .primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.24),
    inset 0 -10px 0 rgba(0, 77, 126, 0.32),
    0 13px 0 #06577e,
    0 27px 34px rgba(4, 31, 76, 0.34);
}

#nickname-screen .primary-button:active {
  transform: translateY(6px) scale(0.98);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.22),
    inset 0 -5px 0 rgba(0, 77, 126, 0.36),
    0 4px 0 #06577e,
    0 12px 22px rgba(4, 31, 76, 0.32);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

#nickname-screen .primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.18);
  opacity: 0.7;
}

@keyframes nickname-card-in {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.primary-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
}

.camera-message {
  min-height: 28px;
  margin: 18px 0 0;
  color: #ffd9b3;
  font-size: 0.98rem;
  line-height: 1.5;
}

#camera-screen {
  position: relative;
  overflow: hidden;
  padding: 34px;
  background:
    radial-gradient(circle at 48% 8%, rgba(255, 255, 255, 0.46), transparent 28%),
    radial-gradient(circle at 18% 74%, rgba(106, 245, 255, 0.32), transparent 18%),
    radial-gradient(circle at 84% 77%, rgba(255, 204, 96, 0.24), transparent 18%),
    linear-gradient(180deg, #7eeaff 0%, #22b9ea 44%, #0873bd 76%, #064080 100%);
  font-family: var(--nickname-game-font, "Bagel Fat One", "Jua", "Do Hyeon", "Arial Rounded MT Bold", Arial, Helvetica, sans-serif);
}

#camera-screen::before,
#camera-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

#camera-screen::before {
  z-index: 0;
  background:
    linear-gradient(104deg, transparent 8%, rgba(255, 255, 255, 0.28) 15%, transparent 30%),
    linear-gradient(78deg, transparent 42%, rgba(255, 255, 255, 0.18) 49%, transparent 61%),
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.48), transparent 38%),
    repeating-linear-gradient(0deg, transparent 0 48px, rgba(255, 255, 255, 0.05) 49px 51px);
  opacity: 0.86;
}

#camera-screen::after {
  z-index: 1;
  background:
    radial-gradient(ellipse at 12% 105%, rgba(10, 69, 111, 0.72), transparent 24%),
    radial-gradient(ellipse at 88% 104%, rgba(8, 71, 112, 0.72), transparent 24%),
    radial-gradient(circle at 16% 90%, rgba(255, 139, 211, 0.28), transparent 11%),
    radial-gradient(circle at 78% 91%, rgba(255, 215, 102, 0.24), transparent 12%),
    linear-gradient(180deg, transparent 68%, rgba(2, 34, 77, 0.24));
}

.camera-ocean-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.camera-bubble,
.camera-fish,
.camera-seaweed,
.camera-coral {
  position: absolute;
  filter: drop-shadow(0 8px 10px rgba(0, 43, 94, 0.22));
}

.camera-bubble {
  bottom: -44px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  animation: camera-bubble-rise 9.5s ease-in infinite;
}

.camera-bubble-one {
  left: 12%;
}

.camera-bubble-two {
  left: 48%;
  width: 15px;
  height: 15px;
  animation-delay: -3s;
}

.camera-bubble-three {
  right: 13%;
  width: 30px;
  height: 30px;
  animation-delay: -5.8s;
}

.camera-fish {
  font-size: clamp(2.1rem, 4vw, 4rem);
  opacity: 0.8;
  animation: camera-fish-swim 11s ease-in-out infinite;
}

.camera-fish-one {
  left: 8%;
  top: 24%;
}

.camera-fish-two {
  right: 9%;
  top: 32%;
  animation-delay: -5s;
  animation-direction: reverse;
}

.camera-seaweed {
  bottom: 1%;
  color: rgba(80, 218, 130, 0.68);
  font-size: clamp(4.8rem, 12vw, 9rem);
  transform-origin: bottom center;
  animation: camera-seaweed-sway 3.2s ease-in-out infinite;
}

.camera-seaweed-left {
  left: 8%;
}

.camera-seaweed-right {
  right: 10%;
  animation-delay: -1.4s;
}

.camera-coral {
  bottom: 4%;
  color: rgba(255, 134, 202, 0.72);
  font-size: clamp(4rem, 10vw, 8rem);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.camera-coral-left {
  left: 23%;
}

.camera-coral-right {
  right: 24%;
  color: rgba(255, 216, 102, 0.68);
}

.camera-guide-panel {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(900px, 100%);
  grid-template-columns: minmax(210px, 0.72fr) minmax(360px, 1.28fr);
  gap: clamp(22px, 3.4vw, 38px);
  align-items: center;
}

.dolphin-mascot {
  position: relative;
  display: grid;
  min-height: 280px;
  place-items: center;
  animation: dolphin-float 3.2s ease-in-out infinite;
}

.dolphin-body {
  display: block;
  font-size: clamp(9rem, 19.5vw, 14.5rem);
  filter:
    drop-shadow(0 14px 0 rgba(5, 75, 146, 0.24))
    drop-shadow(0 24px 28px rgba(3, 42, 108, 0.24));
  transform: rotate(-8deg);
}

.dolphin-sparkle {
  position: absolute;
  right: 16%;
  top: 20%;
  color: #fff7a4;
  font-size: clamp(2rem, 4vw, 3rem);
  text-shadow: 0 4px 0 rgba(4, 92, 158, 0.26);
  animation: dolphin-sparkle 2.4s ease-in-out infinite;
}

.camera-speech-bubble {
  position: relative;
  display: grid;
  justify-items: start;
  max-width: 540px;
  padding: clamp(28px, 3.2vw, 40px);
  border: 3px solid rgba(255, 255, 255, 0.74);
  border-radius: 34px;
  color: #1c5b87;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(218, 248, 255, 0.84)),
    rgba(238, 252, 255, 0.82);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.72),
    inset 0 -10px 0 rgba(130, 201, 231, 0.2),
    0 18px 0 rgba(7, 92, 156, 0.22),
    0 28px 36px rgba(2, 42, 102, 0.26);
  backdrop-filter: blur(12px);
  animation: camera-bubble-in 520ms ease both;
}

.camera-speech-bubble::before {
  position: absolute;
  left: -28px;
  top: 45%;
  width: 54px;
  height: 54px;
  border-left: 3px solid rgba(255, 255, 255, 0.72);
  border-bottom: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 0 0 0 18px;
  background: rgba(236, 251, 255, 0.88);
  content: "";
  transform: rotate(45deg);
}

.camera-speech-bubble .eyebrow {
  margin-bottom: 8px;
  color: #00a8c9;
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 1px 2px 0 rgba(116, 169, 194, 0.22);
}

.camera-speech-bubble h2 {
  margin-bottom: 14px;
  color: #1596c9;
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.1;
  text-shadow: 1px 2px 0 rgba(64, 118, 160, 0.22);
}

#camera-screen .camera-message {
  min-height: 0;
  max-width: 28em;
  margin: 0 auto;
  color: #23638f;
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: pre-line;
  text-shadow: 1px 2px 0 rgba(123, 169, 196, 0.18);
}

.camera-speech-bubble.camera-denied {
  border-color: rgba(255, 228, 123, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 204, 0.88)),
    rgba(255, 244, 202, 0.86);
}

.camera-speech-bubble.camera-denied .camera-message {
  color: #b06400;
}

#camera-screen .primary-button {
  position: relative;
  justify-self: center;
  min-width: min(320px, 76vw);
  min-height: 68px;
  margin-top: 24px;
  border: 4px solid #08769c;
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #63f8ff 0%, #09c5de 54%, #0095bd 100%);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.24),
    inset 0 -10px 0 rgba(0, 77, 126, 0.32),
    0 10px 0 #06577e,
    0 22px 30px rgba(4, 31, 76, 0.24);
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  font-weight: 900;
  -webkit-text-stroke: 0.45px rgba(8, 91, 165, 0.32);
  text-shadow: 1px 2px 0 rgba(44, 87, 123, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

#camera-screen .primary-button::before {
  display: none;
}

#camera-screen .primary-button::after {
  position: absolute;
  right: 32px;
  top: 20px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 18px 14px 0 rgba(255, 255, 255, 0.48);
  content: "";
}

#camera-screen .primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.24),
    inset 0 -10px 0 rgba(0, 77, 126, 0.32),
    0 13px 0 #06577e,
    0 27px 34px rgba(4, 31, 76, 0.3);
}

#camera-screen .primary-button:active {
  transform: translateY(6px) scale(0.98);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.22),
    inset 0 -5px 0 rgba(0, 77, 126, 0.36),
    0 4px 0 #06577e,
    0 12px 22px rgba(4, 31, 76, 0.28);
}

#camera-screen .primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.16);
  opacity: 0.76;
  transform: none;
}

@keyframes camera-bubble-rise {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.72);
  }
  18% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: translateY(-110vh) translateX(26px) scale(1.14);
  }
}

@keyframes camera-fish-swim {
  0%,
  100% {
    transform: translate(0, 0) rotate(-4deg);
  }
  50% {
    transform: translate(44px, -10px) rotate(5deg);
  }
}

@keyframes camera-seaweed-sway {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

@keyframes dolphin-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-18px) rotate(3deg);
  }
}

@keyframes dolphin-sparkle {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9) rotate(-10deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) rotate(10deg);
  }
}

@keyframes camera-bubble-in {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.play-screen {
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  background: #0b73bd;
}

.game-layout {
  width: 100%;
  min-height: 100vh;
}

.game-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  position: absolute;
  inset: 18px 18px auto 18px;
  z-index: 12;
  padding: 0;
  pointer-events: none;
}

.game-header h2 {
  display: none;
}

.hud {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, max-content) 1fr repeat(2, max-content);
  gap: 8px;
  align-items: start;
}

.hud-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(184, 244, 255, 0.34);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(5, 78, 137, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 9px 18px rgba(1, 32, 86, 0.16);
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.hud-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: rgba(240, 253, 255, 0.9);
  text-shadow: 1px 2px 0 rgba(19, 80, 131, 0.22);
}

.hud-item:nth-child(1) .hud-label::before {
  content: "🎯";
}

.hud-item:nth-child(2) .hud-label::before {
  content: "🏆";
}

.hud-item:nth-child(3) {
  grid-column: 4;
}

.hud-item:nth-child(3) .hud-label::before {
  content: "⏱";
}

.hud-item:nth-child(3) strong::after {
  content: "초";
}

.hud-item:nth-child(4) .hud-label::before {
  content: "🌊";
}

.hud-item strong {
  display: inline-block;
  font-size: 1.05rem;
  color: #ffffff;
  text-shadow: 1px 2px 0 rgba(19, 80, 131, 0.25);
}

.webcam-panel,
.game-area {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.webcam-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  width: 188px;
  height: 141px;
  border: 2px solid rgba(105, 229, 255, 0.54);
  border-radius: 22px;
  background: rgba(4, 70, 127, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 14px 30px rgba(0, 31, 80, 0.28);
  backdrop-filter: blur(6px);
}

#webcam-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(1, 17, 28, 0.82);
  transform: scaleX(-1);
}

#landmark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
}

.game-area {
  --cleanliness: 0%;
  --cleanliness-level: 0;
  --water-murk: calc(1 - var(--cleanliness-level));
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(255, 255, 255, calc(0.18 + var(--cleanliness-level) * 0.36)), transparent 35%),
    radial-gradient(ellipse at 48% 12%, rgba(99, 232, 255, calc(0.12 + var(--cleanliness-level) * 0.28)), transparent 34%),
    radial-gradient(ellipse at 15% 88%, rgba(255, 135, 205, calc(0.08 + var(--cleanliness-level) * 0.22)), transparent 19%),
    radial-gradient(ellipse at 88% 86%, rgba(145, 250, 174, calc(0.08 + var(--cleanliness-level) * 0.18)), transparent 22%),
    linear-gradient(180deg,
      rgb(
        calc(10 + var(--cleanliness-level) * 64)
        calc(84 + var(--cleanliness-level) * 132)
        calc(142 + var(--cleanliness-level) * 94)
      ) 0%,
      rgb(
        calc(8 + var(--cleanliness-level) * 32)
        calc(66 + var(--cleanliness-level) * 112)
        calc(130 + var(--cleanliness-level) * 92)
      ) 45%,
      rgb(
        calc(5 + var(--cleanliness-level) * 28)
        calc(34 + var(--cleanliness-level) * 88)
        calc(91 + var(--cleanliness-level) * 112)
      ) 100%);
  filter: none;
  transition: background 800ms ease, filter 800ms ease;
}

.game-area::before,
.game-area::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  transition: opacity 500ms ease;
}

.game-area::before {
  z-index: 0;
  background:
    linear-gradient(103deg, transparent 3%, rgba(255, 255, 255, calc(0.1 + var(--cleanliness-level) * 0.24)) 12%, transparent 25%),
    linear-gradient(82deg, transparent 32%, rgba(255, 255, 255, calc(0.08 + var(--cleanliness-level) * 0.18)) 42%, transparent 54%),
    radial-gradient(ellipse at 50% 102%, rgba(255, 238, 178, 0.72), transparent 24%),
    radial-gradient(ellipse at 6% 65%, rgba(19, 57, 109, 0.44), transparent 26%),
    radial-gradient(ellipse at 96% 62%, rgba(22, 67, 124, 0.42), transparent 27%),
    radial-gradient(ellipse at 16% 98%, rgba(95, 92, 168, 0.44), transparent 16%),
    radial-gradient(ellipse at 84% 99%, rgba(104, 176, 132, 0.34), transparent 18%);
  opacity: 1;
}

.game-area::after {
  z-index: 0;
  background:
    radial-gradient(ellipse at 11% 96%, rgba(255, 132, 202, calc(0.26 + var(--cleanliness-level) * 0.3)), transparent 9%),
    radial-gradient(ellipse at 26% 99%, rgba(64, 215, 170, calc(0.24 + var(--cleanliness-level) * 0.24)), transparent 10%),
    radial-gradient(ellipse at 75% 98%, rgba(170, 235, 137, calc(0.18 + var(--cleanliness-level) * 0.26)), transparent 12%),
    radial-gradient(ellipse at 91% 96%, rgba(168, 104, 222, calc(0.18 + var(--cleanliness-level) * 0.26)), transparent 11%),
    linear-gradient(180deg, transparent 72%, rgba(240, 218, 168, 0.72) 100%);
  opacity: calc(0.74 + var(--cleanliness-level) * 0.22);
}

.play-ocean-scenery {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  transition: filter 800ms ease, opacity 800ms ease;
}

.play-ocean-scenery::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(9, 79, 127, calc(0.22 - var(--cleanliness-level) * 0.16)), rgba(5, 45, 92, calc(0.3 - var(--cleanliness-level) * 0.24))),
    url("assets/play-ocean-background.png") center / cover no-repeat;
  content: "";
  transition: filter 800ms ease, opacity 800ms ease;
}

.deep-reef,
.sea-floor,
.reef-cluster,
.water-surface,
.water-caustics {
  display: none;
}

.water-surface {
  position: absolute;
  inset: -4% -8% auto;
  height: 18%;
  opacity: calc(0.3 + var(--cleanliness-level) * 0.36);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(232, 255, 255, 0.58) 0 3%, transparent 7%),
    radial-gradient(ellipse at 50% 5%, rgba(255, 255, 255, 0.54) 0 5%, transparent 10%),
    radial-gradient(ellipse at 80% 12%, rgba(203, 249, 255, 0.5) 0 4%, transparent 9%);
  filter: blur(4px);
  transform-origin: top center;
  animation: play-surface-drift 12s ease-in-out infinite alternate;
}

.light-rays {
  position: absolute;
  inset: 0 0 35%;
  opacity: calc(0.18 + var(--cleanliness-level) * 0.46);
  mix-blend-mode: screen;
  transition: opacity 800ms ease;
}

.light-rays span {
  position: absolute;
  top: -12%;
  width: 18%;
  height: 115%;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, rgba(226, 255, 255, 0.45), rgba(175, 241, 255, 0.08) 68%, transparent);
  filter: blur(8px);
  transform-origin: top center;
  animation: play-ray-sway 15s ease-in-out infinite alternate;
}

.light-rays span:nth-child(1) {
  left: 17%;
  transform: rotate(-13deg);
}

.light-rays span:nth-child(2) {
  left: 45%;
  width: 13%;
  animation-delay: -6s;
}

.light-rays span:nth-child(3) {
  right: 14%;
  transform: rotate(14deg);
  animation-delay: -10s;
}

.water-caustics {
  position: absolute;
  inset: 10% 4% 18%;
  opacity: calc(0.04 + var(--cleanliness-level) * 0.13);
  background:
    radial-gradient(circle at 8% 18%, rgba(221, 254, 255, 0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 24% 62%, rgba(221, 254, 255, 0.2) 0 1px, transparent 3px),
    radial-gradient(circle at 56% 30%, rgba(221, 254, 255, 0.22) 0 2px, transparent 4px),
    radial-gradient(circle at 81% 72%, rgba(221, 254, 255, 0.2) 0 1px, transparent 3px),
    radial-gradient(circle at 94% 21%, rgba(221, 254, 255, 0.24) 0 2px, transparent 4px);
  background-size: 310px 230px;
  filter: blur(0.4px);
  animation: play-caustics 22s linear infinite;
  transition: opacity 800ms ease;
}

.deep-reef {
  position: absolute;
  bottom: 29%;
  width: 28%;
  height: 42%;
  opacity: calc(0.34 + var(--cleanliness-level) * 0.16);
  filter: saturate(calc(0.65 + var(--cleanliness-level) * 0.45));
}

.deep-reef::before,
.deep-reef::after {
  position: absolute;
  bottom: 0;
  content: "";
  border-radius: 48% 52% 20% 18%;
  background:
    radial-gradient(circle at 45% 24%, rgba(100, 171, 199, 0.45), transparent 20%),
    linear-gradient(145deg, rgba(30, 102, 154, 0.82), rgba(13, 65, 125, 0.82));
  box-shadow: inset 12px 9px 20px rgba(151, 224, 233, 0.1);
}

.deep-reef::before {
  width: 76%;
  height: 78%;
}

.deep-reef::after {
  width: 56%;
  height: 56%;
}

.reef-left {
  left: -8%;
}

.reef-left::before {
  left: 0;
  transform: rotate(12deg);
}

.reef-left::after {
  left: 48%;
  transform: rotate(-8deg);
}

.reef-right {
  right: -9%;
}

.reef-right::before {
  right: 0;
  transform: rotate(-13deg);
}

.reef-right::after {
  right: 48%;
  transform: rotate(9deg);
}

.sea-floor {
  position: absolute;
  right: -5%;
  bottom: -8%;
  left: -5%;
  height: 25%;
  border-radius: 50% 50% 0 0 / 24% 24% 0 0;
  opacity: calc(0.78 + var(--cleanliness-level) * 0.18);
  background:
    radial-gradient(circle at 11% 30%, rgba(255, 255, 255, 0.32) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 46%, rgba(112, 130, 151, 0.25) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 24%, rgba(255, 255, 255, 0.25) 0 2px, transparent 3px),
    linear-gradient(180deg, #e7d5a4 0%, #b8a677 48%, #758b8d 100%);
  box-shadow: inset 0 18px 30px rgba(255, 246, 198, 0.18);
  filter: saturate(calc(0.72 + var(--cleanliness-level) * 0.38));
}

.reef-cluster {
  position: absolute;
  bottom: 4%;
  width: 28%;
  height: 30%;
  filter: saturate(calc(0.58 + var(--cleanliness-level) * 0.55)) brightness(calc(0.78 + var(--cleanliness-level) * 0.2));
  transition: filter 800ms ease, opacity 800ms ease;
}

.reef-cluster-left {
  left: 210px;
  width: 17%;
}

.reef-cluster-right {
  right: 220px;
  width: 17%;
}

.reef-cluster-center {
  left: 50%;
  width: 13%;
  height: 18%;
  transform: translateX(-50%);
}

.reef-rock {
  position: absolute;
  bottom: 0;
  border-radius: 48% 52% 38% 34%;
  background: linear-gradient(145deg, #7794b4, #395f87 62%, #26476d);
  box-shadow:
    inset 10px 8px 14px rgba(190, 235, 241, 0.22),
    0 12px 18px rgba(4, 45, 91, 0.22);
}

.rock-one,
.rock-three {
  width: 46%;
  height: 40%;
}

.rock-two,
.rock-four {
  width: 34%;
  height: 31%;
}

.rock-center {
  left: 26%;
  width: 48%;
  height: 27%;
}

.rock-one {
  left: 0;
}

.rock-two {
  left: 31%;
  bottom: 1%;
}

.rock-three {
  right: 0;
}

.rock-four {
  right: 32%;
  bottom: 1%;
}

.play-coral,
.play-sponge,
.play-shell,
.play-starfish {
  position: absolute;
  z-index: 2;
  line-height: 1;
  text-shadow: 0 7px 10px rgba(0, 42, 89, 0.28);
}

.play-coral {
  bottom: 11%;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.8rem);
  transform-origin: bottom center;
  animation: play-coral-sway 6s ease-in-out infinite alternate;
  transition: color 800ms ease, filter 800ms ease, transform 800ms ease;
}

.coral-pink {
  left: 3%;
  color: #f27fb5;
}

.coral-violet {
  left: 34%;
  bottom: 7%;
  color: #a686e8;
  animation-delay: -3s;
}

.coral-orange {
  right: 3%;
  color: #ff9875;
}

.coral-mint {
  right: 35%;
  bottom: 7%;
  color: #63ddb3;
  animation-delay: -2s;
}

.coral-center {
  left: 5%;
  bottom: 3%;
  color: #f58bb3;
  font-size: clamp(2rem, 4vw, 3.8rem);
  animation-delay: -4s;
}

.play-sponge {
  bottom: 8%;
  width: 44px;
  height: 58px;
  overflow: hidden;
  border: 5px dotted rgba(255, 255, 255, 0.3);
  border-radius: 38% 48% 26% 30%;
  font-size: 0;
}

.sponge-yellow {
  left: 55%;
  background: #f2ca58;
}

.sponge-green {
  right: 56%;
  background: #70c98d;
}

.play-shell {
  bottom: 3%;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}

.shell-left {
  left: 62%;
}

.shell-right {
  right: 63%;
}

.shell-center {
  right: 2%;
  bottom: 0;
  font-size: clamp(1.1rem, 2vw, 1.8rem);
}

.play-starfish {
  bottom: 1%;
  color: #ffad5f;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.star-left {
  left: 76%;
  transform: rotate(-18deg);
}

.star-right {
  right: 77%;
  transform: rotate(16deg);
}

.star-center {
  left: 44%;
  bottom: -2%;
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  transform: rotate(10deg);
}

.play-weed {
  position: absolute;
  bottom: 5%;
  width: 18px;
  height: 54%;
  border: solid rgba(56, 194, 145, 0.92);
  border-width: 0 8px 0 0;
  border-radius: 0 80% 0 0;
  transform-origin: bottom center;
  animation: play-weed-sway 5.5s ease-in-out infinite alternate;
  transition: border-color 800ms ease, filter 800ms ease, opacity 800ms ease;
}

.play-weed::after {
  position: absolute;
  right: -9px;
  bottom: 34%;
  width: 22px;
  height: 11px;
  border-radius: 100% 0;
  background: rgba(82, 218, 158, 0.88);
  content: "";
  transform: rotate(-25deg);
}

.weed-a { left: 20%; height: 48%; }
.weed-b { left: 29%; height: 63%; animation-delay: -1.8s; }
.weed-c { left: 70%; height: 42%; animation-delay: -3.6s; }
.weed-d { right: 20%; height: 52%; animation-delay: -1s; }
.weed-e { right: 30%; height: 66%; animation-delay: -2.8s; }
.weed-f { right: 70%; height: 44%; animation-delay: -4s; }
.weed-center-a { left: 20%; height: 48%; animation-delay: -2.2s; }
.weed-center-b { right: 12%; height: 38%; animation-delay: -4.4s; }

.play-bubbles {
  position: absolute;
  inset: 0;
}

.play-bubbles span {
  position: absolute;
  bottom: -30px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(217, 253, 255, 0.58);
  border-radius: 50%;
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.4);
  opacity: 0;
  animation: play-bubble-rise 14s linear infinite;
  transition: opacity 800ms ease;
}

.bubbles-left span:nth-child(1) { left: 6%; animation-delay: -2s; }
.bubbles-left span:nth-child(2) { left: 12%; width: 8px; height: 8px; animation-delay: -8s; animation-duration: 17s; }
.bubbles-left span:nth-child(3) { left: 19%; width: 17px; height: 17px; animation-delay: -12s; animation-duration: 19s; }
.bubbles-left span:nth-child(4) { left: 24%; width: 7px; height: 7px; animation-delay: -5s; }
.bubbles-left span:nth-child(5) { left: 31%; animation-delay: -15s; animation-duration: 20s; }
.bubbles-right span:nth-child(1) { right: 5%; width: 9px; height: 9px; animation-delay: -4s; }
.bubbles-right span:nth-child(2) { right: 13%; width: 16px; height: 16px; animation-delay: -11s; animation-duration: 18s; }
.bubbles-right span:nth-child(3) { right: 22%; animation-delay: -7s; animation-duration: 16s; }
.bubbles-right span:nth-child(4) { right: 29%; width: 7px; height: 7px; animation-delay: -14s; animation-duration: 20s; }

.ambient-fish {
  position: absolute;
  z-index: 1;
  width: clamp(44px, 4.5vw, 72px);
  aspect-ratio: 1.65;
  opacity: calc(0.22 + var(--cleanliness-level) * 0.2);
  filter: saturate(0.92) drop-shadow(0 5px 5px rgba(0, 35, 80, 0.2));
  line-height: 1;
  will-change: transform;
  transition: opacity 800ms ease, filter 800ms ease;
}

.ambient-fish::before {
  position: absolute;
  inset: 8% 12% 8% 3%;
  border: 3px solid rgba(4, 74, 135, 0.48);
  border-radius: 58% 44% 48% 56%;
  background:
    radial-gradient(circle at 72% 34%, #ffffff 0 5%, #12396d 6% 10%, transparent 11%),
    linear-gradient(120deg, #ffe45f 0 48%, #ffad38 49% 100%);
  box-shadow:
    inset 5px 7px 8px rgba(255, 255, 255, 0.34),
    inset -5px -7px 8px rgba(1, 81, 139, 0.2);
  content: "";
}

.ambient-fish::after {
  position: absolute;
  left: -18%;
  top: 24%;
  width: 31%;
  height: 53%;
  border: 3px solid rgba(4, 74, 135, 0.42);
  border-right: 0;
  border-radius: 75% 0 0 75%;
  background: #ffb739;
  content: "";
  transform: skewY(-14deg);
  transform-origin: right center;
  animation: fish-tail-kick 900ms ease-in-out infinite alternate;
}

.background-debris {
  position: absolute;
  z-index: 1;
  color: rgba(156, 178, 190, 0.62);
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  opacity: 0;
  filter: grayscale(0.85) drop-shadow(0 5px 6px rgba(0, 31, 72, 0.22));
  transition: opacity 700ms ease, transform 700ms ease;
  animation: background-debris-drift 7s ease-in-out infinite alternate;
}

.debris-bottle {
  left: 4%;
  top: 43%;
  transform: rotate(-18deg);
}

.debris-bag {
  right: 5%;
  top: 58%;
  font-size: 2rem;
  transform: rotate(22deg);
}

.debris-can {
  right: 18%;
  bottom: 19%;
  transform: rotate(-12deg);
  animation-delay: -3s;
}

.game-area.ocean-stage-0 .background-debris {
  opacity: 0.42;
}

.game-area.ocean-stage-1 .background-debris {
  opacity: 0.2;
}

.game-area.ocean-stage-2 .background-debris,
.game-area.ocean-stage-3 .background-debris,
.game-area.ocean-stage-4 .background-debris {
  opacity: 0;
}

.game-area.ocean-stage-0 .play-ocean-scenery {
  filter: saturate(0.55) brightness(0.78);
}

.game-area.ocean-stage-0 .reef-cluster {
  filter: grayscale(0.82) saturate(0.42) brightness(0.72);
}

.game-area.ocean-stage-0 .play-coral {
  color: #78909e;
  filter: grayscale(0.8);
  animation-play-state: paused;
}

.game-area.ocean-stage-0 .play-weed {
  border-color: rgba(77, 118, 112, 0.66);
  filter: grayscale(0.65);
  animation: none;
  transform: rotate(13deg) scaleY(0.72);
}

.game-area.ocean-stage-0 .ambient-fish {
  opacity: 0;
  animation-duration: 42s;
  filter: grayscale(0.62) saturate(0.48) brightness(0.72);
}

.game-area.ocean-stage-0 .ambient-fish-yellow {
  opacity: 0.2;
}

.game-area.ocean-stage-0 .play-bubbles span:nth-child(n + 4) {
  display: none;
}

.game-area.ocean-stage-1 .play-ocean-scenery {
  filter: saturate(0.78) brightness(0.88);
}

.game-area.ocean-stage-1 .reef-cluster {
  filter: grayscale(0.35) saturate(0.78) brightness(0.86);
}

.game-area.ocean-stage-1 .play-coral,
.game-area.ocean-stage-1 .play-weed {
  animation-duration: 9s;
}

.game-area.ocean-stage-1 .ambient-fish {
  opacity: 0;
  animation-duration: 31s;
}

.game-area.ocean-stage-1 .ambient-fish-yellow,
.game-area.ocean-stage-1 .ambient-fish-blue,
.game-area.ocean-stage-1 .ambient-fish-striped {
  opacity: 0.3;
}

.game-area.ocean-stage-2 .play-ocean-scenery {
  filter: saturate(0.98) brightness(0.96);
}

.game-area.ocean-stage-2 .reef-cluster {
  filter: saturate(1) brightness(0.96);
}

.game-area.ocean-stage-2 .ambient-fish {
  opacity: 0.38;
}

.game-area.ocean-stage-2 .play-bubbles span {
  animation-duration: 11s;
}

.game-area.ocean-stage-3 .play-ocean-scenery,
.game-area.ocean-stage-4 .play-ocean-scenery {
  filter: saturate(1.12) brightness(1.04);
}

.game-area.ocean-stage-3 .reef-cluster,
.game-area.ocean-stage-4 .reef-cluster {
  filter: saturate(1.16) brightness(1.05);
}

.game-area.ocean-stage-3 .light-rays {
  opacity: 0.72;
}

.game-area.ocean-stage-3 .ambient-fish {
  opacity: 0.46;
}

.game-area.ocean-stage-4 .light-rays {
  opacity: 0.92;
}

.game-area.ocean-stage-4 .water-caustics {
  opacity: 0.2;
}

.game-area.ocean-stage-4 .ambient-fish {
  opacity: 0.56;
  filter: saturate(1.05) drop-shadow(0 5px 7px rgba(0, 35, 80, 0.18));
}

@keyframes background-debris-drift {
  from { translate: 0 0; rotate: -3deg; }
  to { translate: 5px -9px; rotate: 3deg; }
}

.ambient-fish-yellow {
  top: 24%;
  left: -220px;
  animation: play-fish-right 24s linear infinite;
}

.ambient-fish-blue {
  top: 48%;
  right: -220px;
  transform: scaleX(-1);
  animation: play-fish-left 29s linear -12s infinite;
}

.ambient-fish-blue::before {
  background:
    radial-gradient(circle at 72% 34%, #ffffff 0 5%, #12396d 6% 10%, transparent 11%),
    linear-gradient(120deg, #35d9ee 0 48%, #1988dc 49% 100%);
}

.ambient-fish-blue::after {
  background: #1ca6de;
}

.ambient-fish-striped {
  top: 67%;
  left: -220px;
  animation: play-fish-right 34s linear -19s infinite;
}

.ambient-fish-striped::before {
  background:
    radial-gradient(circle at 72% 34%, #ffffff 0 5%, #12396d 6% 10%, transparent 11%),
    linear-gradient(90deg, #ff7b30 0 17%, #fff8e8 18% 29%, #ff762d 30% 53%, #fff8e8 54% 65%, #f25e29 66%);
}

.ambient-fish-striped::after {
  background: #ff7130;
}

.ambient-fish-coral {
  left: -220px;
  top: 56%;
  width: clamp(38px, 4vw, 62px);
  animation: play-fish-right 31s linear -7s infinite;
}

.ambient-fish-coral::before {
  background:
    radial-gradient(circle at 72% 34%, #ffffff 0 5%, #12396d 6% 10%, transparent 11%),
    linear-gradient(120deg, #ff8d7f 0 48%, #ec547c 49% 100%);
}

.ambient-fish-coral::after {
  background: #ef6480;
}

.ambient-fish-tiny {
  top: 34%;
  right: -260px;
  display: flex;
  width: 145px;
  height: 54px;
  align-items: center;
  gap: 8px;
  animation: play-school-left 36s linear -8s infinite;
}

.ambient-fish-tiny::before,
.ambient-fish-tiny::after {
  display: none;
}

.ambient-fish-tiny i {
  position: relative;
  display: block;
  width: 18px;
  height: 11px;
  flex: 0 0 18px;
  border-radius: 60% 45% 45% 60%;
  background: #f7d94f;
  box-shadow: inset -4px 0 0 #2b9bd2;
}

.ambient-fish-tiny i::before {
  position: absolute;
  left: -6px;
  top: 2px;
  border-width: 4px 7px 4px 0;
  border-style: solid;
  border-color: transparent #58b7d9 transparent transparent;
  content: "";
}

.ambient-fish-tiny i:nth-child(2) { translate: 0 -13px; }
.ambient-fish-tiny i:nth-child(3) { translate: 0 10px; }
.ambient-fish-tiny i:nth-child(4) { translate: 0 -5px; }
.ambient-fish-tiny i:nth-child(5) { translate: 0 13px; }

/* Raster game characters replace the temporary CSS and text illustrations. */
.ambient-fish,
.ambient-puffer,
.ocean-life .fish,
.turtle,
.seahorse,
.jellyfish {
  border: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

.ambient-fish::before,
.ambient-fish::after,
.ambient-puffer::before,
.ambient-puffer::after,
.ocean-life .fish::before,
.ocean-life .fish::after,
.turtle::before,
.turtle::after,
.jellyfish::before,
.jellyfish::after,
.seahorse::before,
.seahorse::after {
  display: none;
}

.ambient-fish-yellow {
  width: clamp(70px, 7vw, 90px);
  background-image: url("assets/marine-life/butterflyfish.png");
}

.ambient-fish-blue {
  width: clamp(72px, 7vw, 92px);
  background-image: url("assets/marine-life/blue-tang.png");
  transform: none;
}

.ambient-fish-striped {
  width: clamp(82px, 8vw, 100px);
  background-image: url("assets/marine-life/clownfish.png");
}

.ambient-fish-coral {
  width: clamp(48px, 5vw, 64px);
  background-image: url("assets/marine-life/butterflyfish.png");
}

.ambient-fish-tiny {
  width: clamp(135px, 14vw, 180px);
  height: 90px;
  background-image: url("assets/marine-life/fish-school.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.ambient-fish-tiny i {
  display: none;
}

.ambient-puffer {
  background-image: url("assets/marine-life/pufferfish.png");
}


.ambient-puffer {
  position: absolute;
  left: -190px;
  top: 43%;
  z-index: 1;
  width: clamp(90px, 8vw, 110px);
  aspect-ratio: 1;
  border: 4px solid rgba(77, 94, 54, 0.55);
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle at 67% 34%, #fff 0 5%, #243c4d 6% 10%, transparent 11%),
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.46) 0 5%, transparent 6%),
    radial-gradient(circle at 22% 61%, #9a873d 0 3%, transparent 4%),
    radial-gradient(circle at 51% 70%, #9a873d 0 3%, transparent 4%),
    linear-gradient(145deg, #ffe976, #d8b84f);
  box-shadow:
    inset 8px 10px 13px rgba(255, 255, 255, 0.28),
    inset -9px -10px 13px rgba(117, 92, 35, 0.22),
    0 8px 12px rgba(0, 38, 80, 0.2);
  transition: opacity 800ms ease, filter 800ms ease;
  animation: puffer-swim 33s linear -16s infinite;
}

.ambient-puffer::before {
  position: absolute;
  left: -21px;
  top: 31%;
  border-width: 18px 25px 18px 0;
  border-style: solid;
  border-color: transparent #d3ad47 transparent transparent;
  content: "";
}

.ambient-puffer::after {
  position: absolute;
  right: -8px;
  top: 54%;
  width: 16px;
  height: 9px;
  border-radius: 50%;
  background: #735b31;
  content: "";
}

.game-area.ocean-stage-2 .ambient-puffer {
  opacity: 0.34;
}

.game-area.ocean-stage-3 .ambient-puffer {
  opacity: 0.48;
}

.game-area.ocean-stage-4 .ambient-puffer {
  opacity: 0.62;
}

.game-area.ocean-stage-0 .ambient-puffer,
.game-area.ocean-stage-1 .ambient-puffer {
  opacity: 0;
}

@keyframes puffer-swim {
  0% { transform: translateX(0) translateY(0) rotate(-2deg); }
  45% { transform: translateX(56vw) translateY(-18px) rotate(3deg); }
  100% { transform: translateX(calc(100vw + 390px)) translateY(8px) rotate(-2deg); }
}

@keyframes play-surface-drift {
  from { transform: translateX(-2%) scaleX(1); }
  to { transform: translateX(2%) scaleX(1.04); }
}

@keyframes play-ray-sway {
  from { translate: -3% 0; rotate: -3deg; }
  to { translate: 4% 0; rotate: 4deg; }
}

@keyframes play-caustics {
  from { background-position: 0 0; }
  to { background-position: 260px 150px; }
}

@keyframes play-coral-sway {
  from { transform: rotate(-2deg) scaleY(0.97); }
  to { transform: rotate(2deg) scaleY(1.02); }
}

@keyframes play-weed-sway {
  from { transform: rotate(-7deg); }
  to { transform: rotate(9deg); }
}

@keyframes play-bubble-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(0.75); }
  12% { opacity: 0.55; }
  88% { opacity: 0.45; }
  100% { opacity: 0; transform: translate(24px, -108vh) scale(1.15); }
}

@keyframes play-fish-right {
  0% { transform: translateX(0) translateY(0); }
  45% { transform: translateX(55vw) translateY(-12px); }
  100% { transform: translateX(calc(100vw + 390px)) translateY(5px); }
}

@keyframes play-fish-left {
  0% { transform: translateX(0) translateY(0); }
  48% { transform: translateX(-55vw) translateY(12px); }
  100% { transform: translateX(calc(-100vw - 390px)) translateY(-5px); }
}

@keyframes play-school-left {
  0% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(-58vw) translateY(-14px); }
  100% { transform: translateX(calc(-100vw - 460px)) translateY(4px); }
}

.placeholder-text {
  display: none;
}

.ocean-life {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.sea-life {
  position: absolute;
  color: rgba(147, 123, 88, 0.62);
  opacity: 0;
  text-shadow: 0 7px 12px rgba(0, 39, 94, 0.22);
  transition: color 500ms ease, opacity 500ms ease, transform 500ms ease, filter 500ms ease;
}

.life-stage-0 {
  opacity: calc(0.36 + var(--cleanliness-level) * 0.24);
}

.game-area.ocean-stage-1 .life-stage-1,
.game-area.ocean-stage-2 .life-stage-1,
.game-area.ocean-stage-2 .life-stage-2,
.game-area.ocean-stage-3 .life-stage-1,
.game-area.ocean-stage-3 .life-stage-2,
.game-area.ocean-stage-3 .life-stage-3,
.game-area.ocean-stage-4 .life-stage-1,
.game-area.ocean-stage-4 .life-stage-2,
.game-area.ocean-stage-4 .life-stage-3,
.game-area.ocean-stage-4 .life-stage-4 {
  opacity: calc(0.58 + var(--cleanliness-level) * 0.38);
}

.coral {
  bottom: 5%;
  font-size: clamp(3.2rem, 9vw, 7rem);
  transform: scaleY(calc(0.68 + var(--cleanliness-level) * 0.32));
  transform-origin: bottom center;
}

.coral-one {
  left: 15%;
}

.coral-two {
  right: 24%;
  bottom: 7%;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
}

.fish {
  width: clamp(42px, 4vw, 64px);
  aspect-ratio: 1.65;
  font-size: 0;
  transform: translateY(calc((1 - var(--cleanliness-level)) * 18px)) rotate(calc((0.35 - var(--cleanliness-level)) * -8deg));
  animation: tired-swim 9s ease-in-out infinite;
}

.fish::before {
  position: absolute;
  inset: 7% 11% 7% 4%;
  border: 3px solid rgba(2, 68, 126, 0.48);
  border-radius: 58% 44% 48% 56%;
  background:
    radial-gradient(circle at 72% 34%, #ffffff 0 5%, #143866 6% 10%, transparent 11%),
    linear-gradient(120deg, #ff9256 0 46%, #f0543f 47% 100%);
  box-shadow:
    inset 4px 6px 7px rgba(255, 255, 255, 0.32),
    inset -5px -6px 7px rgba(3, 73, 126, 0.18);
  content: "";
}

.fish::after {
  position: absolute;
  left: -17%;
  top: 24%;
  width: 31%;
  height: 52%;
  border: 3px solid rgba(2, 68, 126, 0.42);
  border-right: 0;
  border-radius: 75% 0 0 75%;
  background: #ef6048;
  content: "";
  transform-origin: right center;
  animation: fish-tail-kick 1.1s ease-in-out infinite alternate;
}

.fish-one {
  left: 28%;
  top: 36%;
}

.fish-two {
  right: 27%;
  top: 52%;
  animation-delay: -2.5s;
}

.fish-two::before {
  background:
    radial-gradient(circle at 72% 34%, #ffffff 0 5%, #143866 6% 10%, transparent 11%),
    linear-gradient(120deg, #54d9ef 0 46%, #276fd1 47% 100%);
}

.fish-two::after {
  background: #328fcf;
}

.seaweed {
  bottom: 3%;
  color: rgba(75, 191, 141, 0.8);
  font-size: clamp(2.4rem, 6vw, 5rem);
  transform-origin: bottom center;
  animation: seaweed-sway 2.8s ease-in-out infinite;
}

.seaweed-one {
  left: 34%;
}

.seaweed-two {
  right: 14%;
  bottom: 4%;
  animation-delay: -1.1s;
}

.fish-school {
  font-family: "Courier New", monospace;
  color: rgba(220, 255, 240, 0.88);
  font-size: clamp(0.95rem, 2.2vw, 1.5rem);
  animation: school-swim 6.5s ease-in-out infinite;
}

.ocean-life .fish-school {
  display: none;
}

.fish-school-one {
  left: 12%;
  top: 36%;
}

.fish-school-two {
  right: 13%;
  top: 30%;
  animation-delay: -2.4s;
}

.turtle {
  right: 12%;
  top: 43%;
  width: clamp(150px, 14vw, 180px);
  height: 105px;
  animation: turtle-glide 12s ease-in-out infinite;
}

.turtle i {
  position: absolute;
  left: 24%;
  top: 18%;
  width: 58%;
  height: 68%;
  border: 4px solid rgba(30, 93, 76, 0.55);
  border-radius: 52% 48% 46% 54%;
  background:
    radial-gradient(circle at 36% 38%, transparent 0 17%, rgba(34, 116, 91, 0.45) 18% 21%, transparent 22%),
    radial-gradient(circle at 66% 60%, transparent 0 16%, rgba(34, 116, 91, 0.42) 17% 20%, transparent 21%),
    linear-gradient(145deg, #79d48e, #2f9b78);
  box-shadow: inset 8px 9px 12px rgba(235, 255, 207, 0.24);
}

.turtle b {
  position: absolute;
  right: 3%;
  top: 35%;
  width: 31%;
  height: 34%;
  border-radius: 48% 58% 55% 48%;
  background:
    radial-gradient(circle at 68% 34%, #fff 0 7%, #173f4a 8% 13%, transparent 14%),
    #74d69c;
}

.turtle::before,
.turtle::after {
  position: absolute;
  left: 35%;
  width: 40%;
  height: 28%;
  border-radius: 70% 25% 70% 25%;
  background: #62c58d;
  content: "";
  transform-origin: 20% 50%;
  animation: turtle-flipper 3.2s ease-in-out infinite alternate;
}

.turtle::before {
  top: 2%;
  transform: rotate(-24deg);
}

.turtle::after {
  bottom: 0;
  transform: scaleY(-1) rotate(-24deg);
  animation-delay: -1.6s;
}

.starfish {
  left: 12%;
  bottom: 10%;
  color: rgba(255, 184, 100, 0.95);
  font-size: clamp(1.8rem, 4.8vw, 3.2rem);
  transform: rotate(-14deg);
}

.seahorse {
  right: 8%;
  top: 32%;
  width: 90px;
  height: 105px;
  animation: seahorse-drift 6.8s ease-in-out infinite;
}

.seahorse::before {
  position: absolute;
  left: 24px;
  top: 8px;
  width: 42px;
  height: 76px;
  border: 9px solid #f6b84c;
  border-left-width: 16px;
  border-radius: 60% 48% 58% 42%;
  box-shadow:
    inset 5px 0 rgba(255, 233, 140, 0.5),
    0 5px 8px rgba(0, 42, 86, 0.2);
  content: "";
  transform: rotate(-10deg);
}

.seahorse::after {
  position: absolute;
  left: 13px;
  bottom: 0;
  width: 48px;
  height: 42px;
  border: 10px solid #f6b84c;
  border-top-color: transparent;
  border-radius: 50%;
  content: "";
}

.seahorse i {
  position: absolute;
  right: 9px;
  top: 19px;
  z-index: 1;
  width: 32px;
  height: 19px;
  border-radius: 45% 70% 70% 45%;
  background:
    radial-gradient(circle at 69% 31%, #fff 0 8%, #233c55 9% 15%, transparent 16%),
    #ffd368;
}

.jellyfish {
  width: clamp(120px, 12vw, 160px);
  height: clamp(130px, 14vw, 175px);
  animation: jelly-float 6.5s ease-in-out infinite;
}

.jellyfish::before {
  position: absolute;
  left: 10%;
  top: 0;
  width: 80%;
  height: 56%;
  border: 3px solid rgba(233, 251, 255, 0.48);
  border-radius: 55% 55% 38% 38%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.75) 0 6%, transparent 7%),
    linear-gradient(145deg, rgba(243, 185, 255, 0.88), rgba(112, 202, 255, 0.72));
  box-shadow: inset 8px 10px 15px rgba(255, 255, 255, 0.28);
  content: "";
}

.jellyfish::after {
  position: absolute;
  left: 19%;
  top: 48%;
  width: 62%;
  height: 49%;
  border-radius: 0 0 50% 50%;
  background:
    linear-gradient(82deg, transparent 0 8%, rgba(193, 168, 255, 0.74) 9% 16%, transparent 17% 29%, rgba(144, 211, 255, 0.7) 30% 37%, transparent 38% 51%, rgba(210, 166, 255, 0.7) 52% 60%, transparent 61% 73%, rgba(131, 209, 255, 0.68) 74% 82%, transparent 83%);
  content: "";
  transform-origin: top center;
  animation: jelly-tentacles 3.6s ease-in-out infinite alternate;
}

.jellyfish-one {
  left: 39%;
  top: 17%;
}

.jellyfish-two {
  right: 27%;
  top: 28%;
  scale: 0.78;
  animation-delay: -2s;
}

.ambient-puffer,
.ocean-life .fish,
.turtle,
.seahorse,
.jellyfish {
  border: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

.ambient-puffer {
  background-image: url("assets/marine-life/pufferfish.png");
}

.ambient-puffer::before,
.ambient-puffer::after,
.ocean-life .fish::before,
.ocean-life .fish::after,
.turtle::before,
.turtle::after,
.jellyfish::before,
.jellyfish::after,
.seahorse::before,
.seahorse::after {
  display: none;
}

.ocean-life .fish-one {
  width: clamp(72px, 7vw, 92px);
  height: 66px;
  background-image: url("assets/marine-life/clownfish.png");
}

.ocean-life .fish-two {
  width: clamp(65px, 6.5vw, 86px);
  height: 62px;
  background-image: url("assets/marine-life/blue-tang.png");
}

.turtle {
  background-image: url("assets/marine-life/turtle.png");
}

.turtle i,
.turtle b,
.seahorse i,
.jellyfish i {
  display: none;
}

.seahorse {
  background-image: url("assets/marine-life/seahorse.png");
}

.jellyfish {
  background-image: url("assets/marine-life/jellyfish.png");
}

.ocean-life .coral,
.ocean-life .seaweed,
.ocean-life .starfish {
  display: none;
}

.sunlight {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 100%;
  height: 58%;
  opacity: calc(var(--cleanliness-level) * 0.72);
  background:
    linear-gradient(105deg, rgba(255, 255, 222, 0.34), transparent 24%),
    linear-gradient(75deg, rgba(255, 255, 255, 0.24), transparent 20%);
  clip-path: polygon(12% 0, 26% 0, 48% 100%, 34% 100%);
  transition: opacity 600ms ease;
  pointer-events: none;
}

.game-area.ocean-stage-4 .sunlight {
  opacity: 0.9;
}

.game-area.ocean-dirty .coral,
.game-area.ocean-dirty .fish,
.game-area.ocean-dirty .sea-life {
  color: rgba(112, 159, 190, 0.54);
  filter: grayscale(0.42) brightness(0.82);
}

.game-area.ocean-recovering .coral {
  color: rgba(214, 122, 132, 0.7);
}

.game-area.ocean-recovering .fish {
  color: rgba(178, 231, 216, 0.82);
}

.game-area.ocean-clean .coral {
  color: rgba(255, 125, 155, 0.9);
}

.game-area.ocean-clean .fish {
  color: rgba(234, 255, 244, 0.95);
}

@keyframes tired-swim {
  0%,
  100% {
    margin-left: 0;
  }
  50% {
    margin-left: 12px;
  }
}

@keyframes seaweed-sway {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

@keyframes school-swim {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(34px);
  }
}

@keyframes turtle-glide {
  0%,
  100% {
    transform: translate(0, 0) rotate(-4deg) scaleX(-1);
  }
  50% {
    transform: translate(-110px, -16px) rotate(3deg) scaleX(-1);
  }
}

@keyframes jelly-float {
  0%,
  100% {
    transform: translate(0, 0) rotate(-2deg) scaleY(0.97);
  }
  28% {
    transform: translate(8px, -15px) rotate(1deg) scaleY(1.02);
  }
  55% {
    transform: translate(17px, -27px) rotate(3deg) scaleY(1.06);
  }
  78% {
    transform: translate(6px, -12px) rotate(-1deg) scaleY(1);
  }
}

@keyframes turtle-flipper {
  from { rotate: -18deg; scale: 1 0.82; }
  to { rotate: 18deg; scale: 1 1.08; }
}

@keyframes jelly-tentacles {
  from { transform: skewX(-5deg) scaleY(0.94); }
  to { transform: skewX(7deg) scaleY(1.08); }
}

@keyframes fish-tail-kick {
  from { scale: 0.86 1; rotate: -5deg; }
  to { scale: 1.12 0.88; rotate: 6deg; }
}

@keyframes seahorse-drift {
  0%,
  100% {
    transform: translateY(0) rotate(8deg);
  }
  50% {
    transform: translateY(-13px) rotate(2deg);
  }
}

.game-area.ocean-stage-0 .ambient-fish,
.game-area.ocean-stage-0 .ambient-puffer {
  opacity: 0;
  animation: none;
}

.game-area.ocean-stage-0 .ocean-life .fish-one {
  filter: grayscale(0.78) saturate(0.38) brightness(0.72);
  animation: sick-fish-drift 13s ease-in-out infinite;
}

.game-area.ocean-stage-1 .ocean-life .fish {
  filter: grayscale(0.38) saturate(0.62) brightness(0.86);
  animation: recovering-fish-drift 9s ease-in-out infinite;
}

.game-area.ocean-stage-1 .ambient-fish-yellow {
  animation-duration: 34s;
}

.game-area.ocean-stage-1 .ambient-fish-blue {
  animation-duration: 38s;
}

.game-area.ocean-stage-1 .ambient-fish-striped {
  animation-duration: 42s;
}

.game-area.ocean-stage-2 .ocean-life .fish {
  filter: grayscale(0.08) saturate(0.9);
  animation: lively-fish-loop 6.8s ease-in-out infinite;
}

.game-area.ocean-stage-2 .ambient-fish-yellow { animation-duration: 25s; }
.game-area.ocean-stage-2 .ambient-fish-blue { animation-duration: 28s; }
.game-area.ocean-stage-2 .ambient-fish-striped { animation-duration: 31s; }
.game-area.ocean-stage-2 .ambient-fish-coral { animation-duration: 29s; }
.game-area.ocean-stage-2 .ambient-fish-tiny { animation-duration: 30s; }
.game-area.ocean-stage-2 .ambient-puffer { animation-duration: 35s; }

.game-area.ocean-stage-3 .ocean-life .fish,
.game-area.ocean-stage-4 .ocean-life .fish {
  filter: saturate(1.1) brightness(1.03);
  animation: lively-fish-loop 4.8s ease-in-out infinite;
}

.game-area.ocean-stage-3 .ambient-fish-yellow { animation-duration: 19s; }
.game-area.ocean-stage-3 .ambient-fish-blue { animation-duration: 22s; }
.game-area.ocean-stage-3 .ambient-fish-striped { animation-duration: 24s; }
.game-area.ocean-stage-3 .ambient-fish-coral { animation-duration: 21s; }
.game-area.ocean-stage-3 .ambient-fish-tiny { animation-duration: 23s; }
.game-area.ocean-stage-3 .ambient-puffer { animation-duration: 26s; }
.game-area.ocean-stage-3 .turtle { animation-duration: 14s; }
.game-area.ocean-stage-3 .seahorse { animation-duration: 8s; }

.game-area.ocean-stage-4 .ambient-fish-yellow { animation-duration: 14s; }
.game-area.ocean-stage-4 .ambient-fish-blue { animation-duration: 17s; }
.game-area.ocean-stage-4 .ambient-fish-striped { animation-duration: 18s; }
.game-area.ocean-stage-4 .ambient-fish-coral { animation-duration: 15s; }
.game-area.ocean-stage-4 .ambient-fish-tiny { animation-duration: 17s; }
.game-area.ocean-stage-4 .ambient-puffer { animation-duration: 20s; }
.game-area.ocean-stage-4 .turtle { animation-duration: 10s; }
.game-area.ocean-stage-4 .seahorse { animation-duration: 5.8s; }
.game-area.ocean-stage-4 .jellyfish-one { animation-duration: 5.2s; }
.game-area.ocean-stage-4 .jellyfish-two { animation-duration: 7.1s; }

.game-area.ocean-stage-2 .jellyfish,
.game-area.ocean-stage-3 .jellyfish,
.game-area.ocean-stage-4 .jellyfish {
  opacity: 0.76;
  filter:
    saturate(1.08)
    brightness(1.06)
    drop-shadow(0 10px 12px rgba(27, 87, 150, 0.24));
}

.game-area.ocean-stage-2 .jellyfish {
  animation-duration: 8.5s;
}

.game-area.ocean-stage-3 .jellyfish {
  opacity: 0.88;
  animation-duration: 6.8s;
}

.game-area.ocean-stage-4 .jellyfish {
  opacity: 1;
  filter:
    saturate(1.22)
    brightness(1.12)
    drop-shadow(0 0 12px rgba(172, 232, 255, 0.38))
    drop-shadow(0 12px 14px rgba(27, 87, 150, 0.2));
}

/* Visible creatures stay opaque; cleanliness changes their color and energy instead. */
.game-area.ocean-stage-0 .life-stage-0 {
  opacity: 0.96;
}

.game-area.ocean-stage-1 .life-stage-0,
.game-area.ocean-stage-1 .life-stage-1,
.game-area.ocean-stage-2 .life-stage-0,
.game-area.ocean-stage-2 .life-stage-1,
.game-area.ocean-stage-2 .life-stage-2,
.game-area.ocean-stage-3 .life-stage-0,
.game-area.ocean-stage-3 .life-stage-1,
.game-area.ocean-stage-3 .life-stage-2,
.game-area.ocean-stage-3 .life-stage-3,
.game-area.ocean-stage-4 .sea-life {
  opacity: 0.96;
}

.game-area.ocean-stage-1 .ambient-fish-yellow,
.game-area.ocean-stage-1 .ambient-fish-blue,
.game-area.ocean-stage-1 .ambient-fish-striped,
.game-area.ocean-stage-2 .ambient-fish,
.game-area.ocean-stage-3 .ambient-fish,
.game-area.ocean-stage-4 .ambient-fish {
  opacity: 0.96;
}

.game-area.ocean-stage-2 .ambient-puffer,
.game-area.ocean-stage-3 .ambient-puffer,
.game-area.ocean-stage-4 .ambient-puffer {
  opacity: 0.98;
  filter:
    saturate(1.28)
    contrast(1.12)
    brightness(1.04)
    drop-shadow(0 0 2px rgba(83, 52, 18, 0.78))
    drop-shadow(0 8px 11px rgba(0, 35, 72, 0.36));
}

.game-area.ocean-stage-1 .ambient-fish,
.game-area.ocean-stage-1 .ocean-life .fish {
  opacity: 0.96;
  filter:
    grayscale(0.42)
    saturate(0.56)
    contrast(1.06)
    brightness(0.84)
    drop-shadow(0 7px 9px rgba(0, 33, 70, 0.3));
}

.game-area.ocean-stage-2 .ambient-fish,
.game-area.ocean-stage-2 .ocean-life .fish,
.game-area.ocean-stage-3 .ambient-fish,
.game-area.ocean-stage-3 .sea-life,
.game-area.ocean-stage-4 .ambient-fish,
.game-area.ocean-stage-4 .sea-life {
  filter:
    saturate(1.12)
    contrast(1.06)
    drop-shadow(0 8px 10px rgba(0, 34, 75, 0.28));
}

.game-area.ocean-stage-0 .ocean-life .fish-one {
  opacity: 0.96;
  filter:
    grayscale(0.78)
    saturate(0.36)
    contrast(1.08)
    brightness(0.7)
    drop-shadow(0 7px 9px rgba(0, 29, 62, 0.3));
}

.game-area.ocean-stage-2 .jellyfish {
  opacity: 0.96;
  filter:
    saturate(1.08)
    brightness(1.06)
    drop-shadow(0 10px 12px rgba(27, 87, 150, 0.28));
}

.game-area.ocean-stage-3 .jellyfish {
  opacity: 0.98;
  filter:
    saturate(1.14)
    brightness(1.08)
    drop-shadow(0 10px 13px rgba(27, 87, 150, 0.28));
}

.game-area.ocean-stage-4 .jellyfish {
  opacity: 1;
  filter:
    saturate(1.22)
    brightness(1.12)
    drop-shadow(0 0 12px rgba(172, 232, 255, 0.38))
    drop-shadow(0 12px 14px rgba(27, 87, 150, 0.22));
}

@keyframes sick-fish-drift {
  0% {
    transform: translate(0, 12px) rotate(11deg) scale(0.96);
  }
  22% {
    transform: translate(8px, 16px) rotate(13deg) scale(0.95);
  }
  30%,
  58% {
    transform: translate(10px, 17px) rotate(14deg) scale(0.95);
  }
  78% {
    transform: translate(3px, 14px) rotate(12deg) scale(0.96);
  }
  100% {
    transform: translate(0, 12px) rotate(11deg) scale(0.96);
  }
}

@keyframes recovering-fish-drift {
  0%,
  100% {
    transform: translate(0, 5px) rotate(5deg);
  }
  45% {
    transform: translate(28px, -5px) rotate(-2deg);
  }
  65% {
    transform: translate(33px, -2px) rotate(1deg);
  }
}

@keyframes lively-fish-loop {
  0%,
  100% {
    transform: translate(0, 0) rotate(-3deg);
  }
  28% {
    transform: translate(38px, -15px) rotate(3deg);
  }
  56% {
    transform: translate(66px, 7px) rotate(-2deg);
  }
  78% {
    transform: translate(25px, 14px) rotate(2deg);
  }
}

@keyframes hand-guide-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(0.96);
  }
  14%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.98);
  }
}

.trash-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.trash-object {
  position: absolute;
  left: var(--trash-x);
  top: var(--trash-y);
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: default;
  font-size: 2.75rem;
  filter: drop-shadow(0 9px 9px rgba(0, 38, 83, 0.28));
  isolation: isolate;
  transform: translate(-50%, -50%);
  transition: transform 140ms ease, filter 140ms ease;
  animation: trash-float 4.8s ease-in-out infinite;
  pointer-events: auto;
}

.trash-object::before {
  position: absolute;
  inset: -5px;
  z-index: -1;
  border: 2px solid rgba(236, 253, 255, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.56) 0 6%, transparent 7%),
    radial-gradient(circle at 68% 73%, rgba(157, 235, 255, 0.18), transparent 45%),
    rgba(180, 238, 255, 0.08);
  box-shadow:
    inset 4px 5px 8px rgba(255, 255, 255, 0.2),
    0 0 11px rgba(177, 239, 255, 0.2);
  content: "";
  animation: trash-bubble-shimmer 2.8s ease-in-out infinite;
}

.trash-object::after {
  position: absolute;
  right: 5px;
  top: 8px;
  width: 10px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  content: "";
  filter: blur(0.3px);
  transform: rotate(-28deg);
}

.trash-object:nth-child(3n + 1) {
  --trash-drift-x: 5px;
  --trash-drift-y: -9px;
  --trash-tilt: 4deg;
  animation-duration: 5.6s;
  animation-delay: -1.4s;
}

.trash-object:nth-child(3n + 2) {
  --trash-drift-x: -4px;
  --trash-drift-y: -7px;
  --trash-tilt: -5deg;
  animation-duration: 6.4s;
  animation-delay: -3.1s;
}

.trash-object:nth-child(3n) {
  --trash-drift-x: 3px;
  --trash-drift-y: -11px;
  --trash-tilt: 3deg;
  animation-duration: 7.2s;
  animation-delay: -4.7s;
}

.trash-object.targeted {
  background: transparent;
  filter:
    drop-shadow(0 0 8px rgba(123, 255, 230, 0.78))
    drop-shadow(0 11px 10px rgba(0, 38, 83, 0.3));
  transform: translate(-50%, -50%) scale(1.22) rotate(-4deg);
  animation: none;
}

.trash-object.held {
  z-index: 9;
  background: transparent;
  filter:
    drop-shadow(0 0 10px rgba(255, 229, 130, 0.8))
    drop-shadow(0 15px 12px rgba(0, 35, 80, 0.34));
  transform: translate(-50%, -50%) scale(1.28) rotate(-8deg);
  animation: none;
}

.trash-object.collected {
  display: none;
}

@keyframes trash-float {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(calc(var(--trash-tilt, 3deg) * -0.45));
  }
  50% {
    transform:
      translate(
        calc(-50% + var(--trash-drift-x, 4px)),
        calc(-50% + var(--trash-drift-y, -8px))
      )
      rotate(var(--trash-tilt, 3deg));
  }
}

@keyframes trash-bubble-shimmer {
  0%,
  100% {
    border-color: rgba(236, 253, 255, 0.55);
    box-shadow:
      inset 4px 5px 8px rgba(255, 255, 255, 0.18),
      0 0 9px rgba(177, 239, 255, 0.18);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.86);
    box-shadow:
      inset 6px 7px 10px rgba(255, 255, 255, 0.28),
      0 0 16px rgba(177, 239, 255, 0.34);
  }
}

.trash-bin {
  position: absolute;
  left: 52px;
  bottom: 44px;
  z-index: 6;
  display: grid;
  width: 138px;
  min-height: 118px;
  place-items: center;
  padding: 14px 12px 12px;
  border: 0;
  border-radius: 22px 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 28%),
    linear-gradient(180deg, #7cf1ff 0%, #16badc 45%, #087aae 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.36),
    inset 0 -10px 0 rgba(0, 73, 122, 0.28),
    0 12px 0 rgba(4, 76, 116, 0.32),
    0 20px 22px rgba(0, 35, 80, 0.22);
  color: #f8fbff;
  pointer-events: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.trash-bin::before {
  position: absolute;
  left: -18px;
  right: -18px;
  bottom: -15px;
  z-index: -1;
  height: 42px;
  border-radius: 55% 45% 40% 50%;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(145deg, rgba(102, 156, 188, 0.78), rgba(47, 88, 139, 0.82));
  content: "";
  box-shadow: 0 8px 12px rgba(0, 36, 80, 0.16);
}

.trash-bin::after {
  position: absolute;
  left: 20px;
  right: 20px;
  top: -9px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ffff, #18bddd);
  box-shadow: 0 6px 0 rgba(5, 102, 150, 0.36);
  content: "";
}

.trash-bin.ready {
  filter: drop-shadow(0 0 12px rgba(255, 224, 138, 0.54));
}

.trash-bin.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #8dffdf 0%, #23dcc0 48%, #079b9f 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.38),
    inset 0 -10px 0 rgba(0, 93, 110, 0.28),
    0 12px 0 rgba(4, 92, 110, 0.32),
    0 0 0 6px rgba(115, 240, 197, 0.16),
    0 20px 22px rgba(0, 35, 80, 0.22);
  transform: translateY(-5px) scale(1.04);
}

.trash-bin-icon {
  font-size: 3.1rem;
  line-height: 1;
  filter: drop-shadow(0 4px 0 rgba(4, 77, 120, 0.3));
}

.trash-bin-label {
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-size: 0.86rem;
  font-weight: 800;
  text-shadow: 1px 2px 0 rgba(3, 75, 120, 0.32);
}

.hand-guide {
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: 8;
  margin: 0;
  max-width: min(420px, 80vw);
  padding: 12px 18px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: #23638f;
  background: rgba(238, 252, 255, 0.78);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    0 12px 22px rgba(1, 38, 90, 0.18);
  font-family: var(--nickname-game-font, "Jua", Arial, Helvetica, sans-serif);
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: hand-guide-pop 4s ease forwards;
  pointer-events: none;
}

.hand-guide.hidden {
  display: none;
}

.claw {
  --claw-x: 50%;
  --claw-y: 52%;
  position: absolute;
  left: var(--claw-x);
  top: var(--claw-y);
  z-index: 7;
  width: 72px;
  height: 88px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 140ms ease, filter 140ms ease;
  pointer-events: none;
}

.claw.tracking {
  opacity: 1;
}

.claw.pinching {
  filter: drop-shadow(0 0 14px rgba(115, 240, 197, 0.62));
}

.claw-arm,
.claw-left,
.claw-right {
  position: absolute;
  display: block;
  background: #ffe08a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

.claw-arm {
  left: 50%;
  top: 0;
  width: 12px;
  height: 44px;
  border-radius: 8px;
  transform: translateX(-50%);
}

.claw-left,
.claw-right {
  top: 42px;
  width: 15px;
  height: 42px;
  border-radius: 999px;
  transform-origin: top center;
  transition: transform 120ms ease, background 120ms ease;
}

.claw-left {
  left: 22px;
  transform: rotate(28deg);
}

.claw-right {
  right: 22px;
  transform: rotate(-28deg);
}

.claw.pinching .claw-left,
.claw.pinching .claw-right {
  background: #73f0c5;
}

.claw.pinching .claw-left {
  transform: rotate(8deg) translateX(7px);
}

.claw.pinching .claw-right {
  transform: rotate(-8deg) translateX(-7px);
}

.webcam-placeholder {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  margin: 0;
  padding: 0 12px;
  transform: translate(-50%, -50%);
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.webcam-panel.camera-on .webcam-placeholder {
  display: none;
}

.game-end-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.game-end-overlay.visible {
  display: block;
}

.recovery-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.92), rgba(139, 241, 255, 0.38) 30%, transparent 64%);
}

.success-sequence .recovery-flash {
  animation: ocean-recovery-flash 850ms ease-out both;
}

.dolphin-runner {
  position: absolute;
  left: -360px;
  top: 37%;
  width: clamp(230px, 25vw, 350px);
  opacity: 0;
  filter: drop-shadow(0 16px 14px rgba(0, 60, 112, 0.3));
}

.dolphin-runner img {
  display: block;
  width: 100%;
}

.success-sequence .dolphin-runner {
  animation: dolphin-cross 1.55s cubic-bezier(0.2, 0.64, 0.25, 1) 500ms both;
}

.dolphin-splash {
  position: absolute;
  left: -10%;
  top: 58%;
  width: 74px;
  height: 34px;
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle at 15% 70%, rgba(255, 255, 255, 0.9) 0 8%, transparent 9%),
    radial-gradient(circle at 45% 25%, rgba(169, 242, 255, 0.88) 0 10%, transparent 11%),
    radial-gradient(circle at 72% 65%, rgba(255, 255, 255, 0.82) 0 7%, transparent 8%);
}

.success-sequence .dolphin-splash {
  animation: dolphin-splash-pop 620ms ease-out 650ms infinite;
}

.splash-two {
  left: 10%;
  top: 76%;
  scale: 0.72;
  animation-delay: 820ms !important;
}

.celebration-school {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.celebration-school img {
  position: absolute;
  width: clamp(64px, 7vw, 96px);
  filter: saturate(1.2) drop-shadow(0 8px 9px rgba(0, 49, 93, 0.24));
}

.celebration-school img:nth-child(1) { left: 15%; top: 28%; }
.celebration-school img:nth-child(2) { right: 17%; top: 34%; }
.celebration-school img:nth-child(3) { left: 28%; bottom: 20%; }

.success-sequence .celebration-school {
  animation: celebration-school-in 1.3s ease 1.55s both;
}

.success-sequence .celebration-school img:nth-child(1) {
  animation: celebration-fish-one 1.7s ease-in-out 1.5s both;
}

.success-sequence .celebration-school img:nth-child(2) {
  animation: celebration-fish-two 1.8s ease-in-out 1.55s both;
}

.success-sequence .celebration-school img:nth-child(3) {
  animation: celebration-fish-three 1.65s ease-in-out 1.62s both;
}

.game-clear-message,
.game-failure-message {
  position: absolute;
  left: 50%;
  top: 46%;
  display: grid;
  justify-items: center;
  width: min(90%, 720px);
  padding: 24px 30px;
  border: 2px solid rgba(223, 252, 255, 0.5);
  border-radius: 28px;
  opacity: 0;
  color: #ffffff;
  background: rgba(4, 92, 154, 0.56);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 18px 40px rgba(0, 38, 91, 0.26);
  text-align: center;
  transform: translate(-50%, -50%) scale(0.88);
  backdrop-filter: blur(10px);
}

.game-clear-message strong,
.game-failure-message strong {
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.05;
  text-shadow: 0 5px 0 rgba(4, 83, 143, 0.42);
}

.game-clear-message span,
.game-failure-message span {
  margin-top: 9px;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: clamp(1.1rem, 2.4vw, 2rem);
}

.success-sequence .game-clear-message {
  animation: game-message-in 620ms cubic-bezier(0.2, 0.9, 0.28, 1.2) 1.85s both;
}

.game-failure-message {
  top: 48%;
  align-content: center;
  justify-content: center;
  background: rgba(15, 65, 108, 0.68);
}

.game-failure-message strong {
  width: min(100%, 15em);
  font-size: clamp(1.45rem, 3.5vw, 3rem);
  line-height: 1.22;
}

.game-failure-message span {
  width: 100%;
  line-height: 1.4;
}

.failure-dolphin-icon {
  display: block;
  width: auto !important;
  margin: 0 auto 10px !important;
  font-size: clamp(2.5rem, 5vw, 4.4rem) !important;
  line-height: 1 !important;
  text-align: center;
  filter: drop-shadow(0 6px 7px rgba(0, 47, 91, 0.24));
}

.failure-title-lines {
  display: grid;
  justify-items: stretch;
  width: min(100%, 15em);
  margin-inline: auto;
  text-align: center;
}

.failure-title-lines > span {
  display: block;
  width: 100%;
  margin: 0 !important;
  font: inherit !important;
  line-height: inherit !important;
  text-align: center;
  white-space: nowrap;
}

.failure-sequence .game-failure-message {
  animation: game-message-in 420ms ease 180ms both;
}

.mission-failed-title {
  display: flex;
  width: fit-content !important;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  color: #ffffff;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  line-height: 1.1 !important;
  text-align: center;
  text-shadow:
    0 5px 0 rgba(0, 53, 101, 0.38),
    0 10px 18px rgba(0, 34, 74, 0.24);
  white-space: nowrap;
}

.mission-failed-title .mission-failed-emoji {
  display: block;
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  font-size: 48px !important;
  line-height: 1 !important;
}

.mission-failed-title .mission-failed-text {
  display: block;
  width: auto;
  margin: 0;
  font-size: clamp(58px, 5vw, 64px) !important;
  line-height: 1.05 !important;
}

.game-area.game-ending .hand-guide,
.game-area.game-ending .claw {
  opacity: 0;
}

.game-area.failure-sequence .play-ocean-scenery,
.game-area.failure-sequence .ocean-life {
  filter: grayscale(0.72) saturate(0.38) brightness(0.58);
  transition: filter 700ms ease;
}

.game-area.failure-sequence::before {
  z-index: 20;
  background: rgba(0, 21, 54, 0.28);
  backdrop-filter: blur(2px);
}

.game-area.failure-sequence .trash-object:not(.collected) {
  z-index: 25;
  animation: remaining-trash-pulse 700ms ease-in-out infinite alternate;
}

.result-screen {
  position: relative;
  overflow: auto;
  padding: 28px;
  background:
    linear-gradient(rgba(0, 105, 170, 0.22), rgba(2, 58, 117, 0.32)),
    url("assets/play-ocean-background.png") center / cover fixed;
}

.result-ocean-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.34), transparent 48%);
  pointer-events: none;
}

.result-panel {
  position: relative;
  z-index: 1;
  width: min(94vw, 720px);
  padding: 28px 34px 30px;
  border: 2px solid rgba(216, 250, 255, 0.48);
  border-radius: 30px;
  color: #ffffff;
  background: rgba(2, 91, 157, 0.72);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 24px 50px rgba(0, 34, 86, 0.3);
  text-align: center;
  backdrop-filter: blur(14px);
  animation: result-panel-in 620ms ease both;
}

.result-badge {
  margin: 0 0 7px;
  color: #fff0a0;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: clamp(1.15rem, 2.8vw, 1.8rem);
  text-shadow: 0 3px 0 rgba(81, 83, 22, 0.32);
}

.result-panel h2 {
  margin: 0;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  text-shadow: 0 6px 0 rgba(0, 70, 128, 0.38);
  overflow-wrap: normal;
  word-break: keep-all;
}

.result-subtitle {
  margin: 7px 0 20px;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: 1.2rem;
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: keep-all;
}

#fail-title {
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1.22;
}

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

.result-stats div {
  display: grid;
  gap: 4px;
  padding: 13px 10px;
  border-radius: 16px;
  background: rgba(0, 55, 118, 0.3);
}

.result-stats span {
  color: rgba(225, 249, 255, 0.84);
  font-size: 0.86rem;
}

.result-stats strong {
  font-size: 1.16rem;
}

.result-ranking {
  margin-top: 16px;
  padding: 15px 18px;
  border-radius: 20px;
  background: rgba(1, 55, 115, 0.34);
}

.result-ranking h3 {
  margin: 0 0 10px;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: 1.2rem;
}

.result-ranking ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-ranking li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 11px;
  background: rgba(0, 41, 99, 0.3);
}

.replay-button {
  width: min(100%, 330px);
  margin-top: 18px;
}

.fail-result-panel {
  display: grid;
  justify-items: center;
  width: min(94vw, 640px);
  border-color: rgba(205, 249, 255, 0.66);
  background: rgba(8, 119, 178, 0.82);
}

.fail-result-panel .result-badge {
  margin-bottom: 12px;
}

.fail-result-panel .result-subtitle {
  margin: 16px auto 0;
  line-height: 1.5;
  text-align: center;
}

.fail-result-panel .replay-button {
  justify-self: center;
  margin-top: 26px;
}

.failure-main-title,
#fail-title.failure-main-title {
  display: block;
  width: 100%;
  margin-inline: auto;
  color: #ffffff;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: clamp(1.15rem, 2.7vw, 2.15rem);
  line-height: 1.18;
  text-align: center;
  text-shadow:
    0 4px 0 rgba(0, 76, 132, 0.34),
    0 8px 14px rgba(0, 51, 100, 0.18);
  white-space: nowrap;
}

.failure-subtitle-lines {
  display: grid;
  justify-items: center;
  width: 100%;
  margin: 15px auto 0 !important;
  color: #eaffff;
  font-family: var(--nickname-game-font, "Jua", sans-serif);
  font-size: clamp(0.95rem, 2vw, 1.28rem) !important;
  line-height: 1.46 !important;
  text-align: center;
}

.failure-subtitle-lines > span {
  display: block;
  width: 100%;
  margin: 0 !important;
  font: inherit !important;
  line-height: inherit !important;
  text-align: center;
  white-space: nowrap;
}

@keyframes ocean-recovery-flash {
  0% { opacity: 0; }
  35% { opacity: 0.94; }
  100% { opacity: 0; }
}

@keyframes dolphin-cross {
  0% { opacity: 0; transform: translate(-10vw, 40px) rotate(-8deg) scale(0.88); }
  8% { opacity: 1; }
  48% { transform: translate(58vw, -48px) rotate(5deg) scale(1.05); }
  100% { opacity: 1; transform: translate(calc(100vw + 430px), 18px) rotate(-3deg) scale(0.94); }
}

@keyframes dolphin-splash-pop {
  0% { opacity: 0; transform: translate(0, 8px) scale(0.5); }
  45% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-35px, -24px) scale(1.25); }
}

@keyframes celebration-school-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes celebration-fish-one {
  from { transform: translate(-180px, 35px) rotate(8deg); }
  to { transform: translate(55px, -30px) rotate(-3deg); }
}

@keyframes celebration-fish-two {
  from { transform: translate(180px, -25px) scaleX(-1); }
  to { transform: translate(-60px, 36px) scaleX(-1); }
}

@keyframes celebration-fish-three {
  from { transform: translate(-130px, 70px) rotate(-5deg); }
  to { transform: translate(100px, -20px) rotate(3deg); }
}

@keyframes game-message-in {
  from { opacity: 0; transform: translate(-50%, -42%) scale(0.84); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes remaining-trash-pulse {
  from {
    filter: drop-shadow(0 0 7px rgba(255, 208, 90, 0.6)) drop-shadow(0 9px 9px rgba(0, 38, 83, 0.3));
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    filter: drop-shadow(0 0 18px rgba(255, 126, 72, 0.96)) drop-shadow(0 12px 11px rgba(0, 38, 83, 0.34));
    transform: translate(-50%, -50%) scale(1.22);
  }
}

@keyframes result-panel-in {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .screen {
    padding: 20px;
  }

  .dolphin-runner {
    left: -270px;
    top: 35%;
    width: 240px;
  }

  .game-clear-message,
  .game-failure-message {
    width: calc(100% - 28px);
    padding: 20px 16px;
    border-radius: 22px;
  }

  .game-failure-message strong {
    font-size: clamp(1.2rem, 5.4vw, 1.9rem);
  }

  .mission-failed-title {
    gap: 10px;
  }

  .mission-failed-title .mission-failed-emoji {
    font-size: 36px !important;
  }

  .mission-failed-title .mission-failed-text {
    font-size: clamp(32px, 9vw, 44px) !important;
  }

  .game-failure-message span {
    font-size: clamp(0.95rem, 4vw, 1.25rem);
  }

  #fail-title {
    font-size: clamp(1.45rem, 6vw, 2.15rem);
  }

  .result-screen {
    padding: 16px;
  }

  .result-panel {
    width: 100%;
    padding: 24px 18px;
    border-radius: 24px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .result-ranking {
    padding: 13px 10px;
  }

  .start-screen {
    padding: 18px;
  }

  .game-logo {
    font-size: clamp(3rem, 17vw, 5.6rem);
  }

  .logo-tail,
  .drop-two {
    display: none;
  }

  .logo-crab {
    right: -0.32em;
    bottom: -0.28em;
    font-size: clamp(1.7rem, 8vw, 3.2rem);
  }

  .start-game-button {
    min-height: 66px;
    padding: 0 38px;
  }

  .title-fish-three,
  .title-fish-four,
  .title-jelly-two,
  .title-school-right,
  .title-coral-left,
  .title-rock-right,
  .title-shell-right {
    display: none;
  }

  .hero-panel,
  .info-panel,
  .ranking-panel {
    padding: 30px 24px;
  }

  .start-layout {
    grid-template-columns: 1fr;
  }

  #nickname-screen {
    padding: 20px;
  }

  #nickname-screen .start-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #nickname-screen .hero-panel,
  #nickname-screen .ranking-panel {
    min-height: auto;
    padding: 32px 24px;
    border-radius: 24px;
  }

  #nickname-screen .nickname-field input {
    min-height: 68px;
    padding-left: 74px;
    padding-right: 66px;
  }

  #nickname-screen .nickname-icon {
    width: 50px;
    height: 50px;
    font-size: 1.45rem;
  }

  #nickname-screen .primary-button {
    min-height: 66px;
  }

  #camera-screen {
    padding: 20px;
  }

  .camera-guide-panel {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dolphin-mascot {
    min-height: 140px;
  }

  .dolphin-body {
    font-size: clamp(6.5rem, 36vw, 10rem);
  }

  .camera-speech-bubble {
    justify-items: center;
    padding: 30px 24px;
    border-radius: 26px;
    text-align: center;
  }

  .camera-speech-bubble::before {
    left: 50%;
    top: -23px;
    transform: translateX(-50%) rotate(135deg);
  }

  #camera-screen .primary-button {
    min-height: 66px;
  }

  .nickname-fish-three,
  .nickname-coral-left,
  .camera-fish-two,
  .camera-coral-left {
    display: none;
  }

  .play-screen {
    padding: 0;
  }

  .game-layout {
    min-height: 100vh;
  }

  .game-header {
    inset: 10px 10px auto 10px;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, max-content));
    justify-content: space-between;
    gap: 7px;
  }

  .hud-item:nth-child(3) {
    grid-column: auto;
  }

  .hud-item {
    min-height: 36px;
    padding: 7px 9px;
  }

  .hud-label {
    font-size: 0.72rem;
  }

  .hud-item strong {
    font-size: 0.86rem;
  }

  .game-area {
    min-height: 100vh;
  }

  .deep-reef {
    width: 38%;
    height: 48%;
  }

  .reef-cluster {
    width: 38%;
    height: 25%;
  }

  .reef-cluster-left {
    left: 150px;
    width: 25%;
  }

  .reef-cluster-right {
    right: 165px;
    width: 25%;
  }

  .reef-cluster-center {
    width: 18%;
    height: 15%;
  }

  .turtle {
    width: 150px;
    height: 90px;
  }

  .jellyfish {
    width: 120px;
    height: 135px;
  }

  .play-coral {
    font-size: clamp(2.4rem, 10vw, 4rem);
  }

  .ambient-fish {
    opacity: calc(0.16 + var(--cleanliness-level) * 0.16);
  }

  .ambient-fish-striped,
  .bubbles-left span:nth-child(5),
  .bubbles-right span:nth-child(4) {
    display: none;
  }

  .webcam-panel {
    right: 10px;
    bottom: 10px;
    width: 150px;
    height: 112px;
    border-radius: 18px;
  }

  .trash-bin {
    left: 24px;
    bottom: 22px;
    width: 108px;
    min-height: 94px;
    padding: 12px 9px 10px;
  }

  .trash-bin-icon {
    font-size: 2.35rem;
  }

  .trash-bin-label {
    font-size: 0.74rem;
  }

  .trash-object {
    width: 56px;
    height: 56px;
    font-size: 2.35rem;
  }
}
