@font-face { font-family: Kalam; src: url(fonts/Kalam-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #15183a;
  --bg2: #22265a;
  --fg: #fff;
  --muted: #c7c9e6;
  --accent: #e8202a;
  --accent2: #f7a823;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(120% 60% at 50% 0%, var(--bg2), var(--bg)) fixed, var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100svh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 0; max-width: 560px; margin: 0 auto; }
.brand { height: 52px; width: auto; }
.langs { display: flex; gap: 4px; }
.langs button { background: transparent; color: var(--muted); border: 1px solid #ffffff33; border-radius: 999px; padding: 4px 10px; font-size: 13px; min-height: 0; }
.langs button[aria-pressed="true"] { background: #ffffff22; color: var(--fg); }
main { max-width: 560px; margin: 0 auto; padding: 4px 16px 24px; }
h1 { font-family: Kalam, system-ui, sans-serif; font-size: 30px; margin: 8px 0 0; line-height: 1.1; }
.intro { color: var(--muted); margin: 4px 0 12px; }
.stage {
  position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  background: #0b0d24; box-shadow: 0 4px 14px #0006;
}
.stage canvas, .stage img#result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage img#result { -webkit-touch-callout: default; user-select: auto; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; }
.placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: #0006; }
.busy span { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #fff4; border-top-color: #fff; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.picker { display: flex; gap: 10px; justify-content: center; margin: 12px 0 0; }
.pick {
  flex: 1 1 0; max-width: 54px; aspect-ratio: 1; min-height: 0; padding: 0; border-radius: 50%; overflow: hidden;
  background: #ffffff1c; border: 3px solid #ffffff33; opacity: .7; transition: transform .12s, opacity .12s;
}
.pick img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transform: scale(1.5); transform-origin: 50% 30%; pointer-events: none; }
.pick[aria-pressed="true"] { border-color: var(--accent2); background: #fff; opacity: 1; transform: scale(1.12); box-shadow: 0 0 0 3px #f7a82355; }
.msg { min-height: 1.4em; color: var(--accent2); margin: 8px 0; text-align: center; }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 10px 0; flex-wrap: wrap; }
button, .button {
  font: inherit; font-weight: 650; border: 0; border-radius: 999px; padding: 12px 20px; min-height: 48px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.primary { background: linear-gradient(180deg, #f2392f, var(--accent)); color: #fff; box-shadow: 0 4px 14px #e8202a66; }
.secondary { background: #ffffff1c; color: var(--fg); border: 1px solid #ffffff33; }
.ghost { background: transparent; color: var(--muted); padding: 8px 12px; min-height: 40px; font-weight: 500; }
/* knoppen liggen altijd boven de schaduw van het beeld */
.start, #live-controls, #result-controls, .picker { position: relative; z-index: 2; }
.start { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0 0; }
.start .big { margin-top: 0; min-height: 58px; }
.start .ghost { text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.shutter { width: 76px; height: 76px; min-height: 0; padding: 0; border-radius: 50%; background: #fff; border: 6px solid var(--accent); box-shadow: 0 0 0 4px #fff4; }
.round { width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%; background: var(--accent2); color: #1a1d3a; }
.round svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.big { width: 100%; min-height: 64px; font-size: 21px; margin-top: 6px; }
.hint { color: var(--fg); font-size: 17px; font-weight: 600; text-align: center; margin: 10px 0 4px; }
.hint strong { color: var(--accent2); font-weight: 800; }
.privacy { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto;
  background: #fff; color: #15183a; padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 24px #0008; font-weight: 600;
}
/* Startscherm: voorbeeld kleiner, zodat beide knoppen zonder scrollen in beeld staan. */
body[data-mode="start"] .stage { width: min(100%, calc((100svh - 385px) * 0.8)); min-width: 180px; margin: 0 auto; }
body[data-mode="start"] .msg { margin: 2px 0; min-height: 0; }
/* Tijdens het fotograferen en bij het resultaat: titel en uitleg weg, beeld zo hoog als past, zodat
   de afdrukknop resp. de deelknop zonder scrollen in beeld staat (svh = zichtbare hoogte mét de
   balken van de browser). */
body:is([data-mode="live"], [data-mode="result"]) :is(h1, .intro) { display: none; }
body[data-mode="live"] .privacy { display: none; }
body:is([data-mode="live"], [data-mode="result"]) .stage { width: min(100%, calc((100svh - 280px) * 0.8)); min-width: 200px; margin: 6px auto 0; }
body:is([data-mode="live"], [data-mode="result"]) .picker { margin-top: 10px; }
body:is([data-mode="live"], [data-mode="result"]) .msg { margin: 4px 0; min-height: 0; }
body[data-mode="live"] .row { margin: 8px 0 0; }
body[data-mode="result"] .big { margin-top: 4px; }
body[data-mode="result"] .stage { width: min(100%, calc((100svh - 320px) * 0.8)); } /* + regel met de tag-oproep */
[hidden] { display: none !important; }
