/* Webbouwers – vrolijk, groot en duidelijk voor groep 4/5 */
:root {
  --paars: #6c4fd9;
  --paars-donker: #5239b3;
  --grijs: #f3f1fb;
  --rand: #d9d4f0;
  --tekst: #2b2540;
  --groen: #2e9e5b;
  --rood: #d94f4f;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Segoe UI', 'Nunito', Arial, sans-serif;
  color: var(--tekst);
  background: var(--grijs);
  font-size: 18px;
}
h1, h2 { margin: 0 0 .5rem; }
a { color: var(--paars); }
.hint { font-size: .9rem; color: #6a6480; margin: .25rem 0 .75rem; }
.fout { background: #ffe1e1; border: 2px solid var(--rood); padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.melding { background: #e2f7ea; border: 2px solid var(--groen); padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; }

/* Knoppen */
.knop {
  display: inline-block; cursor: pointer; border: 0; text-decoration: none;
  background: var(--paars); color: #fff; font: inherit; font-weight: 700;
  padding: .8rem 1.4rem; border-radius: 999px; box-shadow: 0 4px 0 var(--paars-donker);
  transition: transform .05s;
}
.knop:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--paars-donker); }
.knop.klein { padding: .45rem .9rem; font-size: .9rem; box-shadow: 0 3px 0 var(--paars-donker); }
.knop.grijs { background: #8a85a8; box-shadow: 0 3px 0 #6b6688; }
.knop.rood { background: var(--rood); box-shadow: 0 3px 0 #a93b3b; }

/* Startpagina & docent */
body.start, body.docent { display: flex; flex-direction: column; align-items: center; padding: 2rem 1rem; min-height: 100vh; }
.kaart {
  background: #fff; border-radius: 24px; padding: 2rem; width: 100%; max-width: 520px;
  box-shadow: 0 10px 40px rgba(60, 40, 140, .12);
}
.kaart.breed { max-width: 900px; }
.kaart h1 { font-size: 2rem; }
.sub { margin-top: 0; color: #6a6480; }
label { display: block; font-weight: 700; margin: 1.25rem 0 .25rem; }
input.groot, input[type=password] {
  width: 100%; font: inherit; font-size: 1.4rem; padding: .7rem 1rem;
  border: 3px solid var(--rand); border-radius: 14px; outline: none;
}
input.groot:focus { border-color: var(--paars); }
#klascode { text-transform: uppercase; letter-spacing: .2em; text-align: center; }
.klasnaam { margin: 0; }
.dieren { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.dier { cursor: pointer; margin: 0; }
.dier input { position: absolute; opacity: 0; }
.dier span {
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
  height: 64px; border: 3px solid var(--rand); border-radius: 14px; background: #fff; transition: .1s;
}
.dier input:checked + span { border-color: var(--paars); background: #ece7ff; transform: scale(1.08); }
.voet { margin-top: 1.5rem; font-size: .9rem; }
.rij { display: flex; gap: .5rem; align-items: center; }
.klasblok { border-top: 2px solid var(--rand); margin-top: 1.5rem; padding-top: 1rem; }
.code { font-family: monospace; background: #ece7ff; padding: .1rem .5rem; border-radius: 8px; letter-spacing: .1em; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-bottom: .75rem; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--rand); }
.acties { white-space: nowrap; }
.inline { display: inline; }

/* ---------- Editor ---------- */
body.editor { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.balk {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff; padding: .6rem 1rem; border-bottom: 2px solid var(--rand);
}
.balk-links, .balk-rechts { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.logo { font-size: 1.5rem; }
.status { font-size: .85rem; color: var(--groen); }
.status.bezig { color: #8a85a8; }
.status.fout { color: var(--rood); }
.kleurkiezer { display: flex; gap: .3rem; }
.kleurkiezer .kleur {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #c9c4e0; cursor: pointer; padding: 0;
}
.kleurkiezer .kleur.actief { border: 3px solid var(--paars); transform: scale(1.15); }
.welkom {
  background: #fff4b8; padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.welkom button { font: inherit; border: 0; background: var(--paars); color: #fff; border-radius: 999px; padding: .3rem 1rem; cursor: pointer; }

.werkplek { flex: 1; display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
body.met-code .werkplek { grid-template-columns: 220px 1fr 400px; }

.palet { background: #fff; border-right: 2px solid var(--rand); padding: 1rem; overflow-y: auto; }
.palet h2 { font-size: 1.1rem; }
.palet-blok {
  display: flex; align-items: center; gap: .6rem; cursor: grab; user-select: none;
  background: var(--grijs); border: 2px solid var(--rand); border-radius: 12px;
  padding: .7rem .8rem; margin-bottom: .5rem; font-weight: 700;
}
.palet-blok span { font-size: 1.4rem; }
.palet-blok:hover { border-color: var(--paars); background: #ece7ff; }
.palet-blok:active { cursor: grabbing; }

.canvas-wrap { overflow-y: auto; padding: 1.5rem; }
.canvas {
  max-width: 720px; margin: 0 auto; min-height: 400px; border-radius: 20px; padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(60, 40, 140, .12); transition: background .2s;
}
.kleur-geel { background: #fff4b8; } .kleur-blauw { background: #cfe8ff; } .kleur-groen { background: #d4f5d0; }
.kleur-roze { background: #ffd6e7; } .kleur-paars { background: #e5d4ff; } .kleur-oranje { background: #ffe0c2; } .kleur-wit { background: #fff; }
.leeg { text-align: center; color: #7a7490; padding: 3rem 1rem; font-size: 1.2rem; border: 3px dashed #bbb3dd; border-radius: 16px; }

.blok {
  background: rgba(255,255,255,.75); border: 3px solid transparent; border-radius: 14px; margin-bottom: .75rem; cursor: pointer;
  transition: border-color .1s;
}
.blok:hover { border-color: #bbb3dd; }
.blok.geselecteerd { border-color: var(--paars); box-shadow: 0 0 0 4px rgba(108, 79, 217, .15); }
.blok.sleept { opacity: .4; }
.blok-handvat {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem; font-size: .8rem; color: #6a6480;
  border-bottom: 1px dashed #d9d4f0; cursor: grab;
}
.grip { font-size: 1.1rem; }
.blok-naam { flex: 1; font-weight: 700; }
.blok-knoppen button {
  border: 0; background: #ece7ff; color: var(--paars); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: .9rem; margin-left: 2px;
}
.blok-knoppen button[data-actie=weg] { background: #ffe1e1; color: var(--rood); }
.blok-inhoud { padding: .6rem .8rem; }
.blok-inhoud input, .blok-inhoud textarea {
  width: 100%; font: inherit; border: 0; background: transparent; outline: none; resize: none; padding: .2rem; border-radius: 8px;
  font-family: 'Comic Sans MS', 'Segoe UI', sans-serif;
}
.blok-inhoud input:focus, .blok-inhoud textarea:focus { background: #fff; }
.type-kop input { font-size: 2.2rem; font-weight: 700; }
.type-kop2 input { font-size: 1.5rem; font-weight: 700; }
.type-tekst textarea, .type-lijst textarea { font-size: 1.2rem; line-height: 1.5; }
.type-lijst textarea { padding-left: 1.5rem; background-image: radial-gradient(circle, #555 3px, transparent 3.5px); background-size: 1.5rem 1.8rem; background-repeat: repeat-y; background-position: 0 .55rem; }
.type-lijn hr { border: 0; border-top: 4px dotted #999; margin: .5rem 0; }
.emoji-groot { font-size: 5rem; background: transparent; border: 0; cursor: pointer; display: block; margin: 0 auto; line-height: 1.2; }
.emoji-kiezer { display: grid; grid-template-columns: repeat(10, 1fr); gap: .25rem; background: #fff; border: 2px solid var(--rand); border-radius: 12px; padding: .5rem; margin-top: .5rem; }
.emoji-kiezer button { font-size: 1.8rem; background: transparent; border: 0; cursor: pointer; border-radius: 8px; padding: .2rem; }
.emoji-kiezer button:hover { background: #ece7ff; }
.drop-lijn { height: 6px; background: var(--paars); border-radius: 3px; margin: .25rem 0 .75rem; }

/* Codepaneel */
.codepaneel { background: #1e1b2e; color: #e8e4ff; padding: 1rem; overflow-y: auto; border-left: 2px solid var(--rand); }
.codepaneel h2 { font-size: 1.1rem; }
.codepaneel .hint { color: #b4aed6; }
#code { font-family: 'Cascadia Code', Consolas, monospace; font-size: .95rem; white-space: pre-wrap; word-break: break-word; margin: 0; line-height: 1.5; }
.code-vast { opacity: .55; }
.code-blok { border-left: 4px solid transparent; margin-left: -8px; padding-left: 4px; cursor: pointer; border-radius: 4px; }
.code-blok:hover { background: rgba(255,255,255,.06); }
.code-blok.geselecteerd { border-left-color: #ffd34d; background: rgba(255, 211, 77, .15); }
.c-tag { color: #7fd1ff; }
.c-attr { color: #ffb86c; }
.c-val { color: #b4f28c; }
.c-doctype { color: #8a85a8; }

@media (max-width: 800px) {
  .werkplek, body.met-code .werkplek { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .palet { display: flex; gap: .5rem; overflow-x: auto; border-right: 0; border-bottom: 2px solid var(--rand); padding: .5rem; }
  .palet h2, .palet .hint { display: none; }
  .palet-blok { margin: 0; white-space: nowrap; }
  .codepaneel { max-height: 45vh; }
  .dieren { grid-template-columns: repeat(4, 1fr); }
}

/* Gezamenlijke klaspagina */
body.klasoverzicht { padding: 1.5rem 1rem 3rem; }
.klaskop { text-align: center; margin-bottom: 1.5rem; }
.klaskop h1 { font-size: 2rem; }
.tegels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; max-width: 1100px; margin: 0 auto; }
.tegel { display: block; text-decoration: none; color: var(--tekst); border-radius: 20px; padding: 1.2rem; min-height: 180px; box-shadow: 0 6px 20px rgba(60,40,140,.12); transition: transform .1s; }
.tegel:hover { transform: translateY(-4px) scale(1.02); }
.tegel-emoji { font-size: 3rem; text-align: center; }
.tegel-naam { font-weight: 800; font-size: 1.2rem; text-align: center; margin: .3rem 0; }
.tegel-kop { font-family: 'Comic Sans MS', 'Segoe UI', sans-serif; font-weight: 700; text-align: center; }
.tegel-tekst { font-size: .9rem; color: #5a5470; text-align: center; margin-top: .3rem; }
.klasoverzicht .voet { text-align: center; margin-top: 2rem; }
.deelvak { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: #ece7ff; border-radius: 12px; padding: .6rem .8rem; margin: .5rem 0 .75rem; }
.deelvak input { flex: 1; min-width: 240px; font: inherit; font-size: .95rem; padding: .4rem .6rem; border: 2px solid var(--rand); border-radius: 8px; background: #fff; }
.tegel-foto { display: block; width: 100%; height: 120px; object-fit: cover; border-radius: 12px; }
.blok-foto { display: block; max-width: 100%; max-height: 320px; margin: 0 auto .5rem; border-radius: 12px; }
.plaatje-knoppen { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.plaatje-knoppen button { font: inherit; font-weight: 700; font-size: .9rem; border: 2px solid var(--rand); background: #fff; border-radius: 999px; padding: .4rem .9rem; cursor: pointer; }
.plaatje-knoppen button:hover { border-color: var(--paars); background: #ece7ff; }
.upload-bezig { text-align: center; color: #6a6480; font-size: .9rem; }
.video-url { font-size: 1rem !important; border: 2px solid var(--rand) !important; background: #fff !important; padding: .5rem .7rem !important; font-family: inherit !important; }
.video-kader { width: 360px; max-width: 100%; aspect-ratio: 16/9; margin: .6rem auto 0; background: #222; color: #fff; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.3rem; text-align: center; }
.video-kader small { font-size: .8rem; opacity: .8; margin-top: .3rem; }
.video-kader.fout { background: #ffe1e1; color: var(--rood); }

/* Terugkerende leerlingen kiezen hun bestaande website. */
.leerlingnamen { display:flex; flex-wrap:wrap; gap:.75rem; margin:1rem 0; }
.leerlingnamen .knop { overflow-wrap:anywhere; max-width:100%; }

/* Leesbare uitleg bij de HTML van ieder bouwblok. */
.c-comment { color: #a9d9b1; font-style: italic; }
