/* ─────────────────────────────────────────────────────────────
   Make it real – vormgeving
   Warm en natuurlijk (wit, zacht beige, bladgroen), maar modern en app-achtig:
   zachte glas-oppervlakken, pil-knoppen, een zwevend knoppendock onderin,
   vloeiende overgangen waarbij je tekening van scherm naar scherm meebeweegt.
   ───────────────────────────────────────────────────────────── */

/* Optioneel: zet Baloo 2 en Nunito (gratis, OFL) als .woff2 in /public/fonts. */
@font-face { font-family: "Baloo 2"; src: local("Baloo 2"), url("fonts/Baloo2-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: local("Nunito"), url("fonts/Nunito-Variable.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --beige: #f7f3ea;
  --beige-deep: #ede5d4;
  --paper: #fffdf8;
  --glass: rgba(255, 253, 248, 0.72);
  --glass-strong: rgba(255, 253, 248, 0.9);
  --glass-line: rgba(255, 255, 255, 0.85);
  --line: #e4dbc8;
  --leaf-900: #1d421b;
  --leaf-800: #265924;
  --leaf-700: #2e6a2b;
  --leaf-600: #3b7d36;
  --leaf-500: #5c9a45;
  --leaf-300: #a9cb8f;
  --leaf-200: #d6e7c4;
  --leaf-100: #eaf2de;
  --sun: #e8c766;
  --ink: #272622;
  --ink-soft: #55514a;
  --error: #9b3b26;
  --error-bg: #fbeee8;

  --font-display: "Baloo 2", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Neue", cursive;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-soft: 0 1px 1px rgba(60, 48, 25, 0.04), 0 8px 24px -6px rgba(60, 48, 25, 0.1);
  --shadow-float: 0 2px 4px rgba(60, 48, 25, 0.06), 0 24px 48px -12px rgba(60, 48, 25, 0.22);
  --shadow-green: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 10px 24px -8px rgba(38, 89, 36, 0.55);
  --focus: 0 0 0 3px var(--paper), 0 0 0 6px var(--leaf-700);
  --dock-space: calc(118px + env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--beige); }

body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.125rem; line-height: 1.55;
  color: var(--ink);
  background: var(--beige);
  padding-left: env(safe-area-inset-left, 0); padding-right: env(safe-area-inset-right, 0);
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
/* Zachte groene vlakken op de achtergrond (stil, geen beweging) */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(32% 28% at 12% 18%, rgba(169, 203, 143, 0.45), transparent 70%),
    radial-gradient(30% 26% at 92% 12%, rgba(232, 199, 102, 0.18), transparent 70%),
    radial-gradient(36% 30% at 85% 88%, rgba(169, 203, 143, 0.38), transparent 70%),
    radial-gradient(28% 24% at 8% 92%, rgba(214, 231, 196, 0.6), transparent 70%);
  filter: blur(8px);
}

img { max-width: 100%; display: block; }
button, label, a { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; font-family: inherit; }

h1, h2 {
  font-family: var(--font-display); font-weight: 800;
  color: var(--leaf-800); margin: 0;
  letter-spacing: -0.025em; text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 9vw, 4.6rem); line-height: 0.98; }
h2 { font-size: clamp(1.75rem, 6.4vw, 2.35rem); line-height: 1.08; text-align: center; }
h1:focus, h2:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon {
  width: 1.5em; height: 1.5em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Knoppen ─────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 60px; padding: 0 28px;
  border: 0; border-radius: 999px;
  font: 800 1.18rem/1.2 var(--font-body); letter-spacing: -0.005em;
  text-align: center; cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s, background-color 0.25s, filter 0.25s;
}
.btn:active { transform: scale(0.965); }
.btn:focus-visible, .tile:focus-visible, .download-option:focus-visible, .appbar-back:focus-visible,
.toast button:focus-visible, .lang-switch button:focus-visible, .credit a:focus-visible {
  outline: none; box-shadow: var(--focus);
}
.btn[disabled], .download-option[disabled] { opacity: 0.6; cursor: wait; }

