:root {
  --bg: #fff8ec;
  --ink: #2b2240;
  --muted: #6d6480;
  --line: #f1e3cc;
  --card: #ffffff;
  --sun: #ffc93c;
  --mint: #4fd1a5;
  --sky: #2f9be0;
  --pink: #ff5c8a;
  --grape: #9f86f7;
  --accent: var(--sky);
  --radius: 22px;
  color-scheme: light;
}
body[data-kid="liss"] { --accent: var(--pink); }
body[data-kid="floekie"] { --accent: var(--grape); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.5 'Nunito', system-ui, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3, .tab, .btn, .stamp, .price { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Versiering */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky svg { position: absolute; }
.s1 { top: -34px; left: -30px; animation: spin 40s linear infinite; }
.s2 { top: 70px; right: 6%; transform: rotate(12deg); }
.s3 { bottom: 12%; left: -20px; opacity: .8; }
.s4 { top: 38%; right: -14px; animation: float 6s ease-in-out infinite; }
.s5 { bottom: 4%; right: 10%; transform: rotate(-14deg); opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-14px) rotate(-4deg); } }

.wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 32px 16px 72px; }

/* Kop */
.top { text-align: center; margin-bottom: 24px; }
.top h1 { margin: 0; font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 700; line-height: 1.05; }
.top .hl { color: var(--accent); position: relative; transition: color .3s; }
.top .hl::after {
  content: ''; position: absolute; left: 4%; right: 2%; bottom: -6px; height: 10px;
  background: radial-gradient(circle at 6px 0, transparent 6px, var(--sun) 6.5px) 0 0 / 14px 10px repeat-x;
  border-radius: 4px; opacity: .9;
}
.lead { margin: 16px auto 0; max-width: 34ch; color: var(--muted); font-weight: 700; }

/* Beheerbalk */
.adminbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; padding: 10px 12px 10px 16px; border-radius: 16px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: .9rem;
}

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 24px; }
.tab {
  --c: var(--sky);
  appearance: none; display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 18px 7px 7px; border: 3px solid var(--c); border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 1.2rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 40%, transparent);
  transition: transform .12s, background .2s;
}
.tab[data-kid="liss"] { --c: var(--pink); }
.tab[data-kid="floekie"] { --c: var(--grape); }
.tab .ava {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 700;
}
.tab .count { font: 800 .85rem 'Nunito', sans-serif; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--c); color: var(--ink); }
.tab[aria-selected="true"] .ava { background: #fff; color: var(--c); }
.tab[aria-selected="true"] .count { color: var(--ink); }
.tab:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 40%, transparent); }

/* Knoppen */
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 10px 18px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.btn.primary { background: color-mix(in srgb, var(--accent) 75%, #000); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 50%, #000); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 50%, #000); }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.small { padding: 6px 14px; font-size: .9rem; background: var(--sun); color: var(--ink); }
.btn.primary, .btn.ghost { min-height: 44px; }
.btn.danger { color: #c2410c; margin-left: auto; }
.btn:disabled { opacity: .55; cursor: default; }

/* Formulier */
.editor {
  margin-bottom: 26px; padding: 18px; border-radius: var(--radius);
  background: #fff; border: 3px dashed color-mix(in srgb, var(--accent) 50%, #fff);
}
.editor h2 { margin: 0 0 4px; font-size: 1.35rem; font-weight: 600; }
.editor label { display: block; margin: 12px 0 4px; font-size: .9rem; font-weight: 800; }
.editor input, .editor textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px;
  background: #fffdf8; color: var(--ink); font: inherit; font-size: 16px;
}
.editor textarea { resize: vertical; }
.editor .check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 700; }
.editor input[type="checkbox"] { width: 24px; height: 24px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); }
.tally {
  display: inline-block; margin: 10px 0 0; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--mint) 25%, #fff); color: #155e47; font-weight: 800; font-size: .9rem;
}
.editor input:focus, .editor textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 150px; gap: 10px; }
.hint { min-height: 1.3em; margin: 6px 0 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
.hint.loading::before {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.imgprev { display: block; max-width: 140px; max-height: 140px; margin-top: 10px; border-radius: 12px; border: 2px solid var(--line); object-fit: contain; background: #fff; }
.imgprev[hidden] { display: none; }

/* Kaartjes */
.list { display: grid; gap: 18px; }
.card {
  position: relative; display: grid; grid-template-columns: 124px 1fr; gap: 16px;
  padding: 14px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line);
}
.pic {
  width: 124px; height: 124px; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, #fff);
}
.pic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.card h3 { margin: 2px 0 6px; font-size: 1.2rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.price {
  display: inline-block; padding: 2px 12px; border-radius: 999px; transform: rotate(-2deg);
  background: var(--sun); color: var(--ink); font-size: .95rem; font-weight: 600;
}
.desc { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.pending { font-style: italic; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.note {
  margin: 10px 0 0; padding: 8px 12px; border-radius: 14px; font-size: .95rem;
  background: color-mix(in srgb, var(--accent) 9%, #fff);
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, #fff);
}
.note b { font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.status { font-weight: 800; color: #1f7a5c; }
.admin-actions { display: flex; gap: 8px; width: 100%; padding-top: 10px; border-top: 2px dashed var(--line); }
.admin-actions .btn { padding: 8px 14px; font-size: .9rem; min-height: 40px; }

.card.bought { background: #fbfaf6; box-shadow: none; }
.card.bought .pic img { filter: grayscale(1); opacity: .6; }
.card.bought h3 { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.card.bought .desc, .card.bought .note { opacity: .85; }
.stamp {
  position: absolute; top: 8px; left: 8px; padding: 3px 12px; border-radius: 999px;
  background: var(--mint); color: #0d3b2e; font-weight: 700; font-size: .9rem; transform: rotate(-6deg);
  box-shadow: 0 3px 0 #2fa982;
}
.divider { margin: 12px 0 0; text-align: center; color: var(--muted); font: 600 1rem 'Fredoka', sans-serif; }

.empty {
  padding: 40px 16px; text-align: center; color: var(--muted); font-weight: 800;
  background: #fff; border: 3px dashed var(--line); border-radius: var(--radius);
}

/* Confetti */
.confetti { position: fixed; z-index: 50; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: pop 1.1s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes pop { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

@media (max-width: 900px) {
  .s3, .s4, .s5 { display: none; }
  .s1 { width: 84px; height: 84px; top: -40px; left: -40px; }
  .s2 { width: 40px; height: 40px; top: 10px; right: 10px; }
  .wrap { padding-top: 44px; }
}
@media (max-width: 540px) {
  .card { grid-template-columns: 88px 1fr; gap: 12px; padding: 12px; }
  .pic { width: 88px; height: 88px; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tab { flex-direction: column; gap: 4px; padding: 8px 4px 10px; border-radius: 22px; font-size: 1rem; text-align: center; }
  .tab .ava { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .sky svg, .confetti { animation: none !important; }
  .confetti { display: none; }
}
