/* ============================================================
   Melate el Chocolate - Estilos principales
   Paleta Chocolate, Crema y Dorado + Bootstrap 5
   ============================================================ */

:root {
    /* Paleta Chocolate */
    --ml-cafe-muy-oscuro: #1F1105;
    --ml-cafe-oscuro:     #3D2817;
    --ml-cafe-medio:      #6B4423;
    --ml-cafe-claro:      #A6714D;
    --ml-crema:           #F5F1E8;
    
    /* Acentos (mantienen conceptos previos) */
    --ml-dorado:          #f0c040;
    --ml-dorado-dark:     #c9a100;
    --ml-blanco:          #ffffff;
    
    /* Colores para compatibilidad (renombrados) */
    --ml-verde:           --ml-cafe-oscuro;
    --ml-verde-oscuro:    --ml-cafe-muy-oscuro;
    --ml-verde-claro:     --ml-cafe-medio;
    --ml-verde-light:     #f5f0e8;
    
    --ml-texto:           #2a2a2a;
    --ml-rojo:            #dc3545;
    --ml-naranja:         #fd7e14;
    --ml-azul:            #0d6efd;
    --ml-shadow:          0 4px 18px rgba(31,17,5,.22);
    --ml-radius:          12px;
}

/* ---- Body ---- */
body {
    background-color: var(--ml-crema);
    color: var(--ml-texto);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar-mellatron {
    background: var(--ml-cafe-muy-oscuro);
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
    padding: .6rem 1rem;
}
.navbar-mellatron .navbar-brand {
    color: var(--ml-dorado) !important;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: .04em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    filter: none;
    padding: 0;
}
.navbar-mellatron .navbar-brand .navbar-brand-logo {
    display: block;
    width: auto;
    height: 42px;
    max-width: min(72vw, 360px);
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(255,255,255,.25));
}
.navbar-mellatron .nav-link {
    color: rgba(255,255,255,.88) !important;
    font-weight: 500;
    transition: color .2s;
}
.navbar-mellatron .nav-link:hover,
.navbar-mellatron .nav-link.active {
    color: var(--ml-dorado) !important;
}
.navbar-mellatron .navbar-toggler {
    border-color: rgba(255,255,255,.35);
}
.navbar-mellatron .navbar-toggler-icon {
    filter: invert(1);
}

/* ---- Hero Banner ---- */
.hero-banner {
    background: linear-gradient(135deg, rgba(61, 40, 23, 0.18), rgba(107, 68, 35, 0.18)), url('../img/background.jpg');
    background-size: cover;
    background-position: center 58%;
    background-repeat: no-repeat;
    color: #fff;
    min-height: 420px;
    margin-bottom: 2rem;
    border-radius: 0 0 var(--ml-radius) var(--ml-radius);
    display: flex;
    align-items: center;
}
.hero-banner .container { padding: 2rem 0; }
.hero-banner h1 { font-weight: 800; }
.hero-banner .bolsa-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--ml-dorado);
    text-shadow: 1px 1px 4px rgba(0,0,0,.3);
}

