/* Stijl van de uitnodiging: blauw linnen, lichtsnoeren, wit schrift, een wit labeltje met gouden paperclip. */
:root {
  --blauw-licht: #6F9FD8;   /* bovenkant, rond de lampjes */
  --blauw: #4A7DBA;         /* kaartkleur */
  --blauw-diep: #3F70AD;    /* achter lopende tekst: wit haalt 5,1:1 */
  --blauw-nacht: #2C5487;   /* tabbalk, schaduw */
  --blauw-inkt: #2F5F96;    /* tekst op wit: 6,6:1 */
  --wit: #FFFFFF;
  --papier: #FBFAF6;        /* het labeltje */
  --goud: #C9A45C;
  --goud-licht: #E7CD8F;
  --lamp: #FFF4D6;
  --fout: #B3261E;
  --rand: rgba(255, 255, 255, .55);
  --schaduw: 0 10px 30px rgba(20, 45, 85, .28);
  --rond: 18px;
  --tab-h: 68px;
  --font: 'Kurale', 'Georgia', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--wit);
  background-color: var(--blauw-diep);
  /* linnenstructuur zoals het kaartpapier */
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--blauw-licht) 0, var(--blauw) 170px, var(--blauw-diep) 380px);
  background-attachment: scroll;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px);
  overflow-x: hidden;
}
h1, h2 { font-weight: 400; margin: 0; line-height: 1.2; }
button, input { font: inherit; }
a { color: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--goud-licht); outline-offset: 3px; }

/* ---------- Lampjes ---------- */
.lampjes { position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none; z-index: 0; }
.lampjes svg { width: 100%; height: 100%; display: block; }
.lampjes-g circle { fill: var(--lamp); animation: twinkel 3s ease-in-out infinite alternate; }
@keyframes twinkel { from { opacity: 1; } to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .lampjes-g circle { animation: none; } }

main { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 16px; }
.paneel { padding-top: 96px; animation: in .35s ease both; }
@keyframes in { from { opacity: .001; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .paneel { animation: none; } }

/* ---------- Start ---------- */
.spreuk { text-align: center; padding: 18px 0 8px; }
.spreuk h1 { font-size: clamp(34px, 10vw, 46px); line-height: 1.22; letter-spacing: .01em; text-shadow: 0 1px 12px rgba(20,45,85,.25); }
.hart { width: 44px; height: 40px; fill: var(--wit); display: block; margin: 22px auto 0; }

.label-kaart {
  position: relative;
  background: var(--papier);
  color: var(--blauw-inkt);
  border-radius: 4px;
  padding: 22px 20px 18px 84px;
  margin: 26px 6px 22px;
  box-shadow: var(--schaduw);
  transform: rotate(-1.2deg);
}
.paperclip {
  position: absolute; left: 14px; top: -14px; width: 22px; height: 58px;
  border: 2.5px solid var(--goud); border-radius: 12px 12px 3px 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.paperclip::after {
  content: ''; position: absolute; left: 3px; right: 3px; top: 8px; bottom: 12px;
  border: 2.5px solid var(--goud); border-top-color: transparent; border-radius: 0 0 8px 8px;
}
.label-datum {
  position: absolute; left: 44px; top: 18px; margin: 0;
  display: flex; flex-direction: column; font-size: 15px; line-height: 1.35;
}
.label-datum span:nth-child(2) { padding-left: 8px; }
.label-datum span:nth-child(3) { padding-left: 16px; }
.label-tekst { margin: 0; font-size: 16px; }

.knoppen { display: grid; gap: 12px; }
.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px; border-radius: 999px; border: 0;
  font-size: 18px; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.knop svg { width: 24px; height: 24px; flex: none; }
.knop:active { transform: scale(.98); }
.knop-hoofd { background: var(--wit); color: var(--blauw-inkt); box-shadow: 0 6px 18px rgba(20,45,85,.25); }
.knop-hoofd:hover { background: var(--papier); }
.knop-rand { background: transparent; color: var(--wit); box-shadow: inset 0 0 0 2px var(--rand); }
.knop-rand:hover { background: rgba(255,255,255,.08); }
.knop-rand-blauw { background: transparent; color: var(--blauw-inkt); box-shadow: inset 0 0 0 2px var(--blauw-inkt); }
.knop-klein { min-height: 44px; font-size: 16px; padding: 8px 18px; background: var(--wit); color: var(--blauw-inkt); }
.knop:disabled { opacity: .6; cursor: default; }
.tekstknop { background: none; border: 0; color: var(--wit); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px 4px; min-height: 44px; font-size: 16px; }
.tekstknop-blauw { color: var(--blauw-inkt); }

.wachtrij {
  margin-top: 14px; padding: 12px 16px; border-radius: 14px;
  background: rgba(20,45,85,.28); font-size: 15px;
  display: flex; align-items: center; gap: 12px;
}
.wachtrij .tekstknop { margin-left: auto; padding: 4px; min-height: 0; }
.draaier { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: var(--wit); animation: draai .8s linear infinite; flex: none; }
@keyframes draai { to { transform: rotate(360deg); } }

.blok { margin-top: 30px; }
.blok h2 { font-size: 22px; margin-bottom: 10px; }
.blok-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.strook { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.strook button, .raster button {
  padding: 0; border: 0; background: rgba(255,255,255,.12); border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; cursor: pointer; position: relative; display: block; width: 100%;
}
.strook img, .raster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bingo-teaser {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 30px;
  background: rgba(20,45,85,.28); color: var(--wit); border: 0; border-radius: var(--rond);
  padding: 16px 18px; cursor: pointer; text-align: left; min-height: 64px;
}
.bt-tekst { display: flex; flex-direction: column; font-size: 15px; }
.bt-tekst strong { font-weight: 400; font-size: 20px; }
.bt-pijl { margin-left: auto; font-size: 30px; line-height: 1; }

/* ---------- Kop per paneel ---------- */
.paneel-kop { text-align: center; padding: 8px 0 18px; }
.paneel-kop h1 { font-size: clamp(30px, 8.5vw, 38px); }
.paneel-kop p { margin: 8px auto 0; max-width: 34ch; }

/* ---------- Fotomuur ---------- */
.chips { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--wit); box-shadow: inset 0 0 0 1.5px var(--rand); font-size: 15px;
}
.chip[aria-pressed="true"] { background: var(--wit); color: var(--blauw-inkt); box-shadow: none; }
.raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 520px) { .raster { gap: 8px; } }
.raster .tag {
  position: absolute; left: 5px; bottom: 5px; right: 5px;
  font-size: 11px; line-height: 1.25; color: var(--blauw-inkt); background: rgba(251,250,246,.94);
  padding: 3px 6px; border-radius: 6px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.raster .nieuw { animation: pop .5s ease both; }
@keyframes pop { from { transform: scale(.85); opacity: .001; } }
.leeg { text-align: center; padding: 30px 10px; }
.leeg .hart { margin-top: 0; margin-bottom: 12px; opacity: .9; }
.leeg p { margin: 0 0 18px; }

.download-blok { margin-top: 36px; }
.download-knoppen { display: grid; gap: 8px; margin-top: 10px; }
.download-knoppen:empty { display: none; }
.download-knop {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-radius: 14px; min-height: 56px;
  background: var(--papier); color: var(--blauw-inkt); text-decoration: none; box-shadow: 0 4px 14px rgba(20,45,85,.2);
}
.download-knop strong { font-weight: 400; font-size: 18px; }
.download-knop span { font-size: 14.5px; }
#downloadMijn .download-knop { background: transparent; color: var(--wit); box-shadow: inset 0 0 0 2px var(--rand); }
.download-knop { border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.voortgang { margin-top: 14px; }
.vg-balk { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.vg-balk span { display: block; height: 100%; width: 0; background: var(--goud-licht); transition: width .3s ease; }
.voortgang p { margin: 8px 0 0; font-size: 15px; }
.inline-icoon { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }

/* ---------- Bingo ---------- */
.bingo-stand { text-align: center; margin: -6px 0 14px; font-size: 16px; min-height: 24px; }
.bingo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.vak {
  position: relative; aspect-ratio: 1; border: 0; padding: 6px; cursor: pointer;
  background: var(--papier); color: var(--blauw-inkt); border-radius: 6px;
  font-size: clamp(11px, 3.1vw, 14px); line-height: 1.2; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 3px 10px rgba(20,45,85,.22);
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere;
}
.vak.gedaan { padding: 0; }
.vak.gedaan img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vak.gedaan::after {
  content: ''; position: absolute; right: 5px; top: 5px; width: 22px; height: 20px;
  background: var(--wit);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 58'%3E%3Cpath d='M32 56 C 26 50, 4 36, 3 20 C 2 9, 10 2, 18 2 C 25 2, 30 7, 32 13 C 34 7, 40 2, 47 2 C 56 2, 62 10, 61 20 C 60 35, 38 50, 32 56 Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 58'%3E%3Cpath d='M32 56 C 26 50, 4 36, 3 20 C 2 9, 10 2, 18 2 C 25 2, 30 7, 32 13 C 34 7, 40 2, 47 2 C 56 2, 62 10, 61 20 C 60 35, 38 50, 32 56 Z'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}
.vak.in-rij { box-shadow: 0 0 0 3px var(--goud-licht), 0 3px 10px rgba(20,45,85,.22); }
.vak.bezig { opacity: .6; }
.winnaars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.winnaars li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(20,45,85,.28); font-size: 16px; }
.winnaars .plek { width: 28px; text-align: center; opacity: .9; }
.winnaars .extra { margin-left: auto; font-size: 14px; opacity: .92; }
.winnaars li.eerste { background: var(--papier); color: var(--blauw-inkt); }
.winnaars .niemand { background: none; padding: 0; opacity: .92; }

/* ---------- Feest ---------- */
.info { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.info li { display: flex; gap: 14px; align-items: flex-start; }
.info svg { width: 28px; height: 28px; flex: none; margin-top: 2px; color: var(--wit); }
.info strong { font-weight: 400; font-size: 19px; }
.stappen { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.naam-form { display: flex; gap: 8px; }
.naam-form input { flex: 1; min-width: 0; }
input:not([type=file]) {
  min-height: 48px; border-radius: 12px; border: 2px solid transparent; padding: 10px 14px;
  background: var(--wit); color: var(--blauw-inkt); width: 100%; font-size: 17px;
}
input::placeholder { color: #5E7896; }
input:focus { outline: none; border-color: var(--goud); }
.klein { font-size: 14.5px; opacity: .95; }
.beheer { padding: 16px; border-radius: var(--rond); background: rgba(20,45,85,.32); }
.beheer-knoppen { display: grid; gap: 8px; }

/* ---------- Tabbalk ---------- */
.tabbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--blauw-nacht); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 20px rgba(10,30,60,.25);
}
.tabbalk button {
  height: var(--tab-h); background: none; border: 0; color: rgba(255,255,255,.82); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13.5px;
  position: relative;
}
.tabbalk svg { width: 26px; height: 26px; }
.tabbalk button[aria-current="page"] { color: var(--wit); }
.tabbalk button[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--goud-licht);
}
.tabbalk .stip { position: absolute; top: 12px; left: calc(50% + 10px); width: 9px; height: 9px; border-radius: 50%; background: var(--goud-licht); }

/* ---------- Vensters ---------- */
.venster {
  border: 0; border-radius: 22px; padding: 0; width: min(420px, calc(100vw - 32px));
  background: var(--papier); color: var(--blauw-inkt); box-shadow: 0 20px 60px rgba(10,30,60,.45);
  max-height: calc(100vh - 32px); overflow: auto;
}
.venster::backdrop { background: rgba(20,40,75,.6); }
.venster form { padding: 26px 22px 22px; display: grid; gap: 14px; position: relative; }
.venster h2 { font-size: 26px; }
.venster p { margin: 0; }
.venster input:not([type=file]) { border-color: #C8D5E6; }
.venster input:focus { border-color: var(--blauw-inkt); }
#welkom form { padding-top: 70px; background: linear-gradient(180deg, var(--blauw) 0, var(--blauw) 60px, transparent 60px); }
#welkom .lampjes-klein { height: 60px; }
#welkom .knop-hoofd, .venster .knop-hoofd { background: var(--blauw-inkt); color: var(--wit); box-shadow: none; }
#welkom .knop-hoofd:hover, .venster .knop-hoofd:hover { background: var(--blauw-nacht); }
.knoppen-rij { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.knoppen-kolom { display: grid; gap: 10px; }
.fout { color: var(--fout); min-height: 0; font-size: 15px; }
.fout:empty { display: none; }
.venster-foto img, #vakBeeld { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 10px; background: #E9EEF5; display: block; }
.vb-bingo, .vak-label { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--blauw-inkt); }

/* ---------- Lichtbak ---------- */
.lichtbak {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: #0E1E33; color: var(--wit);
  display: none; grid-template-rows: auto 1fr auto;
}
.lichtbak[open] { display: grid; }
.lichtbak::backdrop { background: #0E1E33; }
.lb-balk { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
.lb-teller { flex: 1; text-align: center; font-size: 15px; opacity: .9; }
.lb-knop { width: 48px; height: 48px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 0; border-radius: 50%; color: var(--wit); cursor: pointer; }
.lb-knop svg { width: 24px; height: 24px; }
.lb-beeld { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; touch-action: pan-y; }
.lb-beeld img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-pijl {
  position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 12px;
  background: rgba(14,30,51,.55); color: var(--wit); font-size: 36px; line-height: 1; cursor: pointer;
}
.lb-vorige { left: 8px; } .lb-volgende { right: 8px; }
.lb-onder { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); text-align: center; font-size: 16px; }
.lb-onder .lb-tag { display: inline-block; background: var(--papier); color: var(--blauw-inkt); padding: 2px 10px; border-radius: 6px; font-size: 14px; margin-top: 6px; }
.lb-onder .lb-meta { opacity: .85; font-size: 14.5px; }

/* ---------- Melding & confetti ---------- */
.melding {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--papier); color: var(--blauw-inkt); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--schaduw); font-size: 16px; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}
.melding.zichtbaar { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }
