/* --- FIX: Set HTML background to prevent white bar on scroll bounce --- */
html {
    /* CHANGED: Inky Dark Blue (Purple + Dark Blue Blend) */
    background-color: #0D111A;
    scroll-behavior: smooth;
}

/* Custom styles for professional, tech-forward look */
body {
    font-family: 'Inter', sans-serif;
    /* CHANGED: Inky Dark Blue (Purple + Dark Blue Blend) */
    background-color: #0D111A; 
    color: #f0f6fc; /* Light text */
    /* Hide default cursor and use custom cursor for the main body */
    cursor: none; 
    overflow-x: hidden; /* Prevent horizontal scroll due to potential overshoots */
}

/* --- Text Selection Disabled --- */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Gradient uses the purple glow against the dark blue background */
.hero-gradient {
    /* Subtle radial gradient for depth - using purple glow on dark blue */
    background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.1), transparent 60%); 
}

/* Custom ring/shadow for interactive cards */
.card-glow:hover {
    /* Purple/blue glow retained */
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5); 
    transform: translateY(-4px) scale(1.02);
}

.floating-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.floating-badges span {
    border: 1px solid rgba(56, 189, 248, 0.5);
    padding: 0.45rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e0f2fe;
    background: rgba(8, 47, 73, 0.4);
    animation: floatBadge 6s ease-in-out infinite;
}

.floating-badges span:nth-child(2) {
    animation-delay: 1s;
}

.floating-badges span:nth-child(3) {
    animation-delay: 2s;
}

.hero-stats {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 1.5rem;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
}

.hero-stats div {
    text-align: center;
    padding: 0.5rem 0;
}

.stat-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #f8fafc;
}

.floating-orbs {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 160px;
    margin: 0 auto 1.5rem;
    pointer-events: none;
}

.orb {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    filter: blur(0.5px);
    opacity: 0.35;
    animation: orbPulse 10s ease-in-out infinite;
}

.orb-one {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.7), transparent 70%);
    top: 0;
    left: 5%;
}

.orb-two {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.7), transparent 70%);
    top: 20%;
    right: 0;
    animation-delay: 1.5s;
}

.orb-three {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.7), transparent 70%);
    bottom: 0;
    left: 25%;
    animation-delay: 3s;
}

/* --- Interactive Canvas Background + Cursor Layer --- */
.background-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #030712);
}

#dot-container {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
}

.cursor-dot,
.cursor-ring {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    transition: opacity 0.2s ease;
    opacity: 0;
    will-change: transform;
}

.cursor-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #22d3ee, #a855f7);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
}

.cursor-ring {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(59, 130, 246, 0.6);
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
    transition: transform 0.3s ease, opacity 0.2s ease, border 0.3s ease;
}

.cursor-ring.hold {
    border-color: rgba(248, 113, 113, 0.8);
}

/* Scroll to top button */
#scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 5rem; /* Adjusted to avoid gamification panel */
    width: 50px;
    height: 50px;
    background: rgba(56, 189, 248, 0.9);
    border: 2px solid rgba(56, 189, 248, 0.5);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

#scroll-to-top:hover {
    background: rgba(56, 189, 248, 1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

#scroll-to-top.show {
    display: flex;
}

.signature-grid {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 3rem 2rem;
    border-radius: 2rem;
    border: 1px solid rgba(56, 189, 248, 0.15);
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.7), rgba(8, 47, 73, 0.7));
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.6);
}

.signature-grid__intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2.5rem;
}

.signature-grid__intro h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #f8fafc;
}

.signature-grid__intro p {
    color: #94a3b8;
    line-height: 1.7;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.5em;
    font-size: 0.75rem;
    color: #38bdf8;
    margin-bottom: 1rem;
}

.signature-grid__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.signature-card {
    padding: 2rem;
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border 0.3s ease;
}

.signature-card::after {
    content: '';
    position: absolute;
    inset: -40% -20% auto;
    height: 60%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.signature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.5);
}

.signature-card:hover::after {
    opacity: 1;
}

