/* ==========================================================================
   BRIGHT & VIBRANT LUXURY STORYTELLING MAP EXPERIENCE - DONG ANH SMART CITY
   Pure Light Theme | White Frosted Glassmorphism | Vibrant Royal Indigo & Gold
   ========================================================================== */

/* 1. Modal Overlay Container (Bright & Clean) */
.story-overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #f8fafc;
    color: #0f172a;
    font-family: 'Be Vietnam Pro', sans-serif;
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.story-overlay-modal.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* 2. Sparkle Canvas Layer */
#storySparkleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 800;
    pointer-events: none;
}

/* 3. Phase 0: Royal Purple & Magenta Gold Light Glassmorphism (Vibrant & Animated) */
.story-intro-screen {
    position: absolute;
    inset: 0;
    z-index: 99999;
    background:
        radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.3) 0%, transparent 45%),
        radial-gradient(circle at 50% 15%, rgba(129, 140, 248, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 85%, rgba(251, 191, 36, 0.22) 0%, transparent 50%),
        linear-gradient(135deg, #faf5ff 0%, #f3e8ff 35%, #eef2ff 70%, #fdf4ff 100%);
    background-size: 200% 200%;
    animation: storyGradientShift 10s ease infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    opacity: 1;
    overflow: hidden;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-intro-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.06);
}

/* Ambient Floating Background Orbs */
.story-intro-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.65;
    pointer-events: none;
    z-index: 1;
    animation: storyOrbFloat 8s ease-in-out infinite alternate;
}

.story-intro-orb.orb-1 {
    width: 400px;
    height: 400px;
    top: -80px;
    left: -80px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.55), rgba(147, 51, 234, 0.05));
}

.story-intro-orb.orb-2 {
    width: 440px;
    height: 440px;
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5), rgba(219, 39, 119, 0.05));
    animation-delay: -3.5s;
}

.story-intro-orb.orb-3 {
    width: 320px;
    height: 320px;
    top: 18%;
    right: 12%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4), rgba(245, 158, 11, 0.05));
    animation-delay: -5s;
}

@keyframes storyOrbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(35px, -45px) scale(1.15); }
    100% { transform: translate(-30px, 25px) scale(0.92); }
}

.story-intro-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(36px);
    -webkit-backdrop-filter: blur(36px);
    border: 2px solid transparent;
    background:
        linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.94)) padding-box,
        linear-gradient(135deg, #a855f7 0%, #ec4899 40%, #fbbf24 75%, #818cf8 100%) border-box;
    border-radius: 38px;
    padding: 48px 60px;
    max-width: 980px;
    width: 92%;
    box-shadow: 0 35px 90px rgba(147, 51, 234, 0.28), 0 12px 36px rgba(236, 72, 153, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 10;
    overflow: hidden;
    animation: storyCardScaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards, storyCardFloat 4s ease-in-out infinite alternate 0.8s;
}

.story-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 11px 30px;
    border-radius: 30px;
    background: linear-gradient(135deg, #581c87 0%, #7e22ce 50%, #9333ea 100%);
    color: #ffffff !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 26px;
    box-shadow: 0 10px 30px rgba(126, 34, 206, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    -webkit-font-smoothing: antialiased;
    animation: storyBadgeShimmer 3s ease-in-out infinite alternate;
}

.story-intro-badge span {
    display: inline-block;
    animation: storyIconBounce 2s ease-in-out infinite;
}

@keyframes storyBadgeShimmer {
    0% { box-shadow: 0 10px 30px rgba(126, 34, 206, 0.4); transform: scale(1); }
    50% { box-shadow: 0 14px 40px rgba(236, 72, 153, 0.55); transform: scale(1.03); }
    100% { box-shadow: 0 10px 30px rgba(126, 34, 206, 0.4); transform: scale(1); }
}

@keyframes storyIconBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(-8deg); }
}

.story-intro-divider {
    width: 240px;
    height: 5px;
    border-radius: 6px;
    background: linear-gradient(90deg, transparent, #a855f7, #ec4899, #fbbf24, transparent);
    margin: 16px 0 28px 0;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
    position: relative;
    overflow: hidden;
}

.story-intro-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    animation: storyLineSweep 2.2s ease-in-out infinite;
}

