/* Not My Event: the look of "The Christmas House of Wonders" (public/templates/christmas-house-of-wonders.html), a snowy Victorian Christmas house that has been waiting for you.
   Evergreen #173F35, velvet red #8E2435, warm gold #C5A267, snow ivory #F2E9DA, walnut #473126. The drawings are /assets/house-art.js. Moving things use only transform and opacity. */
:root {
  --green: #173F35; --red: #8E2435; --gold: #C5A267; --goldL: #ecd9a6; --ivory: #F2E9DA; --walnut: #473126; --ink: #F2E9DA; --ink2: #d6c9b0;
  --accent: #C5A267; --accentInk: #1a120d; --btn: #8E2435; --tint: rgba(0, 0, 0, 0); --panel: rgba(16, 38, 32, .88); --line: rgba(197, 162, 103, .5);
  --serif: "Playfair Display", "Cormorant Garamond", Georgia, serif; --ui: "Lato", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
[data-theme="red"] { --btn: #a82c40; --panel: rgba(56, 14, 24, .9); --tint: rgba(142, 36, 53, .16); }
[data-theme="gold"] { --btn: #8a6f33; --panel: rgba(44, 32, 16, .9); --tint: rgba(197, 162, 103, .14); --accent: #ecd9a6; }
* { box-sizing: border-box; }
html, body { background: #08121a; color: var(--ink); }
body { margin: 0; font-family: var(--ui); font-size: 17px; line-height: 1.55; overflow-x: clip; -webkit-tap-highlight-color: transparent; }
body.modal { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.15; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.peek:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 6px; background: var(--accent); color: var(--accentInk); font-weight: 700; transition: top .15s; }
.skip:focus { top: 12px; }

/* ---------- the stage: the house, behind everything ---------- */
#stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #08121a; }
.world { position: absolute; inset: 0; overflow: hidden; transform-origin: 0 0; will-change: opacity; }
.world > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.grade { position: absolute; inset: 0; pointer-events: none; }
.g-warm { background: radial-gradient(120% 90% at 50% 55%, rgba(255, 200, 120, .06), rgba(4, 10, 16, .5) 100%); }
.g-tint { background: var(--tint); }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* things in the drawings that move */
.flm { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .9s ease-in-out infinite alternate; }
.flm.b { animation-duration: 1.3s; animation-delay: -.4s; } .flm.a { animation-duration: 1.1s; }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.93, 1.08) skewX(2deg); } 100% { transform: scale(1.05, .94) skewX(-2deg); } }
.glint { transform-box: fill-box; transform-origin: 50% 50%; animation: glint 2.6s ease-in-out infinite; }
@keyframes glint { 0%, 60%, 100% { opacity: 0; transform: scale(.4); } 75% { opacity: 1; transform: scale(1.2); } }
.stm { animation: stm 3.4s ease-out infinite; }
.stm.s1 { animation-delay: -1.1s; } .stm.s2 { animation-delay: -2.2s; }
@keyframes stm { 0% { opacity: .6; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-18px); } }
.hot { cursor: pointer; pointer-events: all; }
.hit { pointer-events: all; }
.win .lit { opacity: 0; transition: opacity 1.2s ease; }
.win.on .lit { opacity: 1; }
.lant { transform-box: fill-box; transform-origin: 50% 0; }
.lant.flick { animation: lflick .7s ease-in-out; }
@keyframes lflick { 0%, 100% { opacity: 1; } 20% { opacity: .35; } 40% { opacity: 1; } 60% { opacity: .5; } 80% { opacity: 1; } }
#hbell.ring { animation: bell 1s ease-out; }
@keyframes bell { 0% { transform: rotate(0); } 15% { transform: rotate(-9deg); } 35% { transform: rotate(8deg); } 55% { transform: rotate(-5deg); } 75% { transform: rotate(3deg); } 100% { transform: rotate(0); } }
#hdoor { transition: transform 1.4s cubic-bezier(.5, 0, .2, 1); }
#hlock { transition: opacity .6s; }
.unlocked #hlock { opacity: 1; }
.pend { transform-box: fill-box; transform-origin: 50% 0; animation: swing 2s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.gf { transform-box: fill-box; transform-origin: 50% 100%; animation: gfloat 4s ease-in-out infinite alternate; }
@keyframes gfloat { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-9px) rotate(2deg); } }
.gift.shake .gf { animation: gshake .5s ease-in-out 2; }
@keyframes gshake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.gift.gone { opacity: .62; }
.gift.gone .lid { transform: translateY(-14px) rotate(-8deg); transform-box: fill-box; }
.mote { animation: mote 9s ease-in-out infinite alternate; }
.mote.m1 { animation-duration: 12s; } .mote.m2 { animation-duration: 7s; } .mote.m3 { animation-duration: 10s; }
@keyframes mote { from { transform: translateY(0); opacity: .3; } to { transform: translateY(-26px); opacity: .9; } }
.gb { transform-box: fill-box; transform-origin: 50% 100%; animation: gb 3s ease-in-out infinite alternate; }
@keyframes gb { from { transform: translateX(-8px) rotate(-4deg); } to { transform: translateX(8px) rotate(4deg); } }
#pstar .stglow { transform-box: fill-box; transform-origin: 50% 50%; }
#pstar.on .stglow { opacity: 1; animation: stp 1.2s ease-in-out infinite alternate; }
@keyframes stp { from { transform: scale(.9); } to { transform: scale(1.4); } }
.gl { animation: gl 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
.gl.g1 { animation-delay: -.6s; } .gl.g2 { animation-delay: -1.2s; } .gl.g3 { animation-delay: -1.8s; }
@keyframes gl { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }
.glim .gl { animation-duration: .45s; }
#dchair { transition: transform 1.1s cubic-bezier(.5, 0, .2, 1); }
.chair-in #dchair { transform: translateX(130px); }
.chair-half #dchair { transform: translateX(65px); }
#dorn { transition: opacity 1s ease; }
.wish-on #dorn { opacity: 1; }
#dpc { transition: transform .9s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.card-up #dpc { transform: translateY(-10px); }
#dglow { transition: opacity 1.2s ease; opacity: .5; }
.glow-on #dglow { opacity: 1; }
/* the House's Christmas Spirit: what each tier changes (the page sets data-tier on the stage) */
#pfire { transform-origin: 1010px 640px; transition: transform .8s; }
[data-tier="2"] #pfire, [data-tier="3"] #pfire, [data-tier="4"] #pfire { transform: scale(1.12); }
#hsparkle .sp { opacity: 0; }
[data-tier="3"] #hsparkle .sp, [data-tier="4"] #hsparkle .sp, .sparkle-on #hsparkle .sp { animation: sp 1.8s ease-out infinite; }
#hsparkle .sp.s1 { animation-delay: -.45s; } #hsparkle .sp.s2 { animation-delay: -.9s; } #hsparkle .sp.s3 { animation-delay: -1.35s; }
@keyframes sp { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.lite .flm, .lite .gl, .lite .glint, .lite .pend, .lite .gf, .lite .gb, .lite .mote, .lite .stm { animation: none; }

/* ---------- the rooms of the house (hidden buttons for the keyboard; nothing is drawn on the screen) and the heads-up display ---------- */
#ribbon { position: fixed; z-index: 14; left: 8px; top: 84px; }
#ribbon .stops button:focus { position: static; width: auto; height: auto; margin: 0; padding: 6px 12px; clip: auto; overflow: visible; border-radius: 8px; background: rgba(10, 24, 20, .94); color: #f2e9da; font-size: 13px; }
.hud { position: fixed; z-index: 20; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 10px 30px; background: linear-gradient(rgba(8, 18, 26, .8), rgba(8, 18, 26, 0)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--goldL); text-shadow: 0 1px 6px rgba(0, 0, 0, .7); max-width: 34vw; line-height: 1.15; }
.hud-r { display: flex; gap: 6px; align-items: center; }
.hbtn { min-height: 44px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(12, 28, 24, .8); font-size: 13px; letter-spacing: .02em; }
.hbtn.solid { background: var(--btn); border-color: transparent; font-weight: 700; }
#spirit { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(12, 28, 24, .8); font-size: 12px; color: var(--goldL); }
#spirit i { width: 34px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
#spirit i b { display: block; height: 100%; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s ease; }
#prog { position: fixed; z-index: 21; left: 0; top: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, .1); }
#prog i { display: block; height: 100%; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; }
#cap { position: fixed; z-index: 18; left: 50%; top: 64px; transform: translateX(-50%); width: min(92vw, 540px); padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); text-align: center; pointer-events: none; }
#cap b { display: block; font: 700 12px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--goldL); }
#cap span { font-family: var(--serif); font-size: 18px; }
#cap.in { animation: capin .3s ease-out; }
@keyframes capin { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- the story: words over the house ---------- */
#story { position: relative; z-index: 2; pointer-events: none; }
.scene { position: relative; }
.beat { min-height: 100vh; min-height: 100svh; padding: 92px 18px 36px 36px; display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; max-width: 580px; margin: 0 auto; }
.beat.spacer { justify-content: flex-end; min-height: 80svh; padding-bottom: 60px; }
.beat > * { pointer-events: auto; }
.intro { display: grid; gap: 10px; padding: 18px 20px 20px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line); }
.kick { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--goldL); }
h1 { font-size: clamp(32px, 8vw, 50px); }
h2 { font-size: clamp(22px, 5.4vw, 32px); }
.lead { font-family: var(--serif); font-size: clamp(17px, 4.4vw, 21px); font-style: italic; color: var(--ink); }
.tagline { font-size: 14px; color: var(--ink2); }
.cue { align-self: center; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); padding: 10px 14px; border-radius: 999px; background: var(--panel); }
.btn { min-height: 48px; padding: 12px 22px; border: 0; border-radius: 999px; background: var(--btn); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.btn.ghost { background: rgba(12, 28, 24, .85); border: 1.5px solid var(--line); box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }
.linkish { align-self: flex-start; min-height: 44px; padding: 8px 4px; border: 0; background: none; color: var(--goldL); text-decoration: underline; text-underline-offset: 3px; }
.f-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(12, 28, 24, .88); font-size: 14px; }
.chip[aria-pressed="true"], .chip.done { border-color: var(--goldL); background: rgba(142, 36, 53, .62); }
.hint { font-size: 14px; color: var(--ink2); }
.card, .paper { padding: 18px; border-radius: 16px; background: rgba(12, 28, 24, .93); border: 1.5px solid var(--line); box-shadow: 0 12px 36px rgba(0, 0, 0, .45); }
.q-count { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--goldL); margin-bottom: 8px; }
.note { font-size: 14px; color: var(--ink2); }
.confirm { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(197, 162, 103, .18); font-family: var(--serif); font-style: italic; }
.react { min-height: 26px; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--goldL); }

