/* ==================== BRAINBOUND - ADVANCED STYLES ==================== */
/* Modern, Animated, Professional Game UI */

/* ==================== MODERN DARK THEME ==================== */
:root {
    /* Dark Theme Colors - Sleek & Modern */
    --bg-primary: #0A0E27;
    --bg-secondary: #151932;
    --bg-tertiary: #1E2139;
    --bg-elevated: #252A48;
    
    /* Vibrant Accent Colors */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --secondary: #EC4899;
    --accent: #F59E0B;
    
    /* Semantic Colors - Vibrant on Dark */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    
    /* Theme Gradients - Vibrant */
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-ocean: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
    --gradient-space: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-jungle: linear-gradient(135deg, #10B981 0%, #059669 100%);
    
    /* Text Colors */
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Border Colors */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.05);
    --border-accent: rgba(99, 102, 241, 0.3);
    
    /* Glass Morphism - Dark */
    --glass-bg: rgba(30, 33, 57, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Shadows - Dark Theme */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #0A0E27 0%, #151932 50%, #1E2139 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Clean Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

/* ==================== DARK CONTAINER ==================== */
.game-container {
    width: 100%;
    max-width: 1400px;
    min-height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 500;
    animation: containerFadeIn 0.8s ease-out;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== MODERN HEADER ==================== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border-radius: 20px;
    margin-bottom: 32px;
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.6s ease-out;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.game-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    position: relative;
    z-index: 1;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
    animation: logoGlow 3s ease-in-out infinite;
    letter-spacing: -1px;
}

@keyframes logoGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.8));
    }
}

.player-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.xp-display, .level-display {
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.xp-display::before,
.level-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.xp-display:hover::before,
.level-display:hover::before {
    left: 100%;
}

.xp-display:hover, .level-display:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0.1) 100%);
}

/* ==================== MENU CONTENT ==================== */
.menu-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.menu-content h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8)); }
}

/* ==================== MASCOT ==================== */
.mascot-intro {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    animation: mascotBounce 1s ease-out;
}

@keyframes mascotBounce {
    0% { transform: translateY(-100px) scale(0); opacity: 0; }
    60% { transform: translateY(10px) scale(1.1); opacity: 1; }
    80% { transform: translateY(-5px) scale(0.95); }
    100% { transform: translateY(0) scale(1); }
}

.mascot {
    font-size: 6rem;
    display: inline-block;
    animation: mascotFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.6));
}

@keyframes mascotFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.mascot-text {
    font-size: 1.4rem;
    margin-top: 15px;
    color: #F9FAFB;
    font-weight: 600;
    text-shadow: 0 2px 15px rgba(102, 126, 234, 0.5);
    animation: textFadeIn 1s ease-out 0.3s both;
}

@keyframes textFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== BUTTONS ==================== */
.pack-button, .activity-btn, .btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-normal);
}

.pack-button::before, .activity-btn::before, .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.pack-button:hover::before, .activity-btn:hover::before, .btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* ==================== PACK BUTTONS ==================== */
.level-packs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.pack-button {
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: packSlideIn 0.6s ease-out backwards;
    position: relative;
}

.pack-button:nth-child(1) { animation-delay: 0.1s; }
.pack-button:nth-child(2) { animation-delay: 0.2s; }
.pack-button:nth-child(3) { animation-delay: 0.3s; }

@keyframes packSlideIn {
    from {
        opacity: 0;
        transform: translateX(-150px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.pack-button:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.pack-button[data-pack="underwater"]:hover {
    box-shadow: 0 10px 40px rgba(0, 147, 233, 0.5);
}

.pack-button[data-pack="space"]:hover {
    box-shadow: 0 10px 40px rgba(142, 45, 226, 0.5);
}

.pack-button[data-pack="jungle"]:hover {
    box-shadow: 0 10px 40px rgba(86, 171, 47, 0.5);
}

.pack-icon {
    font-size: 5rem;
    animation: iconSpin 0.6s ease-out;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
    transition: all 0.3s ease;
}

.pack-button:hover .pack-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.6));
}

@keyframes iconSpin {
    from { transform: rotate(-180deg) scale(0); }
    to { transform: rotate(0) scale(1); }
}

.pack-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #F9FAFB;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.pack-info {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    text-align: center;
}

/* ==================== ACTIVITIES ==================== */
.activities-section {
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.activities-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.activity-btn {
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 150px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    animation: activityPop 0.5s ease-out backwards;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.activity-btn:nth-child(1) { animation-delay: 0.5s; }
.activity-btn:nth-child(2) { animation-delay: 0.6s; }
.activity-btn:nth-child(3) { animation-delay: 0.7s; }

@keyframes activityPop {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.activity-btn:hover {
    transform: translateY(-8px) rotate(2deg);
    box-shadow: var(--shadow-lg);
}

.activity-btn .activity-icon {
    font-size: 3.5rem !important;
    display: block !important;
    line-height: 1 !important;
    animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.activity-btn .activity-label {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    display: block !important;
}

/* ==================== DEBUG PANEL ==================== */
.debug-panel {
    margin-top: 40px; /* Same as activities-section for consistent spacing */
    margin-bottom: 40px; /* Same gap below as above */
    padding: 25px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 500; /* Higher z-index to stay above nav */
    animation: debugSlideUp 0.6s ease-out 0.8s both;
}

@keyframes debugSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.debug-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.debug-label {
    color: rgba(255, 255, 255, 0.7);
}

.debug-value {
    color: var(--neon-green);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.debug-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.debug-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15));
    transform: translateY(-2px);
    box-shadow: var(--glow-blue);
}

/* ==================== LEVEL SELECT ==================== */
#levelSelect {
    width: 100%;
}

.level-select-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.level-select-content .back-button {
    margin-top: 0;
    margin-bottom: 20px;
}

#levelSelect h2 {
    text-align: center;
    color: #F9FAFB;
    margin: 0 0 20px 0;
    font-size: 2rem;
}

.level-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0;
    max-width: 100%;
}

.level-card {
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: levelCardPop 0.4s ease-out backwards;
}

.level-card:nth-child(n) {
    animation-delay: calc(0.05s * var(--i, 1));
}

@keyframes levelCardPop {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.level-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
    position: fixed;
    bottom: 20px; /* Back to bottom of screen */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-xl);
    z-index: 100; /* Lower z-index so it stays behind content */
    animation: navSlideUp 0.6s ease-out 1s both;
}

@keyframes navSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all var(--transition-normal);
    color: #fff;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.nav-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ==================== SCREENS ==================== */
.screen {
    display: none;
    animation: screenFadeIn 0.5s ease-out;
}

.screen.active {
    display: block;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        border-radius: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .player-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .level-packs {
        grid-template-columns: 1fr;
    }
    
    .activities-grid {
        grid-template-columns: 1fr;
    }
    
    .bottom-nav {
        width: 90%;
        padding: 10px 15px;
        bottom: 15px; /* Back to bottom for mobile */
    }
    
    .nav-btn {
        padding: 10px 15px;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
}

/* ==================== LOADING ANIMATION ==================== */
.loading {
    display: inline-block;
    animation: loadingDots 1.4s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ==================== UTILITY CLASSES ==================== */
.glow-blue { box-shadow: var(--glow-blue) !important; }
.glow-pink { box-shadow: var(--glow-pink) !important; }
.glow-green { box-shadow: var(--glow-green) !important; }

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* ==================== BACK BUTTON - ADVANCED STYLE ==================== */
.back-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    z-index: 10;
    animation: backButtonSlideIn 0.6s ease-out;
}

@keyframes backButtonSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Ripple effect on click */
.back-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.back-button:active::before {
    width: 300px;
    height: 300px;
}

/* Hover effect */
.back-button:hover {
    transform: translateX(-5px) scale(1.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg), var(--glow-blue);
}

/* Arrow animation */
.back-button::after {
    content: '←';
    position: absolute;
    left: 15px;
    font-size: 1.5rem;
    transition: all var(--transition-normal);
}

.back-button:hover::after {
    left: 10px;
    animation: arrowBounce 0.6s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-5px);
    }
}

