:root {
    --bg-dark: #050810;
    --bg-card: #1a1f3a;
    --bg-header: rgba(10, 14, 39, 0.98);
    --neon-cyan: #00f7ff;
    --neon-pink: #ff007f;
    --neon-green: #00ff9d;
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --border-color: #2a2f4a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.text-cyan { color: var(--neon-cyan); }
.text-green { color: var(--neon-green); }
.text-pink { color: var(--neon-pink); }

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    border-bottom: 2px solid var(--border-color);
    backdrop-filter: blur(20px);
    padding: 20px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    position: relative;
    padding: 10px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-pink {
    background: var(--neon-pink);
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.4);
}

.btn-pink:hover {
    box-shadow: 0 0 40px rgba(255, 0, 127, 0.7);
    transform: translateY(-2px);
}

.btn-cyan-outline {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
}

.btn-cyan-outline:hover {
    background: rgba(0, 247, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
}

.main-footer {
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    padding: 40px 0;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 900;
}

.footer-links {
    display: flex;
    gap: 30px;
}

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

.footer-links a:hover {
    color: var(--neon-cyan);
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-18 {
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
}

.responsible-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.account-dropdown {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.account-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.account-name {
    font-size: 0.9rem;
    font-weight: bold;
}

.account-bal {
    font-size: 0.8rem;
    color: var(--neon-cyan);
}
/* =========================================
   MOBILE RESPONSIVE DESIGN (Auto-Adjust)
   ========================================= */
@media (max-width: 768px) {
    /* Header & Nav */
    .header-content { flex-direction: column; gap: 10px; padding: 10px; }
    .main-nav { display: none; /* Hide nav links on mobile, rely on footer/buttons */ }
    .header-actions { width: 100%; justify-content: center; }
    
    /* Hero Section */
    .hero-content { flex-direction: column; text-align: center; padding: 20px; }
    .hero-title { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .hero-buttons .btn { width: 100%; justify-content: center; }
    .hero-visual { display: none; /* Hide heavy graphics on mobile */ }

    /* Challenges Grid */
    .challenges-grid { grid-template-columns: 1fr !important; gap: 15px; }
    .user-status-card { flex-direction: column; gap: 15px; }
    
    /* Finance & Admin Dashboards */
    .finance-grid, .analytics-grid { grid-template-columns: 1fr !important; }
    .filter-bar { flex-wrap: wrap; }
    .table-container { overflow-x: auto; }
    
    /* Modals */
    .modal-content { width: 95% !important; margin: 10px; max-height: 90vh; }
    .modal-actions { flex-direction: column; }
    .modal-actions .btn { width: 100%; margin-bottom: 10px; }

    /* Game Controls */
    .controls-container { flex-direction: column; }
    .control-panel { width: 100% !important; }
    .stage-container { width: 100%; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .finance-value { font-size: 1.5rem; }
    .btn { font-size: 0.8rem; padding: 10px; }
}

/* =========================================
   MOBILE & PORTRAIT MODE FIXES
   ========================================= */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    body, html { overflow-x: hidden; width: 100%; }
    .container { padding: 0 15px; width: 100%; }
    
    /* Stack all grids vertically on mobile */
    .challenges-grid, .finance-grid, .analytics-grid, .number-grid { 
        grid-template-columns: 1fr !important; 
        gap: 15px;
    }
    
    /* Fix modal sizing for small screens */
    .modal-overlay { padding: 10px; align-items: flex-start; padding-top: 50px; }
    .modal-content { width: 100% !important; max-width: 100% !important; margin: 0; }
    
    /* Ensure all buttons are large enough for touch (min 44px) */
    .btn, .btn-view, .number-btn, .filter-btn, .action-btn {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 1rem;
        width: 100%;
    }
    
    /* Stack header elements vertically */
    .header-content { flex-direction: column; gap: 15px; }
    .header-actions { width: 100%; justify-content: center; flex-wrap: wrap; gap: 10px; }
    
    /* Fix overlay blocking clicks on mobile */
    .challenge-card { position: relative; }
    .card-lock-overlay { pointer-events: none; }
    .card-lock-overlay .btn-view { pointer-events: auto; position: relative; z-index: 10; }
}
