:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, #1d2b56 0%, #090611 45%, #040208 100%);
  color: #f5f7ff;
}

.game-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: rgba(6, 7, 24, 0.72);
  border-bottom: 1px solid rgba(130, 185, 255, 0.25);
  backdrop-filter: blur(12px);
}

.brand-wrap h1 {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.back-link {
  color: #7fd7ff;
  font-weight: 700;
  text-decoration: none;
}

.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.stats strong {
  color: #ffe57d;
}

.game-stage {
  position: relative;
  padding: 1rem;
  display: grid;
}

#gameCanvas {
  width: min(100%, 1500px);
  height: min(calc(100vh - 140px), 760px);
  justify-self: center;
  border-radius: 18px;
  border: 1px solid rgba(138, 183, 255, 0.45);
  box-shadow: 0 16px 50px rgba(3, 6, 18, 0.7), inset 0 0 40px rgba(81, 133, 255, 0.12);
  background: linear-gradient(#091134, #060510);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.8rem;
  padding: 2rem;
  color: #eff5ff;
  background: radial-gradient(circle at center, rgba(9, 18, 48, 0.5), rgba(3, 3, 10, 0.85));
}

.overlay.hidden {
  display: none;
}

.overlay h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  color: #8fd1ff;
}

.overlay p {
  margin: 0;
  opacity: 0.9;
}

.overlay button {
  border: none;
  background: linear-gradient(135deg, #42d4ff, #9e73ff);
  color: #04111b;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.78rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  justify-self: center;
}