@keyframes storyLineSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.story-intro-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(1.8rem, 4.2vw, 3.2rem);
    font-weight: 900;
    line-height: 1.35;
    color: #2e1065 !important;
    max-width: 950px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.story-intro-top-heading {
    display: block;
    font-size: 0.85em;
    font-weight: 900;
    color: #3b0764 !important;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.story-intro-highlight {
    display: block;
    padding-top: 10px;
    padding-bottom: 8px;
    margin-top: -4px;
    line-height: 1.4;
    color: #6b21a8 !important;
    background: linear-gradient(135deg, #6b21a8 0%, #9333ea 40%, #ec4899 75%, #7e22ce 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    overflow: visible;
    letter-spacing: -0.5px;
    animation: storyTitleGlow 4s ease-in-out infinite alternate;
}

@keyframes storyTitleGlow {
    0% { filter: drop-shadow(0 0 0 transparent); }
    50% { filter: drop-shadow(0 4px 20px rgba(168, 85, 247, 0.35)); }
    100% { filter: drop-shadow(0 0 0 transparent); }
}

.story-intro-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: #4c1d95 !important;
    margin-top: 24px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.5;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

/* 4. Story Map Container (NO DARK OVERLAY!) */
.story-map-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#storyMap {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
}

.story-map-dark-overlay {
    display: none;
}

/* 5. Top Controls Bar (White Glassmorphism) */
.story-top-bar {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.story-top-bar>* {
    pointer-events: auto;
}

.story-header-branding {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.2);
}

.story-header-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.story-header-text h1 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: 0.5px;
}

.story-header-text p {
    font-size: 0.78rem;
    color: #4338ca;
    font-weight: 700;
    margin: 0;
}

.story-btn-skip {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-btn-skip:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 14px 40px rgba(124, 58, 237, 0.6);
}

/* 6. Timeline Sidebar UI (Royal Purple & Magenta Silk Glass) */
.story-timeline-sidebar {
    position: absolute;
    left: 24px;
    top: 105px;
    z-index: 1000;
    width: 320px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 25px 70px rgba(147, 51, 234, 0.22);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.story-timeline-title {
    font-size: 0.85rem;
    font-weight: 900;
    background: linear-gradient(135deg, #7e22ce 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.story-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(243, 232, 255, 0.35));
    border: 1.5px solid rgba(168, 85, 247, 0.2);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-timeline-item:hover {
    background: linear-gradient(135deg, rgba(243, 232, 255, 0.75), rgba(252, 231, 243, 0.75));
    border-color: #a855f7;
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.22);
}

.story-timeline-item.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(236, 72, 153, 0.14));
    border: 2px solid #a855f7;
    box-shadow: 0 8px 26px rgba(147, 51, 234, 0.3);
    transform: translateX(6px);
}

.story-timeline-item.completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(52, 211, 153, 0.08));
    border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.story-timeline-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.12), rgba(236, 72, 153, 0.12));
    border: 1.5px solid rgba(147, 51, 234, 0.3);
    color: #9333ea;
    font-size: 0.82rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.35s ease;
}

.story-timeline-item.active .story-timeline-num {
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    color: #ffffff;
    border: 1.5px solid #ffffff;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.5);
    transform: scale(1.1);
}

.story-timeline-item.completed .story-timeline-num {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #ffffff;
    border: 1.5px solid #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.story-timeline-text {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #581c87;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-timeline-item.active .story-timeline-text {
    color: #6b21a8;
    font-weight: 900;
}

.story-timeline-item.completed .story-timeline-text {
    color: #047857;
    font-weight: 800;
}

/* 7. Narrative Typing Box (Royal Purple & Magenta Silk Glass) */
.story-narrative-box {
    position: absolute;
    bottom: 32px;
    left: 24px;
    z-index: 1000;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 28px;
    padding: 22px 28px;
    box-shadow: 0 25px 70px rgba(147, 51, 234, 0.22);
    transition: all 0.4s ease;
}

