/* styles.css */

/* --- Ad Styles (Kid-Friendly, Non-Intrusive) --- */
.ad-container {
    margin: 20px 0;
    text-align: center;
    position: relative;
    background: transparent;
}

.ad-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.ad-container .adsbygoogle {
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

/* Placeholder ad styling */
.ad-placeholder {
    opacity: 0.7;
}

.ad-placeholder-content {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Top banner ad */
.ad-top {
    margin-top: 10px;
    margin-bottom: 30px;
}

/* Sidebar ad */
.ad-sidebar {
    margin: 20px 0;
    position: sticky;
    top: 100px;
}

/* Footer ad */
.ad-footer {
    margin-top: 40px;
    margin-bottom: 20px;
    padding-top: 0;
    border-top: none;
}

/* In-content ad (between sections) */
.ad-incontent {
    margin: 40px 0;
    padding: 20px 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ad-container {
        margin: 15px 0;
    }
    
    .ad-sidebar {
        position: static;
        margin: 20px auto;
        max-width: 100%;
    }
    
    .ad-label {
        font-size: 10px;
    }
}

/* Hide ads on very small screens if needed */
@media (max-width: 480px) {
    .ad-sidebar {
        display: none; /* Hide sidebar ads on mobile */
    }
}

/* --- General & Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&display=swap');

:root {
    /* Neutral foundation */
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Bootstrap accents (default to Christmas palette) */
    --bs-primary: #0f7a4c;
    --bs-primary-rgb: 15, 122, 76;
    --bs-secondary: #1f3d2a;
    --bs-secondary-rgb: 31, 61, 42;
    --bs-success: #0f7a4c;
    --bs-success-rgb: 15, 122, 76;
    --bs-info: #0d9488;
    --bs-info-rgb: 13, 148, 136;
    --bs-warning: #f2b233;
    --bs-warning-rgb: 242, 178, 51;
    --bs-danger: #b21e2d;
    --bs-danger-rgb: 178, 30, 45;

    /* Holiday-aware brand tokens (default: Christmas) */
    --primary-gradient: linear-gradient(135deg, #0f7a4c 0%, #0b5f3b 100%);
    --secondary-gradient: linear-gradient(135deg, #f15156 0%, #b21e2d 100%);
    --accent-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --success-gradient: linear-gradient(135deg, #2f855a 0%, #1c4b35 100%);
    --warning-gradient: linear-gradient(135deg, #f6d365 0%, #f2b233 100%);
    --dark-gradient: linear-gradient(135deg, #1f3d2a 0%, #121f18 100%);
    --navbar-gradient: linear-gradient(135deg, #b21e2d 0%, #d84b54 100%);

    --story-setup-gradient: linear-gradient(135deg, #0e8f4b 0%, #0b5f3b 100%);
    --story-info-gradient: linear-gradient(135deg, #f15156 0%, #b21e2d 100%);
    --story-display-gradient: linear-gradient(135deg, #0c6b3a 0%, #10364f 100%);

    --focus-border-color: #0f7a4c;
    --focus-outline-shadow: rgba(15, 122, 76, 0.18);
    --interactive-border-hover: #0f7a4c;

    --ad-placeholder-gradient: linear-gradient(135deg, #0f7a4c 0%, #b21e2d 100%);
    --choice-btn-background: linear-gradient(135deg, #fff4e1 0%, #fef3c7 55%, #e6f5eb 100%), linear-gradient(135deg, rgba(15, 122, 76, 0.18) 0%, rgba(178, 30, 45, 0.14) 100%);
    --choice-btn-hover-background: linear-gradient(135deg, #ffeec7 0%, #fde68a 50%, #dff3e8 100%), linear-gradient(135deg, rgba(15, 122, 76, 0.24) 0%, rgba(178, 30, 45, 0.2) 100%);
    --choice-btn-gleam: radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.18) 42%, rgba(255, 255, 255, 0) 72%), radial-gradient(120% 80% at 90% 0%, rgba(15, 122, 76, 0.18) 0%, rgba(15, 122, 76, 0.06) 48%, rgba(15, 122, 76, 0) 78%), radial-gradient(120% 80% at 0% 100%, rgba(178, 30, 45, 0.15) 0%, rgba(178, 30, 45, 0.05) 50%, rgba(178, 30, 45, 0) 80%);
    --choice-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -12px 24px rgba(15, 122, 76, 0.12);
    --choice-btn-hover-shadow: 0 10px 28px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -16px 28px rgba(15, 122, 76, 0.18);
    --choice-number-gradient: linear-gradient(135deg, #b21e2d 0%, #0f7a4c 100%);
    --remove-button-gradient: linear-gradient(135deg, #f15156 0%, #b21e2d 100%);
}

:root[data-holiday-theme="classic"] {
    --bs-primary: #5b6ee1;
    --bs-primary-rgb: 91, 110, 225;
    --bs-secondary: #33455e;
    --bs-secondary-rgb: 51, 69, 94;
    --bs-success: #46e68c;
    --bs-success-rgb: 70, 230, 140;
    --bs-info: #57b3ff;
    --bs-info-rgb: 87, 179, 255;
    --bs-warning: #ffe071;
    --bs-warning-rgb: 255, 224, 113;
    --bs-danger: #f4717f;
    --bs-danger-rgb: 244, 113, 127;

    --primary-gradient: linear-gradient(135deg, #5b6ee1 0%, #7a5eb6 100%);
    --secondary-gradient: linear-gradient(135deg, #eea0ff 0%, #f4717f 100%);
    --accent-gradient: linear-gradient(135deg, #57b3ff 0%, #53f3ff 100%);
    --success-gradient: linear-gradient(135deg, #46e68c 0%, #3ef0d3 100%);
    --warning-gradient: linear-gradient(135deg, #fb87a3 0%, #ffe071 100%);
    --dark-gradient: linear-gradient(135deg, #27384b 0%, #33455e 100%);
    --navbar-gradient: linear-gradient(135deg, #5b6ee1 0%, #7a5eb6 100%);

    --story-setup-gradient: linear-gradient(135deg, #6b62ea 0%, #8a59ba 100%);
    --story-info-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --story-display-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    --focus-border-color: #667eea;
    --focus-outline-shadow: rgba(102, 126, 234, 0.1);
    --interactive-border-hover: #667eea;

    --ad-placeholder-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --choice-btn-background: linear-gradient(135deg, #f4efff 0%, #efe9ff 55%, #ebf0ff 100%), linear-gradient(135deg, rgba(102, 126, 234, 0.22) 0%, rgba(118, 75, 162, 0.18) 100%);
    --choice-btn-hover-background: linear-gradient(135deg, #f1eaff 0%, #ebe5ff 50%, #e7edff 100%), linear-gradient(135deg, rgba(102, 126, 234, 0.28) 0%, rgba(118, 75, 162, 0.22) 100%);
    --choice-btn-gleam: radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.18) 42%, rgba(255, 255, 255, 0) 72%), radial-gradient(120% 80% at 90% 0%, rgba(126, 144, 255, 0.22) 0%, rgba(126, 144, 255, 0.08) 48%, rgba(126, 144, 255, 0) 78%), radial-gradient(120% 80% at 0% 100%, rgba(195, 150, 255, 0.18) 0%, rgba(195, 150, 255, 0.06) 50%, rgba(195, 150, 255, 0) 80%);
    --choice-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -12px 24px rgba(102, 126, 234, 0.10);
    --choice-btn-hover-shadow: 0 10px 28px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -16px 28px rgba(102, 126, 234, 0.16);
    --choice-number-gradient: linear-gradient(135deg, #5b6ee1 0%, #7a5eb6 100%);
    --remove-button-gradient: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

/* --- Utility Classes --- */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* --- Header & Hero Banner --- */
.brand-gradient {
    /* Layered gradient with subtle vignette for depth */
    background: 
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 60%),
        var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.navbar.brand-gradient {
    background: 
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 60%),
        var(--navbar-gradient);
    min-height: 70px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 70px;
}

.navbar-brand {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    color: white !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    line-height: 1.2;
    padding: 0.5rem 0;
}

.navbar-brand .brand-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
    line-height: 1.1;
}

.navbar-brand .brand-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    font-style: italic;
    margin-top: 0.2rem;
    letter-spacing: 0.2px;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.navbar .collapse {
    margin-left: auto;
}

.navbar-nav {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.navbar-toggler {
    z-index: 2;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* --- Enhanced Cards --- */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: var(--card-bg);
    overflow: hidden;
}

.card-interactive {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* --- Story Setup Specific Styles --- */
.story-setup-container {
    background: linear-gradient(180deg, #031321 0%, #04283a 45%, #0b3a32 100%);
    min-height: 100vh;
    padding: 0 0 2rem 0;
    position: relative;
    overflow-x: hidden;
}

.story-setup-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.08), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.06), transparent 35%),
        radial-gradient(circle at 55% 80%, rgba(255, 255, 255, 0.05), transparent 55%),
        linear-gradient(180deg, #020c14 0%, #052032 45%, #0a3c30 100%);
    background-attachment: fixed;
    z-index: 0;
}

.story-snow-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.story-snow-layer--slow {
    opacity: 0.35;
    filter: blur(1px);
}

.story-snow-layer--medium {
    opacity: 0.55;
}

.story-snow-layer--fast {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.story-bg-snowflake {
    position: absolute;
    top: -10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.15) 70%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
    animation: storyBgSnowFall linear infinite;
    opacity: var(--snow-opacity, 0.9);
    transform: translate3d(0, 0, 0);
}

.story-setup-content {
    position: relative;
    z-index: 2;
}

@keyframes storyBgSnowFall {
    0% {
        transform: translate3d(0, -10%, 0) scale(1);
    }
    100% {
        transform: translate3d(var(--snow-drift, 0px), 110vh, 0) scale(0.85);
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-bg-snowflake {
        animation: none;
    }
}

/* Story Card Layout - Physical Card Design */
.story-setup-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 
        0 30px 70px rgba(3, 19, 33, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    margin-top: 2rem;
    backdrop-filter: blur(18px);
}

.story-setup-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(15, 122, 76, 0.18), rgba(178, 30, 45, 0.12));
    border-radius: 24px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-setup-card:hover {
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(-4px);
    border-color: rgba(0, 0, 0, 0.15);
}

.story-setup-card:hover::before {
    opacity: 1;
}

/* Story Card Image Container (Top) */
.story-card-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    aspect-ratio: 1600 / 700;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.story-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

/* Story Image Placeholder */
.story-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #b21e2d 0%, #d84b54 50%, #f093fb 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.story-placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

.story-placeholder-text {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 80%;
    line-height: 1.4;
}

.story-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
}

/* Story Card Content (Middle) */
.story-card-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.story-card-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-family: 'Poppins', sans-serif;
}

.story-card-description {
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.story-card-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.story-card-badge {
    background: rgba(15, 122, 76, 0.15);
    color: #0f7a4c;
    border-radius: 14px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(15, 122, 76, 0.2);
}

.story-card-badge i {
    margin-right: 0.5rem;
}

/* Story Card Button Container (Bottom) */
.story-card-button-container {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02), transparent);
}

/* Story Hero Section - Call to Action Style */
.story-hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.story-hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
    pointer-events: none;
}

.story-hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.story-hero-image-container {
    position: relative;
    flex-shrink: 0;
}

.story-hero-image {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 5px solid rgba(255, 255, 255, 0.5);
    background: white;
    transition: transform 0.3s ease;
}

.story-hero-image:hover {
    transform: scale(1.05) rotate(2deg);
}

.story-hero-image-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    border-radius: 24px;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
    /* Reduce blur effect */
    filter: blur(0px);
}

.story-hero-text {
    flex: 1;
}

.story-hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.story-hero-description {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.story-hero-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.story-badge-large {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.story-badge-large:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.35);
}

.story-badge-large i {
    margin-right: 0.5rem;
}

/* Legacy story-info-section styles for backward compatibility */
.story-info-section {
    background: var(--story-info-gradient);
    color: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.story-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.story-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.story-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* --- Enhanced Form Styles --- */
.form-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.settings-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.form-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.form-section h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.form-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--focus-border-color);
    box-shadow: 0 0 0 3px var(--focus-outline-shadow);
    outline: none;
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* --- Student Entry Styles --- */
.student-entry {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.student-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.student-entry:hover::before {
    transform: scaleY(1);
}

.student-entry:hover {
    border-color: var(--interactive-border-hover);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.remove-student-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--remove-button-gradient);
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-student-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-lg);
}

/* --- Enhanced Buttons --- */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--light-bg);
    border-color: var(--focus-border-color);
    color: var(--focus-border-color);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 16px;
}

/* Start Adventure Button with Snowflake Effect - Card Style */
.start-button-wrapper {
    position: relative;
    display: block;
    overflow: visible;
    padding: 30px;
    margin: -30px;
}

.btn-start-adventure {
    position: relative;
    background: linear-gradient(135deg, #b21e2d 0%, #d84b54 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(178, 30, 45, 0.3);
    transition: all 0.3s ease;
    overflow: visible;
    width: 100%;
    text-align: center;
    z-index: 2;
    text-transform: none;
    letter-spacing: normal;
}

/* Warm glow effect on hover - reduced blur to prevent button from appearing blurred */
.btn-start-adventure:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(178, 30, 45, 0.4),
        0 0 20px rgba(216, 75, 84, 0.4),
        0 0 35px rgba(178, 30, 45, 0.2);
    background: linear-gradient(135deg, #d84b54 0%, #b21e2d 100%);
}

.btn-start-adventure:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(178, 30, 45, 0.3);
}

.btn-start-adventure:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-start-adventure:disabled:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-start-text {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.snowflake-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
    background: transparent;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 20px;
    pointer-events: none;
    /* Strong shadows for visibility on white backgrounds */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 200, 150, 0.6);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    will-change: transform, opacity;
    transform-origin: center center;
    animation: snowflake-fall linear forwards;
    z-index: 1;
}

@keyframes snowflake-fall {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    30% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x, 0), var(--end-y, 100px)) rotate(360deg) scale(0.2);
        opacity: 0;
    }
}

/* --- Story Display Styles --- */
.story-display-area {
    background: var(--story-display-gradient);
    border-radius: 24px;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    box-shadow: var(--shadow-xl);
}

/* Story Header and Controls */
.story-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1.5rem;
    text-align: center;
}

.story-display-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Bottom Navigation Controls */
.story-bottom-controls {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
}

.story-bottom-controls .btn {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
}

.story-bottom-controls .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Progress Bar Styling */
.story-progress-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 1rem;
}

.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
    background: linear-gradient(90deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Story Statistics */
.story-stats {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.stat-item h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.stat-item small {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.stat-item i {
    color: rgba(255, 255, 255, 0.9);
}

/* Story Content Wrapper */
.story-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.story-content-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

/* Enhanced Story Output */
.story-output {
    background: #ffffff;
    color: #1f2937; /* dark gray for comfortable reading */
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    line-height: 1.8;
    position: relative;
    max-width: 800px; /* wider column for less receipt-like feel */
    width: 100%;
}

.story-output::before {
    content: none; /* remove light overlay on text container */
}

.story-output p {
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

/* Enhanced Choice Buttons */
.story-choice-btn {
    background: var(--choice-btn-background);
    background-blend-mode: normal, multiply;
    backdrop-filter: blur(8px);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    color: #0f172a; /* darker text for readability */
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    text-align: left;
    position: relative;
    z-index: 0; /* establish stacking context so overlays can sit behind text */
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--choice-btn-shadow);
}

.story-choice-btn::before {
    /* Soft inner highlight to suggest glassy surface */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.15) 40%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    z-index: 0;
}

.story-choice-btn::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--choice-btn-gleam);
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.25s ease, filter 0.25s ease;
    z-index: 0;
}

.story-choice-btn:hover::after {
    opacity: 0.8;
    filter: saturate(1.1) brightness(1.02);
}

.story-choice-btn:hover {
    background: var(--choice-btn-hover-background);
    background-blend-mode: normal, multiply;
    transform: translateY(-3px);
    box-shadow: var(--choice-btn-hover-shadow);
    border-color: #d3d9e3;
    color: #111827; /* force dark text even on hover */
}

/* Ensure inner text elements stay readable on hover */
.story-choice-btn .choice-text,
.story-choice-btn .choice-destination,
.story-choice-btn .choice-number {
    color: inherit;
}

/* Ensure button contents remain above overlays */
.story-choice-btn > * { position: relative; z-index: 1; }

/* Removed sweeping animation to avoid distraction */

/* Story Choices Container */
.story-choices {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 800px; /* align with story text width */
    width: 100%;
}

/* Choice Number Indicator */
.choice-number {
    background: var(--choice-number-gradient, var(--primary-gradient));
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    border: none;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.choice-text {
    flex-grow: 1;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Destination page hint on choice buttons */
.choice-destination {
    margin-left: auto;
    color: #6c757d; /* muted gray */
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Subtle current page indicator inside story output */
.page-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Story Text */
.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0;
    text-indent: 2em;
    font-family: 'Merriweather', Georgia, serif;
}

/* Story Display Background Pattern */
.story-display-area::before {
    content: none; /* remove subtle dot pattern to avoid ghost circles */
}

/* Story Display Title */
.story-display-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Story End Screen */
.story-end {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

.story-end h4 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .story-card-image-container {
        height: 320px;
        aspect-ratio: 1600 / 700;
    }
    
    .story-card-content {
        padding: 1.5rem;
    }
    
    .story-card-title {
        font-size: 1.75rem;
    }
    
    .story-card-description {
        font-size: 1rem;
    }
    
    .story-card-badges {
        justify-content: center;
    }
    
    .btn-start-adventure {
        padding: 0.875rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .start-button-wrapper {
        padding: 20px;
        margin: -20px;
    }
    
    .story-display-area {
        padding: 2rem 1.5rem;
        min-height: 50vh;
    }
    
    .story-display-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .story-content-wrapper {
        padding: 0;
    }
    
    .story-output {
        padding: 1.5rem;
        font-size: 1rem;
        max-width: 100%;
    }
    
    .story-choice-btn {
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }
    
    .story-controls {
        text-align: center;
        margin-top: 1rem;
    }
    
    .story-controls .btn {
        margin: 0.25rem;
    }
    
    .stat-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .story-card-image-container {
        height: 280px;
        aspect-ratio: 1600 / 700;
    }
    
    .story-card-content {
        padding: 1.25rem;
    }
    
    .story-card-title {
        font-size: 1.5rem;
    }
    
    .story-card-description {
        font-size: 0.95rem;
    }
    
    .story-card-badge {
        padding: 0.4rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .btn-start-adventure {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    
    .start-button-wrapper {
        padding: 15px;
        margin: -15px;
    }
    
}

/* --- Helper Classes --- */
.section-space {
    padding: 80px 0;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}