
:root {
  --navy: #071b35;
  --deep-blue: #0c294b;
  --blue: #38bdf8;
  --ice: #e8f8ff;
  --white: #ffffff;
  --muted: #a9c4dc;
  --gold: #ffd166;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: "Fredoka", sans-serif;
  color: var(--white);
  background:
    radial-gradient(ellipse at 50% 20%, #173e66 0%, transparent 50%),
    linear-gradient(145deg, #071b35, #0c294b 60%, #06172d);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.game-page {
  width: min(100% - 36px, 1100px);
  margin: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-icon {
  font-size: 30px;
}

.brand-accent {
  color: var(--blue);
}

.top-label {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
}

.game-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 38px 0 30px;
}

.intro {
  text-align: center;
  margin-bottom: 25px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--blue);
  font-weight: 600;
}

.intro h1 {
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1.1;
  margin: 10px 0;
}

.intro h1 span {
  color: var(--gold);
}

.intro p {
  color: var(--muted);
  font-size: 14px;
}

.game-shell {
  width: min(100%, 480px);
  padding: 12px;
  border-radius: 23px;
  background: linear-gradient(145deg, #234c70, #0b2341);
  border: 1px solid rgba(255,255,255,.17);
  box-shadow:
    0 25px 70px rgba(0,0,0,.4),
    inset 0 1px rgba(255,255,255,.15);
}

.game-hud {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  padding: 0 12px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.hud-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  font-weight: 600;
}

.hud-item strong {
  font-size: 23px;
  color: var(--white);
}

.best-score strong {
  color: var(--gold);
}

.sound-button {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.17);
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  cursor: pointer;
  font-size: 17px;
  transition: .2s;
}

.sound-button:hover {
  background: rgba(255,255,255,.2);
  transform: scale(1.06);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #8bd8f3;
  aspect-ratio: 3 / 4;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(5, 24, 48, .42);
  backdrop-filter: blur(4px);
  transition: opacity .25s;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  width: min(100%, 300px);
  padding: 28px 22px;
  border-radius: 23px;
  text-align: center;
  background: rgba(9, 37, 65, .92);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}

.penguin-emoji {
  font-size: 65px;
  margin-bottom: 10px;
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.overlay-kicker {
  color: var(--blue);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
}

.overlay-card h2 {
  font-size: 29px;
  margin: 8px 0;
}

.overlay-card p {
  color: #c2d9e9;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.primary-button {
  width: 100%;
  padding: 14px 18px;
  color: #09233e;
  background: linear-gradient(135deg, #ffe18b, #ffc247);
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 5px 0 #bd852d;
  transition: transform .15s, box-shadow .15s;
}

.primary-button span {
  margin-left: 8px;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #bd852d;
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #bd852d;
}

.controls-hint {
  color: #8daec9;
  font-size: 9px;
  letter-spacing: 2px;
  margin-top: 20px;
}

.game-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  font-size: 9px;
  letter-spacing: 1.3px;
  color: var(--muted);
}

#gameStatus {
  color: var(--blue);
}

.instructions {
  display: flex;
  justify-content: center;
  gap: 35px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.instruction {
  display: flex;
  align-items: center;
  gap: 11px;
}

.instruction-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  font-size: 18px;
}

.instruction div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.instruction strong {
  font-size: 10px;
  letter-spacing: 1px;
}

.instruction small {
  color: var(--muted);
  font-size: 10px;
}

.page-footer {
  margin-top: auto;
  padding: 22px 0;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.1);
  color: #7899b6;
  font-size: 11px;
}

@media (max-width: 520px) {
  .game-page {
    width: min(100% - 20px, 480px);
  }

  .topbar {
    padding: 19px 0;
  }

  .top-label {
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  .brand {
    font-size: 15px;
  }

  .game-section {
    padding-top: 28px;
  }

  .intro p {
    max-width: 300px;
    line-height: 1.5;
  }

  .game-shell {
    padding: 8px;
    border-radius: 17px;
  }

  .game-hud {
    height: 54px;
  }

  .instructions {
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
