/* ===== CSS Variables ===== */
:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --dark-bg: #fff5f7;
    --light-bg: #ffe5f0;
    --accent-color: #ffd1dc;
    --text-primary: #5a3a5a;
    --text-secondary: #8b5a8b;
    --border-color: #f5b3d4;
    --success-color: #6bcf7f;
    --warning-color: #ffa502;
}

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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Trebuchet MS', cursive, sans-serif;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe5f0 50%, #fff0f5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Cute floating elements background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(200, 157, 217, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== Header Styles ===== */
.header {
    background: linear-gradient(135deg, #ff6b9d 0%, #c89dd9 100%);
    border-bottom: 5px dashed var(--primary-color);
    padding: 1.5rem 0;
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.2);
    position: relative;
    flex-shrink: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 3px 3px 0px rgba(255, 107, 157, 0.3);
    letter-spacing: 2px;
    animation: bounce 2s infinite;
}

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

.navbar {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 16px;
    border-radius: 25px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== Main Container ===== */
.main-container {
    flex: 1;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
    overflow: visible;
}

.story-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #fff9fb 100%);
    border: 4px solid var(--border-color);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.15), 0 0 0 8px rgba(255, 182, 193, 0.2);
    position: relative;
}

.story-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ff6b9d, #c89dd9, #a2d5f7);
    border-radius: 30px;
    z-index: -1;
    opacity: 0.3;
}

/* ===== Story Section ===== */
.story-section {
    padding: 2.5rem;
    border-bottom: 3px dashed var(--border-color);
}

.story-header {
    margin-bottom: 2rem;
}

.story-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(200, 157, 217, 0.3);
    animation: wiggle 3s infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-1deg); }
    75% { transform: rotate(1deg); }
}

.progress-bar {
    width: 100%;
    height: 15px;
    background-color: #f0e0eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd76f 0%, #ff6b9d 50%, #c89dd9 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

.story-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.story-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-primary);
    border-left: 6px solid var(--primary-color);
    padding-left: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(200, 157, 217, 0.1));
    padding: 1.5rem;
    border-radius: 15px;
    font-weight: 500;
}

.story-text p {
    margin-bottom: 1rem;
}

.story-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ffe5f0 0%, #fff0f5 100%);
    border: 4px solid var(--border-color);
    border-radius: 20px;
    min-height: 300px;
    padding: 1.5rem;
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.1);
}

.story-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    object-fit: cover;
    display: none;
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.2);
    transition: transform 0.3s ease;
}

.story-image.active {
    display: block;
}

/* ===== Choices Section ===== */
.choices-section {
    padding: 2.5rem;
    border-bottom: 3px dashed var(--border-color);
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.05), rgba(200, 157, 217, 0.05));
}

.choices-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(200, 157, 217, 0.3);
}

.choices-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.choice-btn {
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #ffb3d9 100%);
    border: 3px solid #ff6b9d;
    color: #ffffff;
    border-radius: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 700;
    text-align: left;
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.2);
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '✨';
    position: absolute;
    left: 10px;
    opacity: 0;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    background: linear-gradient(135deg, #ff85b0 0%, #ffc9e3 100%);
    border-color: #c44569;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4);
}

.choice-btn:hover::before {
    opacity: 1;
    left: 15px;
}

.choice-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
/* ===== Stats Section ===== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    border-bottom: 3px dashed var(--border-color);
    background: linear-gradient(135deg, rgba(255, 215, 111, 0.1), rgba(162, 213, 247, 0.1));
}

.stat-item {
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 240, 245, 0.8));
    padding: 1.5rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.2);
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #c89dd9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

/* ===== Controls Section ===== */
.controls-section {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(200, 157, 217, 0.1));
}

.control-btn {
    padding: 1rem 2.5rem;
    border: 3px solid var(--border-color);
    background: linear-gradient(135deg, #ffffff 0%, #fff5f7 100%);
    color: var(--text-primary);
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.restart-btn {
    border-color: var(--success-color);
    color: var(--success-color);
}

.restart-btn:hover {
    background: linear-gradient(135deg, var(--success-color) 0%, #9eff9e 100%);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(107, 207, 127, 0.3);
}

.menu-btn {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.menu-btn:hover {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffb84d 100%);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 165, 2, 0.3);
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, #ff6b9d 0%, #c89dd9 100%);
    border-top: 5px dashed var(--primary-color);
    padding: 2rem;
    text-align: center;
    color: #ffffff;
    margin-top: 2rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
/* ===== Animations ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

/* ===== Story Menu ===== */
.story-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
}

/* ===== Pure HTML Interactive Logic ===== */
.scene {
    display: none;
}

.scene:target {
    display: block;
}

/* If any scene is targeted, hide the menu */
.scene:target ~ #menu {
    display: none !important;
}

#menu {
    display: flex;
}

.menu-wrapper {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

.menu-title {
    font-size: 3rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.menu-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 600;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.story-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff9fb 100%);
    border: 4px solid var(--border-color);
    border-radius: 25px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.1);
    text-align: left;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.story-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(255, 107, 157, 0.25);
    border-color: #ff6b9d;
}

.story-card h3 {
    font-size: 1.6rem;
    color: #ff6b9d;
    margin-bottom: 1rem;
}

.story-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

/* ===== Story Viewer Modal ===== */
.story-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.story-viewer.active {
    display: flex;
}

.viewer-content {
    background: linear-gradient(135deg, #ffffff 0%, #fff9fb 100%);
    border: 4px solid var(--border-color);
    border-radius: 30px;
    padding: 3rem;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: #ff6b9d;
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #c44569;
    transform: rotate(90deg);
}

.viewer-title {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
}

.viewer-text {
    color: var(--text-primary);
    line-height: 2;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.viewer-text p {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-bg);
    border-left: 4px solid #ff6b9d;
    border-radius: 10px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar {
        gap: 0.5rem;
    }

    .story-content {
        grid-template-columns: 1fr;
    }

    .main-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .story-section {
        padding: 1.5rem;
    }

    .choices-container {
        grid-template-columns: 1fr;
    }

    .story-title {
        font-size: 1.8rem;
    }

    .controls-section {
        flex-direction: column;
        gap: 1rem;
    }

    .control-btn {
        width: 100%;
    }

    .logo {
        font-size: 2rem;
    }

    .choice-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}