:root {
  color-scheme: dark;
  --bg: #050816;
  --cyan: #65e7ff;
  --pink: #ff5ecf;
  --yellow: #ffe66d;
  --text: #f7fbff;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #000; }
body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  background: radial-gradient(circle at 50% 22%, #102852 0, #071127 36%, #03050d 100%);
  overflow: hidden;
}

#game { display: block; width: 100%; height: 100%; }

#hud {
  position: absolute;
  z-index: 3;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  pointer-events: none;
}
#hud > div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(101, 231, 255, .24);
  background: rgba(1, 8, 24, .58);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 18px rgba(101, 231, 255, .05);
}
#hud > div:nth-child(2) { text-align: center; }
#hud > div:nth-child(3) { text-align: right; }
.hud-label { display: block; font-size: 9px; letter-spacing: .18em; color: #7aa0bd; }
#hud strong { display: block; margin-top: 2px; font-size: 16px; color: var(--text); }

#topbar {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  display: flex;
  gap: 8px;
}
.icon-btn {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: white;
  text-decoration: none;
  background: rgba(4, 12, 30, .7);
  backdrop-filter: blur(8px);
}
.nav-home { font-size: 20px; }

#overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(rgba(2,5,14,.72), rgba(2,5,14,.9));
  backdrop-filter: blur(4px);
}
#overlay.visible { display: flex; }
.panel { width: min(100%, 420px); text-align: center; }
.eyebrow { color: var(--cyan); font-size: 10px; letter-spacing: .24em; }
h1 { margin: 6px 0 18px; font-size: clamp(48px, 15vw, 86px); line-height: .78; letter-spacing: -.08em; text-shadow: 0 0 20px rgba(101,231,255,.24); }
h1 span { color: var(--pink); }
#overlayText { margin: 0 auto 20px; max-width: 34ch; color: #aec1d1; font-size: 13px; line-height: 1.55; }
.stats-line { margin-bottom: 16px; color: #758fa6; letter-spacing: .16em; font-size: 11px; }
.stats-line strong { color: var(--yellow); }
.primary-btn {
  width: min(100%, 300px);
  padding: 15px 20px;
  border: 0;
  border-radius: 14px;
  color: #04101a;
  background: linear-gradient(135deg, var(--cyan), #aef6ff);
  font-weight: 900;
  letter-spacing: .14em;
  box-shadow: 0 8px 32px rgba(101,231,255,.24);
}
.primary-btn:active { transform: translateY(1px) scale(.99); }
.hint { margin-top: 12px; color: #5f778c; font-size: 10px; }

@media (min-width: 641px) {
  body { background: #03050a; }
  #app { box-shadow: 0 0 80px rgba(0,0,0,.8); }
}