.story-narrative-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.story-narrative-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.8);
    animation: storySparklePulse 1.5s infinite alternate;
}

.story-narrative-phase {
    font-size: 0.82rem;
    font-weight: 900;
    background: linear-gradient(135deg, #7e22ce 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.story-narrative-text {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: #581c87;
    font-weight: 700;
    min-height: 52px;
}

.story-typing-cursor {
    display: inline-block;
    width: 3px;
    height: 18px;
    background: linear-gradient(180deg, #9333ea, #ec4899);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.8);
    margin-left: 4px;
    animation: storyBlink 0.8s infinite;
}

/* 8. Floating Glass Cards UI (Bright Clean White) */
.story-card-container {
    position: absolute;
    right: 24px;
    top: 90px;
    bottom: 24px;
    z-index: 1000;
    width: 480px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-glass-card {
    width: 100%;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 26px;
    overflow: hidden;
    padding: 20px 22px;
    box-shadow: 0 35px 80px rgba(99, 102, 241, 0.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(70px) scale(0.92);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-glass-card.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.story-card-image-wrap {
    position: relative;
    width: 100%;
    height: 165px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

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

.story-glass-card:hover .story-card-image {
    transform: scale(1.06);
}

.story-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #4f46e5;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 13px;
    border-radius: 24px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.story-card-badge.merged {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.story-card-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.22rem;
    font-weight: 900;
    color: #6b21a8;
    background: linear-gradient(135deg, #581c87 0%, #7e22ce 60%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-top: 5px;
    padding-bottom: 3px;
    margin: -4px 0 4px 0;
    line-height: 1.32;
    white-space: normal;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    overflow: visible;
    text-align: center;
}

.story-card-address {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
}

.story-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.story-stat-box {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 10px 12px;
    text-align: center;
}

.story-stat-val {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3730a3, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.story-stat-lbl {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Ban Giám Hiệu Trường Mới Section */
.story-board-section {
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(243, 232, 255, 0.75), rgba(252, 231, 243, 0.75));
    border: 1.5px solid rgba(168, 85, 247, 0.3);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.15);
}

.story-board-title {
    font-size: 0.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #7e22ce 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-board-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-board-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    gap: 12px;
}

.story-board-role {
    color: #7e22ce;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.story-board-name {
    color: #581c87;
    font-weight: 900;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
}

.story-info-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
}

.story-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    white-space: nowrap;
}

.story-info-row span:first-child {
    color: #64748b;
    font-weight: 600;
}

.story-info-row span:last-child {
    color: #0f172a;
    font-weight: 800;
}

.story-card-action-btn {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    border: none;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
    transition: all 0.3s ease;
}

.story-card-action-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.6);
}

/* 9. Dynamic Midpoint Distance Badge (Phase 4 - Leaflet Map Midpoint HUD) */
.story-distance-box {
    display: none !important;
}

.custom-story-distance-icon {
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

.story-distance-box-badge {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid #0284c7;
    border-radius: 24px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    box-shadow: 0 14px 40px rgba(2, 132, 199, 0.3), 0 0 20px rgba(56, 189, 248, 0.25);
    white-space: nowrap;
    box-sizing: border-box;
    animation: storyBadgeFloat 3s ease-in-out infinite alternate;
}

.story-dist-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.story-dist-lbl {
    font-size: 0.68rem;
    font-weight: 800;
    color: #0284c7;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 2px;
}

.story-dist-val {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: #0369a1;
    line-height: 1.2;
}

.story-dist-divider {
    width: 1.5px;
    height: 30px;
    background: rgba(2, 132, 199, 0.25);
}

@keyframes storyBadgeFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-4px);
    }
}

/* 10. Merger Phase 5 Flash Announcement Overlay (Royal Purple & Gold Glassmorphism) */
.story-announcement-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    z-index: 10005;
    background:
        radial-gradient(circle at 50% 0%, rgba(217, 70, 239, 0.12) 0%, transparent 70%),
        radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.08) 0%, transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.98)) padding-box,
        linear-gradient(135deg, #a855f7, #ec4899, #fbbf24) border-box;
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 2.5px solid transparent;
    border-radius: 28px;
    padding: 24px 42px;
    text-align: center;
    width: max-content;
    min-width: 420px;
    max-width: 88vw;
    box-shadow: 0 30px 90px rgba(147, 51, 234, 0.35), 0 15px 40px rgba(236, 72, 153, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-announcement-card.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    animation: storyAnnounceFloat 4s ease-in-out infinite alternate 0.4s;
}

.story-announcement-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    box-shadow: 0 8px 22px rgba(147, 51, 234, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #ffffff;
    margin: 0 auto 10px auto;
    animation: storyBounceSparkle 1.5s infinite alternate;
}

.story-announcement-date {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(147, 51, 234, 0.2);
    color: #9333ea;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.story-announcement-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #581c87;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.story-announcement-school-name {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    font-weight: 900;
    display: inline-block;
    padding-top: 8px;
    padding-bottom: 6px;
    margin-top: 0;
    line-height: 1.22;
    background: linear-gradient(135deg, #6b21a8 0%, #9333ea 35%, #ec4899 75%, #f59e0b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 12px rgba(168, 85, 247, 0.3));
    animation: storyTextGlow 3s linear infinite;
    margin: 0;
    white-space: normal;
    text-align: center;
    overflow: visible;
}

/* 10.5 Stage 7 Celebration Fireworks Banner */
.story-celebration-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10010;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 3px solid transparent;
    background:
        linear-gradient(rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.97)) padding-box,
        linear-gradient(135deg, #fbbf24, #ec4899, #9333ea, #38bdf8) border-box;
    border-radius: 40px;
    padding: 48px 60px;
    text-align: center;
    max-width: 620px;
    width: 92%;
    box-shadow: 0 45px 130px rgba(147, 51, 234, 0.45), 0 20px 60px rgba(251, 191, 36, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-celebration-banner.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    animation: storyAnnounceFloat 3.5s ease-in-out infinite alternate;
}

.story-celebration-burst {
    font-size: 2.5rem;
    margin-bottom: 16px;
    letter-spacing: 6px;
    animation: storyBounceSparkle 1.2s infinite alternate;
}

.story-celebration-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 900;
    background: linear-gradient(135deg, #7e22ce 0%, #a855f7 35%, #ec4899 70%, #d97706 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 15px rgba(168, 85, 247, 0.35));
    animation: storyTextGlow 3s linear infinite;
    margin: 0 0 14px 0;
    line-height: 1.25;
}

.story-celebration-sub {
    font-size: 1rem;
    font-weight: 700;
    color: #475569;
    margin: 0;
}

/* 11. Bottom Progress Dots Bar */
.story-progress-bar-wrap {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1005;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 22px;
    border-radius: 24px;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 10px 35px rgba(147, 51, 234, 0.25);
    pointer-events: auto;
}

.story-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.3);
    cursor: pointer;
    transition: all 0.35s ease;
}

