/* ==================== RESET BÁSICO ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #0a0e27;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ==================== FONDO ANIMADO ==================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top, #1e3a8a 0%, transparent 50%),
        radial-gradient(ellipse at bottom, #7c2d12 0%, transparent 50%);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 10% 20%, rgba(59, 130, 246, 0.4), transparent),
        radial-gradient(2px 2px at 80% 60%, rgba(239, 68, 68, 0.4), transparent),
        radial-gradient(1px 1px at 50% 80%, rgba(168, 85, 247, 0.3), transparent),
        radial-gradient(2px 2px at 90% 30%, rgba(34, 211, 238, 0.4), transparent),
        radial-gradient(1px 1px at 20% 70%, rgba(251, 146, 60, 0.3), transparent);
    background-size: 300px 300px, 400px 400px, 350px 350px, 450px 450px, 320px 320px;
    animation: particles 40s linear infinite;
    z-index: -1;
}

@keyframes particles {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 300px 300px, -400px 400px, 350px -350px, -450px -450px, 320px 320px; }
}

/* ==================== HEADER ==================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #ef4444, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
}

header .logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 1));
}

header nav {
    display: flex;
    gap: 0.8rem;
}

header nav a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

header nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    transition: left 0.5s;
}

header nav a:hover::before {
    left: 100%;
}

header nav a:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

header nav a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(168, 85, 247, 0.3));
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
}

header .user-buttons button {
    margin-left: 1rem;
    padding: 0.7rem 1.8rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(34, 211, 238, 0.6);
}

.btn-login:hover { 
    border-color: #22d3ee;
    color: #22d3ee;
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.6);
    transform: translateY(-3px);
}

.btn-register {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

.btn-register:hover { 
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.7);
    background: linear-gradient(135deg, #60a5fa, #c084fc);
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.container {
    display: flex;
    flex-direction: column;
    padding: 2rem 3rem;
    gap: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* ==================== PAGE SECTIONS ==================== */
.page-section {
    flex: 1;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== HERO SECTION - OCULTO ==================== */
.hero-section {
    display: none;
}

.section-title {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::before {
    content: '';
    width: 5px;
    height: 40px;
    background: linear-gradient(180deg, #3b82f6, #ef4444);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
}

/* ==================== JUEGOS - SCROLL HORIZONTAL ==================== */
.game-options {
    display: flex;
    gap: 2rem;
    overflow-x: scroll;
    overflow-y: visible;
    padding: 1.5rem 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 rgba(255, 255, 255, 0.05);
}

.game-options::-webkit-scrollbar {
    height: 12px;
}

.game-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 0 1rem;
}

.game-options::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #3b82f6, #ef4444, #a855f7);
    border-radius: 10px;
    border: 2px solid rgba(10, 14, 39, 0.5);
}

.game-options::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #60a5fa, #f87171, #c084fc);
}

/* ==================== TARJETAS DE JUEGOS ==================== */
.game-card {
    min-width: 320px;
    max-width: 320px;
    height: 450px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.9), rgba(30, 58, 138, 0.3));
    backdrop-filter: blur(10px);
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(59, 130, 246, 0.3);
    display: flex;
    flex-direction: column;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 60px rgba(59, 130, 246, 0.5), 0 0 40px rgba(239, 68, 68, 0.3);
    border-color: rgba(59, 130, 246, 0.8);
}

/* ==================== IMAGEN DEL JUEGO ==================== */
.game-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2));
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid rgba(59, 130, 246, 0.4);
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.game-card:hover .game-image img {
    transform: scale(1.1);
}

.game-image .game-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.8));
    animation: floatIcon 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes floatIcon {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-15px); }
}

.game-card:hover .game-icon {
    animation: floatIcon 1s ease-in-out infinite;
    filter: drop-shadow(0 0 40px rgba(59, 130, 246, 1));
}

/* ==================== CONTENIDO DEL JUEGO ==================== */
.game-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 2;
}

.game-content h3 {
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
    color: #fff;
    font-weight: 800;
}

.game-content p {
    margin-bottom: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
}

.play-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.play-btn::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;
}

.play-btn:hover::before {
    width: 300px;
    height: 300px;
}

.play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.7);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    color: #22d3ee;
    font-weight: 800;
    font-size: 1rem;
}

/* ==================== ASIDE (BARRA LATERAL) ==================== */
aside {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ad-box {
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.9), rgba(30, 58, 138, 0.3));
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s;
    flex-shrink: 0;
}

.ad-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

.ad-box h4 {
    margin-bottom: 1rem;
    color: #3b82f6;
    font-size: 1.2rem;
    font-weight: 800;
}

.ad-box p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
}

.user-greeting {
    margin-bottom: 1rem;
}

.mini-ranking {
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.daily-tip {
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.9rem;
}

.btn-primary {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.7);
    background: linear-gradient(135deg, #60a5fa, #c084fc);
}

/* ==================== FOOTER ==================== */
footer {
    text-align: center;
    padding: 2.5rem;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(20px);
    margin-top: 4rem;
    border-top: 2px solid rgba(59, 130, 246, 0.3);
}

footer p {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #ef4444);
    transition: width 0.3s;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-links a:hover {
    color: #3b82f6;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .container {
        padding: 1.5rem 2rem;
    }
    
    aside {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    header nav {
        display: none;
    }
    
    header .logo {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    aside {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    header .user-buttons {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }
    
    header .user-buttons button {
        margin-left: 0;
        flex: 1;
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .game-card {
        min-width: 280px;
        max-width: 280px;
    }
    
    .game-options {
        padding: 1rem 0.3rem;
    }
}