.signature-card__icon {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.signature-card h3 {
    font-size: 1.4rem;
    color: #f8fafc;
    margin-bottom: 0.75rem;
}

.signature-card p {
    color: #cbd5f5;
    line-height: 1.6;
}

.auth-wrapper {
    max-width: 1100px;
    margin: 0 auto 4rem;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.auth-card {
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.5);
}

.auth-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #f8fafc;
}

.auth-card p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.form-status.error {
    color: #f87171;
}

.form-status.success {
    color: #34d399;
}

/* Mobile menu styles */
#mobile-menu {
    display: none;
}

#mobile-menu-button {
    display: none;
}

@media (max-width: 768px) {
    #mobile-menu-button {
        display: block;
    }
    
    #mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(13, 17, 26, 0.98);
        backdrop-filter: blur(20px);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 2rem;
        display: flex;
        flex-direction: column;
    }
    
    #mobile-menu.open {
        transform: translateX(0);
    }
    
    #mobile-menu a {
        padding: 1rem;
        font-size: 1.25rem;
        border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    }
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #38bdf8;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* --- Click Animation Style retained for fallback ripple --- */
.click-ring {
    position: fixed;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.9);
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease-out;
    z-index: 9999;
}
.click-ring.animate {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
}

/* Custom cursor style for interactive elements (links/buttons) */
a, button, .card-glow, td, table { /* Added 'table' for better hover control */
    cursor: pointer !important;
}

/* Modal Animation for Easter Egg */
.modal-show {
    opacity: 1 !important;
    visibility: visible !important;
}
.modal-show > #modal-content {
    transform: scale(1) !important;
    opacity: 1 !important;
}

/* NEW: Hover effect for Team Table Rows */
.team-row-hover:hover {
    /* CHANGED: Dark Blue-Violet mix for subtle contrast */
    background-color: #1A162B; 
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
    transform: scale(1.005);
}

/* Style for Select element arrow color */
.feedback-select {
    /* Using a simple SVG background to control the dropdown arrow color in dark mode */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M7 9l3 3 3-3m0 0H7' stroke='%23d1d5db' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem; /* Make room for the custom arrow */
}

/* Countdown Timer Styles */
.countdown-item {
    transition: all 0.3s ease;
}
.countdown-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Gamification Panel Styles - Tab Design */
#gamification-panel {
    border-radius: 1rem 0 0 1rem;
}
#gamification-panel.expanded {
    transform: translateX(0);
}
#gamification-panel:not(.expanded) {
    transform: translateX(calc(100% - 60px));
}

#collapsed-tab {
    width: 60px;
    min-height: 180px;
}

#expanded-panel {
    display: none;
}
#gamification-panel.expanded #expanded-panel {
    display: block;
}
#gamification-panel.expanded #collapsed-tab {
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
}

.writing-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

@media (max-width: 768px) {
    #gamification-panel {
        top: 5rem;
        border-radius: 1rem 0 0 1rem;
    }
    #gamification-panel:not(.expanded) {
        transform: translateX(calc(100% - 60px)) !important;
    }
    #collapsed-tab {
        width: 60px;
        min-height: 150px;
    }
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.3s ease;
}
.achievement-item.unlocked {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
}
.achievement-item.unlocked .achievement-icon {
    filter: brightness(1.2);
}

.achievement-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}
.achievement-item.unlocked .achievement-icon {
    opacity: 1;
}

.buff-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 1rem;
    text-align: center;
    padding: 0.75rem 0.5rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.buff-title {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #94a3b8;
}

.buff-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0.2rem 0;
}

.buff-meta {
    font-size: 0.7rem;
    color: #64748b;
}

        /* Point Notification Animation */
        #point-notification {
            border-radius: 0.5rem 0 0 0.5rem; /* Rounded on left side only when at edge */
        }
        #point-notification.show {
            transform: translateX(0);
        }
        @media (max-width: 768px) {
            #point-notification {
                right: 0.5rem !important;
                top: 1rem;
                border-radius: 0.5rem; /* Full rounded on mobile */
            }
        }

        /* Google AdSense Container Styles */
