:root {
  --navy: #16223D;
  --navy-deep: #0E1629;
  --navy-soft: #1F2E4F;
  --navy-line: #3A4A6B;
  --orange: #B5531F;
  --orange-dark: #A24A1A;
  --orange-light: #E7A06F;
  --orange-glow: #E07A3F;
  --cream: #F5EEDF;
  --paper: #FFFCF6;
  --ink: #16223D;
  --muted: #6B6457;
  --muted-light: #C9BFAB;
  --muted-dim: #8E97AE;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--navy);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

.screen { min-height: 100vh; min-height: 100dvh; }
.screen-dark { background: var(--navy); color: var(--cream); }
.screen-light { background: var(--cream); color: var(--ink); }
.screen-camera { background: var(--navy-deep); color: var(--cream); }

/* ---------- Welkom ---------- */
.welcome {
  max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: max(56px, env(safe-area-inset-top)) 28px max(32px, env(safe-area-inset-bottom));
  text-align: center;
}
.monogram {
  width: 96px; height: 96px; border-radius: 50%; border: 1.5px solid #C8672E;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 34px; font-weight: 500; color: var(--orange-light); letter-spacing: 1px;
}
.eyebrow { margin: 32px 0 0; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted-light); }
.names { margin: 12px 0 0; font-family: var(--serif); font-weight: 500; font-size: 46px; line-height: 1.05; display: flex; flex-direction: column; }
.amp { font-style: italic; color: var(--orange-light); font-size: 34px; }
.meta { margin: 14px 0 0; font-size: 14px; color: var(--muted-light); }
.rule { width: 48px; height: 1px; background: #C8672E; margin: 32px 0; }
.lead { margin: 0; font-size: 16px; line-height: 1.5; max-width: 310px; }
.name-form { width: 100%; margin-top: auto; padding-top: 36px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.name-form label { font-size: 13px; color: var(--muted-light); }
.name-form input, .sheet input {
  height: 52px; border-radius: 14px; border: 1px solid var(--navy-line); background: var(--navy-soft);
  color: var(--cream); font-size: 16px; padding: 0 16px; width: 100%;
}
.name-form input::placeholder { color: var(--muted-dim); }
.name-form input:focus, .sheet input:focus { outline: 2px solid var(--orange-light); outline-offset: 1px; }
.name-form .btn { margin-top: 8px; }
.fineprint { margin: 16px 0 0; font-size: 12px; color: var(--muted-dim); }
.form-error { margin: 0; font-size: 13px; color: #F0A57A; }

/* ---------- Knoppies ---------- */
.btn {
  width: 100%; min-height: 54px; border: none; border-radius: 14px; padding: 0 18px;
  font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:active { background: var(--orange-dark); }
.btn-dark { background: var(--navy); color: var(--cream); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost { background: transparent; color: var(--muted); min-height: 46px; font-weight: 500; }
.btn-icon { min-height: 60px; border-radius: 16px; }
.btn-recording { background: #8E2B12; }
.btn:disabled { opacity: .5; }
.link-btn { background: none; border: none; padding: 4px 0; color: var(--orange-dark); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Tuis ---------- */
.home {
  max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow-dark { margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.hello { margin: 2px 0 0; font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; word-break: break-word; }
.monogram-sm {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: var(--orange-light);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 18px;
}

.banner {
  display: flex; gap: 10px; align-items: flex-start; background: #FBE9DC; border: 1px solid #E8C3A6;
  border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #7E3912;
}
.banner.is-done { background: #E6EFE3; border-color: #B9D0B2; color: #2F5527; }
.banner-icon { flex-shrink: 0; margin-top: 1px; }
.banner.is-busy .banner-icon { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.banner-hint { font-size: 12px; opacity: .85; }
.bar { height: 6px; border-radius: 3px; background: rgba(126,57,18,.15); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--orange); border-radius: 3px; transition: width .3s; }

.announce {
  background: var(--navy); color: var(--cream); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; line-height: 1.45; border-left: 0;
}
.choice.is-off { opacity: .55; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice {
  min-height: 200px; border-radius: 20px; padding: 18px; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.choice:active { transform: scale(.98); }
.choice-dark { background: var(--navy); color: var(--cream); border: none; }
.choice-light { background: var(--paper); color: var(--ink); border: 1.5px solid var(--navy); }
.choice-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.tag { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; }
.tag-orange { background: var(--orange-light); color: var(--navy); }
.tag-navy { background: var(--navy); color: #fff; }
.choice-title { font-size: clamp(15px, 4.2vw, 17px); font-weight: 600; overflow-wrap: anywhere; }
.choice-sub { font-size: 13px; line-height: 1.35; }
.choice-dark .choice-sub { color: var(--muted-light); }
.choice-light .choice-sub { color: var(--muted); }
.hint { margin: -6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

.card { background: var(--paper); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 24px; }
.count { font-size: 13px; color: var(--orange-dark); font-weight: 600; }
.challenges { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.challenge-btn {
  width: 100%; background: none; border: none; padding: 8px 0; display: flex; align-items: center; gap: 12px;
  text-align: left; font-size: 15px; color: var(--ink); min-height: 44px;
}
.check {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #B7AC97; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.challenge-btn.is-done { color: var(--muted); }
.challenge-btn.is-done .challenge-label { text-decoration: line-through; }
.challenge-btn.is-done .check { background: var(--orange); border-color: var(--orange); }

.gallery-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.gallery-card .btn { margin-top: 4px; text-decoration: none; }
.footnote { margin: 4px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Kamera ---------- */
.camera {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.cam-top { display: flex; align-items: center; justify-content: space-between; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--navy-soft); color: var(--cream);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.round-btn[aria-pressed="true"] { background: var(--orange-light); color: var(--navy); }
.round-spacer { width: 44px; height: 44px; }
.round-lg { width: 54px; height: 54px; }
.shots-pill { display: flex; align-items: center; gap: 8px; background: var(--navy-soft); border-radius: 999px; padding: 8px 16px; font-size: 14px; }
.shots-pill span:last-child { color: var(--muted-light); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-glow); }
.cam-challenge { margin: 0; text-align: center; font-size: 14px; color: var(--orange-light); }

.viewfinder {
  position: relative; flex: 1; min-height: 300px; border-radius: 24px; overflow: hidden;
  background: #2A3550; border: 1px solid var(--navy-line);
}
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder video.is-mirrored { transform: scaleX(-1); }
.viewfinder video.f-warm { filter: sepia(.22) saturate(1.15) contrast(1.05) brightness(1.04); }
.viewfinder video.f-bw { filter: grayscale(1) contrast(1.15); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cam-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 28px; text-align: center; font-size: 15px; line-height: 1.5; color: var(--cream); background: #2A3550;
}
.cam-msg .btn { width: auto; min-width: 200px; }

.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.filter-btn {
  min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--navy-line);
  background: transparent; color: var(--muted-light); font-size: 13px; font-weight: 500;
}
.filter-btn[aria-checked="true"] { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }

.cam-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.roll {
  width: 54px; height: 54px; border-radius: 12px; border: 2px solid var(--cream); background: #C9A27E;
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--navy); font-size: 15px;
}
.shutter {
  width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--cream); background: var(--orange);
  box-shadow: inset 0 0 0 4px var(--navy-deep);
}
.shutter:active { background: var(--orange-dark); transform: scale(.96); }
.shutter:disabled { background: #4A5470; opacity: .7; }
.cam-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted-light); line-height: 1.5; }
.cam-note-sm { font-size: 12px; color: var(--muted-dim); }
.inline-link { background: none; border: none; padding: 0; color: var(--orange-light); font-weight: 600; text-decoration: underline; font-size: inherit; }

/* ---------- Sheets ---------- */
.sheet {
  width: min(100% - 24px, 440px); border: none; border-radius: 22px; padding: 24px 20px 12px;
  background: var(--paper); color: var(--ink);
}
.sheet::backdrop { background: rgba(14,22,41,.6); }
.sheet h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.15; }
.sheet-eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--orange-dark); font-weight: 600; }
.sheet-sub { margin: 8px 0 0; font-size: 15px; color: var(--muted); line-height: 1.45; }
.sheet-label { display: block; margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.sheet input { background: #fff; color: var(--ink); border-color: #D8CDB8; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.sheet > .btn-ghost { margin-top: 6px; }
.voice-timer { margin-top: 20px; text-align: center; font-family: var(--serif); font-size: 52px; color: var(--navy); }
.voice-timer.is-live { color: #8E2B12; }
#voice-preview { width: 100%; margin-top: 12px; }
#voice-error { margin-top: 10px; color: #8E2B12; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); background: var(--navy); color: var(--cream);
  padding: 12px 18px; border-radius: 14px; font-size: 14px; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Galery ---------- */
.gallery-body { background: var(--cream); }
.g-center { display: flex; align-items: center; justify-content: center; }
.g-center-inner {
  max-width: 420px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(56px, env(safe-area-inset-top)) 28px max(32px, env(safe-area-inset-bottom));
}
.g-locked-title { margin: 12px 0 0; font-family: var(--serif); font-weight: 500; font-size: 42px; line-height: 1.1; }
.g-locked-title em { color: var(--orange-light); }
.g-reel { margin-top: 36px; width: 140px; height: 140px; border-radius: 50%; border: 1.5px dashed var(--navy-line); display: flex; align-items: center; justify-content: center; }
.g-reel svg { animation: spin 12s linear infinite; }
.g-countdown { margin: 8px 0 0; font-family: var(--serif); font-size: 48px; color: var(--cream); }
.g-back { margin-top: 36px; text-decoration: none; }

.g-head { background: var(--navy); color: var(--cream); }
.g-head-inner { max-width: 960px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 18px 24px; }
.g-head-top { display: flex; align-items: center; justify-content: space-between; }
.g-home { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted-light); text-decoration: none; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.g-mono { background: transparent; border: 1.5px solid #C8672E; }
.g-title { margin: 8px 0 0; font-family: var(--serif); font-weight: 500; font-size: 42px; line-height: 1.05; }
.g-title em { color: var(--orange-light); }
.g-sub { margin: 10px 0 0; font-size: 14px; color: var(--muted-light); }
.g-preview { margin: 12px 0 0; display: inline-block; font-size: 13px; font-weight: 600; background: var(--orange-light); color: var(--navy); border-radius: 999px; padding: 4px 12px; }

.g-main { max-width: 960px; margin: 0 auto; padding: 16px 14px max(32px, env(safe-area-inset-bottom)); }
.g-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.g-filters::-webkit-scrollbar { display: none; }
.g-chip {
  flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D8CDB8;
  background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 500;
}
.g-chip[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.g-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 2px 12px; }
.g-hint { margin: 0; font-size: 13px; color: var(--muted); }
.g-mine { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--navy); background: transparent; color: var(--navy); font-size: 13px; font-weight: 600; }
.g-mine[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 640px) { .g-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.g-tile { position: relative; aspect-ratio: 1 / 1; padding: 0; border: none; border-radius: 6px; overflow: hidden; background: #E2D6C1; }
.g-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-tile img.is-broken { visibility: hidden; }
.g-badge {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #fff; background: rgba(14,22,41,.7); border-radius: 999px; padding: 2px 8px;
}
.g-badge-orange { background: rgba(181,83,31,.9); }
.g-empty { text-align: center; color: var(--muted); margin: 40px 0; }
#g-sentinel { height: 1px; }

.g-viewer {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  border: none; background: var(--navy-deep); color: var(--cream);
}
.g-viewer[open] { display: flex; flex-direction: column; gap: 14px; }
.g-viewer::backdrop { background: var(--navy-deep); }
.g-viewer-top { display: flex; align-items: center; justify-content: space-between; max-width: 900px; width: 100%; margin: 0 auto; }
.g-pos { font-size: 14px; color: var(--muted-light); }
.g-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.g-print { margin: 0; background: var(--cream); padding: 10px 10px 0; border-radius: 4px; max-width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.g-media { min-height: 0; display: flex; justify-content: center; background: #2A3550; }
.g-media img { max-width: 100%; max-height: calc(100dvh - 260px); object-fit: contain; display: block; }
.g-media.is-video { width: min(860px, calc(100vw - 52px)); aspect-ratio: 16 / 9; }
.g-media iframe { width: 100%; height: 100%; border: 0; }
.g-print figcaption { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--navy); padding: 0 4px; }
.g-by { font-family: var(--serif); font-style: italic; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-time { font-size: 12px; color: var(--muted); }
.g-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.g-tag { font-size: 12px; font-weight: 600; color: var(--cream); background: var(--navy-soft); border-radius: 999px; padding: 4px 10px; }
.g-tag-orange { color: var(--navy); background: var(--orange-light); }
.g-actions { display: flex; gap: 10px; max-width: 520px; width: 100%; margin: 0 auto; }
.g-actions .round-btn { border-radius: 14px; }
.g-actions .round-btn:disabled { opacity: .35; }
.g-download { flex: 1; text-decoration: none; }
