/* ============================================
   MERGED WELCOME SCENE - Scene 2 + 3 Combined
   ============================================ */

/* Scene 2: Modern Feature Reveal */
.modern-welcome-scene {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

/* Animated Background Elements */
.welcome-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: orbFloat 8s ease-in-out infinite;
}

.welcome-bg-orb.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.welcome-bg-orb.orb-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    bottom: -80px;
    right: -80px;
    animation-delay: -3s;
}

.welcome-bg-orb.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    top: 50%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% { 
        transform: translate(20px, -30px) scale(1.05);
        opacity: 0.4;
    }
    50% { 
        transform: translate(-10px, 20px) scale(0.95);
        opacity: 0.35;
    }
    75% { 
        transform: translate(30px, 10px) scale(1.02);
        opacity: 0.4;
    }
}

/* Hero Section - Avatar + Name */
.welcome-hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
    margin-bottom: 1rem;
}

/* Modern Avatar */
.welcome-avatar-modern {
    position: relative;
    width: 100px;
    height: 100px;
    opacity: 0;
    animation: avatarReveal 0.8s ease-out 0.2s forwards;
}

@keyframes avatarReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.avatar-glow-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
    animation: glowSpin 4s linear infinite;
    opacity: 0.6;
}

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

.avatar-glow-ring::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: rgba(15, 15, 25, 1);
}