.ad-container {
    width: 100%;
    max-width: 728px;
    margin: 0 auto;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.5);
    border-radius: 0.5rem;
    border: 1px solid rgba(56, 189, 248, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

        .ad-container.ad-banner {
            max-width: 728px;
            min-height: 90px;
        }

        .ad-container.ad-responsive {
            max-width: 100%;
            min-height: 250px;
        }

        /* Style AdSense iframes to match dark theme */
        .ad-container ins {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* Mobile responsive ad styling */
        @media (max-width: 768px) {
            .ad-container {
                max-width: 100%;
                padding: 0.75rem;
                min-height: 100px;
            }
            
            .ad-container.ad-responsive {
                min-height: 200px;
            }
        }

        /* Mini Game Modal Styles */
        #game-modal {
            cursor: default !important;
        }
        #game-modal.show {
            opacity: 1 !important;
            visibility: visible !important;
        }
        #game-modal.show #game-modal-content {
            transform: scale(1) !important;
            opacity: 1 !important;
        }
        #game-modal-content {
            max-height: 90vh;
            overflow-y: auto;
            cursor: default !important;
        }
        #game-modal * {
            cursor: default !important;
        }
        #game-modal input,
        #game-modal textarea,
        #game-modal button {
            cursor: pointer !important;
        }
        #game-modal textarea {
            cursor: text !important;
        }
        #code-input:focus {
            outline: none;
        }
        #code-input.correct {
            border-color: #10b981;
            background-color: rgba(16, 185, 129, 0.1);
        }
        #code-input.incorrect {
            border-color: #ef4444;
            background-color: rgba(239, 68, 68, 0.1);
        }

        /* Ensure game start screen is visible */
        #game-start-screen {
            display: block !important;
        }
        #game-start-screen.hidden {
            display: none !important;
        }
        #start-game-btn {
            display: inline-block !important;
            cursor: pointer;
        }

/* --- Interactive Page Deck Styles --- */
.page-deck {
    position: relative;
    margin: 0 auto;
    margin-top: 2rem;
    margin-bottom: 4rem;
    padding: 2.5rem;
    max-width: 1200px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 2rem;
    box-shadow: 0 35px 70px rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(30px);
}

.page-deck__header h2 {
    line-height: 1.1;
}

.page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0 1.5rem;
}

.page-tab {
    flex: 1 1 120px;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.1);
    background: rgba(15, 23, 42, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: #cbd5f5;
    transition: all 0.25s ease;
}

.page-tab:hover,
.page-tab:focus-visible {
    border-color: rgba(56, 189, 248, 0.6);
    color: #f8fafc;
}

.page-tab.active {
    background: linear-gradient(120deg, rgba(14, 165, 233, 0.2), rgba(168, 85, 247, 0.25));
    border-color: rgba(56, 189, 248, 0.8);
    color: #fff;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.2);
}

.page-deck__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.page-card {
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.65);
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0.15;
    transform: translateY(15px) scale(0.96);
    transition: all 0.35s ease;
}

.page-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
}

.page-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.page-card p {
    color: #cbd5f5;
    line-height: 1.7;
}

.page-pill {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(14, 165, 233, 0.15);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    display: inline-flex;
    align-self: flex-start;
}

.page-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
    color: #94a3b8;
}

.page-list li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.page-list li::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(120deg, #38bdf8, #c084fc);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.page-cta, .page-badge {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #e2e8f0;
}

.page-ghost {
    margin-top: auto;
    align-self: flex-start;
    border: 1px dashed rgba(56, 189, 248, 0.6);
    color: #e0f2fe;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.25s ease;
    background: transparent;
}

.page-ghost:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.9);
    transform: translateY(-2px);
}

.page-progress {
    margin-top: 2rem;
    height: 4px;
    background: rgba(51, 65, 85, 0.6);
    border-radius: 999px;
    overflow: hidden;
}

#page-progress-fill {
    width: 25%;
    height: 100%;
    background: linear-gradient(120deg, #38bdf8, #a855f7);
    transition: width 0.3s ease;
}

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

@keyframes orbPulse {
    0% {
        transform: scale(0.85) translateY(0);
        opacity: 0.35;
    }
    50% {
        transform: scale(1.05) translateY(-12px);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.85) translateY(0);
        opacity: 0.35;
    }
}

@media (max-width: 768px) {
    .page-deck {
        padding: 1.75rem;
    }

    .page-card {
        min-height: auto;
    }

    .page-tabs {
        flex-direction: column;
    }
}
