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

:root {
    --bg: #0d0a0e;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --gold: #d4a574;
    --gold-light: #e8c9a0;
    --gold-glow: rgba(212, 165, 116, 0.3);
    --rose: #c97b7b;
    --rose-light: #e8a5a5;
    --text: #f0e6dc;
    --text-dim: rgba(240, 230, 220, 0.5);
    --text-muted: rgba(240, 230, 220, 0.3);
    --success: #7bc97b;
    --close: #d4a574;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Quicksand', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Stars Background === */
#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: var(--gold-light);
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.8; }
}

/* === Screens === */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Welcome Screen === */
.welcome-content {
    text-align: center;
}

.welcome-subtitle {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.welcome-name {
    font-family: var(--font-serif);
    font-size: 72px;
    font-weight: 300;
    font-style: italic;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 24px;
    text-shadow: 0 0 40px var(--gold-glow);
}

.welcome-tagline {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 48px;
}

.btn-enter {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 14px 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.btn-enter:hover {
    background: var(--gold);
    color: var(--bg);
}

/* === Days Screen === */
#days-screen.active {
    justify-content: flex-start;
    padding-top: 60px;
}

.days-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 400px;
}

.days-header h2 {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 300;
    font-style: italic;
    color: var(--gold);
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--rose));
    width: 0%;
    transition: width 0.6s ease;
    border-radius: 2px;
}

.progress-text {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.days-list {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* === Day Card === */
.day-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-card:hover:not(.locked) {
    background: var(--bg-card-hover);
    border-color: rgba(212, 165, 116, 0.2);
    transform: translateY(-2px);
}

.day-card.locked {
    opacity: 0.35;
    cursor: not-allowed;
}

.day-card.solved {
    border-color: rgba(123, 201, 123, 0.2);
}

.day-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.day-number {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 300;
    color: var(--gold);
    min-width: 40px;
}

.day-card.locked .day-number {
    color: var(--text-muted);
}

.day-card.solved .day-number {
    color: var(--success);
}

.day-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-label {
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
}

.day-card.locked .day-label {
    color: var(--text-muted);
}

.day-date {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
}

.day-status {
    font-size: 18px;
}

.day-card.solved .day-status {
    color: var(--success);
}

/* === Riddle Screen === */
#riddle-screen.active {
    justify-content: center;
}

.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-sans);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.btn-back:hover {
    color: var(--gold);
}

.riddle-content {
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.riddle-day-label {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.riddle-hint {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 300;
    color: var(--text-dim);
    margin-bottom: 40px;
    opacity: 0;
    animation: revealText 1.5s ease forwards;
    letter-spacing: 1px;
}

@keyframes revealText {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.riddle-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#answer-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px 18px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 300;
    outline: none;
    transition: border-color 0.3s ease;
}

#answer-input::placeholder {
    color: var(--text-muted);
}

#answer-input:focus {
    border-color: var(--gold);
}

.btn-submit {
    background: var(--gold);
    border: none;
    color: var(--bg);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    padding: 14px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-submit:hover {
    background: var(--gold-light);
    transform: scale(1.02);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* === Feedback === */
.riddle-feedback {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.3s ease;
}

.riddle-feedback.close {
    color: var(--close);
}

.riddle-feedback.wrong {
    color: var(--rose);
}

.riddle-feedback.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* === Solved State === */
.riddle-solved {
    display: none;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.riddle-solved.active {
    display: block;
}

.solved-icon {
    font-size: 48px;
    color: var(--success);
    margin-bottom: 16px;
}

.solved-message {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 300;
    font-style: italic;
    color: var(--gold-light);
    line-height: 1.6;
}

/* === Celebration Overlay === */
.celebration-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 10, 14, 0.95);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.celebration-overlay.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.celebration-content {
    text-align: center;
    z-index: 101;
    padding: 24px;
}

.celebration-emoji {
    font-size: 64px;
    margin-bottom: 24px;
    animation: celebBounce 0.6s ease;
}

@keyframes celebBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.celebration-text {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 300;
    font-style: italic;
    color: var(--gold);
    margin-bottom: 12px;
}

.celebration-sub {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 36px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    white-space: pre-line;
}

.btn-continue {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.btn-continue:hover {
    background: var(--gold);
    color: var(--bg);
}

/* === Final Screen === */
.final-content {
    text-align: center;
    max-width: 400px;
}

.final-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 300;
    font-style: italic;
    color: var(--gold);
    margin-bottom: 32px;
}

.final-message {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 300;
    font-style: italic;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 32px;
}

.final-hearts {
    color: var(--rose);
    font-size: 24px;
    letter-spacing: 8px;
    animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === Responsive === */
@media (max-width: 480px) {
    .welcome-name {
        font-size: 56px;
    }

    .riddle-text {
        font-size: 20px;
    }

    .riddle-input-area {
        flex-direction: column;
    }

    .btn-submit {
        width: 100%;
    }

    .screen {
        padding: 32px 20px;
    }
}
