/* de schouw - a night, a chimney, a warm fire. Minimal, with a hint of the holidays. */
:root {
  --night: #141a2e;
  --night-2: #1b2240;
  --wall: #2a2230;
  --paper: #fbf5e9;
  --paper-2: #f1e7d3;
  --ink: #1d1a2b;
  --ink-soft: #5b546a;
  --ember: #ff8a3d;
  --flame: #ffcf6b;
  --berry: #d94a4a;
  --holly: #3f7d5a;
  --gold: #e8c170;
  --line: rgba(251, 245, 233, .14);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(var(--night) 0, var(--night-2) 60%, var(--wall) 100%);
  color: var(--paper);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--flame); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.stage {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.title { text-align: center; margin-bottom: 18px; }
.title h1 {
  font: 400 44px/1 var(--serif);
  letter-spacing: .01em;
  margin: 0 0 8px;
}
.title h1::after {           /* a single star over the i - the holiday hint */
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 6px;
  vertical-align: super;
  background: var(--flame);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.title p { margin: 0; color: rgba(251, 245, 233, .72); }

/* --- the form ------------------------------------------------------------- */
.panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 26, 46, .6);
  backdrop-filter: blur(4px);
}
.pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint { color: rgba(251, 245, 233, .6); font-size: 14px; overflow-wrap: anywhere; }
.hint.chosen { color: var(--paper); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row label { color: rgba(251, 245, 233, .72); font-size: 14px; min-width: 70px; }
select, input[type=date], input[type=text], input[type=number], input[type=password], .linkrow input {
  font: inherit;
  color: var(--paper);
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
select:focus-visible, input:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 2px;
}
.msg { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--flame); }
.msg.err { color: #ff9b8f; }

.btn {
  font: 600 15px/1 var(--sans);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  color: var(--ink);
  background: var(--paper);
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-warm { background: linear-gradient(180deg, var(--flame), var(--ember)); }
.btn-ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.btn-small { padding: 8px 12px; font-size: 14px; }
.btn-danger { background: var(--berry); color: var(--paper); }
.closed-note { display: grid; gap: 2px; }
.closed-note span { color: rgba(251, 245, 233, .7); font-size: 14px; }

/* --- the scene ------------------------------------------------------------ */
.scene-wrap { position: relative; margin: 18px -16px 0; }
.scene { display: block; width: 100%; height: auto; margin: 0 auto; }
.scene-wrap.dragover .scene { filter: brightness(1.15); }
.drop-hint {
  position: absolute; left: 0; right: 0; top: 8px; margin: 0;
  text-align: center; font-size: 14px; color: var(--flame);
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.scene-wrap.dragover .drop-hint { opacity: 1; }
.scene-wrap.pickable .scene { cursor: pointer; }

.gift, .gift-perch { transform-box: view-box; }
.gift { transform: translateY(calc(var(--drop, 0) * 440px)); }
.gift-perch { opacity: 0; transition: opacity .3s; }
.has-file .gift-perch { opacity: 1; animation: bob 2.4s ease-in-out infinite; }
.dropping .gift-perch { opacity: 0; animation: none; }
.gift { opacity: 0; }
.dropping .gift { opacity: 1; transition: transform .35s linear; }
.landing .gift { opacity: 1; transform: translateY(520px); transition: transform .5s cubic-bezier(.55, 0, 1, .45); }
.landed .gift { opacity: 0; transform: translateY(540px); transition: opacity .2s; }
.stuck .gift {
  opacity: 1;
  animation: stuck .5s ease-in-out 2;
}
@keyframes bob { 50% { transform: translateY(-4px) rotate(-2deg); } }
@keyframes stuck { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

.flame { transform-box: fill-box; transform-origin: 50% 100%; }
.f-a { animation: flick 1.8s ease-in-out infinite; }
.f-b { animation: flick 1.3s ease-in-out infinite reverse; }
@keyframes flick { 50% { transform: scale(1.05, .92) skewX(2deg); } }
.landed .flame { animation: flare .9s ease-out 1, flick 1.6s ease-in-out .9s infinite; }
@keyframes flare { 30% { transform: scale(1.25, 1.45); } }
.glow { transition: opacity .6s; }
.cold .fire, .cold .glow { opacity: .12; }
.cold .flame { animation: none; }

.poof circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
.landed .poof circle { animation: poof .9s ease-out 1; }
.landed .poof circle:nth-child(2n) { animation-delay: .08s; }
@keyframes poof {
  0% { opacity: .9; transform: scale(.3) translateY(0); }
  100% { opacity: 0; transform: scale(2.2) translateY(-18px); }
}

.snow circle { animation: snow 9s linear infinite; }
.snow .f2 { animation-duration: 12s; animation-delay: -3s; }
.snow .f3 { animation-duration: 10s; animation-delay: -6s; }
.snow .f4 { animation-duration: 14s; animation-delay: -2s; }
.snow .f5 { animation-duration: 11s; animation-delay: -8s; }
.snow .f6 { animation-duration: 13s; animation-delay: -5s; }
@keyframes snow {
  0% { transform: translate(0, -10px); opacity: 0; }
  10% { opacity: .9; }
  100% { transform: translate(14px, 190px); opacity: 0; }
}

/* --- the card that falls out of the fireplace ----------------------------- */
.tray { overflow: hidden; margin: 0 -16px; padding: 0 16px 8px; }
.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  text-align: center;
}
.result { margin-top: -8px; transform-origin: 50% 0; }
.result.out { animation: slide-out .9s cubic-bezier(.2, .8, .25, 1.05) both; }
@keyframes slide-out {
  0% { transform: translateY(-110%) scale(.4) rotate(-3deg); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.eyebrow { margin: 0 0 12px; font: italic 15px var(--serif); color: var(--ink-soft); }
.qr {
  display: block; width: 200px; height: 200px; margin: 0 auto 12px;
  border-radius: 8px; image-rendering: pixelated;
}
.fname { font: 600 18px/1.3 var(--sans); margin: 0 0 4px; overflow-wrap: anywhere; }
.meta { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }
.linkrow { display: flex; gap: 8px; margin: 0 0 10px; }
.linkrow input { flex: 1; color: var(--ink); background: var(--paper-2); border-color: transparent; font-size: 14px; }
.card .btn { background: var(--ink); color: var(--paper); }
.card .btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(29, 26, 43, .2); }
.card .btn-warm { background: linear-gradient(180deg, var(--flame), var(--ember)); color: var(--ink); }
.del { text-align: left; margin: 10px 0 16px; font-size: 14px; color: var(--ink-soft); }
.del summary { cursor: pointer; color: var(--ink); }
.del p { margin: 8px 0; }

.small { margin-top: 22px; text-align: center; font-size: 13px; color: rgba(251, 245, 233, .5); }

/* --- the file page (one pakje on the hearth) ------------------------------ */
.mini { display: block; width: 160px; height: auto; margin: 0 auto -6px; }
.file-card .btn-warm { display: inline-block; text-decoration: none; padding: 14px 26px; font-size: 16px; }
.file-card .qr { width: 140px; height: 140px; margin-top: 18px; }
.warn { font-size: 13px; color: var(--ink-soft); margin: 14px 0 0; }

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