:root {
  color-scheme: dark;
  --ink: #05070c;
  --paper: #f1fbff;
  --neon-cyan: #24f2ff;
  --neon-pink: #ff2bd6;
  --neon-yellow: #ffe66d;
  --neon-green: #7cff6b;
  --warning: #ff4b6e;
  --panel: rgba(4, 8, 18, 0.72);
  --panel-strong: rgba(5, 8, 17, 0.94);
  --shadow: rgba(0, 0, 0, 0.58);
  font-family: "Share Tech Mono", "Audiowide", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: #000;
}

button {
  border: 1px solid rgba(36, 242, 255, 0.72);
  border-radius: 4px;
  color: var(--paper);
  background:
    linear-gradient(135deg, rgba(36, 242, 255, 0.18), rgba(255, 43, 214, 0.22)),
    rgba(5, 8, 17, 0.86);
  box-shadow: 0 0 16px rgba(36, 242, 255, 0.26), 0 8px 22px var(--shadow);
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button:active {
  transform: translateY(1px);
}

#game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: none;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--paper);
  pointer-events: none;
}

.stats,
.hud-actions {
  min-height: 46px;
  border: 1px solid rgba(36, 242, 255, 0.42);
  border-radius: 4px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 0 20px rgba(36, 242, 255, 0.06),
    0 0 22px rgba(255, 43, 214, 0.12),
    0 10px 24px var(--shadow);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--neon-yellow);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(255, 230, 109, 0.48);
}

.stats span {
  white-space: nowrap;
}

.hud-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  pointer-events: auto;
}

.hud-actions button {
  width: 42px;
  height: 34px;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(6, 15, 31, 0.9);
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 43, 214, 0.2), rgba(0, 0, 0, 0.88)),
    repeating-linear-gradient(0deg, rgba(36, 242, 255, 0.05) 0 1px, transparent 1px 5px);
}

.overlay.is-visible {
  display: grid;
}

.modal {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid rgba(255, 43, 214, 0.46);
  border-radius: 4px;
  padding: 24px;
  background: var(--panel-strong);
  box-shadow: 0 0 34px rgba(255, 43, 214, 0.2), 0 24px 70px rgba(0, 0, 0, 0.68);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--neon-cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(36, 242, 255, 0.82);
}

h1,
h2 {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 5.25rem);
  line-height: 0.92;
}

.subcopy {
  margin: 16px 0 0;
  color: rgba(241, 251, 255, 0.82);
  font-size: 1rem;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions button {
  min-height: 44px;
  padding: 0 16px;
  font-weight: 900;
  background: rgba(36, 242, 255, 0.16);
}

#continue-btn {
  display: none;
  background: rgba(255, 43, 214, 0.18);
}

#continue-btn.is-visible {
  display: inline-block;
}

.touch-controls {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: none;
  align-items: end;
  justify-content: space-between;
  z-index: 6;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch-move,
.touch-action {
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.touch-controls button {
  width: 76px;
  height: 68px;
  pointer-events: auto;
  border: 2px solid rgba(36, 242, 255, 0.5);
  font-size: 1.35rem;
  font-weight: 900;
  background: rgba(6, 15, 31, 0.86);
  backdrop-filter: blur(8px);
  touch-action: none;
}

.touch-action button {
  width: 88px;
  height: 78px;
  border-color: rgba(255, 43, 214, 0.66);
  background: rgba(255, 43, 214, 0.16);
}

@media (max-width: 900px), (pointer: coarse), (hover: none) {
  .hud {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stats {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hud-actions {
    position: absolute;
    top: 0;
    right: 0;
  }

  .touch-controls {
    display: flex;
  }

  .modal {
    padding: 20px;
  }
}

@media (max-width: 460px) {
  .touch-controls button {
    width: 66px;
    height: 60px;
  }

  .touch-action button {
    width: 76px;
    height: 68px;
  }
}