.story-progress-dot:hover {
    background: #a855f7;
    transform: scale(1.35);
}

.story-progress-dot.active {
    background: linear-gradient(135deg, #9333ea, #ec4899);
    width: 28px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.6);
}

/* 12. Leaflet Custom Markers with Glowing Neon Rings */
.story-marker-icon {
    position: relative;
    width: 48px;
    height: 48px;
}

.story-marker-inner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #ec4899 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5), 0 0 25px rgba(217, 70, 239, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    z-index: 2;
    position: relative;
}

.story-marker-pulse {
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    border: 2.5px solid #d946ef;
    animation: storyMarkerPulse 1.8s infinite ease-out;
}

.story-marker-icon.merged {
    position: relative;
    width: 76px;
    height: 76px;
    z-index: 1000 !important;
}

.story-marker-icon.merged .story-marker-inner {
    background: linear-gradient(135deg, #6b21a8 0%, #9333ea 30%, #ec4899 65%, #f59e0b 100%);
    background-size: 200% 200%;
    border: 4px solid #ffffff;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    font-size: 2.3rem;
    box-shadow: 0 14px 45px rgba(147, 51, 234, 0.75), 0 0 45px rgba(236, 72, 153, 0.9), 0 0 65px rgba(245, 158, 11, 0.8);
    animation: storyMarkerSupernova 3s ease infinite alternate;
}

.story-marker-icon.merged .story-marker-pulse {
    position: absolute;
    top: -18px;
    left: -18px;
    right: -18px;
    bottom: -18px;
    border-radius: 50%;
    border: 3.5px solid #ec4899;
    animation: storyMarkerPulseMerged 1.6s infinite ease-out;
}

.story-marker-icon.merged .story-marker-pulse.pulse-ring-2 {
    position: absolute;
    top: -32px;
    left: -32px;
    right: -32px;
    bottom: -32px;
    border-radius: 50%;
    border: 3.5px solid #a855f7;
    animation: storyMarkerPulseMerged 1.6s infinite ease-out 0.5s;
}

.story-marker-icon.merged .story-marker-pulse.pulse-ring-3 {
    position: absolute;
    top: -48px;
    left: -48px;
    right: -48px;
    bottom: -48px;
    border-radius: 50%;
    border: 2.5px dashed #fbbf24;
    animation: storyMarkerPulseMerged 2.2s infinite ease-out 1s;
}

.story-marker-crown {
    position: absolute;
    top: -12px;
    right: -8px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.7);
    z-index: 10;
    animation: storyCrownFloat 2.2s ease-in-out infinite alternate;
}

