* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #050d1f;
  /* Geen scrollen, zoomen, selecteren of tik-highlights tijdens het spelen */
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  position: fixed;
  inset: 0;
}

#game {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(ellipse at 50% 100%, rgba(42, 159, 232, 0.20), transparent 60%),
    #050d1f;
}

#game canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  outline: none;
}

/* ==========================================================================
   Naam-invoer (HTML-overlay boven de game)
   ========================================================================== */
#name-dialog {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 13, 31, 0.72);
  font-family: 'Press Start 2P', monospace;
}

#name-dialog[hidden] {
  display: none;
}

.name-card {
  width: 100%;
  max-width: 320px;
  padding: 24px 20px 20px;
  background: #0c1f3d;
  border: 4px solid #2a9fe8;
  box-shadow: 6px 6px 0 #030812;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: center;
}

.name-title {
  color: #ffd23f;
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 2px 2px 0 #000;
}

#name-input {
  font-family: inherit;
  font-size: 16px; /* >= 16px: voorkomt automatisch inzoomen op iOS */
  text-transform: uppercase;
  text-align: center;
  color: #0b1630;
  background: #ffffff;
  border: 3px solid #0b1630;
  outline: 3px solid #3ee6d8;
  outline-offset: 0;
  padding: 12px 8px;
  border-radius: 0;
  width: 100%;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

#name-input::placeholder {
  color: #8fb4d8;
}

.name-error {
  min-height: 10px;
  color: #ff9a7a;
  font-size: 8px;
}

.name-btn {
  font-family: inherit;
  font-size: 16px;
  color: #ffffff;
  background: #123a6b;
  border: 3px solid #ffd23f;
  box-shadow: 4px 4px 0 #030812;
  padding: 14px 8px 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.name-btn:active {
  background: #1f6aa8;
  color: #ffd23f;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #030812;
}
