/* ========= STAGE 5 – MESSAGES ========= */
#stage-5 { background: radial-gradient(ellipse at 50% 50%, #1a0040 0%, var(--bg-primary) 70%); }
.messages-wrap { position: relative; width: 100%; min-height: 260px; }
.msg-card {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 20px; padding: 40px 20px;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 24px; backdrop-filter: blur(16px);
    opacity: 0; transform: translateX(60px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.msg-card.active { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.msg-card.exit-left { opacity: 0; transform: translateX(-60px) scale(0.95); }
.msg-icon { font-size: 3rem; }
.msg-text {
    font-family: var(--font-display); font-size: clamp(1.3rem, 5vw, 2rem);
    color: var(--soft-white); line-height: 1.6; max-width: 400px;
}
.msg-nav { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 20px; }
.msg-dots { display: flex; gap: 8px; }
.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.3); transition: all 0.3s;
}
.dot.active { background: var(--neon-pink); box-shadow: 0 0 8px var(--neon-pink); transform: scale(1.3); }
.msg-arrows { display: flex; gap: 20px; }
.arrow-btn {
    width: 44px; height: 44px;
    border: 2px solid var(--glass-border); border-radius: 50%;
    background: var(--glass); color: var(--soft-white);
    font-size: 1rem; cursor: pointer;
    backdrop-filter: blur(10px); transition: all 0.3s;
}
.arrow-btn:hover, .arrow-btn:active { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* ========= STAGE 6 – FINALE ========= */
#stage-6 { background: radial-gradient(ellipse at 50% 70%, #1a0035 0%, var(--bg-primary) 70%); }
.cake-scene { display: flex; flex-direction: column; align-items: center; gap: 30px; z-index: 5; }
.wish-text {
    font-family: var(--font-heading); font-size: 1.1rem; color: var(--gold);
    animation: bounce-gentle 2s ease-in-out infinite;
}
.cake-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; }
.candles-row { display: flex; gap: 30px; margin-bottom: -4px; z-index: 3; position: relative; }
.candle-unit { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.candle-stick {
    width: 8px; height: 45px;
    background: linear-gradient(180deg, #ffe4b5, #ffc966);
    border-radius: 2px 2px 0 0;
}
.flame {
    width: 14px; height: 20px;
    background: radial-gradient(ellipse at 50% 90%, #fff 0%, #ffdd57 30%, #ff8c00 60%, #ff4500 80%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    margin-bottom: -2px; opacity: 0; transition: opacity 0.4s;
}
.flame.active { opacity: 1; animation: flicker 0.3s ease-in-out infinite alternate; }
.flame.blown { opacity: 0; animation: none; }
.cake-layer { border-radius: 12px; position: relative; }
.cake-top-layer {
    width: 140px; height: 40px;
    background: linear-gradient(180deg, #ff9ec4, #ff6fa3);
    border-bottom: 3px solid #e85c93; z-index: 2;
}
.cake-top-layer::after {
    content: ''; position: absolute; top: -6px; left: 10px; right: 10px; height: 12px;
    background: linear-gradient(180deg, #fff0f5, #ffb6d3);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.cake-mid-layer {
    width: 170px; height: 45px;
    background: linear-gradient(180deg, #ffc0d8, #ff8ab5);
    border-bottom: 3px solid #e07098; margin-top: -2px;
}
.cake-bot-layer {
    width: 200px; height: 50px;
    background: linear-gradient(180deg, #ffcce0, #ff99c0);
    border-bottom: 3px solid #d9689a; margin-top: -2px;
    border-radius: 8px 8px 16px 16px;
}
.cake-plate {
    width: 240px; height: 12px;
    background: linear-gradient(180deg, #e8e8e8, #ccc);
    border-radius: 50%; margin-top: 2px;
}
.final-reveal {
    display: flex; flex-direction: column; align-items: center; gap: 16px; z-index: 5;
}
.final-title { text-align: center; }
.ft-line { display: block; opacity: 0; animation: scale-in 0.8s ease-out forwards; }
.ft-1 {
    font-family: var(--font-display); font-size: clamp(2rem, 7vw, 3.5rem);
    color: var(--gold); text-shadow: 0 0 20px rgba(255,215,0,0.5);
    animation-delay: 0.3s;
}
.ft-2 {
    font-family: var(--font-display); font-size: clamp(2.5rem, 9vw, 5rem);
    color: var(--neon-pink);
    text-shadow: 0 0 30px var(--neon-pink), 0 0 80px rgba(255,45,149,0.3);
    animation-delay: 0.8s; line-height: 1.4;
}
.final-heart { font-size: 1.5rem; color: var(--soft-white); opacity: 0; animation: fade-in-up 0.8s 1.3s forwards; }
.replay-btn {
    margin-top: 24px; padding: 12px 28px;
    border: 2px solid var(--gold); border-radius: 50px;
    background: var(--glass); backdrop-filter: blur(10px);
    color: var(--gold); font-family: var(--font-heading);
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    opacity: 0; animation: fade-in-up 0.6s 2.5s forwards;
    transition: all 0.3s;
}
.replay-btn:hover, .replay-btn:active {
    background: var(--gold); color: var(--bg-primary);
    box-shadow: 0 0 25px rgba(255,215,0,0.4);
}
.floating-hearts { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.float-heart {
    position: absolute; font-size: 1.5rem; bottom: -30px;
    animation: heart-rise 4s ease-out forwards;
}

/* ========= ANIMATIONS ========= */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255,45,149,0.4); }
    50%      { box-shadow: 0 0 50px rgba(255,45,149,0.7), 0 0 80px rgba(255,45,149,0.3); }
}
@keyframes ring-expand {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}
@keyframes sparkle-float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    50%      { transform: translateY(-15px) rotate(180deg); opacity: 1; }
}
@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
@keyframes vinyl-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes viz-bounce {
    from { height: 4px; }
    to   { height: calc(4px + 20px * var(--h, 0.5)); }
}
@keyframes flicker {
    0%   { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.1, 1.15) rotate(2deg); }
}
@keyframes emoji-burst {
    from { opacity: 0; transform: scale(0) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes confetti-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes heart-rise {
    0%   { transform: translateY(0) scale(1); opacity: 1; }
    50%  { opacity: 1; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

/* ========= RESPONSIVE ========= */
@media (max-width: 500px) {
    .song-card { flex-direction: column; text-align: center; }
    .vinyl-wrapper { width: 80px; height: 80px; }
    .vinyl-label { width: 28px; height: 28px; }
    .label-title { font-size: 0.28rem; }
    .label-artist { font-size: 0.2rem; }
    .player-controls { justify-content: center; }
    .visualizer { justify-content: center; }
    .music-layout { padding-top: 24px; }
    .candles-row { gap: 20px; }
    .cake-top-layer { width: 110px; height: 35px; }
    .cake-mid-layer { width: 140px; height: 40px; }
    .cake-bot-layer { width: 170px; height: 45px; }
    .cake-plate { width: 200px; }
}
