body { background-color: #f0f2f5; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

/* CARD */
.card-sorteio {
    border: none; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px; background: white; overflow: hidden; transition: transform 0.2s;
}
.card-sorteio:hover { transform: translateY(-3px); }

/* CABEÇALHO */
.card-header-custom {
    background: #2c3e50; color: white; padding: 10px 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid #ffc107;
}
.header-concurso { font-size: 1.1rem; font-weight: bold; }
.header-data-box { text-align: right; line-height: 1.2; }
.header-dia { font-size: 0.75rem; text-transform: uppercase; color: #ffc107; font-weight: 700; letter-spacing: 1px; }
.header-data { font-family: 'Roboto Mono'; font-size: 0.9rem; opacity: 0.9; }

.card-body-custom { padding: 15px; }
.moldura-tabela { border: 1px solid #e0e0e0; border-radius: 10px; background-color: #fff; padding: 5px; }

/* LINHAS - GRID PRINCIPAL */
.resultado-row { 
    display: flex; /* Mudamos de Grid para Flex para ser mais adaptável */
    align-items: center;
    padding: 0 5px; 
    height: 48px; /* Aumentei levemente (era 38px) para o card caber com folga */
    gap: 10px;
    border-bottom: 1px solid #f0f0f0; /* Adicionei uma linha suave para separar melhor */
}

/* Garante que a posição e os números tenham tamanho estável */
.pos-badge { min-width: 30px; }
.numeros-box { min-width: 140px; flex-grow: 1; } 
    align-items: center; 
    padding: 0 5px; 
    height: 38px; 
    gap: 5px;
}
.row-premio-5 { margin-top: 8px; border-top: 1px dotted #ccc; padding-top: 8px; height: auto; }

/* ELEMENTOS */
.pos-badge { font-size: 0.75rem; color: #aaa; font-weight: 700; }

.numeros-box { 
    font-family: 'Roboto Mono', monospace; 
    font-size: 1.25rem; 
    font-weight: 700; 
    display: flex; 
    gap: 3px; 
    justify-content: flex-start;
}

.digito { 
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    width: 28px; 
    height: 38px; 
    position: relative; 
    z-index: 1; 
}

/* THEMES */
.theme-b { background-color: #e3f2fd; color: #0d6efd; border-left: 1px solid #bbdefb; border-right: 1px solid #bbdefb; }
.theme-c { background-color: #e8f5e9; color: #198754; border-left: 1px solid #c8e6c9; border-right: 1px solid #c8e6c9; }
.theme-d { background-color: #fff3e0; color: #e65100; border-left: 1px solid #ffe0b2; border-right: 1px solid #ffe0b2; }
.theme-e { background-color: #f3e5f5; color: #7b1fa2; border-left: 1px solid #e1bee7; border-right: 1px solid #e1bee7; }
.theme-neutro { color: #aaa; background: none; border: none; }
.theme-reset { color: #333; background: none; border: none; font-weight: normal; }

/* PILARES */
.pilar-topo { border-top-left-radius: 8px; border-top-right-radius: 8px; border-top: 1px solid; }
.pilar-base { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; border-bottom: 1px solid; }
.pilar-meio { border-radius: 0; }

/* PROJEÇÕES */
.bloco-solido { width: 100%; text-align: center; color: white; border-radius: 6px; font-size: 1.1rem; padding: 3px 0; box-shadow: 0 2px 5px rgba(0,0,0,0.15); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.bg-b { background-color: #0d6efd; }
.bg-c { background-color: #198754; }
.bg-d { background-color: #e65100; }
.bg-e { background-color: #7b1fa2; }
.bg-soma { background: #2c3e50; color: #ffc107; border: 1px solid #ffc107; }

/* DIVISOR */
.divisor-linha { margin: 10px 0; border-top: 2px dashed #ddd; position: relative; }
.divisor-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #fff; padding: 0 10px; font-size: 0.65rem; color: #aaa; text-transform: uppercase; font-weight: bold; }

/* BICHO - SUB-GRID (A SOLUÇÃO DEFINITIVA) */
.bicho-info { 
    display: grid;
    grid-template-columns: 1fr 35px;
    align-items: center;
    gap: 2px;
    width: 100%;
}
.texto-bicho { 
    text-align: right; 
    line-height: 1; 
    overflow: hidden; 
    white-space: nowrap; 
}
.bicho-nome { 
    font-weight: 700; 
    color: #555; 
    font-size: 0.60rem; 
    text-transform: uppercase; 
    margin-bottom: 2px; 
    letter-spacing: -0.3px; 
}
.bicho-grupo { font-size: 0.65rem; color: #888; background: #eee; padding: 1px 4px; border-radius: 3px; display: inline-block; }

.bicho-img { 
    width: 32px; 
    height: 32px; 
    object-fit: contain; 
    justify-self: center; 
}

/* COMPONENTE: DUQUE INLINE (MODULAR) */
.duque-inline-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.duque-grupo-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 4px 8px;
    border-radius: 8px;
    /* FIXO: Largura calculada para caber "BORBOLETA" e alinhar todos iguais */
    width: 115px; 
    flex-shrink: 0; /* Impede que o box encolha */
}

.duque-info-texto {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    overflow: hidden; /* Segurança para não quebrar layout */
}

.duque-numero {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 2px;
}

.duque-nome-bicho {
    font-size: 0.55rem; /* Tamanho seguro para nomes longos */
    text-transform: uppercase;
    font-weight: 700;
    color: #333;
    letter-spacing: -0.2px;
    white-space: nowrap; /* Garante que fique sempre em uma linha */
}

.duque-icone {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.duque-separador {
    color: #adb5bd;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: -5px;
}

/* =========================================
   MÓDULO: ANÁLISE DE DUQUES (Grade & Stats)
   ========================================= */

/* GRADE RÍGIDA: Bicho | Linha | Bicho */
.dupla-bichos { 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    gap: 5px; 
    width: 100%;
    min-width: 180px; 
}

/* Linha divisória vertical */
.separador-vertical {
    width: 1px;
    height: 30px;
    background-color: #ddd;
    margin: 0 auto;
}

/* Ajuste fino do componente de bicho quando dentro da dupla */
.dupla-bichos .bicho-info {
    display: grid;
    grid-template-columns: 1fr 30px;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.dupla-bichos .bicho-nome {
    font-size: 0.55rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 2px;
}

.dupla-bichos .bicho-grupo { font-size: 0.55rem !important; }
.dupla-bichos .bicho-img { width: 28px !important; height: 28px !important; }

/* CAIXA DE ESTATÍSTICAS */
.stats-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.2;
    font-family: 'Roboto Mono', monospace;
    border-radius: 6px; 
    padding: 5px; 
    margin-right: 15px;
    min-width: 100px;
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-linha { 
    font-size: 0.7rem; 
    color: #2c3e50; 
    width: 100%; 
    display: flex; 
    justify-content: space-between; 
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    padding: 1px 0;
}
.stat-linha:last-child { border-bottom: none; }
.stat-label { color: #555; margin-right: 5px; }
.stat-valor { font-weight: bold; color: #000; }

/* =========================================
   MÓDULO: FREQUÊNCIA (Quentes vs Frios)
   ========================================= */

/* CABEÇALHOS DAS ZONAS */
.zone-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.zone-header {
    padding: 12px;
    text-align: center;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* TEMA QUENTE (FOGO) 🔥 */
.header-hot {
    background: linear-gradient(135deg, #ff9966, #ff5e62); /* Gradiente Laranja/Vermelho */
    border-bottom: 3px solid #d35400;
}
/* Altera o Card Padrão quando estiver dentro da zona hot */
.zone-hot .duque-grupo-box {
    border-color: #ffccbc;
    background-color: #fffbe6;
}
.zone-hot .duque-numero { color: #d35400; }
.zone-hot .rank-qtd { color: #c0392b; }

/* TEMA FRIO (GELO) ❄️ */
.header-cold {
    background: linear-gradient(135deg, #4facfe, #00f2fe); /* Gradiente Azul/Ciano */
    border-bottom: 3px solid #2980b9;
}
/* Altera o Card Padrão quando estiver dentro da zona cold */
.zone-cold .duque-grupo-box {
    border-color: #b3e5fc;
    background-color: #f0faff;
}
.zone-cold .duque-numero { color: #0288d1; }
.zone-cold .rank-qtd { color: #0277bd; }


/* LINHA DO RANKING */
.rank-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background-color: #fafafa; }

.rank-pos {
    font-weight: bold;
    color: #ccc;
    font-size: 0.8rem;
    width: 25px;
}

.rank-qtd-badge {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.03);
}

/* =========================================
   MÓDULO: PÍLULAS DE DÍGITOS (Dez/Cent/Milhar)
   ========================================= */

.digit-row {
    display: flex;
    gap: 3px; /* Espacinho entre os números */
    margin-bottom: 2px;
}

.digit-pill {
    width: 18px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 4px;
    line-height: 1;
    cursor: default;
}

/* CORES BASEADAS NAS COLUNAS (B, C, D, E) */
/* B = Azul (Milhar) */
.pill-b { background-color: #e3f2fd; color: #0d6efd; border: 1px solid #bbdefb; }
/* C = Verde (Centena/Milhar) */
.pill-c { background-color: #e8f5e9; color: #198754; border: 1px solid #c8e6c9; }
/* D = Laranja (Dezena/Centena/Milhar) */
.pill-d { background-color: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }
/* E = Roxo (Dezena/Centena/Milhar) */
.pill-e { background-color: #f3e5f5; color: #7b1fa2; border: 1px solid #e1bee7; }