:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #8b5cf6;
    --secondary: #3b82f6;
    --accent: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 5% 4rem;
    min-height: 80vh;
    background: radial-gradient(circle at top right, #1e1b4b, transparent 40%),
        radial-gradient(circle at bottom left, #312e81, transparent 40%);
}

.hero-content {
    max-width: 50%;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(to right, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    border: 2px solid var(--secondary);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-left: 1rem;
    display: inline-block;
}

/* Dashboard */
.dashboard {
    padding: 4rem 5%;
    background: rgba(255, 255, 255, 0.02);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.stat-card h3 {
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 5rem 5%;
}

.feature-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.5));
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

.hidden {
    display: none !important;
}

/* Floating Animation - Fail-safe version */
@keyframes float {
    0% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, -20px, 0);
    }

    100% {
        transform: translate3d(0, 0, 0);
    }
}

@-webkit-keyframes float {
    0% {
        -webkit-transform: translate3d(0, 0, 0);
    }

    50% {
        -webkit-transform: translate3d(0, -20px, 0);
    }

    100% {
        -webkit-transform: translate3d(0, 0, 0);
    }
}

.phone-mockup {
    width: 300px;
    height: 600px;
    border: 12px solid #1e293b;
    border-radius: 40px;
    background: #000;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    /* Animation with translate3d forces GPU */
    -webkit-animation: float 6s ease-in-out infinite;
    animation: float 6s ease-in-out infinite;
    will-change: transform;
    overflow: hidden;
    z-index: 10;
}

/* Enhanced Hero Background */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 5% 4rem;
    min-height: 80vh;
    background: radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.15), transparent 40%),
        var(--bg-dark);
    /* Fallback */
    position: relative;
    overflow: hidden;
}

/* Background Particles (Pseudo-elements for simplicity without JS) */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
}

.hero::before {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.2);
    top: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

.hero::after {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.2);
    bottom: -100px;
    right: -100px;
    animation: float 10s ease-in-out infinite;
}

.screen-content {
    width: 100%;
    height: 100%;
    background: #000;
}

/* Image Fix - Ensure full containment without clipping */
.screen-content img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    border-radius: 28px;
    display: block;
}

/* Mini Game Section */
.game-section {
    padding: 5rem 5%;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg-dark), #1e1b4b);
}

.game-container-wrapper {
    margin-top: 2rem;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

.game-iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 20px;
}

/* Testimonials */
.testimonials {
    padding: 5rem 5%;
    background: var(--bg-card);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 20px;
    position: relative;
}

.quote {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
}

.author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Footer */
footer {
    padding: 3rem 5%;
    background: #000;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Dashboard / App Simulation Styles */
.dashboard-body {
    background-color: #0b1120;
    /* Slightly darker/different shade */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    /* Grid effect */
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-nav {
    position: relative;
    background: transparent;
    padding: 1rem 2rem;
}

.main-stage {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 2rem;
}

.phone-frame {
    width: 360px;
    height: 740px;
    background: #0f172a;
    border: 14px solid #333;
    border-radius: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.2);
}

.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: #333;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 100;
}

