:root {
  --ink: #17324d;
  --coral: #ff6f61;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(#7bdff2 0%, #b8f2e6 47%, #ffe29a 48%, #f6bd60 100%);
  display: grid;
  place-items: center;
  padding: 20px;
}

.game-shell { width: min(980px, 100%); }

.back-link {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 800;
}

.top-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0b7189;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 8vw, 4rem); line-height: 0.95; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
}

.stats div {
  min-height: 70px;
  padding: 10px;
  border: 3px solid rgba(23, 50, 77, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.82);
  text-align: center;
}

.stats span { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.stats strong { display: block; margin-top: 4px; font-size: 1.8rem; }

.game-board {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: min(68vh, 640px);
  min-height: 500px;
  border: 5px solid rgba(23, 50, 77, 0.25);
  border-radius: 8px;
  background: linear-gradient(180deg, #74d6ef 0 58%, #16a7b8 58% 76%, #f7d78a 76% 100%);
  box-shadow: 0 22px 60px rgba(13, 56, 87, 0.24);
  cursor: crosshair;
}

.sun-bg {
  position: absolute;
  top: 28px;
  right: 42px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 18px rgba(255, 209, 102, 0.28), 0 0 56px rgba(255, 154, 60, 0.8);
}

.cloud {
  position: absolute;
  width: 150px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}
.cloud::before, .cloud::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: inherit;
}
.cloud::before { left: 22px; top: -24px; width: 58px; height: 58px; }
.cloud::after { right: 22px; top: -16px; width: 48px; height: 48px; }
.cloud-one { top: 76px; left: 8%; animation: drift 18s linear infinite; }
.cloud-two { top: 150px; left: 60%; transform: scale(0.75); animation: drift 24s linear infinite reverse; }

.wave {
  position: absolute;
  left: -5%;
  width: 110%;
  height: 56px;
  border-radius: 50%;
  opacity: 0.55;
}
.wave-one { bottom: 104px; background: rgba(255, 255, 255, 0.55); animation: wave 4s ease-in-out infinite; }
.wave-two { bottom: 86px; background: rgba(12, 132, 165, 0.35); animation: wave 5s ease-in-out infinite reverse; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 26px;
  text-align: center;
  background: rgba(255, 253, 247, 0.78);
  backdrop-filter: blur(6px);
}
.overlay.hidden { display: none; }
.hero-icon { width: 120px; height: 120px; }
.overlay h2 { width: min(620px, 100%); margin-bottom: 0; font-size: clamp(1.55rem, 4vw, 2.6rem); line-height: 1.05; }
.overlay p { max-width: 560px; margin-bottom: 4px; font-weight: 700; }

button {
  min-width: 150px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--coral);
  box-shadow: 0 8px 0 #c54642;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.item {
  position: absolute;
  z-index: 5;
  width: var(--size);
  height: var(--size);
  border: 0;
  padding: 0;
  background: transparent var(--image) center / contain no-repeat;
  cursor: pointer;
  filter: drop-shadow(0 9px 8px rgba(20, 41, 61, 0.24));
  animation: fall var(--speed) linear forwards, wiggle 1.25s ease-in-out infinite;
}

.pop {
  position: absolute;
  z-index: 15;
  color: var(--ink);
  font-weight: 900;
  pointer-events: none;
  animation: pop 0.7s ease-out forwards;
}

@keyframes fall { from { top: -90px; } to { top: calc(100% + 90px); } }
@keyframes wiggle { 0%, 100% { rotate: -5deg; } 50% { rotate: 6deg; } }
@keyframes pop { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -34px; } }
@keyframes drift { from { translate: -40px 0; } to { translate: 70px 0; } }
@keyframes wave { 0%, 100% { translate: -18px 0; } 50% { translate: 18px 8px; } }

@media (max-width: 720px) {
  body { padding: 12px; }
  .top-panel { display: block; }
  .stats { margin-top: 12px; }
  .game-board { min-height: 470px; height: 64vh; }
}
