:root {
	color-scheme: dark;
	--ink: #f4f0e6;
	--muted: #a5afa4;
	--gold: #e8cb8b;
	--gold-bright: #ffe8a7;
	--line: rgba(238, 225, 190, .12);
	--serif: "Playfair Display", Georgia, serif;
	--sans: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: #111b18; }
body {
	min-height: 100vh;
	margin: 0;
	overflow-x: hidden;
	color: var(--ink);
	font-family: var(--sans);
	background: radial-gradient(ellipse at 52% 38%, rgba(66, 94, 69, .17), transparent 43%), radial-gradient(ellipse at 88% 4%, rgba(100, 77, 43, .1), transparent 31%), #111b18;
}
button, input, select { font: inherit; }
button { color: inherit; }

.snowfall {
	position: fixed; z-index: 0; inset: 0; pointer-events: none; opacity: .42;
	background-image: radial-gradient(1px 1px at 7% 16%, #fff 98%, transparent), radial-gradient(2px 2px at 17% 62%, #fff 98%, transparent), radial-gradient(1px 1px at 32% 25%, #fff 98%, transparent), radial-gradient(1.5px 1.5px at 44% 83%, #fff 98%, transparent), radial-gradient(1px 1px at 62% 12%, #fff 98%, transparent), radial-gradient(2px 2px at 74% 55%, #fff 98%, transparent), radial-gradient(1px 1px at 89% 31%, #fff 98%, transparent), radial-gradient(1px 1px at 94% 88%, #fff 98%, transparent);
	background-size: 380px 300px;
	animation: snow-drift 24s linear infinite;
}
.app-shell { position: relative; z-index: 1; width: min(1440px, 100%); margin: 0 auto; padding: 0 56px; }
.topbar { position: relative; isolation: isolate; min-height: 108px; display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid rgba(235, 228, 202, .1); }
.topbar::before { position: absolute; z-index: -1; inset: 8px 0; border-radius: 8px; background: url("strip.jpg") repeat center / 200px 240px; content: ""; }
.page-title { position: absolute; z-index: 1; top: 50%; left: 50%; width: max-content; max-width: calc(100% - 32px); margin: 0; padding: .12em .45em; border: 1px solid rgba(165, 191, 145, .3); border-radius: 8px; color: #fff; background: rgba(17, 27, 24, .96); box-shadow: 0 0 18px rgba(20, 70, 35, .55); font-family: "Mountains of Christmas", var(--serif); font-size: clamp(38px, 4.6vw, 60px); font-weight: 700; line-height: 1.1; letter-spacing: .01em; text-align: center; text-shadow: 0 1px 3px #12351b, 0 0 9px #1d6b32, 0 0 18px rgba(25, 91, 42, .95); transform: translate(-50%, -50%); }

.experience { min-height: calc(100vh - 158px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .48fr); align-items: center; gap: clamp(24px, 3vw, 48px); padding: 34px 0 38px; }
.tree-card { min-width: 0; }
.tree-stage { position: relative; width: min(100%, 600px); aspect-ratio: 7 / 8; margin: 0 auto; overflow: hidden; isolation: isolate; border: 1px solid rgba(235, 220, 176, .12); border-radius: 48% 48% 9px 9px / 34% 34% 9px 9px; background: radial-gradient(ellipse at 50% 53%, rgba(86, 119, 74, .22), transparent 45%), radial-gradient(ellipse at 50% 96%, rgba(6, 13, 11, .6), transparent 46%), linear-gradient(155deg, #1e3028, #18271f 52%, #111e1a); box-shadow: 0 24px 70px rgba(0, 0, 0, .24), inset 0 0 65px rgba(0, 0, 0, .18); }
.tree-stage::before { position: absolute; z-index: -1; inset: 0; content: ""; background: radial-gradient(ellipse at 50% 89%, rgba(239, 202, 127, .1), transparent 38%); pointer-events: none; }
.moon-glow { position: absolute; top: 11%; left: 50%; width: 40%; aspect-ratio: 1; border-radius: 50%; background: rgba(229, 219, 171, .035); filter: blur(28px); transform: translateX(-50%); }
.tree-art { position: absolute; inset: 2.5% 0 0; width: 100%; height: 97.5%; overflow: visible; }
.tree-topper { position: absolute; z-index: 3; top: calc(1.5% + 9px); left: calc(50% + 3px); width: 6.3%; height: auto; transform: translateX(-50%); pointer-events: none; }
.tree-snow circle { animation: snow-glint 3.3s ease-in-out infinite alternate; }
.tree-snow circle:nth-child(2n) { animation-delay: -1.5s; }
.garland-lights, .ornaments, .candles, .tree-sparkles { position: absolute; inset: 0; pointer-events: none; }
.garland-bulb { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--bulb-color, #ffe4a0); box-shadow: 0 0 6px 3px var(--bulb-glow, rgba(255, 222, 149, .9)), 0 0 19px 8px var(--bulb-glow, rgba(255, 222, 149, .5)); filter: brightness(1.35); transform: translate(-50%, -50%) scale(1.1); animation: bulb-flicker var(--flicker, 2s) ease-in-out var(--delay, 0s) infinite alternate; transition: opacity .35s, filter .35s, box-shadow .35s, transform .35s; }
.garland-bulb:nth-child(3n) { width: 5px; height: 5px; }
.tree-card.lights-off .garland-bulb { opacity: .025; box-shadow: none; filter: brightness(.45) saturate(.2); transform: translate(-50%, -50%) scale(.75); animation: none; }
.tree-card.candles-off .candles { visibility: hidden; }
.ornaments { pointer-events: none; }
.ornament { position: absolute; z-index: 2; display: grid; width: clamp(22px, 6.34vw, 38px); height: clamp(24px, 6.67vw, 40px); padding: 0; place-items: center; border: 0; background: transparent; cursor: pointer; pointer-events: auto; transform: translate(-50%, -50%); transition: filter .2s, transform .25s; }
.ornament:hover { z-index: 4; filter: drop-shadow(0 0 9px rgba(255, 224, 148, .7)); transform: translate(-50%, -57%) scale(1.15); }
.ornament img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .3)); }
.ornament.falling { pointer-events: none; animation: ornament-fall .55s cubic-bezier(.42, 0, .78, .4) forwards; }
.ornament.broken { z-index: 1; display: block; width: 48px; height: 32px; cursor: default; pointer-events: none; transform: translate(-50%, -50%); }
.ornament.broken img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.candle { position: absolute; z-index: 1; width: 21px; height: 60px; transform: translate(-50%, -50%); }
.candle-wax { position: absolute; right: 4px; bottom: 0; left: 4px; height: 42px; border: 1px solid rgba(255, 247, 222, .52); border-radius: 4px 4px 2px 2px; background: linear-gradient(90deg, #b9955c, #fff0c0 38%, #e4c983 70%, #ac824a); box-shadow: inset 0 5px 6px rgba(255, 255, 255, .52), 0 2px 5px rgba(0, 0, 0, .35); }
.candle-wax::after { position: absolute; top: -2px; left: 2px; width: 9px; height: 4px; border-radius: 50%; background: #fff3d4; content: ""; }
.wick { position: absolute; bottom: 40px; left: 50%; width: 2px; height: 8px; background: #35271b; transform: translateX(-50%); }
.flame { position: absolute; bottom: 47px; left: 50%; width: 12px; height: 20px; border-radius: 70% 30% 60% 40%; background: linear-gradient(155deg, #fff8d1 8%, #ffd975 44%, #ff9f3d 78%, rgba(255, 137, 45, .15)); box-shadow: 0 0 7px 3px rgba(255, 200, 91, .82), 0 0 22px 9px rgba(255, 171, 67, .32); transform: translateX(-50%) rotate(2deg); transform-origin: 50% 90%; animation: flame-flicker 1.75s ease-in-out infinite alternate; }
.candle:nth-child(2n) .flame { animation-delay: -.65s; animation-duration: 1.35s; }
.candle:nth-child(3n) .flame { animation-delay: -.3s; animation-duration: 2.1s; }
.tree-sparkles span { position: absolute; color: #ffefb8; text-shadow: 0 0 9px #ffe8a0; animation: sparkle 1.9s ease-in-out infinite; }
.scene-footer { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 10px; color: #a6b0a4; font-size: 10px; }
.scene-toggle { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 20px; color: #ded9c8; background: rgba(255, 255, 255, .035); font-size: 10px; cursor: pointer; }
.scene-toggle:hover { border-color: rgba(232, 203, 139, .4); }
.toggle-icon { color: var(--gold-bright); font-size: 13px; }
.lights-off #lightsToggle .toggle-icon, .candles-off #candlesToggle .toggle-icon { color: #778076; }

.controls-card { align-self: center; padding: 25px 22px 21px; border: 1px solid rgba(235, 225, 195, .13); border-radius: 10px; background: linear-gradient(145deg, rgba(34, 48, 40, .89), rgba(24, 37, 32, .89)); box-shadow: 0 18px 42px rgba(0, 0, 0, .15); }
.controls-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.controls-heading .eyebrow { margin-bottom: 8px; font-size: 9px; }
.controls-heading h2 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.25; }
.controls-icon { color: var(--gold); font-size: 22px; }
.control-group { margin: 0 0 23px; }
.range-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.range-heading label, .palette-group > label { color: #eee9dc; font-size: 12px; font-weight: 500; }
.range-heading output { display: grid; width: 31px; height: 28px; place-items: center; border: 1px solid rgba(233, 204, 142, .25); border-radius: 5px; color: var(--gold-bright); background: rgba(233, 204, 142, .08); font-size: 12px; }
input[type="range"] { display: block; width: 100%; height: 4px; margin: 0; border-radius: 10px; outline: none; background: linear-gradient(90deg, #c7a66d 0%, #c7a66d 50%, rgba(244, 238, 218, .16) 50%); appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; border: 3px solid #1b2a23; border-radius: 50%; background: #f1d89e; box-shadow: 0 0 0 1px #d4b577, 0 0 10px rgba(246, 216, 152, .28); appearance: none; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #1b2a23; border-radius: 50%; background: #f1d89e; box-shadow: 0 0 0 1px #d4b577, 0 0 10px rgba(246, 216, 152, .28); }
.range-labels { display: flex; justify-content: space-between; margin-top: 9px; color: #879387; font-size: 9px; }
.palette-group { margin-bottom: 21px; }
.select-wrap { position: relative; display: flex; align-items: center; height: 43px; margin-top: 10px; border: 1px solid rgba(232, 225, 206, .15); border-radius: 5px; background: rgba(10, 18, 15, .25); }
.palette-swatch { width: 17px; height: 17px; flex: 0 0 auto; margin-left: 12px; border-radius: 50%; background: linear-gradient(135deg, #cb3132 0 48%, #d7b568 50%); box-shadow: 0 0 8px rgba(224, 185, 112, .23); }
select { width: 100%; height: 100%; padding: 0 31px 0 10px; border: 0; outline: 0; color: #e9e5d9; background: transparent; appearance: none; font-size: 11px; cursor: pointer; }
select option { color: #f5f0e5; background: #1b2922; }
.select-chevron { position: absolute; right: 12px; top: 8px; color: #b6b4a4; font-size: 17px; pointer-events: none; }
.refresh-button { display: flex; width: 100%; min-height: 43px; align-items: center; justify-content: center; gap: 9px; border: 1px solid #e3c88f; border-radius: 5px; color: #1d2a22; background: linear-gradient(110deg, #e8d19e, #d4b678); font-size: 11px; font-weight: 700; cursor: pointer; transition: box-shadow .2s, transform .2s, filter .2s; }
.refresh-button:hover { filter: brightness(1.08); box-shadow: 0 5px 20px rgba(211, 174, 102, .2); transform: translateY(-1px); }
.refresh-button:active { transform: translateY(0); }
.refresh-button > span { font-size: 18px; }
.page-footer { position: relative; isolation: isolate; display: flex; min-height: 50px; align-items: center; justify-content: center; border-top: 1px solid rgba(235, 228, 202, .09); color: #fff; font-family: var(--sans); font-size: 14px; }
.page-footer > span { padding: 6px 12px; border: 1px solid rgba(165, 191, 145, .3); border-radius: 6px; background: rgba(17, 27, 24, .96); box-shadow: 0 0 14px rgba(20, 70, 35, .55); text-shadow: 0 1px 3px #12351b, 0 0 8px #1d6b32, 0 0 16px rgba(25, 91, 42, .95); }
.page-footer::before { position: absolute; z-index: -1; inset: 8px 0; border-radius: 8px; background: url("strip.jpg") repeat center / 200px 240px; content: ""; }
.ambience-on .tree-stage { box-shadow: 0 24px 70px rgba(0, 0, 0, .24), 0 0 50px rgba(233, 190, 109, .1), inset 0 0 65px rgba(0, 0, 0, .18); }
.ambience-on .tree-stage::before { background: radial-gradient(ellipse at 50% 89%, rgba(239, 202, 127, .19), transparent 43%); }
.ambience-on .tree-card:not(.lights-off) .tree-art { filter: drop-shadow(0 0 8px rgba(225, 192, 119, .09)); }

@keyframes bulb-flicker { from { opacity: .68; } to { opacity: 1; } }
@keyframes flame-flicker { 0% { opacity: .87; transform: translateX(-50%) rotate(-5deg) scale(.92, 1.03); } 50% { opacity: 1; transform: translateX(-48%) rotate(4deg) scale(1.08, .94); } 100% { opacity: .9; transform: translateX(-52%) rotate(-2deg) scale(.96, 1.08); } }
@keyframes ornament-fall { from { transform: translate(-50%, -50%); } to { transform: translate(-50%, calc(-50% + var(--fall-distance))); } }
@keyframes snow-glint { from { opacity: .38; } to { opacity: .95; } }
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(.5) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(30deg); } }
@keyframes snow-drift { from { background-position: 0 0; } to { background-position: 35px 300px; } }

@media (min-width: 1500px) { .app-shell { padding-right: 76px; padding-left: 76px; } }
@media (max-width: 1050px) { .app-shell { padding: 0 30px; } .experience { grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr); gap: 20px; } .controls-card { padding: 21px 17px 18px; } }
@media (max-width: 800px) {
	.app-shell { padding: 0 24px; }
	.topbar { min-height: 86px; }
	.page-title { width: calc(100% - 200px); font-size: clamp(30px, 5vw, 40px); }
	.experience { min-height: auto; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 28px 0 26px; }
	.tree-card { grid-column: 1; grid-row: 1; }
	.controls-card { grid-column: 1; grid-row: 2; width: 100%; max-width: 490px; justify-self: center; }
	.tree-stage { width: min(100%, 490px); }
	.scene-footer { flex-wrap: wrap; justify-content: center; padding: 5px 0; }
	.page-footer { min-height: 44px; }
}
@media (max-width: 560px) {
	.app-shell { padding: 0 17px; }
	.topbar { min-height: 78px; justify-content: flex-end; }
	.page-title { position: static; width: auto; max-width: 100%; margin-right: auto; padding: .12em .35em; font-size: clamp(20px, 5.6vw, 28px); text-align: left; transform: none; }
	.experience { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding-top: 22px; }
	.tree-card { width: 100%; }
	.tree-stage { width: min(100%, 420px); }
	.scene-footer { justify-content: center; gap: 8px; font-size: 9px; }
	.scene-toggle { padding: 7px 9px; font-size: 9px; }
	.controls-card { width: 100%; max-width: 420px; align-self: center; padding: 21px; }
	.controls-heading { margin-bottom: 21px; }
	.page-footer { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
