:root {
  --pine: #0E3B2E;
  --pine-deep: #082A20;
  --pine-soft: #1B5A46;
  --cream: #F5ECD7;
  --cream-deep: #E9DCBD;
  --snow: #FFFDF7;
  --holly: #B8202F;
  --holly-deep: #8E1622;
  --gold: #D4A84B;
  --gold-light: #F3D98A;
  --ink: #241D16;
  --ink-soft: #5B4F42;
  --display: 'Young Serif', Georgia, serif;
  --body: 'Figtree', system-ui, sans-serif;
  --hand: 'Caveat', cursive;
  --radius-tile: 14px;
  --radius-btn: 999px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  color: var(--snow);
  background: var(--pine-deep);
  background-image: radial-gradient(120% 80% at 50% 0%, var(--pine-soft) 0%, var(--pine) 45%, var(--pine-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.has-scene::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: url('/img/bg/welcome-landscape.jpg') center / cover no-repeat;
  opacity: .75;
}
@media (orientation: portrait) { body.has-scene::before { background-image: url('/img/bg/welcome-portrait.jpg'); } }
body.has-scene.xmas::before { background-image: url('/img/bg/xmas-landscape.jpg'); }
@media (orientation: portrait) { body.has-scene.xmas::before { background-image: url('/img/bg/xmas-portrait.jpg'); } }
body.has-scene.dim::before { opacity: .3; filter: blur(5px) saturate(.85); }
button { font: inherit; color: inherit; }
a { color: var(--gold-light); }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px 72px; }
.site-foot { position: relative; z-index: 1; text-align: center; padding: 0 16px 24px; }
.giver-link { color: rgba(255, 253, 247, .32); font-size: 12px; text-decoration: none; }
.giver-link:hover { color: rgba(255, 253, 247, .7); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; text-decoration: none;
  padding: 12px 22px; border-radius: var(--radius-btn);
  font-weight: 700; font-size: 16px; letter-spacing: .01em;
  background: var(--holly); color: var(--snow);
  box-shadow: 0 2px 0 var(--holly-deep), 0 6px 16px rgba(0, 0, 0, .25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--holly-deep), 0 2px 6px rgba(0, 0, 0, .25); }
.btn.gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--ink); box-shadow: 0 2px 0 #9C7A2C, 0 6px 16px rgba(0, 0, 0, .25); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 253, 247, .4); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-grid; place-items: center;
  background: rgba(255, 253, 247, .12); color: var(--snow);
}
.icon-btn:hover { background: rgba(255, 253, 247, .2); }
.icon-btn svg { width: 22px; height: 22px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 0 auto; }
.topbar .spacer { flex: 1; }

/* Welcome */
.welcome { max-width: 760px; margin: 0 auto; text-align: center; padding: 6vh 16px 28px; border-radius: 40px; background: radial-gradient(closest-side, rgba(6,24,40,.62), rgba(6,24,40,.35) 70%, transparent); }
.welcome .hello { font-family: var(--display); font-size: clamp(48px, 11vw, 104px); line-height: 1; margin: 0; color: var(--snow); text-shadow: 0 4px 30px rgba(0, 0, 0, .35); }
.welcome .sub { font-family: var(--display); font-size: clamp(22px, 4.6vw, 36px); line-height: 1.2; margin: 12px 0 0; color: var(--gold-light); }
.welcome .lede { text-shadow: 0 2px 10px rgba(0,0,0,.6); font-size: 18px; line-height: 1.55; max-width: 34ch; margin: 28px auto 0; color: rgba(255, 253, 247, .88); }
.welcome .lede strong { color: var(--snow); font-weight: 700; }
.countdown { display: flex; justify-content: center; gap: clamp(8px, 2.5vw, 18px); margin: 32px 0 0; }
.countdown .unit {
  min-width: clamp(68px, 18vw, 110px); padding: 14px 6px 10px; border-radius: 12px;
  background: var(--cream); color: var(--ink);
  box-shadow: inset 0 -4px 0 var(--cream-deep), 0 10px 30px rgba(0, 0, 0, .3);
}
.countdown .num { font-family: var(--display); font-size: clamp(34px, 9vw, 60px); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown .lab { font-size: 13px; color: var(--ink-soft); margin-top: 6px; font-weight: 600; }
.welcome .more { margin-top: 32px; }

/* Calendar */
.cal-head { max-width: 1100px; margin: 8px auto 20px; text-align: center; }
.cal-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 6vw, 48px); line-height: 1.1; margin: 0; }
.cal-head p { margin: 8px 0 0; color: rgba(255, 253, 247, .8); font-size: 16px; }
.cal-head .next { color: var(--gold-light); font-variant-numeric: tabular-nums; font-weight: 600; }

.grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}
@media (min-width: 900px) { .grid { grid-template-columns: repeat(5, 1fr); gap: 16px; } .grid .tile.final { grid-column: 4 / span 2; grid-row: 2 / span 2; } }

.tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-tile); overflow: hidden;
  background: var(--cream); color: var(--ink); border: 0; padding: 0; text-align: center;
  box-shadow: inset 0 -5px 0 var(--cream-deep), 0 10px 24px rgba(0, 0, 0, .28);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.tile .when { font-weight: 700; font-size: clamp(13px, 3.3vw, 16px); line-height: 1.2; }
.tile .time { font-size: clamp(11px, 2.8vw, 13px); color: var(--ink-soft); margin-top: 2px; }
.tile .cd { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--holly); font-size: clamp(12px, 3vw, 15px); margin-top: 6px; }
.tile .glyph { width: 42%; height: auto; margin-bottom: 6px; }
.tile.locked { background: #2A4A3F; color: rgba(255, 253, 247, .62); box-shadow: inset 0 0 0 1px rgba(255, 253, 247, .08); }
.tile.locked { cursor: pointer; }
.tile.locked.rattle { animation: rattle .45s ease; }
@keyframes rattle { 15% { transform: translateX(-4px) rotate(-1.5deg); } 35% { transform: translateX(4px) rotate(1.5deg); } 55% { transform: translateX(-3px) rotate(-1deg); } 75% { transform: translateX(2px); } }
.tile.locked .time { color: rgba(255, 253, 247, .5); }
.tile.locked .glyph { opacity: .45; width: 30%; }
.tile.locked.next { box-shadow: inset 0 0 0 2px rgba(243, 217, 138, .45); }
.tile.locked.next .cd { color: var(--gold-light); }
.tile.available { cursor: pointer; background: var(--snow); box-shadow: inset 0 -5px 0 var(--cream-deep), 0 0 0 3px var(--gold), 0 14px 30px rgba(0, 0, 0, .35); }
.tile.available .glyph { width: 40%; animation: bob 2.6s ease-in-out infinite; }
.tile.available .solve { margin-top: 8px; padding: 7px 12px; font-size: clamp(12px, 3vw, 14px); }
.tile.available:hover { transform: translateY(-3px); }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
.tile.solved { cursor: pointer; }
.tile .foil-thumb { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .foil-label .tap { display: block; width: max-content; margin: 0 auto 6px; padding: 4px 12px; border-radius: 999px; background: var(--holly); color: var(--snow); text-shadow: none; font-size: 1.05em; box-shadow: 0 2px 0 var(--holly-deep); animation: tapPulse 1.8s ease-in-out infinite; }
@keyframes tapPulse { 50% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .tile .foil-label .tap { animation: none; } }
.tile .foil-label { position: relative; z-index: 2; color: #5A4210; font-weight: 700; font-size: clamp(12px, 3vw, 15px); line-height: 1.25; padding: 0 8px; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.tile.revealed .char { width: 54%; aspect-ratio: 1; object-fit: contain; margin-top: 12px; }
.tile.revealed .code { display: flex; gap: 4px; margin-top: 4px; }
.tile.revealed .code span { font-family: var(--display); font-size: clamp(14px, 4vw, 22px); background: var(--pine); color: var(--snow); border-radius: 6px; width: 1.4em; line-height: 1.5; }
.tile .daylab { position: absolute; top: 8px; left: 10px; font-size: 12px; font-weight: 700; opacity: .55; }
.tile.flash { animation: flash 1s ease 2; }
@keyframes flash { 50% { transform: scale(1.04); } }

.tile.final { grid-column: 2 / span 2; grid-row: 4 / span 2; aspect-ratio: 1; background: linear-gradient(160deg, #F7E3A6, var(--gold) 55%, #B98C30); color: var(--ink); box-shadow: inset 0 -6px 0 #A57E2D, 0 14px 30px rgba(0, 0, 0, .35); justify-content: flex-start; padding: 12px; }
.tile.final .ftitle { font-family: var(--display); font-size: clamp(16px, 3.8vw, 24px); margin-top: 2px; }
.tile.final .fsub { font-size: clamp(12px, 3vw, 14px); color: #4A3A18; margin-top: 2px; }
.tile.final .board { width: 100%; flex: 1; min-height: 0; display: grid; place-items: center; margin-top: 8px; }
.tile.final .board canvas { max-width: 100%; max-height: 100%; }
.tile.final .factions { margin-top: 8px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tile.final.revealed .reveal-row { display: flex; align-items: center; gap: 12px; justify-content: center; }
.tile.final.revealed .char { width: 38%; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: rgba(4, 20, 15, .78); backdrop-filter: blur(4px);
  padding: 16px; animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0; } }

/* Scroll */
/* Parchment: fixed aspect so the rolled ends never stretch; text sits inside the gold frame */
.scroll {
  --w: min(560px, calc(100vw - 32px));
  position: relative; width: var(--w);
  height: min(calc(100dvh - 32px), calc(var(--w) * 1.6));
  border-style: solid;
  border-width: calc(var(--w) * 140 / 900) calc(var(--w) * 128 / 900) calc(var(--w) * 128 / 900) calc(var(--w) * 150 / 900);
  border-image: url('/img/scroll.webp') 140 128 128 150 fill stretch;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.5));
  animation: unroll .7s cubic-bezier(.2, .9, .3, 1.1); transform-origin: top center;
  container-type: inline-size;
}
.scroll .frame { height: 100%; display: flex; flex-direction: column; padding: 2px 6px 12px 4px; }
@keyframes unroll { from { transform: scaleY(.08); opacity: .4; } }
.scroll .paper {
  flex: 1; min-height: 0; overflow-y: auto; color: var(--ink);
  scrollbar-width: none; -webkit-mask-image: linear-gradient(180deg, #000 88%, transparent); mask-image: linear-gradient(180deg, #000 88%, transparent);
  padding-bottom: 18px;
}
.scroll .paper::-webkit-scrollbar { display: none; }
.scroll h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 7cqi, 30px); line-height: 1.15; margin: 0 0 10px; color: var(--holly-deep); }
.scroll p { font-size: clamp(14.5px, 4.2cqi, 16.5px); line-height: 1.55; margin: 0 0 10px; }
.scroll .sign { font-family: var(--hand); font-size: clamp(22px, 5.6cqi, 30px); color: var(--holly-deep); margin: 6px 0 0; line-height: 1.1; }
.scroll .fc { float: right; width: 22cqi; max-width: 92px; margin: 0 0 6px 10px; }
.scroll .controls { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 10px; border-top: 1px dashed rgba(90, 60, 20, .35); }
.scroll .controls .btn { padding: 8px 16px; font-size: 15px; white-space: nowrap; flex: none; }
.scroll label { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font-size: clamp(13px, 3.8cqi, 15px); cursor: pointer; color: var(--ink); }
.scroll input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--holly); }

/* Scratch */
.scratch-wrap { width: min(440px, 100%); text-align: center; }
.scratch-wrap h2 { font-family: var(--display); font-weight: 400; margin: 0 0 6px; font-size: 28px; }
.scratch-wrap .hint { margin: 0 0 16px; color: rgba(255, 253, 247, .8); }
.scratch-card { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: var(--snow); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); touch-action: none; user-select: none; -webkit-user-select: none; }
.scratch-card .under { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 50% 40%, var(--snow), var(--cream)); }
.scratch-card .under img { width: 62%; aspect-ratio: 1; object-fit: contain; }
.scratch-card .under .cname { font-family: var(--display); font-size: 24px; margin-top: 4px; }
.scratch-card .under .code { display: flex; gap: 10px; margin-top: 10px; }
.scratch-card .under .code span { font-family: var(--display); font-size: 40px; width: 58px; line-height: 64px; border-radius: 10px; background: var(--pine); color: var(--snow); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3); }
.scratch-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; transition: opacity .6s ease; }
.scratch-card canvas.gone { opacity: 0; pointer-events: none; }
.scratch-after { margin-top: 18px; min-height: 52px; }
.scratch-after p { margin: 0 0 12px; color: rgba(255, 253, 247, .9); }