/* Glow pulse effect */
.back-button:hover {
    animation: backButtonGlow 1.5s ease-in-out infinite;
}

@keyframes backButtonGlow {
    0%, 100% {
        box-shadow: var(--shadow-lg), 0 0 15px rgba(0, 243, 255, 0.3);
    }
    50% {
        box-shadow: var(--shadow-xl), 0 0 30px rgba(0, 243, 255, 0.6);
    }
}

/* Active/Click effect */
.back-button:active {
    transform: translateX(-3px) scale(0.98);
    box-shadow: var(--shadow-sm);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .back-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* ==================== GAME HEADER BAR (for back button in game screen) ==================== */
.game-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(15px);
    border-radius: 20px;
    margin: 0 auto 25px auto;
    max-width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    animation: headerSlideDown 0.6s ease-out;
}

@keyframes headerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-header-bar h3 {
    color: #fff;
    font-size: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Hint button styling */
.hint-button {
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.hint-button:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 165, 0, 0.3));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* ==================== PRIMARY & SECONDARY BUTTONS ==================== */
.btn-primary, .btn-secondary {
    position: relative;
    padding: 15px 35px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.2));
    color: #fff;
    border-color: rgba(76, 175, 80, 0.6);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(56, 142, 60, 0.3));
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: #fff;
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15));
    box-shadow: var(--shadow-lg);
}

/* ==================== STORY SECTION ==================== */
.story-section {
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 0 auto 25px auto;
    max-width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    animation: storyFadeIn 0.8s ease-out 0.3s both;
}

@keyframes storyFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.character-dialogue {
    display: flex;
    align-items: center;
    gap: 20px;
}

.character-avatar {
    font-size: 3.5rem;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    animation: avatarBounce 2s ease-in-out infinite;
}

@keyframes avatarBounce {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.character-dialogue p {
    color: #fff;
    font-size: 1.2rem;
    line-height: 1.6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==================== GAME SCREEN ==================== */
#gameScreen {
    width: 100%;
}

.game-screen-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== PUZZLE CONTAINER ==================== */
.puzzle-container {
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(15px);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-height: 300px;
    margin: 0 auto 25px auto;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
    animation: puzzleFadeIn 0.8s ease-out 0.5s both;
}

@keyframes puzzleFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== GAME CONTROLS ==================== */
.game-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: controlsSlideUp 0.8s ease-out 0.7s both;
}

@keyframes controlsSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== PROFILE & SETTINGS SCREENS ==================== */
.profile-container, .settings-container {
    padding: 30px;
    animation: containerFadeIn 0.6s ease-out;
}

.profile-header {
    text-align: center;
    margin-bottom: 40px;
    animation: profileHeaderSlide 0.8s ease-out;
}

@keyframes profileHeaderSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-avatar {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: avatarSpin 1s ease-out;
}

@keyframes avatarSpin {
    from {
        transform: rotate(-360deg) scale(0);
    }
    to {
        transform: rotate(0) scale(1);
    }
}

