:root {
  --pine-900: #0A1C16;
  --pine-800: #0E241D;
  --pine-700: #15342B;
  --pine-600: #1E4A3B;
  --gold: #E8B65A;
  --gold-light: #F6D58E;
  --cream: #F6EEDC;
  --cream-2: #F3EAD6;
  --muted: #CFC6B0;
  --faint: #A9A08A;
  --cranberry: #A8332E;
  --ink: #163A2F;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--pine-800); color: var(--cream); font-family: var(--sans); }
body { min-height: 100vh; overscroll-behavior-y: none; }
button { font-family: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.stars { position: absolute; top: 0; left: 0; width: 100%; height: auto; pointer-events: none; }

.preview-banner {
  position: relative; z-index: 2;
  margin: calc(env(safe-area-inset-top) + 10px) 20px 0;
  padding: 10px 14px; border-radius: 12px;
  background: var(--gold); color: #2B1E06; font-size: 13px; font-weight: 700; text-align: center;
}

.header { position: relative; padding: calc(env(safe-area-inset-top) + 40px) 24px 0; display: flex; flex-direction: column; gap: 10px; }
.preview-banner:not([hidden]) + .header { padding-top: 24px; }
.header-top { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.muted { font-size: 13px; color: var(--muted); }
.title { margin: 6px 0 0; font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: 1.02; letter-spacing: -.02em; }
.title-name { font-style: italic; color: var(--gold); }
.lead { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

.garland { display: block; width: 100%; height: 54px; margin-top: 10px; }
.lights circle { animation: twinkle 2.6s ease-in-out infinite; }
.lights circle:nth-child(2n) { animation-delay: -1.3s; }
.lights circle:nth-child(3n) { animation-delay: -.7s; animation-duration: 1.9s; }

/* Kerstboom */
.tree-card { margin: 4px 20px 0; padding: 18px 18px 16px; border-radius: 22px; background: var(--pine-700); display: flex; gap: 14px; align-items: flex-end; }
.tree-wrap { position: relative; flex: none; width: 170px; height: 222px; }
.tree { position: absolute; inset: 0; animation: sway 6s ease-in-out infinite; transform-origin: 50% 100%; }
.tree > svg:first-child { position: absolute; inset: 0; }
.ball { position: absolute; width: 13px; height: 13px; border-radius: 50%; box-shadow: inset -2px -2px 0 rgba(0,0,0,.25); }
.ball-new { animation: hang .9s cubic-bezier(.3,1.4,.5,1) both, ballGlow 2s ease-in-out .9s infinite; }
.hook { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(246,238,220,.22); }
.topstar { position: absolute; left: 70px; top: 6px; }
.topstar path { fill: #2F4A40; stroke: var(--gold-light); stroke-width: 0; }
.topstar.lit path { fill: var(--gold); stroke-width: 1; }
.topstar.lit { animation: twinkle 1.8s ease-in-out infinite; }
.tree-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.countdown { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; }
.progress { height: 8px; border-radius: 99px; background: var(--pine-800); overflow: hidden; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--gold); width: 0; transition: width .8s ease; }

/* Meldingen-kaart */
.notify-card { margin: 14px 20px 0; padding: 16px; border-radius: 18px; background: var(--cream-2); color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.notify-card strong { font-family: var(--serif); font-size: 19px; }
.notify-card p { margin: 0; font-size: 14px; line-height: 1.5; color: #3E4A3F; }
.notify-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-gold { background: var(--gold); color: #2B1E06; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px #CDBE9C; }
.btn-block { width: 100%; min-height: 52px; }
.btn:disabled { opacity: .6; cursor: default; }

.toast { margin: 14px 24px 0; padding: 12px 16px; border-radius: 14px; background: var(--cream); color: var(--ink); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }

/* Deurtjes */
.grid { padding: 18px 20px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 80px; grid-auto-flow: dense; gap: 8px; }
.door {
  position: relative; border: 0; border-radius: 14px; padding: 10px 11px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  text-align: left; cursor: pointer; overflow: hidden;
  transition: transform .18s ease, filter .18s ease;
}
.door:active { transform: scale(.97); }
@media (hover: hover) { .door:hover { transform: translateY(-3px); filter: brightness(1.08); } }
.door.big { grid-column: span 2; grid-row: span 2; }
.door.wide { grid-column: span 2; }
.door.tall { grid-row: span 2; }
.door.locked { color: var(--cream); box-shadow: inset 0 0 0 1px rgba(246,238,220,.08); }
.door.locked.c0 { background: #1E4A3B; }
.door.locked.c1 { background: #8C2F2B; }
.door.locked.c2 { background: #22344F; }
.door.today { background: var(--gold); color: #2B1E06; animation: glow 2.2s ease-in-out infinite; }
.door.open { background: var(--cream-2); color: var(--ink); }
.door-num { font-family: var(--serif); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-size: 28px; }
.door.wide .door-num, .door.tall .door-num { font-size: 40px; }
.door.big .door-num { font-size: 76px; }
.door-foot { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 6px; }
.door-small { font-size: 11px; font-weight: 500; color: #E3D9C2; }
.door-cta { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #3A2A0C; }
.door-type { display: flex; align-items: center; gap: 6px; color: var(--cranberry); }
.door-type span { font-size: 11px; font-weight: 700; color: #6B5A3E; }
.door.today .star { animation: wiggle 1.6s ease-in-out infinite; }

.footer { margin-top: auto; padding: 28px 24px 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.footer-sign { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--gold); }
.footer-hint { font-size: 12px; color: var(--faint); }

/* Sneeuw */
.snow { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.flake { position: absolute; top: 0; border-radius: 50%; background: #fff; animation-name: fall; animation-timing-function: linear; animation-iteration-count: infinite; }

/* Cadeautje openen */
.backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(6,18,14,.82); overflow-y: auto; padding: calc(env(safe-area-inset-top) + 70px) 18px calc(env(safe-area-inset-bottom) + 30px); animation: fadeIn .25s ease-out; }
.sheet { max-width: 440px; margin: 0 auto; background: var(--pine-700); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: popIn .45s cubic-bezier(.2,.8,.2,1); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sheet-title { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; margin: 0; }
.close { flex: none; width: 44px; height: 44px; border-radius: 99px; border: 0; background: var(--pine-800); color: var(--cream); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.note { margin: 0; font-size: 15px; line-height: 1.55; color: var(--cream); white-space: pre-line; }

.polaroid { margin: 0; align-self: center; background: #FFFDF8; padding: 14px 14px 18px; border-radius: 4px; transform: rotate(-2deg); width: min(290px, 100%); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.polaroid img, .polaroid .ph { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #2A4A3E; }
.polaroid .ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.polaroid figcaption { margin-top: 12px; text-align: center; font-family: var(--serif); font-style: italic; font-size: 17px; color: #2B2418; }

.voucher { background: var(--cranberry); color: #FBF5E8; border-radius: 16px; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.voucher-top, .voucher-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.voucher-label { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.voucher-small { font-size: 13px; color: #F3D9CF; }
.voucher-title { font-family: var(--serif); font-size: 30px; font-weight: 800; line-height: 1.05; }
.voucher-line { border-top: 2px dashed #E08A7F; }
.redeemed { min-height: 52px; border-radius: 14px; background: var(--pine-800); font-size: 15px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 10px; animation: popIn .5s cubic-bezier(.2,.8,.2,1); }

.box-card { background: var(--pine-800); border-radius: 18px; padding: 22px; display: flex; gap: 18px; align-items: center; }
.box { flex: none; width: 92px; height: 92px; border-radius: 14px; background: var(--cranberry); position: relative; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -8px 0 rgba(0,0,0,.18); }
.box::before { content: ''; position: absolute; left: 41px; top: 0; bottom: 0; width: 10px; background: var(--gold); }
.box::after { content: ''; position: absolute; top: 41px; left: 0; right: 0; height: 10px; background: var(--gold); }
.box-num { position: relative; z-index: 1; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 99px; background: var(--cream); color: var(--ink); font-family: var(--serif); font-weight: 800; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.box-text { display: flex; flex-direction: column; gap: 6px; }
.box-text span:last-child { font-size: 15px; line-height: 1.5; }

/* Animaties */
@keyframes fall { 0% { transform: translate(0, -30px); } 25% { transform: translate(14px, 27vh); } 50% { transform: translate(-6px, 55vh); } 75% { transform: translate(12px, 82vh); } 100% { transform: translate(0, 110vh); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 2px #F6D58E, 0 0 22px rgba(232,182,90,.45); } 50% { box-shadow: 0 0 0 2px #F6D58E, 0 0 44px rgba(232,182,90,.85); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: translateY(40px) scale(.94); } 60% { opacity: 1; transform: translateY(-6px) scale(1.01); } 100% { transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes hang { 0% { opacity: 0; transform: translateY(-40px) scale(.4); } 55% { opacity: 1; transform: translateY(4px) scale(1.25); } 75% { transform: translateY(-2px) scale(.95); } 100% { transform: none; } }
@keyframes ballGlow { 0%, 100% { box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), 0 0 0 rgba(246,213,142,0); } 50% { box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), 0 0 14px rgba(246,213,142,.9); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

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

/* Hartjes */
.title-heart { display: inline-block; vertical-align: super; margin-left: 2px; animation: beat 1.6s ease-in-out infinite; transform-origin: 50% 60%; }
.footer-heart { vertical-align: -3px; margin-left: 4px; animation: beat 1.6s ease-in-out infinite; transform-origin: 50% 60%; }
.ball-heart { position: absolute; width: 15px; height: 15px; line-height: 0; filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.ball-heart.ball-new { animation: hang .9s cubic-bezier(.3,1.4,.5,1) both, heartGlow 2s ease-in-out .9s infinite; }
.flake.flake-heart { background: none; border-radius: 0; width: auto !important; height: auto !important; line-height: 0; }
.polaroid { position: relative; }
.polaroid .sticker { position: absolute; top: -10px; right: -8px; transform: rotate(14deg); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.voucher-label { display: inline-flex; align-items: center; gap: 6px; }
.box-heart { position: absolute; z-index: 1; top: 6px; right: 6px; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
@keyframes heartGlow { 0%, 100% { filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); } 50% { filter: drop-shadow(0 0 6px rgba(224,122,154,.9)); } }
