/* ── Merry Christmas · Premium Styles ──────────────────────── */

/* ── Base ──────────────────────────────────────────────────── */

body {
    margin: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a0a1a 0%, #000000 100%);
    font-family: 'Outfit', sans-serif;
    position: relative;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

/* ── Aurora Background ─────────────────────────────────────── */

.aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(0, 100, 200, 0.08),
            rgba(100, 0, 200, 0.06),
            rgba(0, 200, 100, 0.04),
            rgba(200, 100, 0, 0.06));
    background-size: 400% 400%;
    animation: aurora 25s ease infinite;
    z-index: 2;
    pointer-events: none;
    opacity: 0.4;
    will-change: background-position;
}

@keyframes aurora {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ── Floating Particles ────────────────────────────────────── */

.magic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffd700, transparent);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    50% {
        transform: translateY(-60px) scale(1.5);
        opacity: 0.8;
    }
}

/* ── Snowflakes ────────────────────────────────────────────── */

.snowflake {
    position: fixed;
    top: -10px;
    color: rgba(255, 255, 255, 0.7);
    animation: snowfall linear forwards;
    z-index: 4;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.3;
    }
}

/* ── Loader ────────────────────────────────────────────────── */

#loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-out;
}

.loader-text {
    color: rgba(212, 175, 55, 0.7);
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 6px;
    margin-top: 24px;
    text-transform: uppercase;
    font-weight: 400;
}

.loader-ring {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(212, 175, 55, 0.1);
    border-top-color: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(212, 175, 55, 0.1);
    border-top-color: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Title ─────────────────────────────────────────────────── */

#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
    text-align: center;
    padding-top: clamp(15px, 3vh, 30px);
}

h1 {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(32px, 7vw, 56px);
    color: #fff;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 50px rgba(255, 180, 0, 0.3),
        0 0 100px rgba(255, 150, 0, 0.15);
    margin: 0;
    letter-spacing: 2px;
    opacity: 0;
    animation: titleReveal 2s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
    position: relative;
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
        filter: blur(5px);
    }

    100% {
        opacity: 0.95;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ── Upload Button ─────────────────────────────────────────── */

.upload-wrapper {
    margin-top: 8px;
    pointer-events: auto;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: rgba(212, 175, 55, 0.85);
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    transition: all 0.4s;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.upload-btn input[type="file"] {
    display: none;
}

.upload-btn svg {
    opacity: 0.7;
}

.hint-text {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: 200;
}

.ui-hidden {
    display: none !important;
}

/* ── Christmas Card ────────────────────────────────────────── */

#christmas-card {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

#christmas-card.show {
    opacity: 1;
    pointer-events: auto;
}

.card-inner {
    background: linear-gradient(145deg, #0d1520 0%, #1a0a15 50%, #0d0a1a 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 380px;
    width: 90vw;
    text-align: center;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(212, 175, 55, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: cardAppear 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardAppear {
    0% {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.card-ornament {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 15px rgba(0, 200, 0, 0.4));
}

.card-title {
    font-family: 'Great Vibes', cursive;
    font-size: 36px;
    color: #fff;
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    margin-bottom: 12px;
}

.card-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
    margin: 16px auto;
}

.card-message {
    font-family: 'Outfit', sans-serif;
    font-weight: 200;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.8;
    margin-bottom: 24px;
}

.card-message em {
    color: rgba(255, 215, 0, 0.7);
    font-style: italic;
}

.card-close {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    padding: 12px 32px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 300;
}

.card-close:hover {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
}

/* ── Guide Overlay ─────────────────────────────────────────── */

#guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

#guide-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.guide-content {
    max-width: 480px;
    width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px 24px;
    text-align: center;
}

.guide-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #d4af37;
    letter-spacing: 4px;
    margin-bottom: 28px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.guide-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 12px;
    transition: all 0.3s;
}

.guide-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(212, 175, 55, 0.2);
}

.guide-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.guide-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.guide-card-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
    font-weight: 200;
}

/* Legacy guide support */
.guide-section,
.guide-divider,
.guide-item {
    display: none;
}

.guide-close-btn {
    background: linear-gradient(135deg, rgba(0, 150, 50, 0.2), rgba(0, 100, 30, 0.15));
    border: 1px solid rgba(0, 200, 70, 0.25);
    color: rgba(100, 255, 150, 0.8);
    padding: 14px 36px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 300;
}

.guide-close-btn:hover {
    background: rgba(0, 200, 70, 0.2);
    box-shadow: 0 0 25px rgba(0, 200, 70, 0.15);
}

/* ── Guide Button ──────────────────────────────────────────── */

#guide-btn {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: rgba(212, 175, 55, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 300;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

#guide-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
}

/* ── Music Control ─────────────────────────────────────────── */

#music-control {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

#music-control:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
}

#music-control svg {
    width: 18px;
    height: 18px;
    fill: rgba(212, 175, 55, 0.6);
}

/* ── Wish Button ───────────────────────────────────────────── */

#wish-btn {
    position: fixed;
    bottom: 15px;
    left: 65px;
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(255, 165, 0, 0.25);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    color: rgba(255, 165, 0, 0.6);
    font-size: 20px;
}

