/* --- High Fidelity Variable Identity Systems --- */
:root {
    --bg-system-dark: #000000;
    --neon-red-glowing: #ff003c;
    --crimson-base: #8a001c;
    --neon-pink-bright: #ff00a0;
    --pure-white: #ffffff;
    --translucent-glass: rgba(12, 4, 6, 0.7);
    --border-glass: rgba(255, 0, 60, 0.22);
    --sans-primary: 'Montserrat', sans-serif;
    --cursive-luxury: 'Great Vibes', cursive;
}

/* --- Clean Engine Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-system-dark);
    color: var(--pure-white);
    font-family: var(--sans-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- Dynamic Global Environment Background --- */
.ambient-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #1f0106 0%, var(--bg-system-dark) 90%);
    z-index: 1;
    pointer-events: none;
}

#fxCanvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* --- Cinematic Scene Router Constraints --- */
.scene {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transform: scale(1.03) translateY(5px);
    transition: opacity 1.4s cubic-bezier(0.25, 1, 0.5, 1), transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.scene.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
    z-index: 4;
}

/* --- Premium Glassmorphism Interface Card Architecture --- */
.glass-card {
    background: var(--translucent-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 3rem 2.5rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(255, 0, 60, 0.06);
    width: 92%;
    max-width: 540px;
    position: relative;
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: 0; border-radius: 28px;
    padding: 1px;
    background: linear-gradient(135deg, var(--neon-pink-bright), transparent 60%, var(--neon-red-glowing));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}

/* --- Typographical Systems --- */
.neon-title {
    font-size: 2.4rem;
    font-weight: 200;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 20px var(--neon-red-glowing);
}

.neon-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--neon-pink-bright);
}

.pink-glow-text {
    color: var(--neon-pink-bright);
    text-shadow: 0 0 8px var(--neon-pink-bright);
}

.cursive { font-family: var(--cursive-luxury); }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-30 { margin-bottom: 30px; }
.block-center { display: block; margin-left: auto; margin-right: auto; }

/* --- High-End Functional Inputs and Buttons --- */
.neon-btn {
    background: transparent;
    border: 1px solid var(--neon-red-glowing);
    color: var(--pure-white);
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.2);
}

.neon-btn:hover {
    background: var(--neon-red-glowing);
    box-shadow: 0 0 25px var(--neon-red-glowing), 0 0 50px var(--neon-pink-bright);
    transform: translateY(-2px);
    text-shadow: 0 0 4px #fff;
}

input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 15px 20px;
    border-radius: 16px;
    color: var(--pure-white);
    font-size: 1rem;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--neon-pink-bright);
    box-shadow: 0 0 18px rgba(255, 0, 160, 0.35);
}

/* --- Animated Loading Spinner Screen --- */
.heart-spinner {
    font-size: 4.5rem;
    animation: heartBeatLoading 1.1s infinite cubic-bezier(0.215, 0.610, 0.355, 1);
    filter: drop-shadow(0 0 15px var(--neon-red-glowing));
}

/* --- Adaptive Dashboard Layout Hierarchy --- */
.dashboard-stack {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 92%;
    max-width: 680px;
    z-index: 5;
}

/* Premium Audio Framework UI */
.music-widget {
    max-width: 100%;
    padding: 1.5rem 2.5rem;
}

.track-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 1.2rem;
}

.pulse-disc {
    font-size: 1.6rem;
    animation: spinTrack 4s linear infinite;
    filter: drop-shadow(0 0 8px var(--neon-red-glowing));
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.audio-control-btn {
    background: transparent;
    border: 1px solid var(--neon-pink-bright);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.audio-control-btn:hover {
    background: var(--neon-pink-bright);
    box-shadow: 0 0 15px var(--neon-pink-bright);
}

.timeline-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.time-display { font-size: 0.8rem; color: rgba(255,255,255,0.6); min-width: 35px; }

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 4px;
    flex-grow: 1;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--neon-red-glowing), var(--neon-pink-bright));
    height: 100%;
    width: 0%;
    border-radius: 4px;
    box-shadow: 0 0 8px var(--neon-pink-bright);
    position: absolute;
    top: 0; left: 0;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.neon-slider {
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.15); height: 5px; border-radius: 3px; outline: none; width: 85px;
}

.neon-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: var(--neon-red-glowing); box-shadow: 0 0 8px var(--neon-red-glowing); cursor: pointer;
}

/* Precision Chronograph Display layout */
.counter-widget { max-width: 100%; }
.counter-message { font-size: 0.95rem; opacity: 0.75; letter-spacing: 1px; margin-bottom: 1.8rem; }
.chronograph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }

.chrono-block {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 5px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.03);
}

.chrono-block span {
    display: block; font-size: 1.8rem; font-weight: 600;
    text-shadow: 0 0 15px var(--neon-red-glowing); color: #fff;
}

.chrono-block small { font-size: 0.65rem; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-top: 4px; display: block; }

