* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: #0A2CCA;
  font-family: sans-serif;
  color: #fff;
  /* Laat de pagina scrollen op mobiel */
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 12px 0 20px;
}

/* ── Logo ── */
#logovvd {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

#logovvd img {
  display: block;
  width: auto;
  height: auto;
  max-width: 180px;   /* niet groter dan dit op mobiel */
  max-height: 80px;
  object-fit: contain;
}

/* ── Ondertitel ── */
#info {
  font-size: 14px;
  opacity: 0.85;
  text-align: center;
  margin-bottom: 8px;
  padding: 0 12px;
  pointer-events: none;
}

/* ── Wrapper: canvas + dpad onder elkaar ── */
.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* ── Canvas ──
   Op mobiel: pas aan viewport-breedte en laat genoeg ruimte voor dpad (~160px) + logo/tekst (~120px)
   Op desktop: max 720px, beperkt door viewporthoogte minus logo/tekst-ruimte
*/
canvas {
  background: #333;
  border: 2px solid #fff;
  image-rendering: pixelated;
  display: block;
  width: min(720px, 96vw);
  height: min(720px, 96vw);
}

@media (hover: hover) and (pointer: fine) {
  /* Desktop: limiteer ook op hoogte, er is geen dpad */
  canvas {
    width: min(720px, 96vw, calc(100vh - 180px));
    height: min(720px, 96vw, calc(100vh - 180px));
  }

  #info {
    font-size: 20px;
    opacity: 1;
  }

  #logovvd img {
    max-width: 220px;
    max-height: 100px;
  }
}

/* ── D-pad ── */
#dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  user-select: none;
  /* Blokkeer alleen scrollen op de d-pad zelf, niet op de rest van de pagina */
  touch-action: none;
}

.dpad-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.dpad-middle {
  align-items: center;
}

.dpad-center {
  width: 52px;
  height: 52px;
}

.dpad-btn {
  width: 52px;
  height: 52px;
  font-size: 22px;
  background: #FF6400;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.1s;
}

.dpad-btn:active {
  background: rgba(255,255,255,0.4);
}

/* Op desktop: dpad verbergen */
@media (hover: hover) and (pointer: fine) {
  #dpad {
    display: none;
  }
}

/* ── Pop-up overlay ── */
.popup {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
}

.popup.hidden {
  display: none;
}

.popup-box {
  background: #1e1e1e;
  border: 2px solid #555;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

/* Win VVD: blauw-oranje accent */
.popup-box.win-vvd {
  border-color: #f4a014;
}
.popup-box.win-vvd h2 {
  color: #f4a014;
}
.popup-box.win-vvd button {
  background: #f4a014;
}
.popup-box.win-vvd button:hover {
  background: #d4880e;
}

/* Win Links: rood accent */
.popup-box.win-links {
  border-color: #c0392b;
}
.popup-box.win-links h2 {
  color: #e74c3c;
}
.popup-box.win-links button {
  background: #c0392b;
}
.popup-box.win-links button:hover {
  background: #a93226;
}

/* Game Over basis */
.popup-box.gameover {
  border-color: #e74c3c;
}

/* Game Over Links: felle rode tint */
.popup-box.gameover-links {
  border-color: #e74c3c;
  background: #2a0a0a;
}
.popup-box.gameover-links h2 {
  color: #e74c3c;
}

/* Game Over VVD: donkerblauwe tint */
.popup-box.gameover-vvd {
  border-color: #2471a3;
  background: #0a1a2a;
}
.popup-box.gameover-vvd h2 {
  color: #5dade2;
}
.popup-box.gameover-vvd button {
  background: #2471a3;
}
.popup-box.gameover-vvd button:hover {
  background: #1a5276;
}

.popup-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.popup-box h2 {
  margin: 0 0 10px;
  font-size: 28px;
  color: #fff;
}

.popup-box p {
  margin: 0 0 24px;
  color: #ccc;
  font-size: 15px;
  line-height: 1.5;
}

.popup-box button {
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  touch-action: manipulation;
}

.popup-box button:hover {
  background: #219a52;
}

.popup-box.gameover button {
  background: #e74c3c;
}

.popup-box.gameover button:hover {
  background: #c0392b;
}