/* ===== Premium Cinematic Redesign ===== */
:root {
	--color-bg-start: #0a0a0f;
	--color-bg-warm: #1a1520;
	--color-gold: #d4a853;
	--color-gold-light: #f0d48a;
	--color-text-light: rgba(255, 255, 255, 0.85);
	--color-text-muted: rgba(255, 255, 255, 0.55);
	--color-card-bg: rgba(255, 255, 255, 0.04);
	--color-border-subtle: rgba(255, 255, 255, 0.08);
	--font-display: 'Georgia', 'Times New Roman', serif;
	--font-body: 'Signika', 'Helvetica Neue', sans-serif;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	height: 100%;
}

body {
	background: radial-gradient(ellipse at 50% 0%, #1a1525 0%, #0a0a0f 60%, #050508 100%);
	background-attachment: fixed;
	color: var(--color-text-light);
	font-family: var(--font-body);
	overflow-x: hidden;
	min-height: 100vh;
}

/* Subtle ambient grain overlay */
body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/><feComponentTransfer><feFuncA type="linear" slope="0.04"/></feComponentTransfer></filter><rect width="100%" height="100%" filter="url(%23n)"/></svg>');
	opacity: 0.4;
	z-index: 99998;
}

/* Warm ambient glow behind content */
body::after {
	content: '';
	position: fixed;
	top: 20%;
	left: 50%;
	transform: translateX(-50%);
	width: 80vmax;
	height: 60vmax;
	background: radial-gradient(circle, rgba(212, 168, 83, 0.08) 0%, rgba(212, 168, 83, 0.02) 40%, transparent 70%);
	pointer-events: none;
	z-index: -1;
}

