:root {
  color-scheme: light;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  --ink: #173249;
  --sky: #58c9ff;
  --sun: #ffd36e;
  --coral: #ff6658;
  --ember: #ff9f1c;
  --mint: #63d2a2;
  --violet: #7b61ff;
  --ice: #d8fbff;
  --shadow: rgba(23, 50, 73, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 211, 110, 0.8), transparent 20rem),
    linear-gradient(180deg, #58c9ff 0%, #9ee8ff 48%, #fff6b8 100%);
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.game-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100vw, 1420px);
  height: 100svh;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 22px);
  gap: clamp(10px, 1.5vw, 16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  font-weight: 900;
  text-transform: uppercase;
  color: #0f7a8a;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4.6vw, 3.6rem);
  line-height: 0.95;
  color: #173249;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.55);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 48vw;
}

.stats span {
  min-width: 92px;
  padding: 9px 12px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 8px 18px var(--shadow);
  font-size: clamp(0.84rem, 1.8vw, 1rem);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.play-area {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  box-shadow: 0 16px 34px var(--shadow);
  background: #72d9ff;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(25, 80, 116, 0.12);
  backdrop-filter: blur(2px);
}

.overlay.hidden {
  display: none;
}

.panel {
  width: min(520px, 92vw);
  padding: clamp(20px, 4vw, 32px);
  border: 4px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 20px 40px rgba(23, 50, 73, 0.26);
  text-align: center;
}

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffef9a;
  color: #8d4411;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 6vw, 3rem);
  line-height: 1;
}

.panel p:last-of-type {
  margin: 12px auto 18px;
  max-width: 28rem;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
}

.primary-button,
.fire-button,
.round-button {
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 0 #9a2c24, 0 14px 22px var(--shadow);
  font-weight: 1000;
}

.primary-button,
.fire-button {
  min-height: 58px;
  padding: 0 24px;
  background: linear-gradient(180deg, #ff8f30, #ff4336);
  font-size: clamp(1.05rem, 3vw, 1.4rem);
}

.primary-button:active,
.fire-button:active,
.round-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #9a2c24, 0 8px 14px var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: 64px minmax(160px, 280px) 64px;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 76px;
}

.round-button {
  width: 64px;
  height: 58px;
  background: linear-gradient(180deg, #7b61ff, #3852d7);
  box-shadow: 0 8px 0 #27348c, 0 14px 22px var(--shadow);
  font-size: 1.3rem;
}

.fire-button {
  width: 100%;
}

@media (max-width: 700px) {
  body {
    overflow: auto;
  }

  .game-shell {
    height: 100svh;
    padding: 8px;
  }

  .topbar {
    align-items: flex-start;
  }

  .stats {
    max-width: 50vw;
  }

  .stats span {
    min-width: 76px;
    padding: 7px 8px;
  }

  .controls {
    grid-template-columns: 56px minmax(144px, 1fr) 56px;
    gap: 8px;
  }

  .round-button {
    width: 56px;
  }
}