/* Celebration */
.celebrate { text-align: center; position: relative; z-index: 2; }
.celebrate .big { font-family: var(--display); font-size: clamp(56px, 16vw, 120px); line-height: 1; color: var(--gold-light); text-shadow: 0 6px 0 rgba(0, 0, 0, .25); animation: pop .7s cubic-bezier(.2, 1.6, .4, 1); }
.celebrate p { font-size: 20px; margin: 16px 0 0; }
.celebrate .tick { width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%; background: var(--snow); display: grid; place-items: center; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.celebrate .tick svg { width: 56px; height: 56px; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 160; }

/* Puzzle page */
.puzzle-page { max-width: 640px; margin: 0 auto; }
.pz-banner { height: 120px; border-radius: 18px; margin: 12px 0 0; background: linear-gradient(180deg, rgba(8, 42, 32, 0), rgba(8, 42, 32, .7)), url('/img/bg/puzzle-banner.jpg') center / cover, linear-gradient(160deg, #24563F, #0E3B2E); display: flex; align-items: flex-end; padding: 14px 18px; }
.pz-banner h1 { font-family: var(--display); font-weight: 400; margin: 0; font-size: clamp(26px, 6vw, 36px); line-height: 1.1; }
.pz-banner .door { display: block; font-family: var(--body); font-size: 14px; font-weight: 600; color: var(--gold-light); margin-bottom: 4px; }
.pz-card { background: var(--snow); color: var(--ink); border-radius: 18px; padding: 18px; margin-top: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.pz-howto { margin: 0 0 14px; font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); }
.pz-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.pz-msg { min-height: 24px; text-align: center; font-weight: 600; margin-top: 10px; color: var(--holly); }
.pz-msg.good { color: var(--pine); }
.pz-hintbox { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #FFF4D6; color: #5A4210; font-size: 15px; }
.pz-assist { margin-top: 14px; text-align: center; font-size: 14px; color: var(--ink-soft); }

/* Shared puzzle grid styles */
.pgrid { display: grid; margin: 0 auto; user-select: none; -webkit-user-select: none; touch-action: none; width: 100%; max-width: 420px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.pcell { position: relative; display: grid; place-items: center; font-family: var(--display); font-size: clamp(18px, 5.5vw, 28px); cursor: pointer; border: 0; padding: 0; background: #fff; color: var(--ink); }

.testbar { position: sticky; top: 0; z-index: 100; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 12px; background: #FFE082; color: #3B2F00; font-size: 14px; font-weight: 600; }
.testbar .tb-label { font-weight: 800; }
.testbar .spacer { flex: 1; }
.testbar input, .testbar select, .testbar button, .testbar a { font: inherit; color: #3B2F00; height: 32px; padding: 0 10px; border: 1px solid #7a6618; background: #fff7d1; border-radius: 6px; }
.testbar select { cursor: pointer; }
.testbar select option { color: #3B2F00; background: #fff7d1; }
.testbar select option:disabled { color: #a99a6a; }
.testbar button, .testbar a { cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.testbar .tb-group { display: inline-flex; }
.testbar .tb-group > * { border-radius: 0; margin-left: -1px; }
.testbar .tb-group > :first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.testbar .tb-group > :last-child { border-radius: 0 6px 6px 0; }
.testbar .tb-go { background: #3B2F00; color: #FFE082; border-color: #3B2F00; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 180; background: var(--snow); color: var(--ink); padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-weight: 600; max-width: calc(100% - 32px); }

.fly-piece { position: fixed; z-index: 170; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.fly-dim { position: fixed; inset: 0; z-index: 169; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 42%, rgba(8, 20, 16, .25), rgba(8, 20, 16, .6)); }
.fly-card { position: fixed; left: 50%; transform: translateX(-50%); z-index: 171; width: min(360px, calc(100vw - 32px)); padding: 20px 20px 22px; text-align: center; background: var(--cream); color: var(--ink); border-radius: 18px; box-shadow: 0 0 0 3px var(--gold), 0 18px 40px rgba(0, 0, 0, .45); opacity: 0; }
.fly-card h2 { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.15; margin: 0 0 6px; color: var(--holly-deep); }
.fly-card p { margin: 0 0 16px; color: var(--ink-soft); line-height: 1.4; }

.video-wrap { width: min(720px, 100%); text-align: center; }
.video-wrap video, .video-wrap iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: #000; }
.envelope { width: min(320px, 80vw); aspect-ratio: 3 / 2; margin: 0 auto; position: relative; background: #F3E6C4; border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); cursor: pointer; border: 0; overflow: hidden; }
.envelope::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 60%; background: #E6D3A6; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.envelope .seal { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: var(--holly); color: var(--snow); display: grid; place-items: center; font-family: var(--display); font-size: 26px; box-shadow: 0 4px 0 var(--holly-deep); }

.done-banner { max-width: 760px; margin: 0 auto 20px; text-align: center; padding: 18px; border-radius: 18px; background: rgba(255, 253, 247, .08); }
.done-banner h2 { font-family: var(--display); font-weight: 400; margin: 0; font-size: clamp(28px, 6vw, 44px); color: var(--gold-light); }
.done-banner p { margin: 8px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.pz-card { color-scheme: light; }
.pz-card input { background: #fff; color: var(--ink); }
.tile.final.revealed .char { width: 24%; margin: 0; }
.tile.final.revealed .reveal-row { margin-top: 6px; }

.sleigh { position: fixed; top: 2vh; left: 0; width: min(40vw, 360px); z-index: 0; pointer-events: none; animation: sleigh 7s cubic-bezier(.4,.1,.6,.9) forwards; }
@keyframes sleigh { 0% { transform: translate(-50vw, 6vh) rotate(-4deg); opacity: 0; } 8% { opacity: 1; } 50% { transform: translate(40vw, -2vh) rotate(-1deg); } 92% { opacity: 1; } 100% { transform: translate(115vw, -8vh) rotate(-5deg); opacity: 0; } }
.tile.revealed .char, .scratch-card .under img { filter: drop-shadow(0 4px 8px rgba(0,0,0,.18)); }
.scratch-card .under img.pop { animation: charpop .7s cubic-bezier(.2,1.5,.4,1); }
@keyframes charpop { from { transform: scale(.6) rotate(-8deg); } }

/* Final door: the present */
.tile.final { background: radial-gradient(circle at 50% 35%, #1F6B52, var(--pine) 60%, var(--pine-deep)); color: var(--snow); box-shadow: inset 0 0 0 3px var(--gold), 0 14px 30px rgba(0,0,0,.35); justify-content: center; }
.tile.final .fsub { color: rgba(255,253,247,.82); }
.tile.final .ftitle { color: var(--gold-light); }
.tile.final.solved, .tile.final.revealed { background: linear-gradient(160deg, #F7E3A6, var(--gold) 55%, #B98C30); color: var(--ink); }
.tile.final.solved .ftitle, .tile.final.revealed .ftitle { color: var(--ink); }
.tile.final .gift { width: 62%; max-width: 260px; margin: 4px auto 0; }
.tile.final .fcount { font-weight: 700; font-size: clamp(12px, 3vw, 15px); color: var(--gold-light); margin-top: 2px; }
.tile.final .fcount.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.tile.final.available .gift { animation: giftglow 2.4s ease-in-out infinite; }
@keyframes giftglow { 50% { filter: drop-shadow(0 0 18px rgba(243,217,138,.8)); transform: translateY(-4px); } }
.present svg { width: 100%; height: auto; overflow: visible; display: block; }
.present .lid { transform-box: fill-box; transform-origin: 10% 100%; transition: transform .45s cubic-bezier(.3,1.5,.5,1); }
.present.open .lid { transform: translate(-4px, -30px) rotate(-24deg); }
.present.burst .lid { transform: translate(-30px, -80px) rotate(-60deg); transition-duration: .5s; }
.present.wiggle svg { animation: wiggle .6s ease; transform-origin: 50% 95%; }
@keyframes wiggle { 20% { transform: rotate(-5deg); } 45% { transform: rotate(4deg); } 70% { transform: rotate(-2deg); } }

/* Full jigsaw on Christmas morning */
.jg-overlay { position: fixed; inset: 0; z-index: 150; background: radial-gradient(120% 90% at 50% 20%, #1B5A46, #082A20 70%); overflow: hidden; touch-action: none; animation: fadein .3s ease; }
.jg-head { position: absolute; left: 0; right: 0; top: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; }
.jg-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 4.6vw, 26px); margin: 0; line-height: 1.1; }
.jg-progress { font-size: 13px; color: var(--gold-light); font-weight: 600; }
.jg-btns { display: flex; gap: 8px; flex: none; }
.jg-board { position: absolute; border-radius: 6px; box-shadow: 0 0 0 2px rgba(243,217,138,.5), 0 10px 30px rgba(0,0,0,.4); background: rgba(0,0,0,.18); }
.jg-board.done { animation: boardglow 1.4s ease; }
@keyframes boardglow { 40% { box-shadow: 0 0 0 4px #F3D98A, 0 0 60px rgba(243,217,138,.9); } }
.jg-piece { position: absolute; cursor: grab; touch-action: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.jg-piece.dragging { cursor: grabbing; filter: drop-shadow(0 12px 16px rgba(0,0,0,.6)); }
.jg-piece.placed { filter: none; }

/* Looking back at a solved puzzle */
.pz-review { pointer-events: none; }
.pz-reward { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; background: var(--cream); }
.pz-reward img { width: 76px; height: 76px; object-fit: contain; }
.pz-reward-name { font-family: var(--display); font-size: 20px; }
.pz-reward-code { display: flex; gap: 6px; margin-top: 6px; }
.pz-reward-code span { font-family: var(--display); font-size: 24px; width: 1.5em; line-height: 1.6; text-align: center; border-radius: 8px; background: var(--pine); color: var(--snow); }
.pz-review .pad, .pz-review .wd-keys, .pz-review .pp-tray, .pz-review .pp-tools, .pz-review .pn-form, .pz-review .cn-bar, .pz-review .cn-left { display: none !important; }

/* ---------- Platform: 25-door grid and giver rewards ---------- */
.grid.n25 { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid.n25 .tile.final { grid-column: 3 / span 2; grid-row: 6 / span 2; }
@media (min-width: 900px) {
  .grid.n25 { grid-template-columns: repeat(7, 1fr); gap: 14px; }
  .grid.n25 .tile.final { grid-column: 6 / span 2; grid-row: 3 / span 2; }
}
.grid.n25 .tile .when { font-size: clamp(11px, 2.8vw, 15px); }
.grid.n25 .tile.available .solve { padding: 6px 8px; font-size: clamp(11px, 2.6vw, 13px); }
.grid.n25 .tile .foil-label { font-size: clamp(10px, 2.5vw, 14px); }
.tile.revealed .rphoto { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.tile.revealed.has-photo .daylab, .tile.revealed.has-photo .rlabel { position: absolute; z-index: 1; background: rgba(14, 59, 46, .82); color: var(--snow); border-radius: 999px; padding: 2px 8px; opacity: 1; }
.tile.revealed .rlabel { font-weight: 700; font-size: clamp(11px, 2.8vw, 14px); margin-top: 4px; }
.tile.revealed.has-photo .rlabel { bottom: 8px; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap; }
.tile.revealed { overflow: hidden; }
.scratch-card .under.photo { padding: 0; background: var(--pine-deep, #0A2C22); }
.scratch-card .under.photo img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; filter: none; }
.scratch-after .reward-text { background: var(--snow); color: var(--ink); border-radius: 16px; padding: 14px 18px; margin: 14px auto 6px; max-width: 520px; font-size: 18px; line-height: 1.45; text-align: left; white-space: pre-line; }
.pz-reward.stack { flex-direction: column; align-items: stretch; text-align: left; }
.pz-reward .pz-reward-photo { width: 100%; height: auto; max-height: 360px; object-fit: cover; border-radius: 12px; }
.pz-reward-text { margin: 6px 0 0; font-size: 17px; line-height: 1.45; white-space: pre-line; }
.paper p.letter { white-space: pre-line; }

/* ---------- Platform: install card, vouchers ---------- */
.install-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: rgba(255, 253, 247, .95); color: var(--ink); border-radius: 16px; padding: 12px 14px; margin: 0 auto 16px; max-width: 560px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); text-align: left; }
.install-card .ic-text { display: grid; gap: 2px; font-size: 15px; flex: 1 1 220px; }
.install-card .ic-btns { display: flex; gap: 8px; }
.install-card .btn.ghost { color: var(--pine); box-shadow: inset 0 0 0 2px var(--pine); }
.steps-card { background: var(--snow); color: var(--ink); border-radius: 22px; padding: 22px; max-width: 420px; width: calc(100% - 32px); }
.steps-card h2 { font-family: var(--display); font-weight: 400; margin: 0 0 12px; }
.steps-card ol { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.steps-card li { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; line-height: 1.4; }
.steps-card .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pine); color: var(--snow); display: grid; place-items: center; font-weight: 700; }
.icon-btn[data-on="1"] { color: var(--gold-light, #F3D98A); }
.scratch-card .under.voucher-art { background: radial-gradient(circle at 50% 40%, var(--snow), var(--cream)); padding: 18px; }
.scratch-card .under.voucher-art img { object-fit: contain; }
.voucher { background: var(--snow); color: var(--ink); border-radius: 16px; padding: 14px 18px; margin: 14px auto 6px; max-width: 520px; display: grid; gap: 10px; text-align: left; }
.voucher .v-title { font-family: var(--display); font-size: 22px; }
.voucher .v-code { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.voucher .v-code code { font-size: 20px; font-weight: 700; letter-spacing: .06em; background: var(--cream); border-radius: 10px; padding: 8px 12px; user-select: all; -webkit-user-select: all; word-break: break-all; }
.voucher .v-exp { font-size: 14px; color: var(--ink-soft, #6B5F52); }
.voucher .v-how { margin: 0; white-space: pre-line; }
.voucher a.btn { text-decoration: none; justify-self: start; }
.pz-reward .voucher { margin: 0; padding: 0; background: none; }

/* One-day surprise: just the present, centred */
.grid.single { grid-template-columns: 1fr !important; max-width: 520px; margin: 0 auto; }
.grid.single .tile.final { grid-column: 1 !important; grid-row: 1 !important; }
.site-foot .giver-link + .giver-link { margin-left: 14px; }
/* Landing-page demo bar */
.testbar.demobar { background: var(--pine, #0E3B2E); color: #F5ECD7; font-weight: 500; justify-content: space-between; }
.demobar .db-text { flex: 1 1 260px; line-height: 1.35; }
.demobar .db-text strong { color: #D4A84B; }
.demobar .db-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.demobar button, .demobar a { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(245,236,215,.5); background: transparent; color: #F5ECD7; font-weight: 700; }
.demobar a.db-buy { background: #B8202F; border-color: #B8202F; color: #fff; }
.tile.revealed .rphoto.rvoucher { object-fit: contain; padding: 22% 8% 26%; background: var(--cream, #F5ECD7); }