.container {
	display: none;
	position: relative;
	z-index: 10;
	max-width: 720px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Warm ambient pulse when lights are on */
body.peach {
	background: radial-gradient(ellipse at 50% 30%, #2a1f2a 0%, #120d14 50%, #08060a 100%);
	background-attachment: fixed;
	transition: background 4s ease;
}

/* Subtle warm glow breathing when music plays */
body.peach-after {
	animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
	0%, 100% {
		background: radial-gradient(ellipse at 50% 30%, #2a1f2a 0%, #120d14 50%, #08060a 100%);
	}
	50% {
		background: radial-gradient(ellipse at 50% 30%, #3a2a32 0%, #181218 50%, #0a080e 100%);
	}
}


.bulb {
	width: 56px;
	height: 56px;
	margin: auto;
	background-repeat: no-repeat no-repeat;
	background-position: center;
	background-size: contain;
	transition: transform 0.4s ease, opacity 0.4s ease;
	filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
}

.bulb-holder {
	height: 90px;
}

/* Elegant reveal animation for bulbs */
.bulb-glow-yellow {
	background-image: url('bulb_yellow.png');
	animation: bulbReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bulb-glow-red {
	background-image: url('bulb_red.png');
	animation: bulbReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bulb-glow-blue {
	background-image: url('bulb_blue.png');
	animation: bulbReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bulb-glow-green {
	background-image: url('bulb_green.png');
	animation: bulbReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bulb-glow-pink {
	background-image: url('bulb_pink.png');
	animation: bulbReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bulb-glow-orange {
	background-image: url('bulb_orange.png');
	animation: bulbReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bulbReveal {
	0% {
		opacity: 0;
		transform: scale(0.6) rotate(-15deg);
		filter: drop-shadow(0 0 2px rgba(0,0,0,0.9));
	}
	60% {
		transform: scale(1.1) rotate(3deg);
	}
	100% {
		opacity: 1;
		transform: scale(1) rotate(0deg);
		filter: drop-shadow(0 0 10px rgba(255, 230, 180, 0.5));
	}
}

/* Pulsing glow after music plays */
.bulb-glow-yellow-after {
	background-image: url('bulb_yellow.png');
	animation: bulbPulse 1.4s ease-in-out infinite;
}

.bulb-glow-red-after {
	background-image: url('bulb_red.png');
	animation: bulbPulse 1.6s ease-in-out infinite;
}

.bulb-glow-blue-after {
	background-image: url('bulb_blue.png');
	animation: bulbPulse 1.8s ease-in-out infinite;
}

.bulb-glow-green-after {
	background-image: url('bulb_green.png');
	animation: bulbPulse 2.0s ease-in-out infinite;
}

.bulb-glow-pink-after {
	background-image: url('bulb_pink.png');
	animation: bulbPulse 2.2s ease-in-out infinite;
}

.bulb-glow-orange-after {
	background-image: url('bulb_orange.png');
	animation: bulbPulse 2.4s ease-in-out infinite;
}

@keyframes bulbPulse {
	0%, 100% {
		transform: scale(1);
		filter: drop-shadow(0 0 8px rgba(255, 230, 180, 0.4));
	}
	50% {
		transform: scale(1.08);
		filter: drop-shadow(0 0 18px rgba(255, 230, 180, 0.8));
	}
}
audio {
	display: none;
}

/* ===== Banner ===== */
.bannar {
	max-width: 100%;
	max-height: 220px;
	object-fit: contain;
	transform: translateY(-120%) scale(0.92);
	opacity: 0;
	transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
	            opacity 0.6s ease;
	filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
}

.bannar-come {
	animation: bannerEnter 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bannerEnter {
	0% {
		transform: translateY(-120%) scale(0.92) rotate(-3deg);
		opacity: 0;
		filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
	}
	40% {
		transform: translateY(8%) scale(1.02) rotate(1.5deg);
		opacity: 1;
	}
	70% {
		transform: translateY(-4%) scale(0.99) rotate(-0.5deg);
	}
	100% {
		transform: translateY(0) scale(1) rotate(0deg);
		opacity: 1;
		filter: drop-shadow(0 25px 50px rgba(212, 168, 83, 0.25));
	}
}

/* ===== Stage layout ===== */
.banner-row {
	margin-top: 9vh;
}

.banner-row .bannar {
	border-radius: 10px;
}

/* ===== 3D canvas scene ===== */
#scene {
	position: fixed;
	inset: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
}

/* ===== Control panel ===== */
.control-panel {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 16px 20px 22px;
	background: linear-gradient(to top, rgba(10, 10, 15, 0.92) 0%, rgba(10, 10, 15, 0.45) 70%, transparent 100%);
	z-index: 1000;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.control-panel .btn-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	max-width: 880px;
	margin: 0 auto;
}

#play, #bannar_coming, #balloons_flying, #cake_fadein, #light_candle, #wish_message, #story {
	display: none;
}

/* ===== Cake ===== */
.cake-cover {
	position: relative;
	margin-top: 36px;
	min-height: 250px;
}

.cake {
	filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
}

/* ===== Message ===== */
.message {
	margin-top: 60px;
	padding-bottom: 170px;
	display: none;
}

.message p {
	font-family: var(--font-display);
	font-size: 26px;
	font-weight: 400;
	color: var(--color-text-light);
	text-transform: none;
	display: none;
	text-shadow: 0 1px 3px rgba(0,0,0,0.6);
	line-height: 1.7;
	letter-spacing: 0.5px;
	font-style: italic;
}

.message p:nth-child(1) {
	font-size: 32px;
	font-weight: 700;
	color: var(--color-gold-light);
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 4px;
	font-style: normal;
}

.message p:nth-child(2) {
	font-size: 24px;
	color: var(--color-text-muted);
	font-style: normal;
}

/* ===== Buttons ( premium ) ===== */
.btn-primary {
	border: 1px solid rgba(212, 168, 83, 0.5);
	padding: 10px 18px;
	text-transform: uppercase;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 1.5px;
	color: var(--color-gold-light);
	background: linear-gradient(135deg, rgba(212, 168, 83, 0.15) 0%, rgba(212, 168, 83, 0.05) 100%);
	border-radius: 2px;
	transition: all 0.3s ease;
	margin: 3px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
	border-color: var(--color-gold);
	color: var(--color-gold-light);
	background: linear-gradient(135deg, rgba(212, 168, 83, 0.25) 0%, rgba(212, 168, 83, 0.1) 100%);
	box-shadow: 0 4px 16px rgba(212, 168, 83, 0.25), 0 2px 8px rgba(0,0,0,0.3);
	transform: translateY(-1px);
}

.btn-primary:active {
	transform: translateY(0px);
	box-shadow: 0 2px 6px rgba(212, 168, 83, 0.15);
}



    /* ===== Mobile-first base (small screens are the default) ===== */
@media (max-width: 600px) {
	body {
		font-size: 15px;
	}

	.control-panel {
		padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
		max-height: 40vh;
		overflow-y: auto;
	}

	.control-panel .btn-row {
		gap: 6px;
	}

	.btn-primary {
		min-height: 44px;   /* comfortable touch target */
		padding: 10px 14px;
		font-size: 11px;
		touch-action: manipulation;
	}

	.banner-row {
		margin-top: 6vh;
	}

	.banner-row .bannar {
		max-height: 150px;
	}

	.cake-cover {
		min-height: 200px;
		margin-top: 20px;
	}

	.message p {
		font-size: 19px;
	}
}

/* ===== Larger screens ===== */
@media (min-width: 601px) {
	.message p {
		font-size: 24px;
	}

	.message p:nth-child(1) {
		font-size: 30px;
	}

	.banner-row .bannar {
		max-height: 220px;
	}

	.cake-cover {
		min-height: 250px;
	}

	.btn-primary {
		padding: 10px 18px;
		font-size: 12px;
	}
}

/* ===== Final card ===== */
.final-card {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 500;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 24px;
	background: radial-gradient(ellipse at 50% 40%, rgba(26, 21, 32, 0.88) 0%, rgba(5, 5, 8, 0.94) 100%);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.final-card h2 {
	font-family: var(--font-display);
	font-size: clamp(30px, 7vw, 56px);
	font-weight: 700;
	color: var(--color-gold-light);
	text-shadow: 0 0 30px rgba(212, 168, 83, 0.4), 0 2px 8px rgba(0, 0, 0, 0.7);
	letter-spacing: 2px;
	margin-bottom: 6px;
}

.final-card h3 {
	font-family: var(--font-display);
	font-size: clamp(22px, 5vw, 38px);
	font-weight: 400;
	font-style: italic;
	color: var(--color-text-light);
	margin-bottom: 18px;
}

.final-card .final-note {
	font-size: clamp(14px, 3vw, 17px);
	color: var(--color-text-muted);
	max-width: 34ch;
	line-height: 1.6;
	margin-bottom: 28px;
}

/* ===== Loading spinner - premium ===== */
.loading {
	display: flex;
	align-items: center;
	justify-content: center;
}

.loading:before {
	background: radial-gradient(circle at 50% 50%, rgba(212, 168, 83, 0.12) 0%, rgba(10, 10, 15, 0.4) 70%);
}

.loading:not(:required):after {
	border-radius: 50%;
	background: transparent;
	-webkit-box-shadow:
		0 0 0 2px rgba(212, 168, 83, 0.5),
		0 0 0 4px rgba(212, 168, 83, 0.2),
		0 0 20px rgba(212, 168, 83, 0.1);
	box-shadow:
		0 0 0 2px rgba(212, 168, 83, 0.5),
		0 0 0 4px rgba(212, 168, 83, 0.2),
		0 0 20px rgba(212, 168, 83, 0.1);
	transform: scale(0.8);
}