/* Tamtam: warm papier, terracotta, een krant van de familie. */
:root {
  --papier: #f5efe4;
  --kaart: #fffcf6;
  --inkt: #2a231d;
  --zacht: #76695d;
  --lijn: #e5dacb;
  --accent: #c4532f;
  --accent-donker: #a2401f;
  --accent-zacht: #f3dccf;
  --footer: #2a231d;
  --footer-tekst: #d9cdbd;
  --schaduw: 0 1px 2px rgb(60 40 20 / .06), 0 8px 24px -12px rgb(60 40 20 / .18);
  --rond: 22px;
  --serif: "Iowan Old Style", "New York", ui-serif, "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #17130f; --kaart: #221c17; --inkt: #f3ece2; --zacht: #ab9c8c; --lijn: #3a3027;
    --accent: #e27a52; --accent-donker: #f09670; --accent-zacht: #43281c; --footer: #0e0b08; --footer-tekst: #b9aa98;
    --schaduw: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .7);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Verend scrollen: boven de kleur van de kop, onder die van de footer. */
html { background: linear-gradient(var(--papier) 50%, var(--footer) 50%) fixed; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--papier); color: var(--inkt);
  font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column;
}
body.kijkt { overflow: hidden; }
#app { flex: 1; display: flex; flex-direction: column; width: 100%; }
#app > * { width: 100%; max-width: 620px; margin-left: auto; margin-right: auto; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
#app > .footer { max-width: none; margin-top: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
a { color: var(--accent-donker); }
button, .knop {
  font: 600 16px/1 var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: 999px;
  padding: 14px 22px; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, background .15s ease;
}
button:active, .knop:active { transform: scale(.97); }
button:disabled { opacity: .6; }
button.tweede { background: transparent; color: var(--inkt); box-shadow: inset 0 0 0 1.5px var(--lijn); }
button.klein { font-size: 15px; padding: 10px 16px; min-height: 42px; }
button.link { background: none; color: var(--zacht); padding: 0; min-height: 0; font-weight: 500; font-size: 15px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.mini { width: 14px; height: 14px; }
.punt { opacity: .5; margin: 0 .35em; }

/* ---------- merk en kop ---------- */
.merk { display: inline-flex; align-items: center; gap: 9px; font: 700 24px/1 var(--serif); letter-spacing: -.02em; color: var(--inkt); }
.merk-ico { width: 34px; height: 34px; }
.merk.groot { flex-direction: column; gap: 12px; font-size: 34px; }
.merk.groot .merk-ico { width: 84px; height: 84px; }
.kop { padding-top: max(14px, env(safe-area-inset-top)) !important; padding-bottom: 6px; }
.kop-rij { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.kop-knop { display: inline-flex; align-items: center; gap: 7px; color: var(--inkt); text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 10px 14px; margin-right: -8px; border-radius: 999px; min-height: 44px; }
.kop-knop:first-child:not(:only-child) { margin-left: -12px; margin-right: 0; }
.kop-knop:active { background: var(--accent-zacht); }
.kop-datum { margin: 2px 0 0; color: var(--zacht); font-size: 14px; display: flex; flex-wrap: wrap; }

/* ---------- meldingen ---------- */
.status { margin-top: 14px; background: var(--kaart); border-radius: 18px; padding: 16px 18px; box-shadow: var(--schaduw); border-left: 5px solid #d9a441; }
.status.inloggen { border-left-color: var(--accent); }
.status h2 { font-size: 19px; margin-bottom: 6px; }
.status p { margin: 0; color: var(--zacht); font-size: 16px; }
.nieuw { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px !important; background: var(--accent-zacht); border-radius: 999px;
  width: calc(100% - 36px) !important; color: var(--inkt); }
.nieuw.bij { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lijn); color: var(--zacht); }
.nieuw p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.nieuw .vink { color: var(--accent); }
.nieuw-gezichten { display: flex; flex: none; }
.nieuw-gezichten .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--accent-zacht); }
.nieuw-gezichten .avatar:first-child { margin-left: 0; }