.profile-header h2 {
    color: #fff;
    font-size: 2rem;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.profile-level {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-top: 10px;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    animation: statCardPop 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes statCardPop {
    from {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-top: 10px;
}

/* ==================== SETTINGS ==================== */
.settings-group {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: settingsSlideIn 0.6s ease-out backwards;
}

.settings-group:nth-child(1) { animation-delay: 0.1s; }
.settings-group:nth-child(2) { animation-delay: 0.2s; }

@keyframes settingsSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.settings-group h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.setting-item label {
    color: #fff;
    font-size: 1.1rem;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.5) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-content p {
    color: #fff;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
}


/* ==================== BACK BUTTON ICON & TEXT ==================== */
.back-icon {
    font-size: 1.5rem;
    display: inline-block;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
}

.back-text {
    position: relative;
    z-index: 1;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.back-button:hover .back-icon {
    transform: translateX(-8px);
    animation: arrowPulse 0.8s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(-8px) scale(1);
    }
    50% {
        transform: translateX(-12px) scale(1.2);
    }
}

.back-button:hover .back-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Different color variants for back button */
.back-button.ocean-theme {
    background: linear-gradient(135deg, rgba(0, 147, 233, 0.3), rgba(128, 208, 199, 0.2));
    border-color: rgba(0, 147, 233, 0.6);
}

.back-button.ocean-theme:hover {
    box-shadow: 0 0 30px rgba(0, 147, 233, 0.6);
}

.back-button.space-theme {
    background: linear-gradient(135deg, rgba(142, 45, 226, 0.3), rgba(74, 0, 224, 0.2));
    border-color: rgba(142, 45, 226, 0.6);
}

.back-button.space-theme:hover {
    box-shadow: 0 0 30px rgba(142, 45, 226, 0.6);
}

.back-button.jungle-theme {
    background: linear-gradient(135deg, rgba(86, 171, 47, 0.3), rgba(168, 224, 99, 0.2));
    border-color: rgba(86, 171, 47, 0.6);
}

.back-button.jungle-theme:hover {
    box-shadow: 0 0 30px rgba(86, 171, 47, 0.6);
}

/* Shine effect on hover */
.back-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.back-button:hover::after {
    transform: translateX(100%);
}

/* ==================== MATCHING PUZZLE STYLES ==================== */
.matching-puzzle {
    width: 100%;
    padding: 20px;
}

.matching-instructions {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.matching-instructions p {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
}

.matching-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.matching-column h4 {
    text-align: center;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.match-item {
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 15px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.05rem;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.match-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.match-item:hover::before {
    left: 100%;
}

.match-item:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.match-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #fff;
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    animation: pulse 0.6s ease-in-out;
}

.match-item.connected {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    border-color: #ffd89b;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 216, 155, 0.4);
}

.match-item.correct {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #00f2fe;
    pointer-events: none;
    animation: matchSuccess 0.6s ease-out;
}

.match-item.correct::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
}

.match-item.wrong {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border-color: #ff6b6b;
    animation: shakeWrong 0.5s ease-out;
}

.match-item.wrong::after {
    content: '✗';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
}

.match-item.matched {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #00f2fe;
    pointer-events: none;
    animation: matchSuccess 0.6s ease-out;
}

.match-item.matched::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: bold;
}

@keyframes pulse {
    0%, 100% { transform: translateY(-5px) scale(1.08); }
    50% { transform: translateY(-5px) scale(1.12); }
}

@keyframes matchSuccess {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shakeWrong {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .matching-columns {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .matching-column h4 {
        font-size: 1.1rem;
    }
    
    .match-item {
        padding: 15px;
        font-size: 0.95rem;
    }
}


/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

/* Hardware Acceleration for smooth animations */
.match-item,
.level-card,
.pack-button,
.activity-btn,
.nav-btn,
.back-button,
.btn-primary,
.btn-secondary {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Reduce motion for accessibility and performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize repaints - use transform instead of position */
.modal {
    transform: translate3d(0, 0, 0);
}

/* GPU acceleration for backdrop filters */
.game-container,
.matching-column,
.level-card {
    transform: translate3d(0, 0, 0);
}

/* Contain layout changes */
.puzzle-container {
    contain: layout style paint;
}

.level-list {
    contain: layout style;
}


/* ==================== NOTIFICATION MODAL ==================== */
.notification-modal {
    z-index: 10000;
}

.notification-modal .modal-content {
    max-width: 450px;
    text-align: center;
    padding: 40px 30px;
    animation: notificationPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconBounce 0.6s ease-out;
}

.notification-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}

.notification-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.9);
    white-space: pre-line;
}

.notification-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.notification-buttons button {
    min-width: 120px;
    padding: 12px 25px;
    font-size: 1.05rem;
}

@keyframes notificationPop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    70% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Success variant */
.notification-modal.success .notification-icon {
    color: #4caf50;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.notification-modal.success h3 {
    color: #4caf50;
}

/* Error variant */
.notification-modal.error .notification-icon {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.notification-modal.error h3 {
    color: #ff6b6b;
}

/* Info variant */
.notification-modal.info .notification-icon {
    color: #4facfe;
    text-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

.notification-modal.info h3 {
    color: #4facfe;
}

/* Warning variant */
.notification-modal.warning .notification-icon {
    color: #ffd93d;
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
}

.notification-modal.warning h3 {
    color: #ffd93d;
}


/* ==================== CLEAN DIAGONAL SHINE ==================== */
/* Pure diagonal shine - no circles, full coverage */

/* Pack Buttons - Clean Shine */
.pack-button {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pack-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.pack-button:hover::after {
    transform: translateX(100%);
}

.pack-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Activity Buttons - Clean Shine */
.activity-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.activity-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.activity-btn:hover::after {
    transform: translateX(100%);
}

.activity-btn:hover {
    transform: translateY(-8px) rotate(2deg);
}

/* Level Cards - Clean Shine */
.level-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.level-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.level-card:hover::after {
    transform: translateX(100%);
}

.level-card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Match Items - Clean Shine */
.match-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.match-item:hover::before {
    transform: translateX(100%);
}

/* Navigation Buttons - Clean Shine */
.nav-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.nav-btn:hover::after {
    transform: translateX(100%);
}

.nav-btn:hover {
    transform: translateY(-3px);
}

/* Back Button - Clean Shine */
.back-button {
    position: relative;
    overflow: hidden;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.back-button:hover::before {
    transform: translateX(100%);
}

/* Primary & Secondary Buttons - Clean Shine */
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-primary:hover::after,
.btn-secondary:hover::after {
    transform: translateX(100%);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Hint Button - Clean Shine */
.hint-button {
    position: relative;
    overflow: hidden;
}

.hint-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.hint-button:hover::after {
    transform: translateX(100%);
}


/* ==================== REMOVE ALL CIRCULAR EFFECTS ==================== */
/* Force remove any circular hover effects */

.pack-button,
.activity-btn,
.level-card,
.match-item,
.nav-btn,
.back-button,
.btn-primary,
.btn-secondary,
.hint-button {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

.pack-button:focus,
.activity-btn:focus,
.level-card:focus,
.match-item:focus,
.nav-btn:focus,
.back-button:focus,
.btn-primary:focus,
.btn-secondary:focus,
.hint-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove any ripple effects */
.pack-button::before,
.activity-btn::before,
.level-card::before,
.nav-btn::before {
    display: none !important;
}

/* Ensure no circular masks */
* {
    -webkit-mask-image: none !important;
    mask-image: none !important;
}


/* ==================== DECORATIVE CARDS ==================== */
/* Beautiful gradient cards with modern effects */

/* Pack Buttons - Decorative with Gradients */
.pack-button {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pack-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pack-button:hover::before {
    opacity: 1;
}

.pack-button[data-pack="underwater"] {
    border-color: rgba(6, 182, 212, 0.3);
}

.pack-button[data-pack="underwater"]::before {
    background: var(--gradient-ocean);
}

.pack-button[data-pack="space"] {
    border-color: rgba(139, 92, 246, 0.3);
}

.pack-button[data-pack="space"]::before {
    background: var(--gradient-space);
}

.pack-button[data-pack="jungle"] {
    border-color: rgba(16, 185, 129, 0.3);
}

.pack-button[data-pack="jungle"]::before {
    background: var(--gradient-jungle);
}

.pack-button:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    border-color: var(--primary);
}

/* Activity Buttons - Decorative */
.activity-btn {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.activity-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: 16px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.activity-btn:hover::before {
    opacity: 0.2;
}

.activity-btn:hover {
    transform: translateY(-6px) rotate(2deg);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Level Cards - Decorative with Status Colors */
.level-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-card:hover::before {
    opacity: 1;
}

.level-card.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-tertiary) 100%);
}

.level-card.completed::before {
    background: var(--success);
    opacity: 1;
}

.level-card.locked {
    border-color: var(--border-secondary);
    opacity: 0.6;
}

.level-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Match Items - Decorative */
.match-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--bg-elevated) 100%);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.match-item:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, var(--bg-elevated) 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.match-item.selected {
    background: var(--gradient-primary);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.match-item.connected {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, var(--bg-elevated) 100%);
    border-color: var(--accent);
}

.match-item.correct {
    background: var(--gradient-jungle);
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.match-item.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, var(--bg-elevated) 100%);
    border-color: var(--error);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Navigation Buttons - Decorative */
.nav-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.nav-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-light);
}

/* Primary Buttons - Decorative */
.btn-primary {
    background: var(--gradient-primary);
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-2px);
}

/* Secondary Buttons - Decorative */
.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Back Button - Decorative */
.back-button {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 12px 24px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--gradient-primary);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

/* Modal - Decorative */
.modal-content {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

/* Notification Modal - Decorative */
.notification-modal.success .modal-content {
    border-color: rgba(16, 185, 129, 0.3);
}

.notification-modal.error .modal-content {
    border-color: rgba(239, 68, 68, 0.3);
}

.notification-modal.info .modal-content {
    border-color: rgba(59, 130, 246, 0.3);
}

.notification-modal.warning .modal-content {
    border-color: rgba(245, 158, 11, 0.3);
}


/* ==================== HIDE DEBUG ELEMENTS ==================== */
/* Hide all debug/status panels */

.debug-panel,
.debug-status,
.debug-btn,
.debug-label,
.debug-value,
#loadStatus,
#aiStatus,
[onclick*="checkGameStatus"],
[onclick*="testAI"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide any status text containers */
.activities-section > div:last-child {
    display: none !important;
}


/* ==================== FLOATING ACTION BUTTON (FAB) ==================== */
/* Fixed circular menu button with shine effect */

.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.fab-main {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: 2px solid var(--primary-light);
    box-shadow: var(--shadow-glow), var(--shadow-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

/* Shine effect on FAB */
.fab-main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.fab-main:hover::after {
    transform: translateX(100%);
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), var(--shadow-xl);
}

.fab-main:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 1.8rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.fab-container.active .fab-icon {
    animation: iconPulse 0.3s ease;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* FAB Menu */
.fab-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.fab-container.active .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.fab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-accent);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    animation: fabItemSlide 0.3s ease backwards;
}

.fab-item:nth-child(1) { animation-delay: 0.05s; }
.fab-item:nth-child(2) { animation-delay: 0.1s; }
.fab-item:nth-child(3) { animation-delay: 0.15s; }
.fab-item:nth-child(4) { animation-delay: 0.2s; }

@keyframes fabItemSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fab-item:hover {
    transform: translateX(-8px);
    background: var(--gradient-primary);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.fab-item-icon {
    font-size: 1.5rem;
}

.fab-item-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Hide old bottom nav */
.bottom-nav {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }
    
    .fab-main {
        width: 56px;
        height: 56px;
    }
    
    .fab-icon {
        font-size: 1.5rem;
    }
}


/* ==================== FUN ACTIVITIES SECTION ==================== */
/* Ensure activities section is visible and properly styled */

.activities-section {
    margin-top: 40px !important;
    margin-bottom: 40px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: relative !important;
    z-index: 1 !important;
}

.activities-title {
    text-align: center !important;
    font-size: 2rem !important;
    margin-bottom: 24px !important;
    color: var(--text-primary) !important;
    display: block !important;
}

.activities-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
    width: 100% !important;
}


/* Activity Buttons Styling - Complete */
.activity-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 30px 20px !important;
    min-height: 150px !important;
    cursor: pointer !important;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 16px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-md) !important;
}

.activity-btn .activity-icon,
.activity-icon {
    font-size: 3.5rem !important;
    display: block !important;
    line-height: 1 !important;
    margin-bottom: 8px !important;
}

.activity-btn .activity-label,
.activity-label {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    text-align: center !important;
    display: block !important;
}


/* ==================== ACTIVITY BUTTONS COMPLETE STYLING ==================== */

.activity-btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    box-shadow: var(--shadow-md);
}

.activity-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: 16px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.activity-btn:hover::before {
    opacity: 0.2;
}

.activity-btn:hover {
    transform: translateY(-6px) rotate(2deg);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.activity-icon {
    font-size: 3rem !important;
    display: block !important;
    line-height: 1;
}

.activity-label {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    text-align: center;
    display: block !important;
}

/* Specific activity button colors */
.activity-games:hover {
    border-color: var(--primary);
}

.activity-safari:hover {
    border-color: var(--info);
}

.activity-custom:hover {
    border-color: var(--accent);
}


/* ==================== ACTIVITY BUTTONS - FINAL STYLING ==================== */
/* Force display of activity buttons with highest priority */

.activity-btn:hover {
    transform: translateY(-6px) rotate(2deg) !important;
    box-shadow: var(--shadow-lg) !important;
}

.activity-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        transparent 70%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.activity-btn:hover::after {
    transform: translateX(100%);
}

/* Specific activity button hover colors */
.activity-games:hover {
    border-color: var(--primary) !important;
}

.activity-safari:hover {
    border-color: var(--info) !important;
}

.activity-custom:hover {
    border-color: var(--accent) !important;
}

/* Mobile responsive for activities */
@media (max-width: 768px) {
    .activities-grid {
        grid-template-columns: 1fr !important;
    }
    
    .activity-btn {
        min-height: 120px !important;
    }
    
    .activity-icon {
        font-size: 3rem !important;
    }
}


/* ==================== LEVEL SELECT SCREEN ==================== */
.level-select-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.level-select-container h2 {
    text-align: center;
    color: #F9FAFB;
    font-size: 2rem;
    margin-bottom: 30px;
}

.level-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.level-card {
    background: linear-gradient(135deg, rgba(37, 42, 72, 0.9) 0%, rgba(30, 33, 57, 0.9) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-card:hover:not(.locked) {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.level-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.level-card.completed {
    border-color: rgba(16, 185, 129, 0.5);
}

/* ==================== GAME SCREEN ==================== */
.game-play-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.game-play-container h2 {
    text-align: center;
    color: #F9FAFB;
    font-size: 2rem;
    margin-bottom: 20px;
}

.character-dialogue {
    background: rgba(37, 42, 72, 0.9);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.character-avatar {
    font-size: 3rem;
    line-height: 1;
}

.dialogue-text {
    color: #F9FAFB;
    font-size: 1.1rem;
    margin: 0;
}

.puzzle-container {
    background: rgba(37, 42, 72, 0.9);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    min-height: 400px;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.2);
    color: #667eea;
    border: 2px solid rgba(99, 102, 241, 0.5);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.8);
}


/* ==================== PUZZLE STYLES ==================== */

/* Matching Puzzle */
.matching-puzzle {
    width: 100%;
    padding: 20px;
}

.matching-instructions {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.matching-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.matching-column {
    background: var(--bg-secondary);
    border: 2px solid var(--border-accent);
    border-radius: 12px;
    padding: 20px;
}

.matching-column h4 {
    text-align: center;
    color: var(--primary-light);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.match-item {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.1rem;
}

.match-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.match-item.selected {
    background: var(--primary);
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.match-item.connected {
    background: var(--success);
    border-color: var(--success);
    opacity: 0.7;
}

.match-item.correct {
    background: var(--success);
    border-color: var(--success);
    animation: correctPulse 0.5s ease;
}

.match-item.incorrect {
    background: var(--error);
    border-color: var(--error);
    animation: shake 0.5s ease;
}

/* Path Builder Puzzle */
.path-grid {
    display: grid;
    gap: 8px;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.grid-cell {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-cell:hover:not(.obstacle):not(.start):not(.end) {
    background: var(--bg-elevated);
    border-color: var(--primary);
    transform: scale(1.05);
}

.grid-cell.obstacle {
    background: var(--error);
    border-color: var(--error);
    cursor: not-allowed;
}

.grid-cell.start {
    background: var(--success);
    border-color: var(--success);
    cursor: default;
}

.grid-cell.end {
    background: var(--accent);
    border-color: var(--accent);
    cursor: default;
}

.grid-cell.path {
    background: var(--primary);
    border-color: var(--primary-light);
}

/* Sequence Puzzle */
.sequence-puzzle {
    width: 100%;
    padding: 20px;
}

.sequence-target {
    min-height: 150px;
    background: var(--bg-secondary);
    border: 3px dashed var(--border-accent);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.sequence-target p {
    color: var(--text-tertiary);
    font-size: 1.1rem;
}

.sequence-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.sequence-item {
    background: var(--bg-elevated);
    border: 2px solid var(--border-accent);
    border-radius: 8px;
    padding: 15px 20px;
    cursor: move;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    user-select: none;
}

.sequence-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sequence-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Logic Grid Puzzle */
.logic-grid {
    padding: 20px;
}

.clues-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border-accent);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.clues-section h4 {
    color: var(--primary-light);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.clue {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary);
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 4px;
    color: var(--text-secondary);
}

.grid-section {
    text-align: center;
    padding: 20px;
}

/* Mixed Puzzle */
.mixed-puzzle {
    padding: 20px;
}

.mixed-puzzle h4 {
    color: var(--primary-light);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
}

/* Animations */
@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .matching-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .path-grid {
        max-width: 100%;
        gap: 5px;
    }
    
    .grid-cell {
        font-size: 1.5rem;
    }
    
    .sequence-item {
        padding: 12px 15px;
        font-size: 1rem;
    }
}


/* ==================== GAME SCREEN STYLES ==================== */

.puzzle-container {
    min-height: 400px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-accent);
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
}

.story-section {
    margin: 20px 0;
}

.character-dialogue {
    background: var(--bg-secondary);
    border: 2px solid var(--border-accent);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.character-avatar {
    font-size: 3rem;
    line-height: 1;
}

.character-dialogue p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.5;
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.game-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-header-bar h3 {
    color: var(--primary-light);
    font-size: 1.5rem;
    flex: 1;
    text-align: center;
}

.hint-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.hint-button:hover {
    background: var(--warning);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}


/* ==================== FLOATING ACTION BUTTON (FAB) ==================== */

.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.fab-main {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10000;
}

.fab-main:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.6);
}

.fab-main:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 2rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.fab-main:hover .fab-icon {
    transform: rotate(-90deg);
}

.fab-menu {
    position: absolute;
    bottom: 85px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-container.active .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-accent);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    animation: fabItemSlide 0.3s ease forwards;
    opacity: 0;
}

.fab-item:nth-child(1) { animation-delay: 0.05s; }
.fab-item:nth-child(2) { animation-delay: 0.1s; }
.fab-item:nth-child(3) { animation-delay: 0.15s; }
.fab-item:nth-child(4) { animation-delay: 0.2s; }
.fab-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes fabItemSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fab-item:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.fab-item-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.fab-item-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }
    
    .fab-main {
        width: 60px;
        height: 60px;
    }
    
    .fab-icon {
        font-size: 1.75rem;
    }
    
    .fab-menu {
        bottom: 75px;
    }
    
    .fab-item {
        padding: 10px 16px;
    }
    
    .fab-item-icon {
        font-size: 1.3rem;
    }
    
    .fab-item-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .fab-container {
        bottom: 15px;
        right: 15px;
    }
    
    .fab-main {
        width: 55px;
        height: 55px;
    }
    
    .fab-icon {
        font-size: 1.5rem;
    }
}


/* ==================== FORCE WHITE TEXT IN PUZZLES ==================== */
.puzzle-container,
.puzzle-container *,
.story-section,
.story-section *,
#puzzleContainer,
#puzzleContainer * {
    color: #FFFFFF !important;
}
