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

:root {
    --ice-blue: #E3F2FD;
    --frost-blue: #90CAF9;
    --deep-blue: #1976D2;
    --dark-blue: #0D47A1;
    --snow-white: #FFFFFF;
    --shadow-blue: rgba(25, 118, 210, 0.2);
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

/* Snowfall Animation */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 30px;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 3rem;
    color: var(--snow-white);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

main {
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.story-card {
    background: var(--snow-white);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow-blue);
    overflow: hidden;
    margin-bottom: 30px;
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.story-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--frost-blue), var(--deep-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

.story-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(10%, 10%);
    }
}

.story-content {
    padding: 40px;
}

#storyTitle {
    font-size: 2.2rem;
    color: var(--dark-blue);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

#storyTitle::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--deep-blue);
    border-radius: 2px;
}

#storyText {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 30px;
}

.choices {
    padding: 0 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-btn {
    background: linear-gradient(135deg, var(--frost-blue), var(--deep-blue));
    color: var(--snow-white);
    border: none;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.choice-btn:hover::before {
    width: 300px;
    height: 300px;
}

.choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(25, 118, 210, 0.4);
}

.choice-btn:active {
    transform: translateY(-1px);
}

.stats {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    color: var(--deep-blue);
    font-weight: bold;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--deep-blue);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--snow-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

footer {
    text-align: center;
    color: var(--snow-white);
    padding: 20px;
    font-size: 0.9rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Ending Styles */
.ending {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-top: 20px;
    animation: celebrate 1s ease-out;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .story-content {
        padding: 25px;
    }

    #storyTitle {
        font-size: 1.8rem;
    }

    #storyText {
        font-size: 1rem;
    }

    .choices {
        padding: 0 25px 25px;
    }

    .choice-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Fade transition */
.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