/* ---------- avatars ---------- */
.avatar { --maat: 42px; width: var(--maat); height: var(--maat); border-radius: 50%; flex: none; position: relative; overflow: hidden;
  background: var(--tint, #ccb); display: inline-grid; place-items: center; }
.avatar::before { content: attr(data-letter); color: #fff; font: 700 calc(var(--maat) * .42)/1 var(--serif); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.klein { --maat: 28px; }
.avatar.groot { --maat: 96px; }

/* ---------- een dag ---------- */
.dag { margin-top: 34px; }
.dag-kop h2 { font-size: 34px; }
.dag-kop p { margin: 6px 0 0; color: var(--zacht); font-size: 16px; text-wrap: pretty; }
.gebleven { display: flex; align-items: center; gap: 12px; margin: 26px 0 0; color: var(--accent-donker); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.gebleven::before, .gebleven::after { content: ""; flex: 1; height: 1.5px; background: currentColor; opacity: .35; }

/* ---------- verhalen ---------- */
.verhalen { margin-top: 18px; }
.verhalen h3 { font: 700 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--zacht); margin-bottom: 10px; }
.verhalen-rij { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 4px 18px 6px; scroll-padding: 0 18px; }
.verhalen-rij::-webkit-scrollbar { display: none; }
.verhaal { flex-direction: column; gap: 6px; background: none; color: var(--inkt); padding: 0; min-height: 0; width: 82px; flex: none; border-radius: 12px; }
.verhaal .ring { padding: 3px; border-radius: 50%; background: var(--lijn); display: inline-flex; }
.verhaal.nieuw .ring { background: conic-gradient(from 210deg, #e7a04a, var(--accent), #b8336a, #e7a04a); }
.verhaal .avatar { --maat: 68px; box-shadow: 0 0 0 3px var(--papier); }
.verhaal-naam { font-size: 14px; font-weight: 600; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verhaal-tal { font-size: 12px; font-weight: 500; color: var(--zacht); margin-top: -4px; }

/* ---------- een bericht ---------- */
.bericht { margin-top: 18px; background: var(--kaart); border-radius: var(--rond); box-shadow: var(--schaduw); overflow: hidden; }
.bericht-kop { padding: 12px 14px; }
.wie { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; border-radius: 12px; }
.wie-tekst { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wie-tekst strong { font-size: 16px; }
.wie-tekst small { color: var(--zacht); font-size: 13.5px; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.media { position: relative; background: #0002; }
.strook { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: var(--ratio, 1); overscroll-behavior-x: contain; }
.strook::-webkit-scrollbar { display: none; }
.vak { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; }
.vak img, .vak video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: #0001; }
.video-vak { position: absolute; inset: 0; }
.geluid { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; min-height: 0; padding: 0; background: rgb(0 0 0 / .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.geluid .ico { width: 20px; height: 20px; }
.kwijt { display: grid; place-items: center; height: 100%; color: var(--zacht); font-size: 15px; }
.stipjes { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.stipjes i { width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .5; transition: opacity .2s, transform .2s; box-shadow: 0 0 4px rgb(0 0 0 / .3); }
.stipjes i.aan { opacity: 1; transform: scale(1.15); }
.teller { position: absolute; right: 12px; top: 12px; background: rgb(0 0 0 / .5); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bijschrift-blok, .bericht > .bijschrift { padding: 12px 16px 0; }
.bijschrift { margin: 0; white-space: pre-line; font-size: 16.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bijschrift.ingeklapt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bijschrift .tag { color: var(--accent-donker); }
.bijschrift-blok .link { margin-top: 4px; padding: 6px 0; }
.naar-ig { display: inline-block; margin: 6px 16px 14px; font-size: 13.5px; color: var(--zacht); text-decoration: none; padding: 6px 0; }
.bericht > .media:last-child { border-radius: 0 0 var(--rond) var(--rond); }
.bericht:not(:has(.naar-ig)) { padding-bottom: 14px; }
.bericht:not(:has(.naar-ig)):not(:has(.bijschrift)) { padding-bottom: 0; }

.meer-knop { text-align: center; margin-top: 30px; }
.einde { text-align: center; color: var(--zacht); font-size: 14px; margin: 36px auto 10px; font-family: var(--serif); font-style: italic; }
.laden { color: var(--zacht); margin-top: 30px; }

/* ---------- persoon ---------- */
.persoon-kop { text-align: center; padding-top: 18px; }
.persoon-kop h1 { font-size: 32px; margin-top: 12px; }
.persoon-sub { margin: 4px 0 0; color: var(--zacht); }

/* ---------- leeg en inloggen ---------- */
.leeg, .inlog { text-align: center; padding-top: 40px; padding-bottom: 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.leeg-ico { width: 96px; height: 96px; }
.leeg h1, .inlog h1 { font-size: 30px; }
.leeg p, .inlog p { margin: 0; color: var(--zacht); max-width: 30em; text-wrap: pretty; }
.leeg .knop { margin-top: 8px; }
.inlog { padding-top: max(60px, env(safe-area-inset-top)); min-height: 80vh; justify-content: center; }
.inlog .merk { margin-bottom: 18px; }
.inlog .knoppen { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin-top: 10px; }
.inlog-code { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
input[type=text], input[type=search] {
  font: 17px var(--sans); color: var(--inkt); background: var(--kaart); border: 1.5px solid var(--lijn); border-radius: 14px; padding: 13px 15px; width: 100%; min-height: 48px;
}
.inlog-code input::placeholder { letter-spacing: 0; font-size: 17px; }
.inlog-code input { text-align: center; font-size: 22px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-zacht); }
.fout { color: #b3261e; min-height: 1.5em; }
@media (prefers-color-scheme: dark) { .fout { color: #ff8a80; } }
.vraag { background: var(--kaart); border-radius: var(--rond); padding: 26px 22px; box-shadow: var(--schaduw); max-width: 360px; }
.vraag h2 { font-size: 24px; }
.vraag p { margin: 8px 0 18px; }
.vraag .knoppen { display: flex; flex-direction: column; gap: 10px; }

/* ---------- familie ---------- */
.familie { padding-top: 10px; padding-bottom: 30px; }
.familie h1 { font-size: 34px; }
.uitleg { color: var(--zacht); margin: 8px 0 0; }
.uitleg.klein { font-size: 14.5px; margin-top: 4px; }
.zoekbalk { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 18px -18px 0; padding: 10px 18px; background: var(--papier); }
.zoekbalk .ico { position: absolute; left: 32px; color: var(--zacht); pointer-events: none; }
.zoekbalk input { padding-left: 44px; }
.teller-tekst { flex: none; font-size: 14px; color: var(--zacht); font-weight: 600; }
.mensen { list-style: none; margin: 8px 0 0; padding: 0; background: var(--kaart); border-radius: var(--rond); box-shadow: var(--schaduw); overflow: hidden; }
.mens + .mens, .uitleg-rij + .uitleg-rij { border-top: 1px solid var(--lijn); }
.mens-rij { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 64px; cursor: pointer; }
.mens.aan { background: color-mix(in srgb, var(--accent-zacht) 45%, transparent); }
.mens-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mens-tekst strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mens-tekst small { color: var(--zacht); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uitleg-rij { padding: 18px; color: var(--zacht); }
.bijnaam { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px 70px; }
.bijnaam span { font-size: 14px; color: var(--zacht); flex: none; }
.bijnaam input { min-height: 40px; padding: 8px 12px; font-size: 16px; border-radius: 10px; }
.lijst-voet { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: var(--zacht); }
.paneel { margin-top: 34px; background: var(--kaart); border-radius: var(--rond); padding: 20px 18px; box-shadow: var(--schaduw); }
.paneel h2 { font-size: 22px; margin-bottom: 12px; }
.instelling { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.instelling span { flex: 1; display: flex; flex-direction: column; }
.instelling small { color: var(--zacht); font-size: 14px; }
.knoppen.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
/* schakelaar */
.schakel { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--lijn); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.schakel::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s; }
.schakel:checked { background: var(--accent); }
.schakel:checked::after { transform: translateX(20px); }

/* ---------- footer ---------- */
.footer { background: var(--footer); color: var(--footer-tekst); text-align: center; margin-top: 56px; padding-top: 34px; padding-bottom: max(34px, env(safe-area-inset-bottom)); }
.footer-ico { width: 40px; height: 40px; opacity: .85; }
.footer p { margin: 8px 0 0; font-size: 14px; }

/* ---------- kijker ---------- */
.kijker { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: grid; place-items: center; animation: in .2s ease; }
@keyframes in { from { opacity: 0; } }
.kijker-vak { width: 100%; height: 100%; display: grid; place-items: center; }
.kijker-vak img, .kijker-vak video { max-width: 100%; max-height: 100%; object-fit: contain; }
.is-verhaal .kijker-vak img, .is-verhaal .kijker-vak video { width: 100%; height: 100%; max-width: 560px; object-fit: contain; }
.tik { position: absolute; top: 90px; bottom: 90px; width: 40%; background: none; border-radius: 0; padding: 0; opacity: 0; }
.tik.links { left: 0; } .tik.rechts { right: 0; }
.kijker-boven { position: absolute; top: 0; left: 0; right: 0; padding: max(12px, env(safe-area-inset-top)) 14px 24px; background: linear-gradient(rgb(0 0 0 / .55), transparent); }
.balkjes { display: flex; gap: 4px; margin-bottom: 10px; max-width: 560px; margin-left: auto; margin-right: auto; }
.balkjes i { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .35); overflow: hidden; }
.balkjes i b { display: block; height: 100%; width: 0; background: #fff; }
.balkjes i.vol b { width: 100%; }
.balkjes i.nu b { animation: vol linear forwards; animation-duration: 0s; }
.kijker:not(.is-verhaal) .balkjes i.nu b { width: 100%; animation: none; }
@keyframes vol { to { width: 100%; } }
.kijker-rij { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 560px; margin: 0 auto; }
.kijker-wie { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kijker-wie span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.kijker-wie small { opacity: .75; }
.kijker-knoppen { display: flex; gap: 6px; }
.kijker-knop { width: 44px; height: 44px; min-height: 0; padding: 0; background: rgb(255 255 255 / .16); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.kijker-tekst { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 40px 20px max(20px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgb(0 0 0 / .7));
  max-height: 40vh; overflow-y: auto; white-space: pre-line; font-size: 16px; scroll-padding-bottom: 20px; }

/* ---------- melding onderin ---------- */
#melding { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--inkt); color: var(--papier);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 30px rgb(0 0 0 / .25); max-width: calc(100vw - 32px); text-align: center; animation: op .25s ease; }
#melding.fout { background: #8c2b1d; color: #fff; }
@keyframes op { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (min-width: 700px) {
  .dag-kop h2 { font-size: 40px; }
  .bericht { border-radius: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