@keyframes storyCrownFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-6px) scale(1.1); }
}

/* Tooltip custom styling */
.story-tooltip-custom {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    color: #581c87 !important;
    font-family: 'Be Vietnam Pro', sans-serif !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    padding: 8px 16px !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25) !important;
}

.story-tooltip-custom.story-tooltip-merged {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2.5px solid #a855f7 !important;
    box-shadow: 0 16px 50px rgba(168, 85, 247, 0.45), 0 0 30px rgba(236, 72, 153, 0.35) !important;
    animation: storyTooltipGlow 2.5s ease-in-out infinite alternate !important;
    padding: 14px 28px !important;
    border-radius: 22px !important;
    text-align: center !important;
}

.story-tooltip-custom.story-tooltip-merged.hero-tooltip {
    border: 3px solid #9333ea !important;
    box-shadow: 0 20px 60px rgba(147, 51, 234, 0.5), 0 0 40px rgba(251, 191, 36, 0.4) !important;
}

.story-hero-star {
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    letter-spacing: 1.8px !important;
    color: #d97706 !important;
    text-transform: uppercase !important;
    margin-bottom: 5px !important;
    white-space: nowrap !important;
}

.story-tooltip-custom.story-tooltip-merged b {
    color: #7e22ce !important;
    font-size: 1.35rem !important;
    display: block !important;
    margin-bottom: 4px !important;
    line-height: 1.45 !important;
    padding-top: 4px !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.story-tooltip-custom.story-tooltip-merged .story-tooltip-sublabel {
    color: #9333ea !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    display: block !important;
    margin-top: 2px !important;
    line-height: 1.25 !important;
}

.story-tooltip-custom.story-tooltip-comp {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 2px solid #c084fc !important;
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.3) !important;
    padding: 8px 16px !important;
    border-radius: 16px !important;
    text-align: center !important;
}

.story-tooltip-custom.story-tooltip-comp b {
    color: #6b21a8 !important;
    font-size: 0.95rem !important;
    display: block !important;
    margin-bottom: 2px !important;
    line-height: 1.25 !important;
}

.story-tooltip-custom.story-tooltip-comp .story-tooltip-sublabel {
    color: #c084fc !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    display: block !important;
    margin-top: 1px !important;
    line-height: 1.2 !important;
}

.story-tooltip-custom::before {
    border-top-color: rgba(255, 255, 255, 0.95) !important;
}

/* Standalone / Keep-Scale School Prominent Marker & Tooltip */
.story-tooltip-custom.story-tooltip-standalone {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 3px solid #f59e0b !important;
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.5), 0 0 35px rgba(168, 85, 247, 0.4) !important;
    padding: 14px 28px !important;
    border-radius: 22px !important;
    text-align: center !important;
    animation: storyTooltipGlow 2.5s ease-in-out infinite alternate !important;
}

