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

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --text: #eee;
    --text-muted: #aaa;
    --bg: #0f0f23;
    --card-bg: #1a1a2e;
    --border: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--primary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--accent);
    color: white;
}

.nav-dropdown {
    position: relative;
}

.nav-section-title {
    color: var(--text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: block;
    font-weight: 600;
}

.nav-section-title:hover {
    background: var(--secondary);
}

.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary);
    border-radius: 0 0 4px 4px;
    min-width: 150px;
    z-index: 100;
    list-style: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.nav-dropdown:hover .nav-submenu {
    display: block;
}

.nav-submenu li a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0;
}

.nav-submenu li a:hover,
.nav-submenu li a.active {
    background: var(--accent);
}

.navbar {
    flex-wrap: wrap;
}

.container {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.footer {
    background: var(--primary);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.card h2 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.stat-box {
    background: var(--secondary);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-box .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-box .label {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--secondary);
    color: var(--accent);
    font-weight: 600;
}

tr:hover {
    background: rgba(233, 69, 96, 0.1);
}

.number-ball {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f5f5f5, #d4d4d4 40%, #a8a8a8 80%, #888);
    color: #1a1a2e;
    font-weight: 900;
    font-size: 0.85rem;
    margin: 2px;
    border: 2px solid #999;
    box-shadow: 0 3px 8px rgba(0,0,0,0.35), inset 0 1px 2px rgba(255,255,255,0.6);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    position: relative;
    letter-spacing: -0.5px;
}

.number-ball.mega {
    background: radial-gradient(circle at 35% 35%, #ffd700, #f39c12 40%, #e67e22 80%, #d35400);
    color: #fff;
    border-color: #b8860b;
    box-shadow: 0 3px 8px rgba(0,0,0,0.35), inset 0 1px 2px rgba(255,255,255,0.5), 0 0 12px rgba(243,156,18,0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

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

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--secondary);
    color: var(--text);
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
}

.pagination a:hover,
.pagination .active {
    background: var(--accent);
    border-color: var(--accent);
}

.generated-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--secondary), var(--primary));
    border: 3px solid var(--accent);
    margin: 0.5rem;
    animation: pulse 2s infinite;
}

.generated-number.mega {
    background: linear-gradient(145deg, var(--accent), #ff6b6b);
    border-color: #ff6b6b;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hot-number {
    color: #ff6b6b;
}

.cold-number {
    color: #4ecdc4;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
}
/* ============================================
   AUTENTICACION / SESION
   ============================================ */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-auth-btn {
    background: var(--accent);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.nav-auth-btn:hover {
    opacity: 0.85;
}

@media (max-width: 768px) {
    .nav-auth {
        margin-left: 0;
        justify-content: center;
    }
}

/* ============================================
   MARCA / FOOTER LEGAL
   ============================================ */
.tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 1.5rem;
    font-style: italic;
}

.jackpot-card .number { color: #f39c12; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.2rem 0;
    white-space: nowrap;
    transition: color 0.2s;
}

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

.footer-note {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin: 0.3rem auto;
    line-height: 1.4;
    max-width: 600px;
    text-align: center;
}

.footer p { margin: 0.3rem auto; text-align: center; }

/* FAQ acordeon */
.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--card-bg);
}
.faq-q {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-q:hover { background: var(--secondary); }
.faq-a {
    display: none;
    padding: 0 1.25rem 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q { color: var(--accent); }

/* ============================================
   MOVIL / APP
   ============================================ */
@media (max-width: 768px) {
    .container { padding: 0.75rem; }
    .navbar { padding: 0.75rem 1rem; }

    .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    .nav-dropdown { width: 100%; }
    .nav-section-title {
        background: var(--secondary);
        border-radius: 6px;
        margin-bottom: 2px;
        padding: 0.7rem 1rem;
    }
    .nav-submenu {
        position: static;
        min-width: 0;
        width: 100%;
        box-shadow: none;
        background: transparent;
    }
    .nav-dropdown.open .nav-submenu { display: block; }
    .nav-submenu li a { padding: 0.55rem 1.25rem; font-size: 0.9rem; }
    .nav-auth { width: 100%; margin-top: 0.5rem; }

    .card { padding: 1rem; }
    .card table { display: block; overflow-x: auto; white-space: nowrap; }
    .filter-group { width: 100%; }
    .filter-group select,
    .filter-group input { width: 100% !important; box-sizing: border-box; }
    .chart-container { height: 260px; }
    .stat-box .number { font-size: 1.5rem; }

    #installBtn { bottom: 12px; right: 12px; }
}

@media (max-width: 480px) {
    .nav-brand { font-size: 1.25rem; }
    h1 { font-size: 1.4rem; }
    .chart-container { height: 220px; }
    .number-ball { width: 32px; height: 32px; line-height:32px; font-size: 0.75rem; }
}
