:root {
  --bg: #fff6e8;
  --bg2: #ffe8c8;
  --ink: #1f2a24;
  --muted: #5c6b62;
  --brand: #e85d04;
  --brand-deep: #c43d00;
  --leaf: #2a9d8f;
  --leaf-deep: #1d7a70;
  --card: #ffffff;
  --line: #f0d9b5;
  --danger: #c1121f;
  --shadow: 0 12px 40px rgba(232, 93, 4, 0.12);
  --radius: 1.25rem;
  --font: "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, #ffd6a5 0%, transparent 42%),
    radial-gradient(circle at 88% 8%, #b7efe8 0%, transparent 38%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  line-height: 1.45;
}

a { color: var(--leaf-deep); }
img { max-width: 100%; }

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.brand {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand span { color: var(--brand); }

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  min-height: min(70vh, 640px);
  padding: 1rem 0 2rem;
}
@media (min-width: 840px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; }
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 32rem;
}
.hero-art {
  aspect-ratio: 1;
  border-radius: 2rem;
  background:
    linear-gradient(145deg, #fff 0%, #ffe0b5 55%, #ffb703 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-art::before,
.hero-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.hero-art::before {
  width: 45%;
  height: 45%;
  left: 12%;
  top: 18%;
  background: var(--leaf);
  opacity: 0.85;
}
.hero-art::after {
  width: 28%;
  height: 28%;
  right: 16%;
  bottom: 18%;
  background: var(--brand);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(232, 93, 4, 0.35);
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary {
  background: var(--leaf);
  color: #fff;
  box-shadow: 0 8px 20px rgba(42, 157, 143, 0.3);
}
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.92rem; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--line);
  padding: 1.35rem;
}
.card h2 {
  font-family: var(--display);
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

.form-grid { display: grid; gap: 0.85rem; }
label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}
input, select, textarea {
  font: inherit;
  border: 2px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.7rem 0.85rem;
  background: #fffdf8;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(42, 157, 143, 0.35);
  border-color: var(--leaf);
}
.hint { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.error {
  background: #ffe5e5;
  color: var(--danger);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-weight: 700;
}
.ok {
  background: #e3f8f4;
  color: var(--leaf-deep);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.class-card h3 {
  font-family: var(--display);
  margin: 0 0 0.35rem;
}
.class-card .meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.85rem; }
.class-card .code {
  font-family: ui-monospace, monospace;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: #fff3e0;
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 0.5rem;
  margin-bottom: 0.85rem;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.preset {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 800;
  cursor: pointer;
}
.preset.is-active {
  border-color: var(--leaf);
  background: #e3f8f4;
  color: var(--leaf-deep);
}

/* Editor */
.editor-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}
.toolbar {
  display: grid;
  gap: 0.65rem;
  position: static;
  min-width: 0;
}
.tool-group {
  display: grid;
  gap: 0.4rem;
}
.tool-group strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tool {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
}
.tool.is-active {
  border-color: var(--brand);
  background: #fff0e4;
  color: var(--brand-deep);
}
.canvas-frame {
  background: #3a3a3a;
  border-radius: 1.25rem;
  padding: 0.85rem;
  overflow: auto;
  width: 100%;
  min-width: 0;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#stage-host {
  background: #fff;
  box-shadow: 0 0 0 3px #111;
  touch-action: none;
  flex: 0 0 auto;
}
.editor-shell--side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 800px) {
  .editor-shell--side {
    flex-direction: row;
    align-items: stretch;
  }
  .editor-shell--side .toolbar {
    flex: 0 0 220px;
  }
  .editor-shell--side .canvas-frame {
    flex: 1 1 auto;
    min-width: 0;
  }
}
.color-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.color-dot {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #f0d9b5;
  cursor: pointer;
  padding: 0;
}
.color-dot.is-active {
  box-shadow: 0 0 0 3px var(--brand);
}
.share-box {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.share-box code {
  font-size: 1.35rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  background: #fff3e0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  display: inline-block;
}

.work-thumb {
  aspect-ratio: 1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.work-thumb canvas, .work-thumb img { width: 100%; height: 100%; object-fit: contain; }
.work-thumb .label {
  font-weight: 800;
  padding: 0.5rem;
  text-align: center;
}

.is-hidden { display: none !important; }

.footer-note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* === Speels voor 6–7 jaar (leerling) === */
body.kids {
  font-size: 1.15rem;
}
body.kids .wrap { width: min(980px, calc(100% - 1.25rem)); }
body.kids .brand { font-size: 1.9rem; }
body.kids .card {
  border-width: 3px;
  border-radius: 1.75rem;
  padding: 1.25rem;
}
body.kids h2 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  text-align: center;
}
body.kids .btn {
  min-height: 3.4rem;
  font-size: 1.2rem;
  padding: 0.95rem 1.5rem;
  border-radius: 1.25rem;
}
body.kids .btn-xl {
  min-height: 4.2rem;
  font-size: 1.45rem;
  width: 100%;
  border-radius: 1.5rem;
  box-shadow: 0 10px 0 #1d7a70, 0 14px 24px rgba(0,0,0,0.12);
}
body.kids .btn-xl:active {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #1d7a70, 0 6px 12px rgba(0,0,0,0.12);
}
body.kids .btn-submit {
  background: linear-gradient(180deg, #52b788, #2a9d8f);
  color: #fff;
  font-size: 1.55rem;
  min-height: 4.6rem;
  width: 100%;
  border-radius: 1.5rem;
  box-shadow: 0 10px 0 #1b6b63;
}
body.kids .btn-submit:disabled {
  opacity: 0.7;
  box-shadow: none;
}
body.kids input {
  min-height: 3.5rem;
  font-size: 1.35rem;
  border-width: 3px;
  border-radius: 1.1rem;
  text-align: center;
}
body.kids .kid-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
body.kids .kid-step {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #ffe0b5;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--brand-deep);
}
body.kids .kid-step.is-on {
  background: var(--leaf);
  color: #fff;
}
body.kids .color-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}
body.kids .color-dot {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px #f0d9b5;
  cursor: pointer;
  padding: 0;
}
body.kids .color-dot.is-active {
  box-shadow: 0 0 0 4px var(--brand);
  transform: scale(1.08);
}
body.kids .tools .tool {
  width: 3.4rem;
  height: 3.4rem;
  font-size: 1.45rem;
  border-radius: 1rem;
  border-width: 3px;
}
/* Leerling: tools LINKS, canvas RECHTS — op smal scherm onder elkaar */
body.kids .editor-shell,
body.kids .editor-shell--side {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem;
}
@media (min-width: 800px) {
  body.kids .editor-shell--side {
    flex-direction: row !important;
    align-items: stretch;
  }
  body.kids .editor-shell--side .toolbar {
    flex: 0 0 220px;
    max-width: 240px;
  }
  body.kids .editor-shell--side .canvas-frame {
    flex: 1 1 auto;
    min-width: 0;
  }
}
body.kids .toolbar {
  position: static;
  width: 100%;
  background: #fff8ef;
  border: 3px solid var(--line);
  border-radius: 1.25rem;
  padding: 0.9rem;
}
body.kids .toolbar.card {
  box-shadow: none;
}
body.kids .canvas-frame {
  width: 100%;
  max-width: 100%;
  min-height: 200px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.kids .studio-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.5rem;
}
body.kids #studio {
  overflow: hidden;
}
body.kids .color-dots--laser {
  justify-content: center;
  gap: 1rem;
}
body.kids .color-dots--laser .color-dot {
  width: 3.4rem;
  height: 3.4rem;
}
body.kids .color-dot--cut {
  box-shadow: 0 0 0 3px #ffc9c9;
}
body.kids .laser-legend {
  display: grid;
  gap: 0.25rem;
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
}
body.kids .leg-black { color: #1f2a24; }
body.kids .leg-red { color: #c1121f; }
body.kids .big-msg {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-align: center;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: #d8f3dc;
  color: #1b4332;
  margin: 1rem 0;
}
.badge {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}
.badge-ok {
  background: #d8f3dc;
  color: #1b4332;
}
.badge-wait {
  background: #fff3cd;
  color: #7a5c00;
}
.work-card.is-submitted {
  border-color: #2a9d8f;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.25);
}
.celebrate {
  animation: pop 0.45s ease;
}
@keyframes pop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* === Chromebook / touch teken-app (alles in het venster) === */
body.kids-draw {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  margin: 0;
}
body.kids-draw .draw-app {
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.75rem 0.75rem;
  box-sizing: border-box;
  width: min(1200px, 100%);
  margin: 0 auto;
  min-height: 0;
}
body.kids-draw .draw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  margin-bottom: 0.4rem;
}
body.kids-draw .draw-who {
  font-weight: 800;
  font-size: 1.1rem;
}
body.kids-draw .draw-title {
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
  text-align: center;
}
body.kids-draw .draw-studio {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 1.25rem;
  padding: 0.65rem 0.75rem 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
body.kids-draw .draw-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.65rem;
}
@media (min-width: 800px) {
  body.kids-draw .draw-main {
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}
body.kids-draw .draw-side {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff8ef;
  border: 3px solid var(--line);
  border-radius: 1rem;
  padding: 0.65rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  z-index: 2;
}
body.kids-draw .draw-canvas-wrap {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  z-index: 1;
}
body.kids-draw .draw-canvas-wrap .canvas-frame {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.kids-draw .mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
body.kids-draw .mode-btn {
  border: 3px solid var(--line);
  background: #fff;
  border-radius: 0.85rem;
  padding: 0.55rem 0.35rem;
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  touch-action: manipulation;
}
body.kids-draw .mode-btn.is-active {
  border-color: var(--leaf);
  background: #e3f8f4;
}
body.kids-draw .mode-btn.mode-cut.is-active {
  border-color: #c1121f;
  background: #ffe5e5;
  color: #c1121f;
}
body.kids-draw .studio-actions {
  display: grid;
  gap: 0.45rem;
}
body.kids-draw .btn-submit {
  min-height: 3.2rem;
  font-size: 1.15rem;
}
body.kids-draw .draw-thick input[type="range"] {
  min-height: auto;
  width: 100%;
  text-align: left;
}
body.kids-draw .draw-done {
  margin: auto;
  max-width: 28rem;
}
body.kids-draw #stage-host {
  max-width: 100%;
  max-height: 100%;
}
body.kids-draw .tools {
  justify-content: center;
}
body.kids-draw .color-dots {
  justify-content: center;
  gap: 0.45rem;
}
body.kids-draw .color-dot {
  width: 2.5rem;
  height: 2.5rem;
}

