/* ============================================
   🎮 GAME HUB - Character Selection Screen
   ============================================ */

/* Game Hub Container */
.game-hub {
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at top, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(240, 147, 251, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Floating Background Elements */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 30px;
    height: 30px;
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
}

.floating-star::before {
    content: '⭐';
    font-size: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.floating-heart {
    position: absolute;
    left: var(--x);
    top: var(--y);
    animation: float 5s ease-in-out infinite;
    animation-delay: var(--delay);
}

.floating-heart::before {
    content: '💖';
    font-size: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 107, 157, 0.5));
}

.floating-cloud {
    position: absolute;
    left: var(--x);
    top: 10%;
    animation: floatHorizontal 20s linear infinite;
    animation-delay: var(--delay);
    opacity: 0.3;
}

.floating-cloud::before {
    content: '☁️';
    font-size: 4rem;
}

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

@keyframes floatHorizontal {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

/* Header */
.hub-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 10;
}

.main-title {
    font-size: clamp(2rem, 6vw, 4rem);
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.3));
    animation: titleGlow 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.title-emoji {
    -webkit-text-fill-color: initial;
    animation: sparkle 1.5s ease-in-out infinite;
}

.title-emoji:last-child {
    animation-delay: 0.75s;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.3)); }
    50% { filter: drop-shadow(0 4px 40px rgba(255, 255, 255, 0.5)); }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

/* Character Selection Grid */
.character-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    max-width: 1200px;
    width: 100%;
    padding: var(--spacing-md);
    position: relative;
    z-index: 10;
}

/* Character Card Base */
.character-card {
    position: relative;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.character-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.character-card:active {
    transform: translateY(-5px) scale(0.98);
}

.card-glow {
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-xl);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.character-card:hover .card-glow {
    opacity: 1;
}

.card-inner {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 450px;
}

/* Card Header */
.card-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.mascot-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lottie Animation Container */
.mascot-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.fallback-mascot {
    z-index: 1;
}

.mascot {
    font-size: 4rem;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

/* Toca Boca style - chunky, playful shadows */
.mascot-container::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 15px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    animation: shadowPulse 2s ease-in-out infinite;
}

@keyframes shadowPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.15; }
    50% { transform: translateX(-50%) scale(0.8); opacity: 0.1; }
}

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

.stars-decoration {
    display: flex;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    margin-top: var(--spacing-sm);
}

.stars-decoration span {
    animation: twinkle 2s ease-in-out infinite;
}

.stars-decoration span:nth-child(2) {
    animation-delay: 0.3s;
}

.stars-decoration span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* Photo Frame */
.photo-frame {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    padding: 5px;
    margin: var(--spacing-md) 0;
    position: relative;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kid-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-avatar {
    font-size: 4rem;
    display: none;
}

.kid-photo[src=""] + .placeholder-avatar,
.kid-photo:not([src]) + .placeholder-avatar {
    display: flex;
}

/* Card Content */
.card-content {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kid-name {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.kid-age {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.world-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.preview-icon {
    font-size: 1.5rem;
}

.preview-text {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    width: 100%;
}

.play-button {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.play-button:hover::before {
    opacity: 1;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.button-icon {
    transition: transform var(--transition-normal);
}

.play-button:hover .button-icon {
    transform: translateX(5px);
}

/* Card Sparkles */
.card-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: sparkleFloat 3s ease-in-out infinite;
}

.sparkle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.sparkle:nth-child(2) { left: 80%; top: 30%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { left: 20%; top: 70%; animation-delay: 1s; }
.sparkle:nth-child(4) { left: 70%; top: 80%; animation-delay: 1.5s; }

@keyframes sparkleFloat {
    0%, 100% { opacity: 0; transform: scale(0) translateY(0); }
    50% { opacity: 1; transform: scale(1) translateY(-20px); }
}

/* ============================================
   ZUNAIRAH'S CARD - Unicorn Theme
   ============================================ */

.zunairah-card .card-glow {
    background: linear-gradient(135deg, #FF69B4, #9B59B6, #FFD700);
    filter: blur(20px);
}

.zunairah-card .card-inner {
    border-color: rgba(255, 105, 180, 0.3);
}

.zunairah-card .photo-frame {
    background: linear-gradient(135deg, #FF69B4, #9B59B6);
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.4);
}

.zunairah-card .kid-name {
    background: linear-gradient(135deg, #FF69B4, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.unicorn-button {
    background: linear-gradient(135deg, #FF69B4, #9B59B6);
    color: white;
    box-shadow: 0 5px 20px rgba(255, 105, 180, 0.4);
}

.unicorn-mascot {
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.5));
}

/* ============================================
   MUSTAFA'S CARD - Dinosaur Theme
   ============================================ */

.mustafa-card .card-glow {
    background: linear-gradient(135deg, #2ECC71, #E67E22, #27AE60);
    filter: blur(20px);
}

.mustafa-card .card-inner {
    border-color: rgba(46, 204, 113, 0.3);
}

.mustafa-card .photo-frame {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.4);
}

.mustafa-card .kid-name {
    background: linear-gradient(135deg, #2ECC71, #E67E22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dino-button {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
    color: white;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.dino-mascot {
    filter: drop-shadow(0 0 20px rgba(46, 204, 113, 0.5));
}

.dino-sparkles .sparkle.leaf {
    background: none;
    font-size: 1.2rem;
}

/* ============================================
   HASAN'S CARD - Rainbow Theme
   ============================================ */

.hasan-card .card-glow {
    background: linear-gradient(135deg, #3498DB, #E74C3C, #F39C12, #9B59B6, #2ECC71);
    filter: blur(20px);
}

.hasan-card .card-inner {
    border-color: rgba(52, 152, 219, 0.3);
}

.hasan-card .photo-frame {
    background: linear-gradient(135deg, #3498DB, #E74C3C, #F39C12);
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.4);
}

.hasan-card .kid-name {
    background: linear-gradient(135deg, #3498DB, #E74C3C, #F39C12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rainbow-button {
    background: linear-gradient(135deg, #3498DB, #9B59B6);
    color: white;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

.bunny-mascot {
    filter: drop-shadow(0 0 20px rgba(52, 152, 219, 0.5));
}

.rainbow-sparkles .sparkle.bubble {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    width: 15px;
    height: 15px;
}

/* Footer */
.hub-footer {
    margin-top: auto;
    padding-top: var(--spacing-xl);
    text-align: center;
    position: relative;
    z-index: 10;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .character-selection {
        gap: var(--spacing-md);
    }
    
    .card-inner {
        min-height: 400px;
        padding: var(--spacing-md);
    }
    
    .mascot {
        font-size: 3rem;
    }
    
    .photo-frame {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 768px) {
    .game-hub {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .character-selection {
        grid-template-columns: 1fr;
        max-width: 350px;
    }
    
    .card-inner {
        min-height: auto;
        padding: var(--spacing-md);
    }
    
    .mascot {
        font-size: 2.5rem;
    }
    
    .photo-frame {
        width: 100px;
        height: 100px;
    }
    
    .kid-name {
        font-size: 1.5rem;
    }
    
    .play-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .character-selection {
        max-width: 300px;
    }
}