/* App Header */
.app-header {
    background: linear-gradient(to right, #1e1b4b, #312e81);
    padding: 3rem 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.level-badge-container {
    text-align: center;
}

.level-circle {
    width: 50px;
    height: 50px;
    border: 3px solid #f59e0b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.level-label {
    font-size: 0.7rem;
    margin-top: 4px;
    color: #94a3b8;
    text-transform: uppercase;
}

.currency-container {
    display: flex;
    gap: 10px;
}

.coin-pill,
.star-pill {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
}

.coin-icon {
    color: #ffd700;
    font-size: 1.1rem;
}

.star-icon {
    color: #60a5fa;
    font-size: 1.1rem;
}

.profile-icon img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #8b5cf6;
}

/* App Content */
.app-content-scroll {
    padding: 1.5rem;
    height: calc(100% - 180px);
    /* Space for header + footer */
    overflow-y: auto;
}

.screen-content {
    padding: 1.5rem;
    height: calc(100% - 180px);
    overflow-y: auto;
    color: white;
    /* Ensure text is visible */
}

/* Scrollbar hide */
.app-content-scroll::-webkit-scrollbar,
.screen-content::-webkit-scrollbar {
    width: 0px;
}

.welcome-card {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    padding: 1.5rem;
    border-radius: 20px;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 10px;
    margin-top: 10px;
}

.progress-bar-fill {
    background: #f59e0b;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.section-header {
    color: #cbd5e1;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.activity-card {
    background: #1e293b;
    padding: 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-card:hover {
    transform: translateY(-2px);
    background: #334155;
}

.card-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.bg-purple {
    background: #8b5cf6;
}

.bg-blue {
    background: #3b82f6;
}

.bg-orange {
    background: #f59e0b;
}

.card-info {
    flex: 1;
    color: white;
}

.card-info h5 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.card-info small {
    color: #94a3b8;
}

.card-action {
    color: #64748b;
}

/* Bottom Nav */
.app-bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    cursor: pointer;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #64748b;
    transition: color 0.2s;
}

.nav-item.active {
    color: #8b5cf6;
}

.nav-item .material-icons-round {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.nav-item .label {
    font-size: 0.7rem;
}

/* Overlay Game */
.app-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.overlay-header {
    padding: 3rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #1e293b;
    color: white;
    font-weight: bold;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.internal-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
        /* Space for navbar */
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 3rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .phone-mockup {
        width: 260px;
        height: 520px;
        margin-top: 2rem;
    }

    .stats-grid,
    .features {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .btn-outline {
        margin-left: 0;
    }

    /* Sphere Activity Styles */
    .sphere-header {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .sphere-tab {
        background: transparent;
        border: none;
        color: #64748b;
        font-weight: bold;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        cursor: pointer;
    }

    .sphere-tab.active {
        background: #0ea5e9;
        color: white;
        box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
    }

    .hex-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 1rem;
    }

    .hex-item {
        width: 90px;
        height: 100px;
        clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
        background: #1e293b;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: white;
        font-size: 0.8rem;
        cursor: pointer;
        transition: transform 0.2s;
    }

    .hex-item:hover {
        transform: scale(1.05);
    }

    .bg-blue-light {
        background: linear-gradient(135deg, #60a5fa, #3b82f6);
    }

    .bg-orange-light {
        background: linear-gradient(135deg, #fb923c, #ea580c);
    }

    .bg-pink-light {
        background: linear-gradient(135deg, #f472b6, #db2777);
    }

    .bg-green-light {
        background: linear-gradient(135deg, #4ade80, #16a34a);
    }

    .hex-item.locked {
        background: #334155;
        opacity: 0.6;
    }

    /* Calendar Styles */
    .calendar-header {
        text-align: center;
        margin-bottom: 1.5rem;
        color: white;
    }

    .progress-stats-card {
        background: #1e293b;
        padding: 1.5rem;
        border-radius: 20px;
        display: flex;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .stat-bar {
        height: 6px;
        background: #334155;
        border-radius: 4px;
        width: 100%;
        margin-top: 5px;
    }

    .circle-chart {
        width: 60px;
        height: 60px;
        border: 4px solid #334155;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
    }

    .next-lesson-card {
        background: linear-gradient(135deg, #4f46e5, #4338ca);
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 1.5rem;
        color: white;
        text-align: center;
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
        text-align: center;
        font-size: 0.9rem;
    }

    .cal-day-header {
        color: #94a3b8;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }

    .cal-day {
        padding: 8px;
        color: white;
        border-radius: 50%;
    }

    .cal-day.active {
        border: 2px solid #f59e0b;
        color: #f59e0b;
        font-weight: bold;
    }

    /* Games Grid Styles */
    .games-header {
        text-align: center;
        margin-bottom: 2rem;
        color: white;
    }

    .games-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .game-tile {
        background: #0f172a;
        border-radius: 20px;
        overflow: hidden;
        border: 1px solid #334155;
        cursor: pointer;
    }

    .game-img-placeholder {
        height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        color: white;
        font-size: 1.2rem;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }

    .bg-blue-glow {
        background: linear-gradient(45deg, #2563eb, #60a5fa);
    }

    .bg-purple-glow {
        background: linear-gradient(45deg, #7c3aed, #a78bfa);
    }

    .bg-cyan-glow {
        background: linear-gradient(45deg, #0891b2, #22d3ee);
    }

    .bg-indigo-glow {
        background: linear-gradient(45deg, #4338ca, #818cf8);
    }

    .game-info {
        padding: 10px;
        background: #1e293b;
        display: flex;
        justify-content: space-between;
        color: white;
    }

    .game-info small {
        color: #94a3b8;
    }