:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #05070d;
  color: #f5f8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #05070d;
}

button,
canvas {
  font: inherit;
}

canvas:focus {
  outline: none;
}

#game-shell {
  position: fixed;
  inset: 0;
  min-width: 320px;
  min-height: 320px;
  background:
    radial-gradient(circle at 70% 20%, rgba(79, 210, 255, 0.18), transparent 28rem),
    linear-gradient(180deg, #080d18 0%, #05070d 62%, #020308 100%);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 10px;
  max-width: 520px;
  pointer-events: none;
}

#hud > div {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(196, 224, 255, 0.22);
  border-radius: 8px;
  background: rgba(3, 8, 18, 0.66);
  backdrop-filter: blur(12px);
}

.label {
  display: block;
  margin-bottom: 2px;
  color: #9bb1c9;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

#hud strong {
  display: block;
  color: #ffffff;
  font-size: clamp(1.1rem, 2.8vh, 1.55rem);
  line-height: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 3, 8, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: none;
}

.overlay > * {
  width: min(460px, 100%);
  text-align: center;
}

.overlay h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(2.4rem, 10vh, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.overlay p {
  margin: 0 0 24px;
  color: #c3d1e4;
  font-size: clamp(1rem, 2.6vh, 1.25rem);
  line-height: 1.45;
}

#start-button {
  min-width: 164px;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: #43d9ad;
  color: #031016;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(67, 217, 173, 0.28);
}

#start-button:hover,
#start-button:focus-visible {
  background: #7ff0ce;
  outline: none;
}

#version-badge {
  position: fixed;
  left: 10px;
  bottom: 8px;
  z-index: 4;
  padding: 3px 6px;
  color: rgba(224, 238, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

@media (max-width: 520px) {
  #hud {
    top: 10px;
    left: 10px;
    right: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #hud > div {
    min-height: 50px;
    padding: 8px;
  }
}