.btn-xl { min-height: 68px; font-size: clamp(1.04rem, 4.4vw, 1.22rem); padding: 0 20px; gap: 10px; }
.btn-block { display: flex; width: 100%; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--leaf-600), var(--leaf-700) 60%, var(--leaf-800));
  box-shadow: var(--shadow-green);
}
.btn-secondary, .btn-soft {
  color: var(--leaf-900); background: var(--glass-strong);
  box-shadow: 0 0 0 1px var(--line) inset, var(--shadow-soft);
}
.btn-soft { font-size: 1.02rem; min-height: 60px; padding: 0 18px; }
.btn-link { background: transparent; color: var(--leaf-800); min-height: 48px; padding: 0 18px; font-size: 1.08rem; }

@media (hover: hover) {
  .btn-primary:hover { filter: brightness(1.06); }
  .btn-secondary:hover, .btn-soft:hover { box-shadow: 0 0 0 2px var(--leaf-300) inset, var(--shadow-soft); }
  .btn-link:hover { background: rgba(214, 231, 196, 0.5); }
}

/* ── Bovenbalk ───────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 1px 0 rgba(228, 219, 200, 0.7);
  view-transition-name: appbar;
}
.appbar-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px;
  min-height: 46px; min-width: 46px; padding: 0 12px 0 8px;
  border: 0; border-radius: 999px; background: var(--glass-strong);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--leaf-800); font: 800 1rem var(--font-body); cursor: pointer;
  transition: transform 0.18s var(--ease-out), opacity 0.2s;
}
.appbar-back:active { transform: scale(0.94); }
.appbar-back .icon { width: 1.4em; height: 1.4em; stroke-width: 2.6; }
.appbar-back-label { display: none; }
.appbar-back.is-hidden { visibility: hidden; }

.stepper { min-width: 0; text-align: center; }
.step-text {
  margin: 0 0 6px; font-weight: 800; font-size: 0.95rem; line-height: 1.2;
  color: var(--leaf-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.progress { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; max-width: 220px; }
.progress li { height: 6px; border-radius: 99px; background: var(--beige-deep); overflow: hidden; position: relative; }
.progress li::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf-500), var(--leaf-700));
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease-out);
}
.progress li.done::after, .progress li.current::after { transform: scaleX(1); }

/* ── Taalkeuze ───────────────────────────────────────────── */
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: rgba(237, 229, 212, 0.85); box-shadow: 0 0 0 1px rgba(228, 219, 200, 0.8) inset;
}
.lang-switch button {
  min-width: 42px; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 800 0.92rem var(--font-body); color: var(--ink-soft); background: transparent;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.lang-switch button[aria-pressed="true"] { background: var(--paper); color: var(--leaf-800); box-shadow: 0 2px 6px rgba(60, 48, 25, 0.14); }
.lang-switch-start { position: absolute; z-index: 5; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }

/* ── Schermen ────────────────────────────────────────────── */
.screen:not(.screen-start) { padding: 22px 16px var(--dock-space); }
.screen[data-screen="result"] { padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
.panel { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; }
.panel-wide { max-width: 920px; }
.sub { text-align: center; color: var(--ink-soft); margin: 10px auto 22px; max-width: 42ch; font-size: 1.1rem; }

/* Overgang als de browser geen "view transitions" kent */
.screen.enter-forward { animation: enter-forward 0.45s var(--ease-out) backwards; }
.screen.enter-back { animation: enter-back 0.45s var(--ease-out) backwards; }
@keyframes enter-forward { from { opacity: 0; transform: translateX(36px); } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-36px); } }

/* Vloeiende overgangen tussen schermen (Chrome, Edge, Safari 18+) */
.screen:not([hidden]) .vt-drawing { view-transition-name: drawing; }
.screen:not([hidden]) .actionbar { view-transition-name: dock; }
::view-transition-old(root) { animation: vt-out 0.26s var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 0.42s var(--ease-out) both; }
html[data-dir="back"]::view-transition-old(root) { animation-name: vt-out-back; }
html[data-dir="back"]::view-transition-new(root) { animation-name: vt-in-back; }
::view-transition-group(drawing) { animation-duration: 0.55s; animation-timing-function: var(--ease-out); }
::view-transition-group(dock), ::view-transition-group(appbar) { animation-duration: 0.4s; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; transform: translateX(-28px) scale(0.98); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(28px) scale(0.98); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-40px); } }