.story-tooltip-custom.story-tooltip-standalone b {
    color: #7e22ce !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    display: block !important;
    margin-bottom: 4px !important;
    line-height: 1.35 !important;
    letter-spacing: -0.2px !important;
    white-space: nowrap !important;
}

.story-tooltip-custom.story-tooltip-standalone .story-tooltip-sublabel {
    color: #d97706 !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    display: block !important;
    margin-top: 3px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
}

.story-marker-icon.standalone-marker {
    width: 76px !important;
    height: 76px !important;
    background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6) !important;
    border: 3.5px solid #ffffff !important;
    box-shadow: 0 14px 45px rgba(245, 158, 11, 0.65), 0 0 35px rgba(236, 72, 153, 0.5) !important;
    font-size: 2.2rem !important;
}

.story-tooltip-custom.story-tooltip-shield {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2.5px solid #10b981 !important;
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.35), 0 0 20px rgba(52, 211, 153, 0.25) !important;
    padding: 10px 20px !important;
    border-radius: 18px !important;
    text-align: center !important;
}

.story-tooltip-custom.story-tooltip-shield b {
    color: #047857 !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    display: block !important;
    margin-bottom: 3px !important;
    line-height: 1.25 !important;
}

.story-tooltip-custom.story-tooltip-shield .story-tooltip-sublabel {
    color: #7e22ce !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    display: block !important;
    margin-top: 2px !important;
    line-height: 1.2 !important;
}

/* 13. Keyframe Animations */
@keyframes storyGradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes storyCardFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-12px);
    }
}

@keyframes storyTextGlow {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes storyCardScaleIn {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes storyBadgeShine {
    0% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }

    100% {
        box-shadow: 0 0 40px rgba(254, 240, 138, 0.8);
    }
}

@keyframes storyTitleSparkle {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(30px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes storySparklePulse {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
        box-shadow: 0 0 10px #d97706;
    }

    100% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 25px #d97706;
    }
}

@keyframes storyBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes storyBounceSparkle {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

@keyframes storyMarkerPulse {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes storyMarkerSupernova {
    0% {
        background-position: 0% 50%;
        transform: scale(1);
        box-shadow: 0 10px 35px rgba(147, 51, 234, 0.6), 0 0 25px rgba(236, 72, 153, 0.7);
    }

    50% {
        background-position: 100% 50%;
        transform: scale(1.08);
        box-shadow: 0 14px 45px rgba(236, 72, 153, 0.8), 0 0 45px rgba(251, 191, 36, 0.9);
    }

    100% {
        background-position: 0% 50%;
        transform: scale(1);
        box-shadow: 0 10px 35px rgba(147, 51, 234, 0.6), 0 0 25px rgba(236, 72, 153, 0.7);
    }
}

@keyframes storyMarkerPulseMerged {
    0% {
        transform: scale(0.6);
        opacity: 1;
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
    }

    100% {
        transform: scale(2.3);
        opacity: 0;
        box-shadow: 0 0 35px rgba(236, 72, 153, 0);
    }
}

@keyframes storyTooltipGlow {
    0% {
        border-color: #a855f7 !important;
        box-shadow: 0 10px 35px rgba(168, 85, 247, 0.4), 0 0 20px rgba(236, 72, 153, 0.3) !important;
    }

    100% {
        border-color: #ec4899 !important;
        box-shadow: 0 16px 50px rgba(236, 72, 153, 0.65), 0 0 30px rgba(251, 191, 36, 0.6) !important;
    }
}

@keyframes storyAnnounceFloat {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1) translateY(-10px);
    }
}

/* 14. Responsive Breakpoints */
@media (max-width: 992px) {
    .story-timeline-sidebar {
        display: none;
    }

    .story-card-container {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
        top: 80px;
        bottom: 120px;
    }

    .story-narrative-box {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }

    .story-top-bar {
        top: 12px;
        left: 12px;
        right: 12px;
    }
}