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

:root {
    --gold: #d4af37;
    --gold-light: #f4e5b2;
    --red: #9e2a2b;
    --red-dark: #6d1a1c;
    --burgundy: #722f37;
    --cream: #fdf8ef;
    --night-top: #0f1729;
    --night-bottom: #1a1a2e;
}

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--night-top) 0%, var(--night-bottom) 50%, #16213e 100%);
    min-height: 100vh;
    color: var(--cream);
    overflow-x: hidden;
}

/* ========== STARS ========== */
.stars, .stars2 {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.stars {
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 230px 80px, white, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 380px 60px, white, transparent),
        radial-gradient(2px 2px at 450px 180px, rgba(255,255,255,0.7), transparent);
    background-size: 500px 220px;
    animation: twinkleStars 8s ease-in-out infinite;
}

.stars2 {
    background-image:
        radial-gradient(1px 1px at 100px 20px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 200px 100px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 350px 45px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 420px 130px, rgba(255,255,255,0.5), transparent);
    background-size: 480px 180px;
    animation: twinkleStars 12s ease-in-out infinite reverse;
}

@keyframes twinkleStars {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Shooting stars */
.shooting-stars {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.shooting-stars::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 80%;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, white, transparent);
    animation: shoot 8s linear infinite;
    opacity: 0;
}

@keyframes shoot {
    0% { transform: translateX(0) translateY(0); opacity: 0; }
    5% { opacity: 1; }
    15% { transform: translateX(-400px) translateY(150px); opacity: 0; }
    100% { opacity: 0; }
}

/* ========== SCREENS ========== */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.hidden { display: none; }
.hidden { display: none !important; }

/* ========== LOGIN ========== */
.login-card {
    text-align: center;
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow:
        0 25px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.1);
    max-width: 380px;
    width: 100%;
}

.ornament-decor {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    background: radial-gradient(circle at 30% 30%, #c41e3a 0%, #8b0000 100%);
    border-radius: 50%;
    box-shadow:
        0 8px 25px rgba(139, 0, 0, 0.5),
        inset 0 -8px 15px rgba(0,0,0,0.3),
        inset 0 8px 15px rgba(255,255,255,0.2);
    position: relative;
}

.ornament-decor::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 15px;
    background: var(--gold);
    border-radius: 3px 3px 0 0;
}

.ornament-decor::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 15px;
    width: 12px;
    height: 8px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: rotate(-30deg);
}

.login-card h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--cream);
    line-height: 1.2;
    margin-bottom: 8px;
}

.login-card h1 span {
    color: var(--gold);
    font-weight: 600;
}

.login-subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 35px;
    letter-spacing: 2px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#password-input {
    padding: 16px 24px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: var(--cream);
    text-align: center;
    transition: all 0.3s;
}

#password-input::placeholder {
    color: rgba(255,255,255,0.4);
}

#password-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.btn-gold {
    padding: 16px 32px;
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 1px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--gold), #b8960c);
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

.error {
    color: #ff8a8a;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* ========== CALENDAR ========== */
#calendar-screen {
    padding: 30px 20px;
    justify-content: center;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--cream);
}

header h1 span {
    color: var(--gold);
    font-weight: 600;
}

.countdown-text {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    margin-top: 8px;
}

/* ========== ORNAMENTS GRID ========== */
.ornaments-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 600px;
    width: 100%;
    padding: 20px;
}

/* ========== ORNAMENT ========== */
.ornament {
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ornament:hover:not(.disabled) {
    transform: scale(1.1) rotate(5deg);
}

.ornament.disabled {
    cursor: not-allowed;
    filter: brightness(0.4) saturate(0.3);
}

.ornament-ball {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-shadow:
        0 8px 30px rgba(0,0,0,0.4),
        inset 0 -15px 30px rgba(0,0,0,0.3),
        inset 0 15px 30px rgba(255,255,255,0.15);
    transition: box-shadow 0.3s;
}

.ornament:hover:not(.disabled) .ornament-ball {
    box-shadow:
        0 12px 40px rgba(0,0,0,0.5),
        0 0 30px rgba(255,255,255,0.1),
        inset 0 -15px 30px rgba(0,0,0,0.3),
        inset 0 15px 30px rgba(255,255,255,0.2);
}

/* Ornament colors */
.ornament-ball.red {
    background: radial-gradient(circle at 30% 30%, #e63946 0%, #9e2a2b 60%, #6d1a1c 100%);
}

.ornament-ball.gold {
    background: radial-gradient(circle at 30% 30%, #f4e5b2 0%, #d4af37 50%, #b8860b 100%);
}

.ornament-ball.green {
    background: radial-gradient(circle at 30% 30%, #4a7c59 0%, #2d5a3d 60%, #1a3d28 100%);
}

.ornament-ball.silver {
    background: radial-gradient(circle at 30% 30%, #f5f5f5 0%, #c0c0c0 50%, #808080 100%);
}

.ornament-ball.burgundy {
    background: radial-gradient(circle at 30% 30%, #a4303f 0%, #722f37 60%, #4a1c24 100%);
}

/* Ornament top cap */
.ornament-cap {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 12px;
    background: linear-gradient(180deg, #d4af37 0%, #b8860b 100%);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.ornament-cap::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: transparent;
}

/* Shine effect */
.ornament-shine {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 25%;
    height: 20%;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    filter: blur(2px);
}

/* Day number */
.ornament-day {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Opened state */
.ornament.opened .ornament-ball {
    box-shadow:
        0 0 25px rgba(255, 215, 0, 0.6),
        0 8px 30px rgba(0,0,0,0.4),
        inset 0 -15px 30px rgba(0,0,0,0.3),
        inset 0 15px 30px rgba(255,255,255,0.2);
}

.ornament.opened::after {
    content: '✓';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 40, 0.98));
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 24px;
    padding: 40px 35px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 25px 80px rgba(0,0,0,0.6),
        0 0 60px rgba(212, 175, 55, 0.1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-x {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close-x:hover {
    color: white;
}

.modal-date {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 5px;
}

.modal-countdown {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 30px;
}

.modal-message {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 30px 25px;
    border-radius: 16px;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--cream);
    font-style: italic;
}

.modal-close {
    width: 100%;
}

/* ========== DEV PANEL ========== */
.dev-panel {
    position: fixed;
    bottom: 15px; left: 15px;
    background: rgba(255, 50, 50, 0.15);
    border: 2px solid rgba(255,50,50,0.4);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 2000;
    display: flex;
    gap: 15px;
    align-items: center;
    font-family: monospace;
    backdrop-filter: blur(5px);
}

.dev-panel button {
    padding: 5px 12px;
    background: rgba(255,50,50,0.7);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.dev-panel button:hover {
    background: rgba(255,50,50,0.9);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .ornaments-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 15px;
    }

    .ornament-day {
        font-size: 1.2rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .login-card {
        padding: 40px 30px;
    }

    .login-card h1 {
        font-size: 1.9rem;
    }
}

@media (max-width: 450px) {
    .ornaments-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .ornament-day {
        font-size: 1.1rem;
    }

    .modal-content {
        padding: 30px 25px;
    }

    .modal-date {
        font-size: 1.8rem;
    }

    .modal-message {
        font-size: 1rem;
        padding: 25px 20px;
    }
}