/* ---- Tarjetas (game cards) ---- */
.card-mellatron {
    border: none;
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    transition: transform .2s, box-shadow .2s;
    background: #fff;
}
.card-mellatron:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(26,127,60,.22);
}
.card-mellatron .card-header {
    border-radius: var(--ml-radius) var(--ml-radius) 0 0 !important;
    font-weight: 700;
    font-size: 1.05rem;
    padding: .75rem 1.25rem;
}
.header-melate    { background: linear-gradient(90deg, var(--ml-cafe-oscuro), var(--ml-cafe-medio)); color: #fff; }
.header-revancha  { background: linear-gradient(90deg, #2c5282, #2c7a8f); color: #fff; }
.header-revanchita{ background: linear-gradient(90deg, #5a3d6e, #7a5c8f); color: #fff; }

/* ---- Bolas de números ---- */
.bola-container {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: center;
    padding: .8rem 0;
}
.bola {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .95rem;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: inset 0 -3px 6px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.15);
    cursor: default;
    user-select: none;
    transition: transform .15s;
}
.bola:hover { transform: scale(1.12); }

/* Colores de bola por tipo */
.bola-melate {
    background: radial-gradient(circle at 30% 30%, #7d4e2d 0%, #4a2c16 70%, #2b1608 100%);
    color: #fff;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3), inset -2px -2px 5px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}
.bola-revancha   { background: linear-gradient(145deg, #3d5a80, #1e3a5f); color: #fff; }
.bola-revanchita { background: linear-gradient(145deg, #6b4d7a, #4a2f5f); color: #fff; }
.bola-adicional {
    background: radial-gradient(circle at 30% 30%, #ffd700 0%, #d4af37 60%, #b8860b 100%);
    color: #212529;
    box-shadow: 2px 4px 10px rgba(212, 175, 55, 0.3), inset -1px -1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Bolas para estadísticas (caliente/frio/normal) */
.bola-caliente   { background: linear-gradient(145deg, #c86432, #8b4513); color: #fff; }
.bola-frio       { background: linear-gradient(145deg, #4d7a8f, #2c5282); color: #fff; }
.bola-retardo    { background: linear-gradient(145deg, #8e44ad, #5b2c6f); color: #fff; }
.bola-normal     { background: linear-gradient(145deg, #8B7355, #5D4E37); color: #fff; }
.bola-sugerida   { background: linear-gradient(145deg, #f0c040, #d4a70e); color: #212529; }
.bola-zodiacal   { background: linear-gradient(145deg, #8b5a8f, #5d3d6b); color: #fff; }

/* Predicciones: combinación sugerida por estadística */
.bola-sug-caliente { background: linear-gradient(145deg, #ef5350, #c62828); color: #fff; }
.bola-sug-frio     { background: linear-gradient(145deg, #64b5f6, #1565c0); color: #fff; }
.bola-sug-retardo  { background: linear-gradient(145deg, #ab47bc, #6a1b9a); color: #fff; }

/* Logo con efecto chocolate 3D */
.logo-chocolate {
    display: block;
    width: min(100%, 760px);
    height: auto;
    max-height: none;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 245, 225, 0.4));
    transition: transform 0.3s ease;
}
.hero-banner .logo-chocolate {
    width: min(100%, 760px);
}
.logo-chocolate:hover {
    transform: scale(1.05);
}

.bola-sm {
    width: 36px;
    height: 36px;
    font-size: .82rem;
}
.bola-lg {
    width: 58px;
    height: 58px;
    font-size: 1.2rem;
}

/* ---- Separador adicional ---- */
.sep-adicional {
    color: var(--ml-dorado-dark);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 .2rem;
    align-self: center;
}

/* ---- Badges ---- */
.badge-concurso {
    background: rgba(240, 192, 64, .82);
    color: #1f1105;
    font-size: .78rem;
    border-radius: 6px;
    padding: .2rem .55rem;
    font-weight: 700;
}
.badge-bolsa {
    background: var(--ml-dorado);
    color: #212529;
    font-weight: 700;
    border-radius: 6px;
    padding: .25rem .65rem;
}

/* ---- Estadísticas ---- */
.freq-bar-container { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.freq-num   { width: 32px; font-weight: 700; text-align: right; font-size: .88rem; }
.freq-bar   {
    height: 16px;
    border-radius: 4px;
    transition: width .5s ease;
    min-width: 4px;
}
.freq-bar-hot {
    background: linear-gradient(90deg, #ffb347 0%, #ff7043 45%, #e53935 100%);
}
.freq-bar-cold {
    background: linear-gradient(90deg, #64b5f6 0%, #1e88e5 45%, #0d47a1 100%);
}
.freq-count { font-size: .8rem; color: #666; }

.stat-card {
    background: #fff;
    border-radius: var(--ml-radius);
    box-shadow: 0 4px 18px rgba(31,17,5,.18);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.stat-card h5 {
    font-weight: 700;
    color: var(--ml-cafe-oscuro);
    border-bottom: 2px solid var(--ml-cafe-medio);
    padding-bottom: .4rem;
    margin-bottom: 1rem;
}

/* ---- Tabla historial ---- */
.tabla-historial th { background: var(--ml-cafe-oscuro); color: #fff; }
.tabla-historial td { vertical-align: middle; }
.tabla-historial .bola { width: 30px; height: 30px; font-size: .78rem; }
.historial-page .bola {
    animation: none !important;
    transition: none !important;
}
.historial-page .bola:hover {
    transform: none !important;
}

/* Fila de sorteo con Primer Premio */
.fila-ganador td {
    background-color: rgba(240, 192, 64, .18) !important;
    border-top: 2px solid var(--ml-dorado) !important;
    border-bottom: 2px solid var(--ml-dorado) !important;
}
.fila-ganador td:first-child { border-left: 4px solid var(--ml-dorado) !important; }
.fila-ganador .badge-concurso,
.tabla-historial.table-hover tbody tr:hover .badge-concurso {
    color: #1f1105 !important;
    background: rgba(240, 192, 64, .95);
}

/* ---- Predicciones / Zodiac ---- */
.zodiac-card {
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    border: 2px solid transparent;
}
.zodiac-card:hover, .zodiac-card.selected {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    border-color: var(--ml-verde-claro);
}
.zodiac-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

/* ---- Sección de herramientas ---- */
.tool-card {
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.tool-card h5 { color: var(--ml-verde-oscuro); font-weight: 700; }

/* ---- Pills de naves ---- */
.nav-pills-verde .nav-link {
    color: var(--ml-cafe-oscuro);
    border: 1.5px solid var(--ml-cafe-oscuro);
    border-radius: 8px;
    margin-right: .35rem;
    font-weight: 600;
}
.nav-pills-verde .nav-link.active,
.nav-pills-verde .nav-link:hover {
    background: var(--ml-cafe-oscuro);
    color: #fff;
}

/* ---- Footer ---- */
footer {
    background: linear-gradient(135deg, var(--ml-cafe-muy-oscuro), var(--ml-cafe-oscuro));
    color: rgba(255,255,255,.8);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}
footer a { color: var(--ml-dorado); text-decoration: none; }
footer a:hover { color: #fff; }
footer .footer-title { color: var(--ml-dorado); font-weight: 700; }

/* ---- Animaciones ---- */
@keyframes rollIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.bola-animate { animation: rollIn .35s ease both; }

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .bola        { width: 38px; height: 38px; font-size: .85rem; }
    .bola-lg     { width: 46px; height: 46px; font-size: 1rem; }
    .hero-banner { min-height: 300px; background-position: center 52%; }
    .hero-banner .container { padding: 1.5rem 0; }
    .hero-banner h1 { margin-bottom: .75rem; }
    .hero-banner .logo-chocolate {
        width: min(100%, 320px);
    }
    .hero-banner .bolsa-value { font-size: 1.6rem; }
    .navbar-mellatron .navbar-brand .navbar-brand-logo {
        height: 34px;
        max-width: min(74vw, 250px);
    }
}

@media (min-width: 1400px) {
    .hero-banner {
        min-height: 520px;
        background-position: center 60%;
    }
}

@media (min-width: 1800px) {
    .hero-banner {
        min-height: 600px;
        background-position: center 62%;
    }
}

/* ---- Gráfica de calor (heatmap) ---- */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 34px));
    justify-content: center;
    gap: 6px;
    padding: .5rem;
}
@media (max-width: 576px) {
    .heatmap-grid {
        grid-template-columns: repeat(auto-fill, minmax(30px, 30px));
        gap: 5px;
    }
}
.heatmap-cell {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    cursor: default;
    transition: transform .15s;
    box-shadow: 0 2px 5px rgba(0,0,0,.12);
}
@media (max-width: 576px) {
    .heatmap-cell {
        width: 30px;
        height: 30px;
        font-size: .62rem;
    }
}
.heatmap-cell:hover { transform: scale(1.18); }

/* Calor visual estándar: frío (azul) → neutro (amarillo) → caliente (rojo) */
.heat-0  { background:#313695; color:#fff; }
.heat-1  { background:#4575b4; color:#fff; }
.heat-2  { background:#74add1; color:#10233a; }
.heat-3  { background:#abd9e9; color:#10233a; }
.heat-4  { background:#e0f3f8; color:#16324a; }
.heat-5  { background:#fee090; color:#4a2a00; }
.heat-6  { background:#fdae61; color:#4a1f00; }
.heat-7  { background:#f46d43; color:#fff; }
.heat-8  { background:#d73027; color:#fff; }
.heat-9  { background:#a50026; color:#fff; }

/* ---- Google Adsense placeholder ---- */
.ad-slot {
    background: #faf7f2;
    border: 1px dashed #d0b191;
    border-radius: 8px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a08070;
    font-size: .8rem;
    margin: 1rem 0;
}

/* ---- Blog: cards destacadas ---- */
.blog-img-1 { background: linear-gradient(150deg, #3D2817, #8B5E3C); }
.blog-img-2 { background: linear-gradient(150deg, #1a4a2e, #2d7a4f); }
.blog-img-3 { background: linear-gradient(150deg, #1a2a5a, #2d5fa0); }
.blog-img-4 { background: linear-gradient(150deg, #3a1a5a, #6a3a8f); }
.blog-img-5 { background: linear-gradient(150deg, #5a2a10, #c06010); }

.blog-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(61,40,23,.10);
    box-shadow: 0 2px 14px rgba(61,40,23,.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .2s ease, box-shadow .2s ease;
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(61,40,23,.18);
}
.blog-card-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 190px;
    text-decoration: none;
    flex-shrink: 0;
}
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-icon { font-size: 3.2rem; color: rgba(255,255,255,.82); }
.blog-card-body {
    padding: 1.2rem 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.blog-card-meta   { font-size: .78rem; color: #999; margin-bottom: .45rem; }
.blog-card-title  { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin-bottom: .55rem; }
.blog-card-title a {
    color: var(--ml-cafe-oscuro);
    text-decoration: none;
}
.blog-card-title a:hover { color: var(--ml-dorado-dark); text-decoration: underline; }
.blog-card-excerpt {
    font-size: .9rem;
    color: #555;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 1rem;
}
.blog-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--ml-cafe-oscuro);
    text-decoration: none;
    border-bottom: 2px solid var(--ml-cafe-medio);
    padding-bottom: 1px;
    transition: color .2s, border-color .2s;
    margin-top: auto;
    align-self: flex-start;
}
.blog-card-readmore:hover { color: var(--ml-dorado-dark); border-color: var(--ml-dorado-dark); }

/* Estadísticas: pares frecuentes en cuadrícula */
.pair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .85rem;
}
.pair-card {
    border: 1px solid rgba(61,40,23,.16);
    border-radius: 10px;
    background: #fff;
    padding: .7rem .75rem;
}
.pair-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .55rem;
}
.pair-rank {
    font-weight: 800;
    color: var(--ml-cafe-oscuro);
    font-size: .9rem;
}
.pair-count {
    font-size: .78rem;
    color: #6b7280;
    font-weight: 600;
}
.pair-balls {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .55rem;
}
.pair-bar-wrap {
    height: 8px;
    background: #efe9df;
    border-radius: 999px;
    overflow: hidden;
}
.pair-bar {
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f7b955, #e2822a);
}

/* Artículo de blog */
.blog-h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ml-cafe-oscuro);
    margin-top: 1.75rem;
    margin-bottom: .65rem;
    padding-bottom: .3rem;
    border-bottom: 2px solid var(--ml-cafe-medio);
}
.blog-math {
    text-align: center;
    padding: 1rem 0;
    font-size: 1.15rem;
    overflow-x: auto;
}

.blog-article {
    background: linear-gradient(135deg, var(--ml-cafe-oscuro), var(--ml-cafe-muy-oscuro));
    overflow: hidden;
}
.blog-article-hero {
    display: block;
    width: calc(100% + 2.5rem);
    max-height: 380px;
    object-fit: cover;
    margin: -1.25rem -1.25rem 1.25rem;
    border-radius: var(--ml-radius) var(--ml-radius) 0 0;
}
.blog-article-title,
.blog-article-excerpt {
    text-align: center;
    color: var(--ml-blanco);
}
.blog-article-content {
    color: var(--ml-blanco);
    line-height: 1.75;
}
.blog-article-content p,
.blog-article-content li,
.blog-article-content blockquote,
.blog-article-content td,
.blog-article-content th {
    color: var(--ml-blanco);
}
.blog-article-content h2,
.blog-article-content .blog-h2 {
    color: var(--ml-blanco);
    text-align: left;
}
.blog-article-content h3,
.blog-article-content h4 {
    color: var(--ml-blanco);
    text-align: left;
}
.blog-article-content a {
    color: var(--ml-dorado);
}
.blog-article-content table {
    width: 100% !important;
    max-width: 100%;
    margin: 1.2rem auto;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(240, 192, 64, .55);
    background: rgba(255, 255, 255, .04);
}
.blog-article-content table th,
.blog-article-content table td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid rgba(240, 192, 64, .45) !important;
    padding: .7rem .6rem;
}
.blog-article-content table th {
    background: rgba(240, 192, 64, .22) !important;
    color: var(--ml-blanco);
}

@media (max-width: 576px) {
    .blog-article-content {
        font-size: .95rem;
    }
    .blog-article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575px) {
    .blog-entry              { flex-direction: column; }
    .blog-entry-img-wrap     { width: 100%; height: 160px; }
}

/* ---- Blog: estadísticas en artículo ---- */
.blog-article-stats {
    border-top: 1px solid rgba(255,255,255,.18);
}
.blog-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: rgba(255,255,255,.90);
    background: rgba(255,255,255,.12);
    border-radius: 999px;
    padding: .3rem .75rem;
}

.blog-like-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    padding: .3rem .9rem;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
    line-height: 1.4;
}
.blog-like-btn:hover {
    background: rgba(240,192,64,.18);
    border-color: rgba(240,192,64,.55);
    color: var(--ml-dorado);
    transform: scale(1.04);
}
.blog-like-btn.liked {
    background: rgba(240,192,64,.22);
    border-color: var(--ml-dorado);
    color: var(--ml-dorado);
}
.blog-like-btn:disabled {
    opacity: .6;
    cursor: default;
    transform: none;
}

/* Compartir */
.blog-share-sep {
    font-size: .78rem;
    color: rgba(255,255,255,.50);
    margin-left: .25rem;
}
.blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 600;
    border-radius: 999px;
    padding: .3rem .85rem;
    text-decoration: none;
    transition: opacity .2s, transform .15s;
    line-height: 1.4;
}
.blog-share-btn:hover { opacity: .85; transform: scale(1.05); }
.blog-share-fb {
    background: #1877F2;
    color: #fff;
}
.blog-share-fb:hover { color: #fff; }
.blog-share-x {
    background: #000;
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
}
.blog-share-x:hover { color: #fff; }
.blog-share-x-icon {
    width: 13px;
    height: 13px;
    fill: #fff;
    flex-shrink: 0;
}

/* ---- Blog cards: meta stats (vistas/likes) ---- */
.blog-card-meta .bi-eye,
.blog-card-meta .bi-hand-thumbs-up {
    font-size: .75rem;
    opacity: .75;
}