/* the frosted pane where the guest writes a name */
.frost { position: relative; height: 170px; border-radius: 14px; overflow: hidden; border: 2px solid var(--ivory); background: radial-gradient(90% 90% at 50% 60%, #ffe7b0, #c98a3a 70%, #5a3418); touch-action: none; }
.frost canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.frost .fh { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 13px; color: #3a2a18; pointer-events: none; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.namerow { display: flex; gap: 8px; }
.namerow input { flex: 1; min-width: 0; }
#snowflake { position: fixed; z-index: 30; left: 0; top: 0; width: 18px; height: 18px; pointer-events: none; opacity: 0; transition: opacity .4s; font-size: 16px; line-height: 18px; text-align: center; color: #fff; }

/* the wishes, the gifts, the treat */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 46px; padding: 8px 14px; text-align: left; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .06); }
.opt[aria-pressed="true"], .opt.picked { border-color: var(--goldL); background: rgba(142, 36, 53, .62); }
.gifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.giftbtn { display: grid; place-items: center; gap: 4px; min-height: 92px; padding: 10px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .06); font-size: 13px; text-align: center; }
.giftbtn b { font-size: 32px; line-height: 1; }
.giftbtn[aria-pressed="true"] { border-color: var(--goldL); background: rgba(142, 36, 53, .62); }
.giftbtn:disabled { opacity: .55; cursor: default; }
.reveal { margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: #f4ead4; color: #3a2a18; font-family: var(--serif); font-style: italic; font-size: 18px; animation: unfold .6s cubic-bezier(.3, 1.1, .5, 1) both; transform-origin: 50% 0; }
@keyframes unfold { from { transform: scaleY(.1); opacity: 0; } }
.tb { display: grid; gap: 10px; }
.tb .row > p { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--goldL); margin-bottom: 4px; }
.treat { width: 150px; height: 130px; margin: 6px auto 0; display: block; }
.treat .p { opacity: 0; transform: translateY(-26px); transition: opacity .5s ease, transform .6s cubic-bezier(.3, 1.4, .5, 1); transform-box: fill-box; }
.treat.has-b .pb, .treat.has-t .pt, .treat.has-d .pd { opacity: 1; transform: none; }
.board { margin-top: 10px; padding: 12px; border-radius: 10px; background: #1d2a26; border: 4px solid var(--walnut); font-family: 'Snell Roundhand', 'Brush Script MT', 'Segoe Script', cursive; color: #f2e9da; }
.board:empty { display: none; }
.board div { font-size: 20px; animation: chalk .8s ease-out; }
@keyframes chalk { from { opacity: 0; transform: translateX(-10px); } }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
label, legend, .flabel { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--goldL); padding: 0; }
input[type="text"], textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .08); color: var(--ink); font: inherit; }
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(242, 233, 218, .45); }
.tick { display: flex; align-items: center; gap: 10px; min-height: 44px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }
.tick input { width: 22px; height: 22px; accent-color: var(--gold); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; flex: 1 1 140px; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .05); text-transform: none; letter-spacing: 0; font-size: 16px; text-align: center; color: var(--ink); }
.choice input:checked + span { border-color: var(--goldL); background: rgba(142, 36, 53, .72); font-weight: 700; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .08); font-size: 24px; }
.stepper output { min-width: 32px; text-align: center; font-size: 22px; font-weight: 700; }
.err { padding: 10px 14px; border-radius: 10px; background: rgba(200, 60, 60, .25); border: 1.5px solid #c85a5a; }
.result h3 { font-size: 24px; color: var(--goldL); margin-bottom: 8px; }
.f-rows { display: grid; gap: 8px; margin: 0; }
.f-rows > div { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
.f-rows dt { color: var(--goldL); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding-top: 4px; }
.f-rows dd { margin: 0; }
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 14px; background: rgba(4, 10, 14, .76); }
.sheet { position: relative; width: min(100%, 520px); max-height: 86svh; overflow: auto; padding: 22px 18px; border-radius: 20px; background: #10241f; border: 1.5px solid var(--line); }
.sheet h2 { margin-bottom: 12px; padding-right: 48px; }
.sheet .x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); font-size: 26px; line-height: 1; }
.final { text-align: center; justify-items: center; }
.final .lead { max-width: 30ch; }

@media (min-width: 900px) {
  .beat { margin-left: max(5vw, 56px); margin-right: auto; max-width: 480px; }
  .brand { font-size: 17px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