#wish-btn:hover {
    background: rgba(255, 165, 0, 0.15);
    border-color: rgba(255, 165, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.15);
}

/* ── Wish Modal ────────────────────────────────────────────── */

#wish-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

#wish-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.wish-modal-inner {
    background: linear-gradient(145deg, #1a0a00 0%, #0d1b2a 100%);
    border: 1px solid rgba(255, 165, 0, 0.25);
    border-radius: 18px;
    padding: 32px 28px;
    max-width: 360px;
    width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 165, 0, 0.08);
}

.wish-modal-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

#wish-modal h3 {
    color: rgba(255, 165, 0, 0.85);
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 16px 0;
    letter-spacing: 2px;
}

#wish-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffeebb;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    outline: none;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}

#wish-input:focus {
    border-color: rgba(255, 165, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.1);
}

#wish-send {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.3), rgba(212, 175, 55, 0.2));
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: #ffa500;
    padding: 12px 28px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 400;
    font-family: 'Outfit', sans-serif;
}

#wish-send:hover {
    background: rgba(255, 165, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.2);
}

/* ── Countdown ─────────────────────────────────────────────── */

#countdown-wrapper {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    text-align: center;
    pointer-events: none;
}

#countdown-label {
    color: rgba(212, 175, 55, 0.4);
    font-size: 8px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 200;
}

#countdown-timer {
    color: rgba(255, 215, 0, 0.7);
    font-family: 'Cinzel', serif;
    font-size: 16px;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* ── Webcam ────────────────────────────────────────────────── */

#webcam-wrapper {
    position: fixed;
    bottom: 70px;
    left: 15px;
    width: 180px;
    height: 135px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    overflow: hidden;
    opacity: 1;
    pointer-events: none;
    z-index: 50;
    background: #000;
    transition: opacity 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

/* ── Firework Particles ────────────────────────────────────── */

.firework-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 500;
    will-change: transform, opacity;
}

.firework-trail {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 499;
    opacity: 0.6;
}

/* ── Santa Sleigh ──────────────────────────────────────────── */

.santa-sleigh {
    position: fixed;
    top: 8%;
    font-size: 36px;
    z-index: 90;
    pointer-events: none;
    animation: santaFly 8s linear forwards;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    will-change: transform;
}

@keyframes santaFly {
    0% {
        left: -120px;
        transform: translateY(0);
    }

    25% {
        transform: translateY(-25px);
    }

    50% {
        transform: translateY(10px);
    }

    75% {
        transform: translateY(-15px);
    }

    100% {
        left: calc(100% + 120px);
        transform: translateY(0);
    }
}

.santa-trail {
    position: fixed;
    font-size: 12px;
    pointer-events: none;
    z-index: 89;
    animation: trailFade 2s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(20px) scale(0.3);
    }
}

/* ── Wish Lantern ──────────────────────────────────────────── */

.wish-lantern {
    position: fixed;
    z-index: 80;
    pointer-events: none;
    animation: lanternFloat 12s ease-in forwards;
    will-change: transform, opacity;
}

.wish-lantern-body {
    width: 56px;
    height: 72px;
    background: radial-gradient(ellipse at center,
            rgba(255, 200, 50, 0.85) 0%,
            rgba(255, 140, 0, 0.6) 40%,
            rgba(200, 80, 0, 0.3) 100%);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    box-shadow: 0 0 25px rgba(255, 165, 0, 0.5), 0 0 50px rgba(255, 100, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.wish-lantern-text {
    color: #3a0a00;
    font-size: 8px;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
    max-height: 52px;
    overflow: hidden;
}

.wish-lantern-flame {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 10px;
    background: radial-gradient(ellipse, #fff 0%, #ffa500 50%, transparent 100%);
    border-radius: 50%;
    animation: flicker 0.3s ease-in-out infinite alternate;
}

@keyframes lanternFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }

    30% {
        transform: translateY(-30vh) translateX(30px) rotate(5deg);
        opacity: 1;
    }

    60% {
        transform: translateY(-60vh) translateX(-20px) rotate(-3deg);
        opacity: 0.7;
    }

    100% {
        transform: translateY(-110vh) translateX(40px) rotate(8deg);
        opacity: 0;
    }
}

@keyframes flicker {
    0% {
        transform: translateX(-50%) scaleY(0.8);
        opacity: 0.8;
    }

    100% {
        transform: translateX(-50%) scaleY(1.2);
        opacity: 1;
    }
}

/* ── Focus States ──────────────────────────────────────────── */

.upload-btn:focus-visible,
.card-close:focus-visible,
#music-control:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
    h1 {
        font-size: clamp(28px, 8vw, 42px);
    }

    #webcam-wrapper {
        width: 140px;
        height: 105px;
        bottom: 60px;
    }

    .guide-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-inner {
        padding: 32px 24px;
    }

    #music-control,
    #guide-btn,
    #wish-btn {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: clamp(24px, 9vw, 32px);
    }

    .hint-text {
        font-size: 8px;
    }

    .card-inner {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .card-title {
        font-size: 28px;
    }

    .card-message {
        font-size: 14px;
    }

    .guide-card {
        padding: 14px 10px;
    }

    .guide-card-icon {
        font-size: 20px;
    }
}

/* ── Reduced Motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}