/* Zwevend knoppendock onderin, binnen bereik van je duim */
.actionbar {
  position: fixed; z-index: 20;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 4px; padding: 10px;
  border-radius: 32px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-float);
}
.actionbar .btn-link { justify-self: center; min-height: 44px; }

/* ── Startscherm ─────────────────────────────────────────── */
.screen-start {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center;
  padding: calc(70px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
}
.hero { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.hero-text { text-align: center; display: flex; flex-direction: column; }
.hero-text > * { align-self: stretch; }
.hero-text > .session-chip, .hero-text > .privacy-note { align-self: center; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.32rem); color: var(--ink-soft); max-width: 34ch; margin: 16px auto 26px; }
.hero-actions { display: grid; gap: 12px; width: 100%; max-width: 420px; margin: 0 auto; }
.hero-caption {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 20px 0 0; white-space: nowrap;
  font-family: var(--font-hand); font-size: clamp(1.05rem, 3.6vw, 1.3rem); color: var(--leaf-800);
}
.hero-caption span:last-child { transform: rotate(-3deg) translateY(4px); }
.hero-caption svg { width: 72px; height: 26px; fill: none; stroke: var(--leaf-700); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.privacy-note {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0;
  padding: 8px 14px; border-radius: 999px; background: rgba(214, 231, 196, 0.55);
  color: var(--leaf-900); font-weight: 800; font-size: 0.98rem;
}
.privacy-note .icon { width: 1.3em; height: 1.3em; }
.credit { margin: 14px 0 0; font-size: 0.98rem; color: var(--ink-soft); }
.credit a { color: var(--leaf-800); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; border-radius: 4px; }
.credit-result { text-align: center; margin-top: 22px; }

.hero-visual { order: -1; position: relative; width: 100%; max-width: 480px; margin: 0 auto 12px; aspect-ratio: 1.5; }
.polaroid { position: absolute; margin: 0; background: #fff; padding: 7px; border-radius: 22px; box-shadow: var(--shadow-float); }
.polaroid img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; }
.polaroid-drawing { width: 37%; left: 3%; top: 13%; aspect-ratio: 556 / 660; transform: rotate(-6deg); z-index: 1; }
.polaroid-result { width: 62%; right: 4%; top: 2%; aspect-ratio: 890 / 758; transform: rotate(4deg); z-index: 2; padding: 8px; }
.hero-swoosh { position: absolute; left: 30%; bottom: 0; width: 20%; z-index: 3; fill: none; stroke: var(--leaf-700); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-spark { position: absolute; right: -2%; top: 34%; width: 6%; z-index: 3; fill: none; stroke: var(--leaf-700); stroke-width: 4; stroke-linecap: round; }

/* Eén rustig openingsmoment */
.screen-start .polaroid-drawing { animation: card-in 0.8s var(--ease-out) 0.05s backwards; }
.screen-start .polaroid-result { animation: develop 1.1s var(--ease-out) 0.3s backwards; }
.screen-start .polaroid-result img { animation: develop-img 1.5s var(--ease-out) 0.3s backwards; }
.screen-start .hero-swoosh path, .screen-start .hero-caption path { stroke-dasharray: 200; animation: draw 0.9s var(--ease-out) 0.9s backwards; }
.screen-start .hero-spark { animation: fade-in 0.5s ease 1.3s backwards; }
.screen-start .hero-text > * { animation: rise 0.7s var(--ease-out) backwards; }
.screen-start .hero-text > :nth-child(2) { animation-delay: 0.06s; }
.screen-start .hero-text > :nth-child(3) { animation-delay: 0.12s; }
.screen-start .hero-text > :nth-child(n+4) { animation-delay: 0.18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes card-in { from { opacity: 0; transform: translate(-26px, 14px) rotate(-14deg); } }
@keyframes develop { from { opacity: 0; transform: translateY(16px) rotate(9deg) scale(0.94); } }
@keyframes develop-img { from { filter: blur(14px) saturate(0.3) brightness(1.15); } }
@keyframes draw { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* ── 1. Tekening ─────────────────────────────────────────── */
.preview {
  border-radius: 30px; padding: 12px;
  background: var(--glass); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-soft);
  display: grid; place-items: center;
}
.preview img { max-height: min(50vh, 520px); width: auto; border-radius: 20px; box-shadow: var(--shadow-soft); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.row-2 .btn { flex-direction: column; gap: 4px; min-height: 86px; border-radius: 26px; font-size: 1rem; line-height: 1.2; padding: 10px 8px; }

/* ── 2. Stijl ────────────────────────────────────────────── */
.style-grid {
  border: 0; margin: 0; padding: 0; min-width: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.style-grid.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.style-card {
  position: relative; display: block; overflow: hidden; cursor: pointer;
  border-radius: 26px; background: var(--beige-deep);
  aspect-ratio: 4 / 3.4;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.style-card:active { transform: scale(0.96); }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-img, .style-img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.style-img img { object-fit: cover; transition: transform 0.6s var(--ease-out); }
.style-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%;
  background: linear-gradient(to top, rgba(16, 30, 14, 0.78), rgba(16, 30, 14, 0));
  pointer-events: none;
}
.style-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 10px 14px; text-align: center;
  font-weight: 800; font-size: clamp(1.02rem, 4.2vw, 1.15rem); color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  hyphens: auto; overflow-wrap: break-word;
}
.style-card:has(input:checked) {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--leaf-700), var(--shadow-float);
  transform: translateY(-2px);
  animation: select-pop 0.4s var(--ease-spring);
}
@keyframes select-pop { 40% { transform: scale(0.95); } }
.style-card:has(input:focus-visible) { box-shadow: var(--focus); }
.style-check {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--leaf-700); color: #fff; box-shadow: 0 0 0 3px #fff, var(--shadow-soft);
  display: grid; place-items: center;
  opacity: 0; transform: scale(0.3) rotate(-30deg);
  transition: opacity 0.2s, transform 0.45s var(--ease-spring);
}
.style-check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.style-card:has(input:checked) .style-check { opacity: 1; transform: none; }

.style-surprise {
  grid-column: 1 / -1; aspect-ratio: auto; min-height: 76px;
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 60px;
  background: linear-gradient(120deg, var(--leaf-100), #f6efd9 55%, var(--leaf-200));
}
.style-surprise::after { display: none; }
.style-surprise .style-name { position: static; padding: 0; color: var(--leaf-900); text-shadow: none; }
.surprise-icon { color: var(--leaf-700); display: grid; place-items: center; }
.surprise-icon .icon { width: 1.9em; height: 1.9em; }
.style-surprise:has(input:checked) .surprise-icon { animation: wiggle 0.6s var(--ease-out); }
@keyframes wiggle { 30% { transform: rotate(-14deg) scale(1.15); } 60% { transform: rotate(10deg); } }
.style-surprise .style-check { top: 50%; margin-top: -19px; right: 16px; }
@media (hover: hover) { .style-card:hover .style-img img { transform: scale(1.06); } }

.field-error { color: var(--error); font-weight: 800; text-align: center; margin: 14px 0 0; }

/* ── 3. Wensen ───────────────────────────────────────────── */
textarea {
  width: 100%; min-height: 210px; padding: 20px 22px;
  font: 1.15rem/1.5 var(--font-body); color: var(--ink);
  background: var(--glass-strong); border: 0; border-radius: 28px; resize: vertical;
  box-shadow: 0 0 0 1px var(--line) inset, var(--shadow-soft);
  transition: box-shadow 0.25s;
}
textarea::placeholder { color: #7f796c; }
textarea:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--leaf-700) inset, 0 0 0 6px rgba(169, 203, 143, 0.45); }

/* ── Bezig ───────────────────────────────────────────────── */
.loading-visual { position: relative; width: min(100%, 330px); margin: 10px auto 0; }
.loading-glow {
  position: absolute; inset: -14%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(169, 203, 143, 0.6), transparent);
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.08); opacity: 0.55; } }
/* Draaiende "magische" rand rond je tekening */
.loading-ring {
  position: absolute; inset: -5px; border-radius: 32px;
  background: conic-gradient(from var(--spin), var(--leaf-300), var(--leaf-700), var(--sun), var(--leaf-500), var(--leaf-300));
  animation: spin 2.6s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }
.loading-frame { position: relative; overflow: hidden; background: #fff; padding: 8px; border-radius: 28px; }
.loading-frame img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 20px; }
.scan {
  position: absolute; left: 0; right: 0; top: 0; height: 38%;
  background: linear-gradient(to bottom, rgba(255, 253, 248, 0), rgba(234, 242, 222, 0.7) 82%, rgba(92, 154, 69, 0.5) 100%);
  border-bottom: 2px solid rgba(92, 154, 69, 0.85);
  animation: scan 2.2s ease-in-out infinite;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(270%); } }
.loading-progress { height: 8px; max-width: 300px; width: 100%; margin: 34px auto 0; background: var(--beige-deep); border-radius: 99px; overflow: hidden; }
.loading-progress span {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--leaf-500), var(--leaf-700));
  transform: scaleX(0.02); transform-origin: left; transition: transform 0.6s var(--ease-out);
}
.loading-msg { text-align: center; margin: 18px 0 0; min-height: 1.5em; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--leaf-800); }
.loading-msg.msg-in { animation: msg-in 0.45s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
.loading-msg + .sub { margin: 6px auto 16px; }
.notice-keep, .notice-download {
  display: flex; align-items: center; gap: 10px; margin: 0 auto; max-width: 520px;
  font-weight: 800; color: var(--leaf-900); line-height: 1.3;
}
.notice-keep {
  padding: 14px 18px; border-radius: 24px; font-size: 1.06rem;
  background: var(--glass-strong); box-shadow: 0 0 0 2px var(--leaf-200) inset, var(--shadow-soft);
}
.notice-keep .icon, .notice-download .icon { color: var(--leaf-700); width: 1.5em; height: 1.5em; }
.notice-download { font-size: 0.98rem; padding: 2px 8px 6px; }

/* ── Fout ────────────────────────────────────────────────── */
.error-icon { display: grid; place-items: center; margin: 12px auto 14px; }
.error-icon svg { width: 68px; height: 68px; fill: var(--error-bg); stroke: var(--error); stroke-width: 1.8; stroke-linecap: round; }
.error-msg { text-align: center; font-size: 1.12rem; background: var(--error-bg); color: var(--error); border-radius: 24px; padding: 16px 18px; margin: 18px 0 0; }
.error-detail { margin: 12px 0 0; font-size: 0.95rem; color: var(--ink-soft); text-align: center; word-break: break-word; }

/* ── 4. Resultaat ────────────────────────────────────────── */
.cached-note { text-align: center; margin: -8px auto 18px; max-width: 46ch; background: var(--leaf-100); color: var(--leaf-900); border-radius: 18px; padding: 10px 16px; font-size: 1rem; }
.compare { position: relative; display: grid; margin-bottom: 56px; }
.compare figure { margin: 0; }
.frame { overflow: hidden; display: grid; place-items: center; }
.frame img { width: 100%; height: 100%; object-fit: contain; }
.compare-result .frame { border-radius: 30px; background: var(--leaf-100); aspect-ratio: var(--ratio, 4 / 3); box-shadow: var(--shadow-float); }
.compare-result figcaption {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--leaf-900); font-weight: 800; font-size: 0.95rem;
  padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow-soft);
}
.compare-drawing {
  position: absolute; left: -4px; bottom: -40px; z-index: 2; width: 38%;
  background: #fff; padding: 6px 6px 0; border-radius: 18px; box-shadow: var(--shadow-float); transform: rotate(-5deg);
}
.compare-drawing .frame { border-radius: 12px; background: var(--beige); aspect-ratio: 4 / 3; }
.compare-drawing figcaption { text-align: center; font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); padding: 5px 0 7px; line-height: 1.2; }