.avatar-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.avatar-initials {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Greeting Section */
.welcome-greeting-section {
    text-align: center;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease-out 0.4s forwards;
}

.welcome-time-greeting {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.welcome-user-name-large {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Line Accent */
.welcome-line-accent {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a78bfa, #6366f1);
    border-radius: 2px;
    margin: 1rem auto;
    opacity: 0;
    animation: lineGrow 0.6s ease-out 0.6s forwards;
}

@keyframes lineGrow {
    0% {
        opacity: 0;
        width: 0;
    }
    100% {
        opacity: 1;
        width: 60px;
    }
}

/* Motivational Quote Section */
.welcome-quote-container {
    max-width: 550px;
    padding: 0 2rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease-out 0.8s forwards;
}

.welcome-quote {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    text-align: center;
    position: relative;
}

.welcome-quote::before {
    content: '"';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5rem;
    font-family: Georgia, serif;
    color: rgba(99, 102, 241, 0.25);
    line-height: 1;
}

.welcome-quote-emphasis {
    color: #a78bfa;
    font-weight: 600;
    font-style: normal;
}

/* Feature Pills - Horizontal Flow */
.welcome-features-flow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 500px;
    margin-top: 2rem;
    padding: 0 1rem;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(15px) scale(0.9);
    animation: pillReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.feature-pill:nth-child(1) { animation-delay: 1.0s; }
.feature-pill:nth-child(2) { animation-delay: 1.1s; }
.feature-pill:nth-child(3) { animation-delay: 1.2s; }
.feature-pill:nth-child(4) { animation-delay: 1.3s; }

@keyframes pillReveal {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feature-pill-icon {
    width: 16px;
    height: 16px;
    color: #a78bfa;
}

.feature-pill-text {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

/* Subtle Particle Effect */
.welcome-particles-modern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.welcome-particle-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(167, 139, 250, 0.5);
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
}

.welcome-particle-dot:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.welcome-particle-dot:nth-child(2) { left: 20%; top: 75%; animation-delay: 1s; }
.welcome-particle-dot:nth-child(3) { left: 85%; top: 25%; animation-delay: 2s; }
.welcome-particle-dot:nth-child(4) { left: 75%; top: 80%; animation-delay: 3s; }
.welcome-particle-dot:nth-child(5) { left: 5%; top: 55%; animation-delay: 2.5s; }
.welcome-particle-dot:nth-child(6) { left: 60%; top: 10%; animation-delay: 1.5s; }

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-25px) scale(1.3);
        opacity: 0.7;
    }
}

/* ============================================
   SCENE 3: Ready Confirmation (Brief)
   ============================================ */
.ready-confirmation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.ready-checkmark {
    width: 80px;
    height: 80px;
    opacity: 0;
    animation: checkmarkReveal 0.6s ease-out 0.1s forwards;
}

@keyframes checkmarkReveal {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.ready-checkmark svg {
    width: 100%;
    height: 100%;
}

.ready-circle {
    stroke: #10b981;
    stroke-width: 2;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: circleStroke 0.6s ease-out 0.2s forwards;
}

@keyframes circleStroke {
    to {
        stroke-dashoffset: 0;
    }
}

.ready-check {
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkStroke 0.4s ease-out 0.6s forwards;
}

@keyframes checkStroke {
    to {
        stroke-dashoffset: 0;
    }
}

.ready-text {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: fadeSlideUp 0.5s ease-out 0.8s forwards;
}

/* Hide old piano key elements */
.piano-key-showcase {
    display: none !important;
}

/* Hide old welcome-showcase from original Scene 3 */
.welcome-showcase {
    display: none !important;
}

/* Override scene-2 to use new design */
.loading-scene.scene-2 {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.loading-scene.scene-3 {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .welcome-user-name-large {
        font-size: 2.2rem;
    }
    
    .welcome-quote {
        font-size: 1rem;
    }
    
    .avatar-circle {
        width: 80px;
        height: 80px;
    }
    
    .welcome-avatar-modern {
        width: 80px;
        height: 80px;
    }
    
    .avatar-initials {
        font-size: 1.75rem;
    }
    
    .welcome-features-flow {
        gap: 6px;
    }
    
    .feature-pill {
        padding: 6px 10px;
    }
    
    .feature-pill-text {
        font-size: 0.7rem;
    }
}


/* Scene 3: Final Transition */
.scene-transition-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
}

.transition-icon {
    color: #6366f1;
    opacity: 0;
    animation: slideInArrow 0.6s ease-out forwards;
}

@keyframes slideInArrow {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.scene-transition-final .scene-message {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeInText 0.6s ease-out 0.2s forwards;
}

@keyframes fadeInText {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================
   DRAMATIC SCENE 3 - Launch Sequence
   ============================================ */

.scene-launch-sequence {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Particle Explosion */
.launch-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    opacity: 0;
    animation: particleExplode 1.5s ease-out forwards;
}

.particle.p1 { background: #6366f1; animation-delay: 0s; --angle: 0deg; --distance: 150px; }
.particle.p2 { background: #8b5cf6; animation-delay: 0.05s; --angle: 30deg; --distance: 180px; }
.particle.p3 { background: #a855f7; animation-delay: 0.1s; --angle: 60deg; --distance: 160px; }
.particle.p4 { background: #ec4899; animation-delay: 0.15s; --angle: 90deg; --distance: 200px; }
.particle.p5 { background: #f43f5e; animation-delay: 0.2s; --angle: 120deg; --distance: 170px; }
.particle.p6 { background: #6366f1; animation-delay: 0.25s; --angle: 150deg; --distance: 190px; }
.particle.p7 { background: #8b5cf6; animation-delay: 0.3s; --angle: 180deg; --distance: 155px; }
.particle.p8 { background: #a855f7; animation-delay: 0.35s; --angle: 210deg; --distance: 185px; }
.particle.p9 { background: #ec4899; animation-delay: 0.4s; --angle: 240deg; --distance: 165px; }
.particle.p10 { background: #f43f5e; animation-delay: 0.45s; --angle: 270deg; --distance: 195px; }
.particle.p11 { background: #6366f1; animation-delay: 0.5s; --angle: 300deg; --distance: 175px; }
.particle.p12 { background: #8b5cf6; animation-delay: 0.55s; --angle: 330deg; --distance: 160px; }

@keyframes particleExplode {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--distance) * -1)) scale(0);
    }
}

/* Pulsing Rings */
.launch-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    border: 2px solid;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: ringPulse 1.2s ease-out forwards;
}

.ring.r1 {
    width: 100px;
    height: 100px;
    border-color: rgba(99, 102, 241, 0.6);
    animation-delay: 0.1s;
}

.ring.r2 {
    width: 160px;
    height: 160px;
    border-color: rgba(168, 85, 247, 0.4);
    animation-delay: 0.25s;
}

.ring.r3 {
    width: 220px;
    height: 220px;
    border-color: rgba(236, 72, 153, 0.3);
    animation-delay: 0.4s;
}

@keyframes ringPulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* Central Icon */
.launch-icon {
    position: relative;
    z-index: 10;
    animation: iconPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

.icon-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes iconPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Text Reveal - Ready Set Go */
.launch-text {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    height: 60px;
    overflow: hidden;
}

.launch-word {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    text-transform: uppercase;
    opacity: 0;
    position: absolute;
}

.launch-ready {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wordReveal 0.4s ease-out 0.2s forwards, wordHide 0.2s ease-in 0.5s forwards;
}

.launch-set {
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wordReveal 0.4s ease-out 0.6s forwards, wordHide 0.2s ease-in 0.9s forwards;
}

.launch-go {
    background: linear-gradient(90deg, #ec4899, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wordReveal 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1s forwards;
    font-size: 3rem;
}

@keyframes wordReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wordHide {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

/* Status Message */
.launch-status {
    position: absolute;
    bottom: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: statusFadeIn 0.5s ease-out 1.2s forwards;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981, 0 0 20px #10b981;
    animation: statusBlink 1s ease-in-out infinite 1.2s;
}

.status-text {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #10b981;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes statusFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}



/* ============================================
   DRAMATIC LAUNCH SEQUENCE - Scene 2 Finale
   ============================================ */

/* Container gets dramatic treatment */
.scene-2.scene-launching {
    animation: sceneFlash 0.3s ease-out;
}

@keyframes sceneFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

/* Main content zooms and blurs away */
.scene-2.scene-launching .modern-welcome-scene {
    animation: contentLaunch 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes contentLaunch {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
    30% {
        transform: scale(1.05) translateY(-10px);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(0.7) translateY(-100px);
        opacity: 0;
        filter: blur(20px);
    }
}

/* Big central burst effect */
.scene-2.scene-launching::before {
    content: '🚀';
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 80px;
    transform: translate(-50%, -50%) scale(0);
    animation: rocketLaunch 1s ease-out forwards;
    z-index: 1000;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.8));
}

@keyframes rocketLaunch {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-45deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.5) rotate(0deg);
        opacity: 1;
    }
    60% {
        transform: translate(-50%, calc(-50% - 50px)) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, calc(-50% - 200px)) scale(0.5) rotate(0deg);
        opacity: 0;
    }
}

/* Expanding rings */
.scene-2.scene-launching::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 4px solid #6366f1;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: burstRing 0.8s ease-out forwards;
    z-index: 999;
    box-shadow: 0 0 40px #6366f1, inset 0 0 40px rgba(99, 102, 241, 0.3);
}

@keyframes burstRing {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
        border-width: 4px;
    }
    100% {
        transform: translate(-50%, -50%) scale(8);
        opacity: 0;
        border-width: 1px;
    }
}

/* Screen flash overlay */
.scene-2.scene-launching .welcome-bg-orb {
    animation: orbFlash 0.5s ease-out forwards !important;
}

@keyframes orbFlash {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Text flies up dramatically */
.scene-2.scene-launching .welcome-greeting-section {
    animation: textFlyUp 0.8s ease-in forwards;
}

@keyframes textFlyUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-150px) scale(1.3);
        opacity: 0;
    }
}

/* Avatar pulses and disappears */
.scene-2.scene-launching .welcome-avatar-modern {
    animation: avatarPulseOut 0.6s ease-out forwards;
}

@keyframes avatarPulseOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        filter: brightness(1.5);
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Quote fades down */
.scene-2.scene-launching .welcome-quote-container {
    animation: quoteDrop 0.5s ease-in forwards;
}

@keyframes quoteDrop {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(50px);
        opacity: 0;
    }
}

/* Feature pills scatter */
.scene-2.scene-launching .feature-pill:nth-child(1) {
    animation: scatterLeft 0.6s ease-in forwards;
}
.scene-2.scene-launching .feature-pill:nth-child(2) {
    animation: scatterUp 0.6s ease-in forwards;
}
.scene-2.scene-launching .feature-pill:nth-child(3) {
    animation: scatterRight 0.6s ease-in forwards;
}

@keyframes scatterLeft {
    to { transform: translateX(-200px) rotate(-20deg); opacity: 0; }
}
@keyframes scatterUp {
    to { transform: translateY(-100px) scale(0.5); opacity: 0; }
}
@keyframes scatterRight {
    to { transform: translateX(200px) rotate(20deg); opacity: 0; }
}
