/* ============================================================================
   WELCOME ONBOARDING MODAL - Soul Realms First-Time User Guide
   ============================================================================ */

/* Overlay */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: welcomeFadeIn 0.5s ease;
}

.welcome-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1;
}

/* Main Container - Scroll parchment feel */
.welcome-modal-container {
    position: relative;
    z-index: 2;
    width: 92%;
    max-width: 680px;
    max-height: 88vh;
    background: linear-gradient(135deg, rgba(18, 5, 35, 0.98), rgba(28, 10, 50, 0.98));
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 24px;
    box-shadow:
        0 0 60px rgba(255, 215, 0, 0.15),
        0 0 120px rgba(95, 0, 185, 0.15),
        0 30px 80px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: welcomeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header */
.welcome-modal-header {
    padding: 2rem 2.5rem 1.5rem;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    flex-shrink: 0;
}

.welcome-scroll-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
    animation: welcomeFloat 3s ease-in-out infinite;
}

.welcome-modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #ffd700, #ffdf33, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: welcomeShimmer 4s ease-in-out infinite;
    text-shadow: none;
}

.welcome-modal-header .welcome-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    color: rgba(224, 208, 255, 0.85);
    margin: 0;
    font-style: italic;
}

/* Scrollable Body */
.welcome-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem 2.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.welcome-modal-body::-webkit-scrollbar {
    width: 6px;
}

.welcome-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.welcome-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

/* Section styling */
.welcome-section {
    margin-bottom: 1.75rem;
}

.welcome-section:last-child {
    margin-bottom: 0;
}

.welcome-section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffd700;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.welcome-section-title .section-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.welcome-section p {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(224, 208, 255, 0.85);
    margin: 0 0 0.6rem;
}

.welcome-section p:last-child {
    margin-bottom: 0;
}

/* Play mode cards */
.welcome-play-modes {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.welcome-play-mode {
    background: linear-gradient(135deg, rgba(95, 0, 185, 0.12), rgba(69, 0, 134, 0.08));
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.welcome-play-mode:hover {
    border-color: rgba(255, 215, 0, 0.35);
    background: linear-gradient(135deg, rgba(95, 0, 185, 0.18), rgba(69, 0, 134, 0.12));
    transform: translateX(4px);
}

.welcome-play-mode-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.welcome-play-mode-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.welcome-play-mode-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffdf33;
    margin: 0;
}

.welcome-play-mode p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(224, 208, 255, 0.75);
    margin: 0;
    padding-left: 1.9rem;
}

/* Energy info box */
.welcome-energy-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    position: relative;
    overflow: hidden;
}

.welcome-energy-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.6), transparent);
}

.welcome-energy-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.welcome-energy-icon {
    font-size: 1.5rem;
    animation: welcomePulseEnergy 2s ease-in-out infinite;
}

.welcome-energy-title {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #10b981;
    margin: 0;
}

.welcome-energy-box p {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(224, 208, 255, 0.8);
    margin: 0 0 0.5rem;
}

.welcome-energy-box p:last-child {
    margin-bottom: 0;
}

.welcome-energy-highlight {
    color: #34d399;
    font-weight: 600;
}

/* Memory persistence callout */
.welcome-callout {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.welcome-callout-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.welcome-callout p {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(224, 208, 255, 0.8);
    margin: 0;
}

.welcome-callout-highlight {
    color: #a78bfa;
    font-weight: 600;
}

/* Quick start steps */
.welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    counter-reset: welcome-step;
}

.welcome-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    counter-increment: welcome-step;
}

.welcome-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1.5px solid rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd700;
    flex-shrink: 0;
}

.welcome-step-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: rgba(224, 208, 255, 0.85);
    line-height: 1.5;
}

.welcome-step-text strong {
    color: #ffdf33;
    font-weight: 600;
}

/* Footer */
.welcome-modal-footer {
    padding: 1.25rem 2.5rem 1.75rem;
    text-align: center;
    border-top: 1px solid rgba(255, 215, 0, 0.12);
    background: linear-gradient(0deg, rgba(255, 215, 0, 0.04) 0%, transparent 100%);
    flex-shrink: 0;
}

.welcome-begin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 2.5rem;
    background: linear-gradient(135deg, #ffd700, #f5c400);
    color: #120523;
    border: none;
    border-radius: 14px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 20px rgba(255, 215, 0, 0.3),
        0 0 40px rgba(255, 215, 0, 0.1);
    letter-spacing: 0.02em;
}

.welcome-begin-btn:hover {
    background: linear-gradient(135deg, #ffdf33, #ffd700);
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(255, 215, 0, 0.4),
        0 0 60px rgba(255, 215, 0, 0.15);
}

.welcome-begin-btn:active {
    transform: translateY(0);
}

.welcome-footer-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: rgba(224, 208, 255, 0.4);
    margin: 0.75rem 0 0;
}

/* Divider */
.welcome-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    margin: 0.25rem 0;
    border: none;
}

/* Animations */
@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes welcomeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes welcomeShimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

@keyframes welcomePulseEnergy {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.85; }
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .welcome-modal-container {
        width: 95%;
        max-height: 92vh;
        border-radius: 18px;
    }

    .welcome-modal-header {
        padding: 1.5rem 1.5rem 1.25rem;
    }

    .welcome-scroll-icon {
        font-size: 2.5rem;
    }

    .welcome-modal-body {
        padding: 1.25rem 1.5rem;
    }

    .welcome-modal-footer {
        padding: 1rem 1.5rem 1.5rem;
    }

    .welcome-play-mode {
        padding: 0.85rem 1rem;
    }

    .welcome-play-mode p {
        padding-left: 0;
    }

    .welcome-begin-btn {
        width: 100%;
        padding: 0.85rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .welcome-modal-container {
        width: 98%;
        border-radius: 14px;
    }

    .welcome-modal-header {
        padding: 1.25rem 1.25rem 1rem;
    }

    .welcome-modal-header h2 {
        font-size: 1.4rem;
    }

    .welcome-modal-body {
        padding: 1rem 1.25rem;
    }

    .welcome-section-title {
        font-size: 1.05rem;
    }

    .welcome-modal-footer {
        padding: 0.85rem 1.25rem 1.25rem;
    }
}
