/* Story Selection Screen */
.story-selector {
    text-align: center;
    padding: 40px 20px;
}

.logo {
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 64px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.story-selector h1 {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-shadow: none;
    letter-spacing: -1px;
}

.story-selector .subtitle {
    font-size: 22px;
    color: var(--text-muted);
    margin-bottom: 50px;
    font-weight: 600;
}

.story-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

/* Game Screen */
.game-screen {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.game-screen.active {
    display: block;
}

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

/* Progress Bar */
.progress-container {
    background: var(--bg-card-solid);
    border-radius: 20px;
    padding: 16px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.progress-star {
    font-size: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.progress-star.filled {
    animation: starCollect 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-star.empty {
    opacity: 0.3;
}

@keyframes starCollect {
    0% { transform: scale(1); }
    30% { transform: scale(1.5) rotate(15deg); }
    60% { transform: scale(1.3) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Ending Screen */
.ending-screen {
    display: none;
    text-align: center;
    padding: 60px 20px;
    animation: fadeInUp 0.6s ease-out;
}

.ending-screen.active {
    display: block;
}

.ending-screen h1 {
    font-size: 52px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.ending-screen .trophy {
    font-size: 120px;
    margin-bottom: 24px;
    display: block;
    animation: trophyBounce 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(250, 204, 21, 0.5));
}

@keyframes trophyBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.ending-screen p {
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.ending-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 380px;
    margin: 0 auto;
}

.ending-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 20px 40px;
    font-family: 'Nunito', sans-serif;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ending-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--glow-primary);
}

.ending-btn.secondary {
    background: linear-gradient(135deg, var(--accent) 0%, #0891b2 100%);
}

.ending-btn.secondary:hover {
    box-shadow: var(--glow-accent);
}
