@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Playfair+Display:wght@600;700&display=swap');
:root { font-family: 'DM Sans',sans-serif; background:#f8f4eb; color:#20382e; }
* { box-sizing:border-box; } [hidden] { display:none!important; } body { margin:0; }
header { text-align:center; padding:36px 18px 44px; background:#173b32; color:#fff8e8; border-bottom:5px solid #c5a16a; }
header span { color:#dfbb80; font-size:30px; } header p { color:#e2ebdf; margin:14px 0 0; }
h1,h2 { margin:0; font-family:'Playfair Display',Georgia,serif; overflow-wrap:anywhere; }
h1 { font-size:clamp(2.35rem,7vw,4.7rem); letter-spacing:-.045em; }
main { width:min(940px,100% - 36px); margin:auto; padding:24px 0 52px; }
#status:empty,#error:empty { display:none; } #error { color:#922a28; }
.actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; } #tools { margin-bottom:20px; }
#list { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr)); gap:18px; }
article { background:#fffdf7; border:1px solid #e5dccb; border-radius:16px; overflow:hidden; display:flex; flex-direction:column; }
article img { width:100%; height:195px; object-fit:contain; background:#f0eadc; }
.details { padding:19px; display:flex; flex-direction:column; gap:12px; flex:1; }
.details p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; } .details .actions { margin-top:auto; }
button,a { display:inline-block; border:1px solid transparent; background:#244e40; color:#fff; border-radius:8px; padding:9px 13px; font:inherit; font-weight:700; cursor:pointer; text-decoration:none; }
.secondary { color:#26483c; background:#f3eddf; border-color:#dfd5c1; } button:disabled { opacity:.55; cursor:wait; }
:focus-visible { outline:3px solid #b47738; outline-offset:3px; }
dialog { width:min(500px,100% - 32px); border:1px solid #ded0b7; border-radius:16px; padding:24px; color:inherit; background:#fffdf7; } dialog::backdrop { background:#112a23b5; }
label { display:grid; gap:5px; margin:14px 0; font-weight:700; }
input:not([type=checkbox]),textarea { width:100%; min-width:0; padding:9px; border:1px solid #cfc5b2; border-radius:7px; font:inherit; color:inherit; background:#fff; }
#unlock { max-width:380px; }

#add-menu { position:relative; }
#add-menu summary { list-style:none; background:#244e40; color:white; border-radius:8px; padding:12px 16px; font-weight:700; cursor:pointer; }
#add-menu summary::-webkit-details-marker { display:none; }
#add-menu summary::after { content:' ▾'; margin-left:8px; }
.choices { position:absolute; z-index:2; top:calc(100% + 5px); left:0; min-width:100%; display:grid; padding:5px; border:1px solid #dfd5c1; border-radius:8px; background:#fffdf7; box-shadow:0 8px 20px #173b3220; }
.choices button { background:transparent; color:#26483c; text-align:left; white-space:nowrap; }
.choices button:hover,.choices button:focus-visible { background:#f3eddf; }
#my-list { margin-bottom:14px; }
header p:empty { display:none; }

main { width:calc(100% - 36px); }
#list { display:block; border-top:1px solid #e5dccb; }
#list:empty { border-top:0; }
#list article { flex-direction:row; align-items:center; gap:18px; padding:16px 4px; border:0; border-bottom:1px solid #e5dccb; border-radius:0; background:transparent; }
#list article img { width:clamp(64px, 18vw, 110px); height:clamp(64px, 18vw, 110px); flex:none; border-radius:8px; background:#fffdf7; }
#list .details { padding:0; min-width:0; }

.details .product-source { color:#5e6c62; font-size:.875rem; margin-top:-7px; }

.gallery { display:none; flex-wrap:wrap; gap:6px; max-width:48%; }
.gallery.has-photos { display:flex; }
#list article .thumbnail { padding:0; background:transparent; border:0; cursor:zoom-in; line-height:0; }
#list article .thumbnail img { width:clamp(52px, 11vw, 105px); height:clamp(52px, 11vw, 105px); }
#viewer { width:max-content; max-width:calc(100% - 24px); padding:12px; }
#viewer img { display:block; max-width:100%; max-height:78vh; object-fit:contain; margin-top:10px; }

/* Large, readable controls for family visitors. */
body { font-size:18px; line-height:1.5; }
button, a, summary { min-height:48px; }
.welcome { max-width:680px; padding-top:36px; text-align:center; }
.welcome > p { font-size:22px; }
.welcome nav { display:grid; gap:24px; margin:30px 0; }
.welcome-button { display:flex; align-items:center; justify-content:center; min-height:88px; padding:20px; font-size:clamp(22px,4vw,28px); line-height:1.4; }
.welcome .editor-hint { font-size:18px; }
#unlock { margin:24px auto; max-width:440px; }
#unlock button { width:100%; }

/* Home-only snowfall: small transform animations, no scripts or image downloads. */
.home { min-height:100vh; background:#e4ede5; position:relative; isolation:isolate; }
.home header, .home main { position:relative; z-index:1; }
.home header { background:#173b32ed; }
.home .welcome > p { position:relative; background:#e4ede5ee; border-radius:12px; padding:8px; }
.snowfall { position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
.snowfall i { position:absolute; left:var(--x); top:-12px; width:var(--size); height:var(--size); border-radius:50%; background:#fff; opacity:.85; animation:snow-fall var(--duration) var(--delay) linear infinite; }
@keyframes snow-fall { from { transform:translate3d(-6px,-12px,0); } to { transform:translate3d(var(--drift),calc(100vh + 24px),0); } }
@media (max-width:600px) { .snowfall i:nth-child(n+61) { display:none; } }

/* Christmas evening, warm lights, and a deeper field of snow. */
.home { background:radial-gradient(ellipse at 50% 20%,#285846 0%,#163e33 58%,#102f29 100%); color:#fff8e8; }
.home header { background:transparent; border-bottom:0; padding:68px 18px 20px; }
.home h1 { max-width:900px; margin:auto; font-size:clamp(2.5rem,8vw,4.7rem); text-shadow:0 3px 12px #09261b80; }
.home header .season-greeting { margin:6px 0 14px; color:#efd2a1; font-size:18px; font-weight:700; letter-spacing:.15em; text-transform:uppercase; }
.home .welcome { padding-top:8px; padding-bottom:100px; }
.home .welcome > p { background:transparent; }
.home .welcome nav { margin:24px 0; }
.home .welcome-button { background:#a32f3c; border:2px solid #e6b97a; box-shadow:0 5px 18px #071d2140; border-radius:16px; }
.home .welcome-button:hover { background:#85232e; }
.home .welcome-button.secondary { background:#fff8e8; color:#20382e; border-color:#e6d6b7; }
.home .welcome-button.secondary:hover { background:#f0e4ca; }
.home .editor-hint { color:#e5ede4; }
.christmas-lights { position:absolute; top:0; left:0; width:100%; height:50px; display:flex; justify-content:space-around; border-top:3px solid #091f19; pointer-events:none; }
.christmas-lights i { --bulb:#ff6b68; position:relative; display:block; flex:none; width:12px; height:23px; margin-top:9px; border-radius:45% 45% 50% 50%; background:var(--bulb); box-shadow:0 0 10px 3px var(--bulb); transform:rotate(9deg); }
.christmas-lights i::before { content:''; position:absolute; top:-10px; left:3px; width:6px; height:12px; border-radius:2px; background:#112a20; }
.christmas-lights i:nth-child(4n+2) { --bulb:#ffdd85; margin-top:16px; transform:rotate(-8deg); }
.christmas-lights i:nth-child(4n+3) { --bulb:#80dba0; }
.christmas-lights i:nth-child(4n) { --bulb:#8ecdf8; margin-top:16px; transform:rotate(-8deg); }
.snowdrifts { position:fixed; bottom:0; left:0; width:100%; height:65px; z-index:0; pointer-events:none; background:#edf5ef; border-radius:70% 45% 0 0 / 80% 70% 0 0; box-shadow:0 -10px 0 #d7e8df70; }
@media (max-width:600px) {
 .christmas-lights i:nth-child(n+15) { display:none; }
 .home header { padding-top:64px; }
 .home .welcome nav { gap:20px; }
 .snowdrifts { height:38px; }
}

.christmas-opening { position:fixed; inset:0; width:100%; max-width:none; height:100%; max-height:none; margin:0; border:0; border-radius:0; padding:24px; background:radial-gradient(ellipse at center,#316350,#0d2c25 75%); color:#fff8e8; overflow:hidden; }
.christmas-opening[open] { display:grid; place-items:center; }
.opening-copy { position:relative; z-index:1; text-align:center; animation:opening-reveal 1.2s ease-out both; }
.opening-copy h2 { font-size:clamp(2.8rem,12vw,6rem); line-height:1.12; color:#fff8e8; font-family:Georgia,'Times New Roman',serif; font-weight:400; letter-spacing:-.025em; text-shadow:none; }
.opening-copy p { font-size:clamp(1.25rem,5vw,2rem); margin:20px 0; animation:opening-reveal 1s .5s ease-out both; }
.opening-star { display:block; color:#f2cb83; font-size:44px; margin-bottom:16px; }
.opening-snow { position:absolute; inset:-20%; pointer-events:none; }
.opening-snow i { position:absolute; top:-20px; left:var(--x); width:var(--size); height:var(--size); border-radius:50%; background:white; opacity:.8; animation:blizzard var(--duration) var(--delay) linear infinite; }
.opening-skip { position:absolute; z-index:2; bottom:max(24px,env(safe-area-inset-bottom)); right:24px; min-height:48px; background:#fff8e8; color:#20382e; }
.christmas-opening.leaving { animation:opening-exit .5s ease-in forwards; pointer-events:none; }
@keyframes blizzard { from { transform:translate3d(-2vw,-5vh,0); } to { transform:translate3d(3vw,145vh,0); } }
@keyframes opening-reveal { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes opening-exit { to { opacity:0; } }
@media (max-width:600px) { .opening-snow i:nth-child(n+65) { display:none; } }
@media (prefers-reduced-motion:reduce) { .opening-copy,.opening-copy p,.opening-snow i,.christmas-opening.leaving { animation:none; } }
@media (prefers-reduced-motion:reduce) { .snowfall { display:none; } }

#purchases { margin-top:36px; padding:22px; border:1px solid #d7cbb7; border-radius:14px; background:#fffdf7; }
.purchase-receipt { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; border-top:1px solid #e5dccb; }
.purchase-receipt p { margin:0; overflow-wrap:anywhere; flex:1 1 220px; }
