:root {
  color: #fff8df;
  background: #031b31;
  font-family: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  align-items: center;
  background:
    radial-gradient(circle at 50% -20%, #207aa5 0, transparent 40%),
    linear-gradient(180deg, #0c4164, #031b31 80%);
  display: flex;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  padding: 24px;
}

.game-shell { text-align: center; width: min(900px, 100%); }

.game-frame {
  aspect-ratio: 3 / 2;
  border: 6px solid #7bc6d7;
  border-radius: 28px;
  box-shadow: 0 0 0 4px #0a3753, 0 20px 70px #010e1caa;
  overflow: hidden;
  position: relative;
}

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

.screen {
  align-items: center;
  background: linear-gradient(#052c4de8, #062440d9);
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: absolute;
}

.screen[hidden] { display: none; }

.eyebrow { color: #f9c74f; font-size: clamp(.65rem, 1.7vw, .9rem); font-weight: 900; letter-spacing: .2em; margin: 0 0 6px; }
h1, h2 { font-family: "Baloo 2", sans-serif; font-weight: 800; line-height: .92; margin: 0; }
h1 { font-size: clamp(3.4rem, 11vw, 6rem); text-shadow: 3px 4px #0a1830; }
h1 span { color: #f9c74f; }
h2 { font-size: clamp(2.5rem, 7vw, 4.4rem); }

blockquote {
  color: #d8f4ea;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  line-height: 1.3;
  margin: 18px auto 12px;
  max-width: 550px;
}

cite { color: #f9c74f; display: block; font-family: "Nunito", sans-serif; font-size: .75em; font-style: normal; font-weight: 900; margin-top: 5px; }
.instructions { font-size: clamp(.8rem, 2vw, 1rem); margin: 0 0 20px; max-width: 560px; }
button { border: 0; cursor: pointer; font: inherit; font-weight: 900; }
.primary-button, .secondary-button { border-radius: 999px; padding: 12px 25px; transition: transform .15s, filter .15s; }
button:hover, button:focus-visible { filter: brightness(1.1); outline: 3px solid #fff; outline-offset: 3px; transform: translateY(-2px); }
.primary-button { background: #f9c74f; box-shadow: 0 4px #b56e18; color: #16324f; }
.secondary-button { background: #d9f4ed; box-shadow: 0 4px #70a6a5; color: #16324f; }
.control-tip { color: #b9dfdf; font-size: .82rem; margin: 20px 0 0; }
kbd { background: #144f6c; border-radius: 4px; padding: 2px 6px; }

.hud { align-items: center; display: flex; justify-content: space-between; left: 0; padding: 16px 20px; position: absolute; right: 0; top: 0; }
.score-label { color: #fff8df; font-size: 1rem; font-weight: 900; letter-spacing: .1em; text-shadow: 2px 2px #05213a; }
.score-label strong { display: block; font-family: "Baloo 2", sans-serif; font-size: 3rem; line-height: .8; }
.sound-button { background: #ffffff30; border: 2px solid #ffffff88; border-radius: 50%; color: white; font-size: 1.3rem; height: 42px; width: 42px; }
.game-over-screen { background: linear-gradient(#072b49d9, #1b1934e8); }
.final-score { font-size: 1.2rem; margin: 12px 0 22px; }
.final-score strong { color: #f9c74f; font-family: "Baloo 2", sans-serif; font-size: 2rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.footer-note { color: #9fd6dd; font-size: .78rem; margin: 18px 0 0; }

@media (max-width: 500px) {
  body { padding: 12px; }
  .game-frame { border-radius: 18px; border-width: 4px; }
  .screen { padding: 18px; }
  .instructions { display: none; }
}
