:root {
  color-scheme: dark;
  --ink: #eafff9;
  --muted: #89bfbd;
  --navy: #042d3d;
  --deep: #031f2c;
  --cyan: #18e5c2;
  --yellow: #ffd24a;
  --coral: #ff6f61;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, #12647a 0, transparent 42%),
    linear-gradient(180deg, #062e41 0%, #031b27 100%);
  font-family: "Nunito", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(#7fead6 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

button { font: inherit; }

.game-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 4vw, 32px) 18px;
}

.topbar, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar { margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid #25d9bd;
  border-radius: 14px;
  background: #0a4c58;
  box-shadow: 0 5px 0 #032a34;
  font-size: 26px;
}
.eyebrow { margin: 0 0 -5px; color: #36d9c1; font-size: 10px; letter-spacing: .28em; }
h1 { margin: 0; font-family: "Baloo 2", sans-serif; font-size: clamp(20px, 3vw, 29px); line-height: 1; letter-spacing: .035em; }
.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid #317080;
  border-radius: 50%;
  color: #c9fff5;
  background: #07394a;
  cursor: pointer;
  font-size: 24px;
}
.icon-button.muted { color: #527d82; }

.game-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 390px;
  border: 3px solid #0a6070;
  border-radius: 28px;
  background: #086276;
  box-shadow: 0 24px 60px #010e17aa, inset 0 0 0 2px #2be1c733;
  touch-action: manipulation;
  user-select: none;
}

canvas { display: block; width: 100%; height: 100%; }

.hud {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.score-pill, .seal-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  padding: 7px 14px;
  border: 2px solid #52e6cf55;
  border-radius: 99px;
  background: #032b39b8;
  box-shadow: 0 4px 0 #021b25aa;
  font-family: "Baloo 2", sans-serif;
  font-size: 23px;
  line-height: 1;
}
.score-icon { color: var(--yellow); }
.mini-seal { color: #b6e3e3; text-shadow: 7px -3px 0 #6fb7bd; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: radial-gradient(circle at center, #07526466, #03283b77 70%);
  transition: opacity .25s, transform .25s;
}
.overlay.hidden { opacity: 0; pointer-events: none; transform: scale(1.04); }
.hero-turtle {
  position: relative;
  width: clamp(150px, 24vw, 230px);
  height: auto;
  margin-bottom: 6px;
  animation: bob 1.8s ease-in-out infinite;
}
.hero-turtle img { display: block; width: 100%; height: auto; filter: drop-shadow(0 9px 4px #02212f66); }
.shell {
  position: absolute;
  inset: 5px 26px 5px 5px;
  display: grid;
  place-items: center;
  border: 6px solid #195442;
  border-radius: 50%;
  color: #1d6048;
  background: repeating-conic-gradient(#ffd65a 0 18deg, #f1ad36 18deg 36deg);
  box-shadow: inset 0 0 0 7px #ffdf6b;
  font-size: 26px;
}
.head {
  position: absolute;
  right: 0;
  top: 19px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 4px solid #174e3f;
  border-radius: 45% 60% 60% 45%;
  color: #15463b;
  background: #79d76f;
  font-size: 12px;
}
.flipper { position: absolute; width: 27px; height: 12px; border-radius: 100%; background: #64c866; transform: rotate(-28deg); }
.f1 { left: 18px; top: 1px; } .f2 { left: 29px; bottom: 0; transform: rotate(24deg); }
@keyframes bob { 50% { transform: translateY(-9px) rotate(-2deg); } }

.kicker { margin: 4px 0 0; color: var(--yellow); font-size: 12px; letter-spacing: .25em; }
.kicker.danger { color: #ff8a6e; }
h2 {
  margin: -2px 0 2px;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(43px, 7vw, 76px);
  line-height: .98;
  letter-spacing: -.045em;
  text-shadow: 0 7px 0 #073745;
}
h2 span { color: var(--yellow); }
.intro { margin: 8px 0 18px; color: #c1ebe5; font-size: clamp(13px, 2vw, 17px); line-height: 1.45; }
.primary-button {
  position: relative;
  min-width: 225px;
  padding: 13px 25px;
  border: 0;
  border-radius: 13px;
  color: #173c37;
  background: var(--yellow);
  box-shadow: 0 6px 0 #c98c28, 0 12px 24px #02182099;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  transition: transform .12s, box-shadow .12s;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #c98c28, 0 14px 28px #021820aa; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #c98c28; }
.play-icon { margin-right: 8px; }
.control-hint { margin: 17px 0 0; color: #73aaa9; font-size: 11px; letter-spacing: .09em; }
kbd { padding: 3px 7px; border: 1px solid #4b8f94; border-bottom-width: 3px; border-radius: 5px; color: #bce4df; background: #073947; font: inherit; }

.results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(390px, 90%);
  margin: 18px 0 22px;
  overflow: hidden;
  border: 2px solid #277384;
  border-radius: 16px;
  background: #032d3bbf;
}
.results div { padding: 10px; }
.results div + div { border-left: 1px solid #277384; }
.results small { display: block; color: #7eb6b5; font-size: 9px; letter-spacing: .16em; }
.results strong { color: var(--yellow); font-family: "Baloo 2"; font-size: 29px; }

footer { padding: 12px 4px 0; color: #619394; font-size: 11px; letter-spacing: .035em; }
footer p { margin: 0; }
footer span { color: var(--yellow); }

@media (max-width: 650px) {
  .game-shell { padding: 12px 8px; }
  .topbar { margin: 0 5px 10px; }
  .game-card { min-height: 490px; aspect-ratio: auto; border-radius: 20px; }
  footer { gap: 8px; font-size: 9px; }
  h2 { font-size: 48px; }
  .hero-turtle { transform: scale(.85); margin-bottom: -3px; }
  @keyframes bob { 50% { transform: scale(.85) translateY(-9px) rotate(-2deg); } }
}