/* Het resultaat "groeit" uit je tekening */
.screen.reveal .compare-result img { animation: wipe 1.2s var(--ease-out) 0.15s backwards, develop-img 1.4s var(--ease-out) 0.15s backwards; }
.screen.reveal .compare-drawing { animation: drop-in 0.6s var(--ease-out) 0.7s backwards; }
@keyframes wipe { from { clip-path: circle(0% at 22% 82%); } to { clip-path: circle(150% at 22% 82%); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(18px) rotate(-14deg); } }

.result-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 94px; padding: 10px 6px;
  font: 800 clamp(0.93rem, 3.6vw, 1.03rem)/1.2 var(--font-body);
  color: var(--leaf-900); background: var(--glass-strong); border: 0; border-radius: 26px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line) inset, var(--shadow-soft);
  overflow-wrap: break-word; hyphens: auto;
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s;
}
.tile:active { transform: scale(0.94); }
.tile .icon { width: 1.75em; height: 1.75em; color: var(--leaf-700); }
@media (hover: hover) { .tile:hover { box-shadow: 0 0 0 2px var(--leaf-300) inset, var(--shadow-soft); } }

/* Afbeeldingen van deze sessie */
.session-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 16px auto 0;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  font: 800 1rem var(--font-body); color: var(--leaf-900);
  background: var(--glass-strong); box-shadow: 0 0 0 1px var(--line) inset, var(--shadow-soft);
  transition: transform 0.18s var(--ease-out);
}
.session-chip:active { transform: scale(0.96); }
.session-chip:focus-visible, .session-item:focus-visible { outline: none; box-shadow: var(--focus); }
.session-chip .icon { color: var(--leaf-700); width: 1.35em; height: 1.35em; }
.session { margin: 0 0 18px; }
.session-title { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; color: var(--leaf-900); }
.session-title #session-count { color: var(--ink-soft); font-weight: 700; }
.session-strip {
  list-style: none; margin: 0 -16px; padding: 4px 16px 10px;
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.session-strip::-webkit-scrollbar { display: none; }
.session-strip li { flex: none; scroll-snap-align: start; }
.session-item {
  position: relative; display: block; width: 84px; height: 84px; padding: 0; border: 0;
  border-radius: 20px; overflow: hidden; cursor: pointer; background: var(--beige-deep);
  box-shadow: var(--shadow-soft); opacity: 0.78;
  transition: transform 0.2s var(--ease-out), opacity 0.2s, box-shadow 0.25s;
}
.session-item img { width: 100%; height: 100%; object-fit: cover; }
.session-item:active { transform: scale(0.94); }
.session-item[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--leaf-700); }
.session-saved {
  position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--leaf-700); color: #fff; box-shadow: 0 0 0 2px #fff;
}
.session-saved svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Downloadvenster (bottom sheet) ──────────────────────── */
.sheet {
  border: 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: min(560px, 100%); max-height: 92dvh; margin: auto auto 0;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  color: var(--ink); border-radius: 34px 34px 0 0;
  box-shadow: 0 -16px 48px rgba(40, 50, 25, 0.2);
  transform: translateY(100%); transition: transform 0.42s var(--ease-out);
}
.sheet.is-open { transform: translateY(0); }
.sheet::backdrop { background: rgba(28, 40, 22, 0.42); opacity: 0; transition: opacity 0.35s; }
.sheet.is-open::backdrop { opacity: 1; }
.sheet-handle { width: 46px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 16px; }
.sheet h2 { font-size: 1.75rem; }
.sheet .sub { margin-bottom: 18px; }
.sheet-options { display: grid; gap: 10px; }
.download-option {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 86px; padding: 14px 16px;
  text-align: left; font: inherit; color: var(--ink);
  background: var(--paper); border: 0; border-radius: 24px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s;
}
.download-option:active { transform: scale(0.98); }
@media (hover: hover) { .download-option:hover { box-shadow: 0 0 0 2px var(--leaf-300) inset; } }
.option-icon { flex: none; width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--leaf-100); color: var(--leaf-700); }
.option-icon .icon { width: 1.7em; height: 1.7em; }
.option-text strong { display: block; font-size: 1.15rem; color: var(--leaf-900); }
.option-text span { display: block; color: var(--ink-soft); font-size: 1rem; line-height: 1.35; }
.dl-status { margin: 14px 0 0; text-align: center; color: var(--leaf-800); font-weight: 800; }
.dl-status:empty { display: none; }
.sheet-close { display: flex; margin: 8px auto 0; }

