:root {
    --bg-color: #f8fafc;
    --primary: #0f172a;
    --accent-red: #dc2626;
    --accent-blue: #0284c7;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: url('img/fondo-pattern.png');
    background-repeat: repeat;
    background-position: center top;
    background-attachment: fixed;
    color: var(--primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.bg-pattern {
    display: none;
}

/* ===== HEADER ===== */
header {
    background-color: #ffffff;
    padding: 1rem 2.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

header.scrolled {
    background-color: rgba(248, 250, 252, 0.45);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo-img {
    width: 1.6rem;
    height: 1.6rem;
    object-fit: contain;
}

.menu-toggle-btn, .user-auth-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
    z-index: 2;
}

.menu-toggle-btn:hover, .user-auth-btn:hover {
    background-color: #e2e8f0;
    color: var(--accent-blue);
}

.user-account-container {
    position: relative;
    z-index: 2;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.games-grid {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    cursor: pointer;
    width: 100px;
    position: relative;
    transition: transform 0.2s ease;
}

.game-card:hover {
    transform: translateY(-3px);
}

.game-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card:hover .game-box {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.game-name {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.badge-coming-soon {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--accent-red);
    color: #ffffff;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 2;
}

.disabled-card {
    opacity: 0.85;
}

.catalog-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

/* ===== VENTANA MODAL DE AUTENTICACIÓN ===== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 1rem;
}

.auth-modal-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalScaleIn 0.25s ease;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalScaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.auth-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.auth-close-btn:hover {
    color: #000;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 0.4rem;
    border-radius: 50%;
}

.auth-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.auth-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.google-auth-btn {
    width: 100%;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

.google-auth-btn i {
    color: #db4437;
    font-size: 1.1rem;
}

.google-auth-btn:hover {
    background: #f8f9fa;
}

.auth-divider {
    text-align: center;
    border-bottom: 1px solid #eee;
    line-height: 0.1rem;
    margin: 1.25rem 0;
}

.auth-divider span {
    background: #fff;
    padding: 0 10px;
    color: #888;
    font-size: 0.85rem;
}

.auth-form .input-group {
    margin-bottom: 0.85rem;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.auth-form input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: var(--accent-blue, #0066ff);
}

.phone-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.phone-input-container:focus-within {
    border-color: var(--accent-blue, #0066ff);
}

.phone-prefix {
    background: #f1f3f5;
    padding: 0.7rem 0.7rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #ddd;
}

.phone-input-container input {
    border: none;
    border-radius: 0;
}

.phone-input-container input:focus {
    border-color: transparent;
}

.auth-error-msg {
    background: #ffe3e3;
    color: #c92a2a;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
    text-align: center;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-submit-btn:hover {
    background: #333;
}

.auth-switch-text {
    text-align: center;
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: #666;
}

.auth-switch-text a {
    color: var(--accent-blue, #0066ff);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch-text a:hover {
    text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--primary);
}

.social-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.social-icon {
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
}

.social-icon:hover { transform: translateY(-2px); }
.social-icon.wa:hover { color: #ffffff; background: #25d366; }
.social-icon.msg:hover { color: #ffffff; background: #0084ff; }
.social-icon.fb:hover { color: #ffffff; background: #1877f2; }
.social-icon.tt:hover { color: #ffffff; background: #000000; }

/* ===== 5 TARJETAS POR FILA EN PC (Y TAMAÑO AJUSTADO) ===== */
@media (min-width: 768px) {
    .game-card {
        width: calc((100% - (1.25rem * 4)) / 5);
        max-width: 150px;
    }

    .game-name {
        font-size: 0.9rem;
    }
}

/* RESPONSIVE MÓVIL */
@media (max-width: 600px) {
    .main-content {
        padding: 1.5rem 1rem;
    }

    header {
        padding: 0.8rem 1.5rem;
    }

    .games-grid {
        gap: 0.6rem;
    }

    .game-card {
        width: calc((100% - 1.2rem) / 3);
    }

    .game-name {
        font-size: 0.75rem;
    }

    .badge-coming-soon {
        font-size: 0.45rem;
        padding: 1px 3px;
        top: 2px;
        right: 2px;
    }
}