* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Neue", "Comic Sans MS", sans-serif;
  font-weight: 700;
  color: #111;
  background-color: #ffd23f;
  background-image: radial-gradient(#f5a623 2px, transparent 2.5px);
  background-size: 16px 16px;
  padding: 12px 16px 24px;
}

.topbar {
  max-width: 960px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-family: "Bangers", Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 6vw, 48px);
  letter-spacing: 2px;
  color: #ff3b1f;
  -webkit-text-stroke: 2px #111;
  text-shadow: 3px 3px 0 #111;
  transform: rotate(-2deg);
}

.terug {
  color: #111;
  text-decoration: none;
  background: #fff;
  border: 3px solid #111;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 3px 3px 0 #111;
  white-space: nowrap;
}

.knoppen { display: flex; gap: 8px; }

.icoon {
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
  background: #fff;
  border: 3px solid #111;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #111;
  cursor: pointer;
}
.icoon:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111; }

.speelveld {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 8 / 5;
  border: 6px solid #111;
  border-radius: 16px;
  box-shadow: 8px 8px 0 #111;
  overflow: hidden;
  background: #3ec3f6;
}

#spel {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 40, 90, 0.45);
  overflow: auto;
}
.overlay.zichtbaar { display: flex; }

.paneel {
  background: #fff;
  border: 5px solid #111;
  border-radius: 18px;
  box-shadow: 6px 6px 0 #111;
  padding: 16px 24px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  max-height: 100%;
  overflow: auto;
}
.paneel p { margin: 8px 0; }

.titel {
  margin: 0 0 6px;
  font-family: "Bangers", Impact, sans-serif;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: 2px;
  color: #ece41f;
  -webkit-text-stroke: 2px #111;
  text-shadow: 3px 3px 0 #111;
}
.titel.rood { color: #ff2e6e; }

.paneel h3 {
  margin: 12px 0 4px;
  font-family: "Bangers", Impact, sans-serif;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 1px;
}

.paxi-groot { width: 110px; height: auto; }
.mini { width: 22px; height: auto; vertical-align: middle; }
.uitleg { font-size: 14px; color: #555; }

.knop {
  font-family: "Bangers", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: 1px;
  padding: 6px 28px;
  margin: 8px 0;
  background: #ece41f;
  border: 4px solid #111;
  border-radius: 12px;
  box-shadow: 4px 4px 0 #111;
  cursor: pointer;
}
.knop:hover { background: #fff04a; }
.knop:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #111; }
.knop.klein { font-size: 20px; padding: 4px 16px; }

.eindscore { font-size: 20px; }

.naam-form { display: none; }
.naam-form.zichtbaar { display: block; }
.naam-form input {
  font: inherit;
  font-size: 20px;
  padding: 6px 10px;
  border: 3px solid #111;
  border-radius: 10px;
  width: 180px;
  max-width: 100%;
}

.scores {
  list-style: none;
  counter-reset: plek;
  margin: 0 auto;
  padding: 0;
  max-width: 320px;
  text-align: left;
}
.scores li {
  counter-increment: plek;
  display: flex;
  gap: 8px;
  padding: 2px 8px;
  border-radius: 6px;
}
.scores li::before { content: counter(plek) "."; width: 26px; color: #888; }
.scores li .naam { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scores li .lvl { color: #888; font-size: 13px; align-self: center; }
.scores li.nieuw { background: #ece41f; animation: knipper 0.6s ease-in-out 4; }
.scores .leeg { color: #888; justify-content: center; }
.scores .leeg::before { content: none; }

@keyframes knipper { 50% { background: #fff; } }

/* Kleine schermen: menu's over het hele scherm, zodat alles past */
@media (max-width: 640px) {
  .overlay { position: fixed; z-index: 10; }
  .paxi-groot { width: 80px; }
  .titel { font-size: 36px; }
  .terug { padding: 4px 8px; font-size: 14px; }
  .topbar h1 { font-size: 26px; letter-spacing: 1px; }
  .icoon { width: 38px; height: 38px; font-size: 18px; }
}
