/* ---------- levelkeuze ---------- */
.home-wrap { max-width: 900px; margin: 0 auto; }
.home-wrap h1 { margin: 4px 0 8px; }
.home-wrap h2 { margin: 36px 0 4px; }
.intro { margin: 0 0 24px; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.level-kaart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.level-kaart:hover, .level-kaart:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.level-kaart--klaar { border-color: var(--primary-green); }

.level-mini { width: 100%; aspect-ratio: 1; background: #faf8f3; border-radius: 10px; }
.level-mini path { stroke: #b9b1a0; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.level-mini--klein { width: 56px; }
.level-mini circle { fill: #4b5a50; }
.level-naam { font-weight: 700; }
.level-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--dempt); }
.level-tijd { color: var(--primary-green); font-weight: 600; }
.stippen { letter-spacing: 1px; }

.willekeurig-rij { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.gast-tip { margin-top: 28px; }

/* ---------- spel ---------- */
.spel-wrap { max-width: 600px; margin: 0 auto; }
.spel-kop h1 { margin: 4px 0 4px; }
.spel-kop p { margin: 0 0 12px; }
.terug { text-decoration: none; font-size: 14px; }

.spel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 8px 0 10px;
  font-size: 15px;
  color: var(--dempt);
}

.spel-stats strong { color: var(--tekst); font-variant-numeric: tabular-nums; }

.bord {
  background: #fffdf8;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  padding: 6px;
}

#bord {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  touch-action: none;       /* geen scrollen tijdens het tekenen */
  user-select: none;
  -webkit-user-select: none;
}

#bord .rand { fill: none; stroke: #cfc8b8; stroke-width: 2.4; stroke-linecap: round; }
#bord .pad  { fill: none; stroke-width: 3.2; stroke-linecap: round; opacity: 0; transition: opacity 0.12s ease; }
#bord .pad.aan { opacity: 1; }
#bord .elastiek { stroke: rgba(46, 125, 50, 0.45); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 2 3; }
#bord .hint-lijn { fill: none; stroke: #f2a900; stroke-width: 4; stroke-linecap: round; opacity: 0.85; }

#bord .halo { fill: transparent; cursor: pointer; }
#bord .punt { fill: #4b5a50; stroke: #fffdf8; stroke-width: 1.2; transition: fill 0.12s ease; }
#bord .punt.start  { fill: #2E7D32; }
#bord .punt.actief { fill: #1565c0; }
#bord .punt-ring { fill: none; stroke: #1565c0; stroke-width: 1.4; opacity: 0; }
#bord .punt-ring.aan { opacity: 0.7; }
#bord .punt.hint { fill: #f2a900; }

#bord .punt-ring.hint {
  stroke: #f2a900;
  opacity: 1;
  animation: puls 0.9s ease-in-out infinite;
}

@keyframes puls {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

#bord .punt-ring { transform-box: fill-box; transform-origin: center; }

.melding { min-height: 1.6em; margin: 10px 2px; color: var(--dempt); }
.melding.fout { color: #b3261e; }
.melding.goed { color: var(--primary-green); font-weight: 600; }

.spel-knoppen { display: flex; flex-wrap: wrap; gap: 10px; }

.klaar {
  margin-top: 18px;
  padding: 16px 18px;
  background: #e8f3e9;
  border: 1px solid var(--primary-green);
  border-radius: 14px;
}

.klaar h2 { margin: 0 0 6px; }
.klaar p { margin: 0 0 12px; }
.klaar[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  #bord .punt-ring.hint { animation: none; }
}

/* ---------- delen ---------- */
.deel-paneel { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.deel-paneel[hidden] { display: none; }
.admin-links { margin-top: 22px; font-size: 14px; }

/* ---------- level-editor ---------- */
.editor-wrap { max-width: 640px; margin: 0 auto; }
.editor-wrap h1 { margin: 4px 0 14px; }
.editor-velden { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.editor-velden > div { display: flex; flex-direction: column; gap: 4px; }
.editor-velden input[type=text] { min-width: 220px; }
.editor-gereedschap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.editor-gereedschap .btn.actief { background: var(--primary-green); border-color: var(--primary-green); color: #fff; }
.snap-label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.editor-tip { margin: 8px 2px 2px; min-height: 1.5em; font-size: 14px; }
.editor-status { margin: 4px 2px 8px; font-weight: 600; }
.editor-status.ok { color: var(--primary-green); }
.editor-status.fout { color: #b3261e; }
.editor-uitleg { font-size: 13px; margin: 0 2px 16px; }
.editor-acties { display: flex; flex-wrap: wrap; gap: 10px; }

#editor { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
#editor .raster { stroke: rgba(0, 0, 0, 0.06); stroke-width: 0.3; }
#editor .e-lijn { fill: none; stroke: #8d8676; stroke-width: 2.4; stroke-linecap: round; }
#editor .e-lijn.sel { stroke: #1565c0; stroke-width: 3; }
#editor .e-punt { fill: #4b5a50; stroke: #fffdf8; stroke-width: 1; }
#editor .e-punt.oneven { stroke: #f2a900; stroke-width: 1.6; }
#editor .e-punt.sel { fill: #1565c0; }
#editor .e-punt.pending { fill: #2E7D32; }
#editor .e-graad { fill: #fff; font-size: 3.6px; font-weight: 700; text-anchor: middle; pointer-events: none; }
#editor .handle { fill: #f2a900; stroke: #fff; stroke-width: 1; cursor: grab; }
#editor .elastiek { stroke: rgba(46, 125, 50, 0.5); stroke-width: 2.2; stroke-dasharray: 2 3; stroke-linecap: round; }