/* ── Melding (toast) ─────────────────────────────────────── */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px;
  background: rgba(38, 37, 32, 0.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; border-radius: 26px; box-shadow: 0 18px 40px rgba(30, 25, 15, 0.32);
  font-weight: 700; font-size: 1.04rem;
  transform: translate(-50%, 24px) scale(0.98); opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.25s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast p { margin: 0; flex: 1; }
.toast button { flex: none; min-height: 44px; padding: 0 18px; font: 800 1rem var(--font-body); color: var(--leaf-900); background: var(--leaf-200); border: 0; border-radius: 999px; cursor: pointer; }

/* ── Groter scherm ───────────────────────────────────────── */
@media (min-width: 480px) {
  .appbar { grid-template-columns: 130px 1fr 130px; padding-left: 14px; padding-right: 14px; }
  .appbar .lang-switch { justify-self: end; }
  .appbar-back-label { display: inline; }
}
@media (min-width: 560px) {
  .row-2 .btn { flex-direction: row; gap: 10px; min-height: 62px; border-radius: 999px; font-size: 1.04rem; }
}
@media (min-width: 720px) {
  .screen:not(.screen-start), .screen[data-screen="result"] { padding: 36px 24px 64px; }
  .panel {
    padding: 40px 40px 34px; border-radius: 40px;
    background: var(--glass); -webkit-backdrop-filter: saturate(1.4) blur(22px); backdrop-filter: saturate(1.4) blur(22px);
    box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-float);
  }
  .actionbar { position: static; padding: 0; margin-top: 28px; background: none; box-shadow: none; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .actionbar .btn-block { max-width: 520px; margin: 0 auto; }
  .notice-download { justify-content: center; }
  .toast { bottom: 28px; }
  .style-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .style-card { aspect-ratio: 3 / 3.6; }
  .style-surprise { aspect-ratio: auto; }

  .compare { grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
  .compare-drawing { position: static; width: auto; transform: none; background: none; padding: 0; box-shadow: none; border-radius: 0; }
  .compare-drawing .frame, .compare-result .frame { aspect-ratio: var(--ratio, 4 / 3); border-radius: 28px; }
  .compare-drawing .frame { background: var(--beige-deep); }
  .compare-result figcaption, .compare-drawing figcaption {
    position: static; background: none; box-shadow: none; padding: 0; margin-top: 10px;
    text-align: center; font-size: 1.04rem; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  @keyframes drop-in { from { opacity: 0; transform: translateY(16px); } }

  .sheet { margin: auto; border-radius: 34px; padding: 16px 28px 24px; transform: translateY(24px) scale(0.97); opacity: 0; transition: transform 0.35s var(--ease-out), opacity 0.25s; }
  .sheet.is-open { transform: none; opacity: 1; }
  .sheet-handle { display: none; }
}
@media (min-width: 960px) {
  .screen-start { padding: 80px 48px 48px; }
  .hero { display: grid; grid-template-columns: 1fr 1.08fr; gap: 56px; align-items: center; }
  .hero-text { text-align: left; }
  .hero-text > .session-chip, .hero-text > .privacy-note { align-self: flex-start; }
  .lead { margin-left: 0; }
  .hero-actions { margin: 0; max-width: 460px; }
  .hero-caption { justify-content: flex-start; margin-top: 26px; }
  .session-chip { margin-left: 0; }
  .hero-visual { order: 0; max-width: 680px; margin: 0; }
}

/* ── Rustige beweging ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .scan { display: none; }
}
@media (forced-colors: active) {
  .style-card:has(input:checked) { outline: 4px solid Highlight; }
  .btn, .tile, .download-option { border: 2px solid ButtonText; }
}