/* --- Challenge Modules & Live Feedback --- */
.challenge-card { max-width: 480px; }
.challenge-progress { font-size: 0.8rem; position: absolute; top: 22px; right: 26px; color: rgba(255,255,255,0.3); }
.challenge-question-text { font-size: 1.35rem; font-weight: 400; margin-bottom: 1.8rem; line-height: 1.5; text-align: center; }
.feedback-error-msg { color: var(--neon-red-glowing); font-size: 0.85rem; margin-top: 10px; opacity: 0; text-align: center; transition: opacity 0.3s; }

.shake-error-node { animation: executeShake 0.45s ease-in-out; border-color: var(--neon-red-glowing) !important; }

/* --- Special Mini Game Interactivity Layers --- */
.game-interface-hud { position: absolute; top: 4%; text-align: center; pointer-events: none; z-index: 5; }
.score-card { font-size: 1.6rem; margin-top: 5px; text-shadow: 0 0 12px var(--neon-red-glowing); }

.neon-target-heart {
    position: absolute; font-size: 4.5rem; cursor: pointer; z-index: 10;
    filter: drop-shadow(0 0 15px var(--neon-red-glowing));
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: heartTargetFloat 1.4s infinite alternate ease-in-out;
}

/* --- Photo Gallery Stack --- */
.gallery-layout-wrap { width: 90%; max-width: 950px; z-index: 5; }
.gallery-responsive-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px; max-height: 52vh; overflow-y: auto; padding: 12px;
}

.gallery-item {
    background: var(--translucent-glass); border: 1px solid var(--border-glass);
    border-radius: 20px; overflow: hidden; aspect-ratio: 1; cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); transition: transform 0.3s ease;
}

.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item:hover img { transform: scale(1.08); }

/* Lightbox Module Layers */
.lightbox-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95);
    z-index: 100; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s;
}

.lightbox-modal.active { opacity: 1; pointer-events: auto; }
.lightbox-modal img { max-width: 85%; max-height: 82%; border-radius: 12px; box-shadow: 0 0 35px var(--neon-red-glowing); }
.lightbox-close { position: absolute; top: 25px; right: 35px; font-size: 3.5rem; color: #fff; cursor: pointer; }

/* --- Dynamic Cassette Love Letter System --- */
.letter-display-card { max-width: 640px; background: rgba(8, 2, 4, 0.85); border-left: 4px solid var(--neon-pink-bright); }
.typewriter-paper-scroll {
    font-size: 1.1rem; line-height: 1.9; font-weight: 300;
    white-space: pre-line; max-height: 390px; overflow-y: auto; padding-right: 12px;
    letter-spacing: 0.5px;
}

/* --- Grand Celebration Scene Layers --- */
.finale-wrapper { width: 90%; max-width: 750px; z-index: 10; }

.mega-interactive-heart {
    font-size: 10rem; filter: drop-shadow(0 0 30px var(--neon-red-glowing));
    animation: omegaNodePulse 0.9s infinite alternate cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-block; cursor: pointer; transition: transform 0.2s;
}

.mega-interactive-heart:active { transform: scale(0.9); }

.birthday-banner-headline {
    font-size: 4rem; margin-top: 2rem; text-shadow: 0 0 30px var(--neon-pink-bright);
    line-height: 1.3; animation: smoothFadeIn 2s ease-out forwards;
}

.signature-tag {
    font-size: 1.6rem; font-weight: 300; letter-spacing: 2px;
    margin-top: 1.8rem; text-shadow: 0 0 12px var(--neon-red-glowing);
    animation: smoothFadeIn 3s ease-out forwards;
}

/* --- Global Animation Framework Engine --- */
@keyframes heartBeatLoading {
    0% { transform: scale(1); }
    30% { transform: scale(1.22); }
    60% { transform: scale(1.05); }
    100% { transform: scale(1.2); filter: drop-shadow(0 0 25px var(--neon-pink-bright)); }
}

@keyframes spinTrack { 100% { transform: rotate(360deg); } }

@keyframes executeShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-12px); }
    40%, 80% { transform: translateX(12px); }
}

@keyframes heartTargetFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-15px) scale(1.1); filter: drop-shadow(0 0 25px var(--neon-pink-bright)); }
}

@keyframes omegaNodePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 20px var(--neon-red-glowing)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 60px var(--neon-pink-bright)); }
}

@keyframes smoothFadeIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Native Camera Viewport Shake Mechanics */
.camera-shake-active { animation: systemViewportShock 0.45s linear; }
@keyframes systemViewportShock {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-5px, 4px); }
    30% { transform: translate(6px, -4px); }
    50% { transform: translate(-4px, -2px); }
    75% { transform: translate(5px, 4px); }
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 10px; }

/* Responsive Adaptations */
@media(max-width: 768px) {
    .chronograph-grid { grid-template-columns: repeat(2, 1fr); }
    .neon-title { font-size: 1.8rem; }
    .birthday-banner-headline { font-size: 2.6rem; }
    .mega-interactive-heart { font-size: 7rem; }
    .gallery-responsive-grid { grid-template-columns: repeat(2, 1fr); }
}