/* ==========================================================================
   ESTILOS GERAIS DA TELA
   ========================================================================== */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f4f6f9; margin: 0; padding: 20px; color: #333; }
h1, h2 { text-align: center; margin-top: 5px; }
.container { max-width: 1300px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px; }

.painel-controle { flex: 1; min-width: 320px; background: white; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; }
.painel-sorteio { flex: 2; min-width: 500px; background: white; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

.container-premios { background: #f8f9fa; padding: 12px; border-radius: 10px; width: 100%; box-sizing: border-box; border: 1px solid #e2e8f0; margin-bottom: 15px; text-align: left; }

/* CONTAINER DA BOLA TRIDIMENSIONAL */
.area-bola {
    width: 160px;
    height: 160px;
    margin: 15px auto;
    position: relative;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #b30000);
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(179, 0, 0, 0.4), inset -10px -10px 20px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#bola-sorteada {
    color: #ffffff !important;
    text-shadow: 2px 3px 6px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    text-align: center;
}

.grid-historico { display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; margin-top: 15px; }
.bola-historico { background: #e9ecef; padding: 10px 0; border-radius: 50%; font-weight: bold; color: #6c757d; text-align: center; font-size: 14px; width: 36px; height: 36px; line-height: 16px; box-sizing: border-box; border: 1px solid #dee2e6; }
.bola-historico.sorteada { background: linear-gradient(135deg, #28a745, #1e7e34); color: white; border-color: #1e7e34; box-shadow: 0 2px 5px rgba(40,167,69,0.4); }

button { color: white; border: none; padding: 12px 20px; font-size: 14px; border-radius: 8px; cursor: pointer; margin: 5px; font-weight: bold; transition: all 0.2s; position: relative; z-index: 20; }
button:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primario { background: #007bff; }
.btn-sucesso { background: #28a745; }
.btn-perigo { background: #dc3545; }
.btn-alerta { background: #ffc107; color: #212529; }
.btn-menu { background: #6c757d; }

.status-badge { display: inline-block; padding: 8px 16px; background: #e2e8f0; border-radius: 20px; font-weight: bold; font-size: 15px; margin-bottom: 15px; color: #4a5568; }

.menu-config { display: none; position: fixed; top: 0; right: 0; width: 320px; height: 100%; background: white; box-shadow: -4px 0 15px rgba(0,0,0,0.1); padding: 25px; box-sizing: border-box; z-index: 999; overflow-y: auto; }
.menu-config h3 { border-bottom: 2px solid #f0f2f5; padding-bottom: 10px; margin-top: 0; }
.config-group { margin-bottom: 20px; text-align: left; }
.config-group label { font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px; }

/* VISUAL DA VITRINE ANTES DO JOGO COMEÇAR */
.cartela-bingo { background: white; padding: 12px; border: 2px solid #cbd5e0; border-radius: 10px; width: 230px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.3s ease; position: relative; opacity: 1; filter: none; }
.cartela-bingo table { width: 100%; border-collapse: collapse; text-align: center; }
.cartela-bingo th { background: #cbd5e0; color: #4a5568; padding: 5px; font-size: 16px; }
.cartela-bingo.status-ativa th { background: #28a745; color: white; }
.cartela-bingo td { border: 1px solid #e2e8f0; padding: 8px 4px; font-weight: bold; font-size: 16px; width: 20%; height: 35px; }
.cartela-bingo td.centro-livre { background: #edf2f7; color: #a0aec0; font-size: 12px; }

/* VISUAL DA VITRINE COM SORTEIO EM ANDAMENTO (ESMAECE NÃO VENDIDAS) */
.jogo-em-andamento .cartela-bingo { opacity: 0.35; filter: grayscale(90%); }
.jogo-em-andamento .cartela-bingo.status-ativa { border-color: #28a745; box-shadow: 0 6px 15px rgba(40,167,69,0.3); opacity: 1 !important; filter: grayscale(0%) !important; transform: translateY(-3px); }

.btn-venda, .btn-print-pos { width: 100%; margin-top: 6px; padding: 6px; font-size: 12px; border-radius: 4px; display: block; }
.btn-print-pos { background: #17a2b8; }

body.modo-tela-cheia { background: #111; color: #fff; }
body.modo-tela-cheia .painel-controle, body.modo-tela-cheia .painel-sorteio { background: #222; border: 1px solid #333; }
body.modo-tela-cheia .secao-cartelas, body.modo-tela-cheia h1, body.modo-tela-cheia .btn-menu, body.modo-tela-cheia .container-premios { display: none !important; }

.efeito-surgir { animation: surgimentoBola 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes surgimentoBola {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

#zona-impressao-pos { display: none !important; }

/* REGRAS TÉRMICAS POS */
/* ==========================================================================
   REGRAS TÉRMICAS POS - AJUSTADO PARA MP-4200 TH
   ========================================================================== */
/* ==========================================================================
   REGRAS TÉRMICAS POS - CORREÇÃO DE QUEBRA VERTICAL
   ========================================================================== */
/* ==========================================================================
   REGRAS TÉRMICAS POS - AJUSTE DE NEGRITO INTENSO
   ========================================================================== */
/* ==========================================================================
   REGRAS TÉRMICAS POS - CORREÇÃO DE COR E CONTRASTE ALVO
   ========================================================================== */
@media print {
    body * { display: none !important; }
    #zona-impressao-pos { display: block !important; }
    #zona-impressao-pos * { display: revert !important; }

    #zona-impressao-pos {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 72mm !important;
        margin: 0;
        padding: 0;
        font-family: 'Courier New', Courier, monospace !important;
        color: #000 !important;
        background: #fff !important;
    }

    .cupom-ticket {
        page-break-after: always;
        padding: 5px;
        margin-bottom: 20px;
        text-align: center;
    }

    .cupom-ticket table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 5px;
        table-layout: fixed !important;
    }

    /* LETRAS B-I-N-G-O EM PRETO NEGRITO PURO */
    .cabecalho-bingo-pos th {
        background: #fff !important; /* Remove o fundo preto que ocultava o texto */
        color: #000 !important;      /* Garante a cor preta */
        font-size: 18px !important;  /* Fonte grande e legível */
        font-weight: 900 !important;
        text-shadow: 0.5px 0 0 #000 !important;
        border: 1px solid #000 !important;
        padding: 6px 0 !important;
        width: 20% !important;
    }

    .cupom-ticket td {
        border: 1px solid #000 !important;
        padding: 6px 0 !important;
        font-size: 15px !important;
        font-weight: bold !important;
        color: #000 !important;
        width: 20% !important;
        text-align: center !important;
    }

    .linha-pontilhada {
        border-top: 1px dashed #000;
        margin: 8px 0;
        display: block !important;
    }

    /* TEXTO DE AGRADECIMENTO EM NEGRITO PURO */
    .rodape-agradecimento-pos {
        font-size: 13px !important;
        font-weight: 900 !important;
        color: #000 !important;
        text-shadow: 0.5px 0 0 #000 !important;
        margin-top: 5px;
        text-align: center !important;
        display: block !important;
    }
}
/* Garante contraste perfeito para o QR Code no Modo Projeção escuro */
body.modo-tela-cheia .painel-sorteio div[style*="background: #f8f9fa"] {
    background: #333 !important;
    border-color: #444 !important;
    color: #fff !important;
}
body.modo-tela-cheia .painel-sorteio div[style*="color: #4a5568"],
body.modo-tela-cheia .painel-sorteio div[style*="color: #718096"] {
    color: #cbd5e0 !important;
}
/* Estilo para quando o jogador marca manualmente */
td.manual {
    background: #ffcc00 !important; /* Cor diferente para indicar que foi ele quem marcou */
    color: #333 !important;
    border-color: #e6b800 !important;
    cursor: pointer;
}
/* Blinda o container de cartelas para cliques instantâneos */
#container-vitrine-cartelas {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}
/* ==========================================================================
   MENU CONFIGURAÇÕES RESPONSIVO - RESOLUÇÃO DE CONFLITOS (TELA CHEIA NO MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
    /* Aplicado tanto para ID quanto para classe para garantir que capture o elemento */
    #menu-config, .menu-config {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;

        /* LIMPEZA DE HERANÇAS DO PC (Evita que o menu vá para a direita) */
        margin: 0 !important;
        transform: none !important;
        inset: 0 !important;

        /* DESIGN DO APP */
        background-color: #ffffff !important;
        padding: 30px 20px !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* Ajuste para que inputs e caixas internas não estourem o limite da tela */
    #menu-config *, .menu-config * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}


