@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');
:root {
  --paper:#33252d; --ink:#ffe9c1; --red:#ffba89; --muted:#dec1a7;
}
body {
  background-color:var(--paper);
  background-image:radial-gradient(ellipse at 70% 10%,#664039 0,transparent 60%),radial-gradient(#f9c89118 1px,transparent 1px);
  background-size:auto,8px 8px;
}
header, footer { max-width:1440px; margin:auto; }
header { padding-block:22px; border-bottom:1px solid #ffdbba30; }
.brand { font:600 17px 'Noto Serif SC',serif; }
.brand span { color:var(--muted); }
.sound { border-radius:0; border-color:#ffdbba55; }
.scene { max-width:1330px; padding-block:46px 64px; }
.opening { display:grid; grid-template-columns:minmax(250px,.75fr) minmax(0,1.65fr); align-items:center; gap:clamp(22px,4vw,70px); text-align:left; min-height:min(640px,67svh); }
.door-note h1 { font-size:clamp(37px,4.8vw,73px); letter-spacing:0; }
.door-note .primary { margin-left:0; }
.eyebrow { color:#f7c99a; font-size:14px; }
.primary { color:#37262c; background:#f3bd72; box-shadow:0 5px 0 #a6654b; border:2px solid #ffe3a6; border-radius:0; font-weight:700; }
.primary:hover { background:#ffd694; }
.room-frame { position:relative; background:#2a1c25; border:5px solid #a9785c; box-shadow:0 0 0 3px #50333a,10px 12px 0 #211921; }
#room { display:block; width:100%; height:auto; image-rendering:pixelated; }
.room-caption { padding:9px 14px; color:#f6dcb4; min-height:44px; font-size:14px; }
.hotspot { position:absolute; border:1px solid #f9cb8f; background:#3a2936; color:#ffe7b0; padding:3px 8px; font-size:13px; }
.hotspot.cats { left:44%; top:66%; }
.hotspot.bunny { left:20%; top:40%; }
.welcome { display:grid; grid-template-columns:minmax(180px,290px) minmax(0,350px); align-items:center; justify-content:center; gap:55px; }
.portrait { transform:rotate(-4deg); color:#513136; background:#f9e8c6; padding:10px 10px 18px; box-shadow:10px 10px #251b24; }
.portrait img { display:block; width:100%; max-height:54svh; object-fit:contain; background:#d9b88f; }
.portrait span { display:block; padding-top:12px; }
.hand,.small,.textbutton { color:#f5cfac; }
.album { position:relative; padding-top:19px; }
.album::before { content:''; position:absolute; left:8%; right:8%; top:0; height:16px; background:radial-gradient(circle,#ffd07d 3px,transparent 6px) 0 0 / 36px 16px repeat-x; border-top:1px solid #ab7654; }
.album .hand:empty { display:none; }
.polaroid,.wish-card { color:#442e35; box-shadow:5px 7px #221920; }
.polaroid:before { content:''; position:absolute; top:-8px; left:45%; width:10%; height:16px; background:#ba895b; }
.card-art { color:#824c45; height:78px; margin:8px 0 15px; font-size:40px; line-height:65px; width:110px; background:#b97652; border:6px solid #6e4842; box-shadow:inset 0 6px #e1a96d,0 6px #4f3440; }
.wish-card:nth-child(2) .card-art { background:#8ca484; box-shadow:inset 0 6px #c3c69a,0 6px #4f3440; }
.wish-card:nth-child(3) .card-art { background:#c48083; box-shadow:inset 0 6px #edaba3,0 6px #4f3440; }
.envelope,article { box-shadow:8px 10px #221920; }
article,dialog { color:#51333b; }
article h2,.letter-ending { color:#8b4046; }
.letter-date,.photo-controls button { color:#634750; }
.final-photos { display:flex; flex-wrap:wrap; justify-content:center; gap:14px; margin:32px auto; max-width:930px; }
.final-photos img { width:clamp(100px,15vw,165px); aspect-ratio:3/4; object-fit:contain; padding:5px; background:#f5dfb3; box-shadow:4px 5px #211921; }
.final-photos img:nth-child(odd) { transform:rotate(-4deg); }
.final-photos img:nth-child(even) { transform:rotate(4deg); }
.final-wish { color:#ffdab3; font:600 clamp(20px,4vw,29px)/1.7 'Noto Serif SC',serif; }
footer { color:#d8bda8; border-color:#ffdbba30; }
nav .current { background:#ffba89; }
@media(max-width:720px) {
  .scene { padding-block:25px 42px; }
  .opening { display:flex; flex-direction:column; gap:26px; text-align:center; min-height:0; }
  .door-note .primary { margin-inline:auto; }
  .room-frame { width:100%; }
  .door-note h1 { margin-block:12px; }
  .door-note .intro { margin-block:12px; }
  .welcome { grid-template-columns:1fr; gap:20px; }
  .portrait { max-width:200px; margin:auto; }
}
@media(max-width:400px) { .hotspot { font-size:12px; padding:1px 4px; } }
#cardPreview { text-align:center; }
#cardPreview img { display:block; max-width:100%; max-height:64svh; margin:auto; }
#cardPreview .primary { text-decoration:none; margin-top:12px; padding:7px 20px; }
#cardPreview p { margin:12px 0 0; font-size:14px; }
.dialog-close { position:absolute; right:10px; top:2px; border:0; background:none; color:#51333b; font-size:29px; }
.parcel { max-width:680px; min-height:58svh; display:grid; align-content:center; }
.parcel-actions { min-height:78px; }
.parcel .intro { min-height:2.4em; }
.room-egg { position:absolute; border:0; background:transparent; width:12%; height:19%; }
.room-egg:hover { background:#ffde8525; outline:2px dashed #ffdd9199; }
.lamp-egg { left:4%; top:28%; }
.window-egg { right:19%; top:12%; width:28%; height:31%; }
.cocoa-egg { left:69%; top:48%; }
#nightReply:empty { display:none; }
:root { --soft-edge:18px; }
.primary,.sound { border-radius:999px; }
.room-frame,article,dialog,.photo-controls button { border-radius:var(--soft-edge); }
.room-frame { overflow:hidden; }
.portrait,.polaroid,.wish-card,.envelope,.final-photos img { border-radius:12px; }
.hotspot { border-radius:8px; }
.parcel-props { position:relative; width:min(280px,90%); margin:10px auto 0; }
.parcel-actions { position:relative; height:185px; width:190px; margin:auto; }
.box-base,.box-top,.ribbon-pull,.parcel-photo { position:absolute; }
.box-base { left:8px; right:8px; bottom:9px; height:92px; background:#a85653; border-radius:10px 10px 16px 16px; box-shadow:inset -12px 0 #874845; pointer-events:none; }
.box-top { left:0; right:0; bottom:89px; height:28px; background:#c77a69; border:0; border-radius:10px; z-index:2; transition:transform .4s; }
.box-top:disabled { cursor:default; }
[data-box="open"] .box-top { transform:translate(58px,-44px) rotate(18deg); }
.ribbon-pull { z-index:3; width:32px; height:117px; left:calc(50% - 16px); bottom:9px; background:#eec386; border:0; border-radius:6px; }
.ribbon-pull::before { content:''; position:absolute; bottom:100%; left:-18px; width:60px; height:21px; border:5px solid #eec386; border-radius:50%; }
.parcel-photo { width:68px; height:88px; object-fit:cover; bottom:88px; left:58px; border:5px solid #fff0cd; border-radius:5px; transform:rotate(-8deg); animation:enter .35s ease both; }
.parcel-cat { position:absolute; bottom:12px; left:0; background:#cb814a; width:50px; height:25px; border-radius:22px 15px 10px 12px; z-index:4; animation:cat-approach .55s ease-out both; }
.parcel-cat i { position:absolute; height:20px; width:23px; border-radius:8px; right:-5px; top:-7px; background:#d58f54; }
.parcel-cat i::before { content:''; position:absolute; top:-4px; left:3px; width:6px; height:7px; background:#d58f54; box-shadow:11px 0 #d58f54; }
.parcel-cat i::after { content:''; position:absolute; left:6px; top:9px; width:3px; height:2px; background:#583529; box-shadow:9px 0 #583529; }
@keyframes cat-approach { from { transform:translateX(-25px); opacity:0; } }
#sleepingCat { position:relative; margin:16px auto; width:92px; height:42px; background:#a85653; border-radius:8px; }
#sleepingCat .parcel-cat { left:15px; bottom:15px; }
#room { transition:filter .4s; }
.lamp-dim #room { filter:brightness(.72); }
.paw-print,.cocoa-steam,.lulu-sprint { display:none; pointer-events:none; }
.egg-snow .paw-print,.egg-cocoa .cocoa-steam { display:block; position:absolute; color:#ffdfae; }
.paw-print { right:31%; top:24%; }
.cocoa-steam { left:74%; top:48%; font-size:25px; animation:steam 1.8s ease-in-out infinite; }
@keyframes steam { to { transform:translateY(-11px); opacity:.25; } }
.cake.out ~ .lulu-sprint { display:block; animation:cat-approach .6s ease-out; }
body {
  background-color:#392632;
  background-image:radial-gradient(ellipse at 76% 20%,#98595066,transparent 48%),
    radial-gradient(ellipse at 11% 79%,#b16d405c,transparent 52%),
    radial-gradient(ellipse at 98% 100%,#62567660,transparent 52%),
    radial-gradient(#fac99139 1px,transparent 1.5px);
  background-size:auto,auto,auto,18px 18px;
}
.scene h1 { font-family:'Ma Shan Zheng','Kaiti SC',KaiTi,serif; font-weight:400; letter-spacing:0; }
.door-note h1 { font-size:clamp(40px,4.3vw,70px); }
.opening { grid-template-columns:minmax(225px,.62fr) minmax(0,2fr); gap:clamp(20px,3vw,44px); }
.room-frame { border-color:#e7b984; box-shadow:0 0 0 3px #814b51,0 14px 34px #22172099; }
.room-caption { background:#422d37; }
.parcel-props { width:min(320px,95%); }
.parcel-actions { width:204px; height:250px; }
.box-base {
  isolation:isolate; bottom:16px;
  background:repeating-linear-gradient(135deg,#9b4849 0 13px,#b75c56 13px 25px);
  box-shadow:inset -12px 0 #6d35383d,0 8px 0 #281b29;
}
.gift-tag { position:absolute; right:13px; top:36px; padding:3px 10px; border-radius:10px; background:#ffe4a5; color:#743c43; transform:rotate(-9deg); font-size:14px; }
.box-top { bottom:96px; background:#db8473; box-shadow:inset 0 4px #ffc1a58c; }
.ribbon-pull { bottom:16px; animation:ribbon-nudge 2.4s ease-in-out infinite; }
@keyframes ribbon-nudge { 15%,35% { transform:rotate(3deg) } 25% { transform:rotate(-3deg) } }
.parcel-photo { z-index:5; width:106px; height:132px; object-fit:contain; background:#fff0cd; left:49px; bottom:119px; transform:rotate(-7deg); animation:photo-pop .6s cubic-bezier(.16,.72,.34,1.24) both; box-shadow:0 6px 18px #22172080; }
@keyframes photo-pop { from { transform:translateY(76px) scale(.52) rotate(0); opacity:0; } }
[data-box="open"] .box-top { transform:translate(70px,7px) rotate(19deg) scale(.83); }
.gift-sparks { display:none; position:absolute; z-index:6; inset:0; color:#ffd392; pointer-events:none; text-align:left; font-size:26px; }
.gift-sparks b { position:absolute; right:0; top:20px; color:#ffb5b9; }
.gift-sparks i { position:absolute; right:1px; top:66px; font-size:16px; }
[data-box="open"] .gift-sparks { display:block; animation:gift-sparks .8s ease-out both; }
@keyframes gift-sparks { from { opacity:0; transform:scale(.35) } 40% { opacity:1 } to { opacity:0; transform:scale(1.22) } }
.polaroid { padding-bottom:18px; }
@media(max-width:720px) {
  .opening { gap:18px; }
  .room-frame { order:-1; }
  .door-note h1 { font-size:clamp(34px,8vw,50px); }
  .opening .eyebrow { margin:0; }
  .door-note .primary { margin-top:15px; }
}
