html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #1a1c1e;
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    overflow: hidden;
}

#sorteioScreen {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: top left;
}

/* ============ BARRA DE CONFIG ============ */
.barConfig {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .65);
    padding: 6px 14px;
    border-bottom-right-radius: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.1rem;
}
.barConfig span, .barConfig button {
    cursor: pointer;
    color: #fff;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.barConfig .lbl-sala { font-size: .85rem; background: #222; padding: 3px 10px; border-radius: 4px; }
.barConfig .lock-on { color: #e74c3c; }

/* ============ OVERLAY CONTAGEM ============ */
#countdownTimer {
    position: absolute;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, .82);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#countdownTimer .cd-msg { font-size: 1.6rem; letter-spacing: .15em; color: #f1c40f; margin-bottom: 20px; }
#seconds {
    font-size: 10rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, .06);
    border: 4px solid #f1c40f;
    border-radius: 50%;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(241, 196, 15, .5);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ============ PLACAS (Destaque / Ganhadores) ============ */
.placa {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 800;
    width: 46%;
    background: #a30000;
    border: 10px solid #f1c40f;
    border-radius: 26px;
    padding: 34px;
    text-align: center;
    box-shadow: 0 0 70px rgba(241, 196, 15, .45);
    display: none;
}
.placa.show { display: block; }
.placa .placa-titulo { font-size: 1.2rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.placa .placa-valor { font-size: 4rem; font-weight: 900; color: #f1c40f; text-shadow: 3px 3px 12px rgba(0,0,0,.6); }
.placa .placa-info { margin-top: 14px; font-size: 1.1rem; }
.placa .placa-doacao { color: #f1c40f; font-weight: 700; }
.linha-ganhador-placa {
    background: #fff;
    color: #2c3e50;
    margin: 8px auto;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    width: 80%;
}
.cartela-placa {
    margin-top: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    display: inline-block;
}
.cartela-placa .cel-placa {
    display: inline-block;
    width: 40px;
    margin: 2px;
    padding: 5px 0;
    text-align: center;
    color: #2c3e50;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: 700;
}
.cartela-placa .cel-placa.ativo { background: #27ae60; color: #fff; border-color: #27ae60; }

/* ============ TOP BAR ============ */
.topBar {
    height: 13%;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 3px solid #34495e;
}
.topBar .titulo-giro { font-size: 1.5rem; font-weight: 900; }
.topBar .box-acumulado { text-align: center; }
.topBar .box-acumulado .rotulo { font-size: .7rem; letter-spacing: .2em; opacity: .8; }
.topBar .box-acumulado .valor { font-size: 2rem; font-weight: 900; background: #fff; color: #2c3e50; padding: 4px 22px; border-radius: 8px; }
.premiosTop {
    display: flex;
    gap: 12px;
}
.premio-top {
    text-align: center;
    background: #34495e;
    border-radius: 8px;
    padding: 6px 14px;
    min-width: 90px;
}
.premio-top .rotulo { font-size: .65rem; letter-spacing: .15em; opacity: .8; text-transform: uppercase; }
.premio-top .valor { font-size: 1.15rem; font-weight: 900; }

/* ============ CORPO ============ */
.sorteioBody { display: flex; height: 87%; }
.leftCol { width: 22%; background: #22262a; display: flex; flex-direction: column; padding: 12px; }
.centerCol { width: 55%; position: relative; display: flex; flex-direction: column; padding: 10px; }
.rightCol { width: 23%; background: #22262a; display: flex; flex-direction: column; padding: 12px; }

/* Pipoqueira + bola atual */
.pipoqueira {
    position: relative;
    height: 42%;
    background: url('https://girodasorte.net/pipoqueira2.gif') center/contain no-repeat;
    border-radius: 10px;
    border: 2px solid #333;
}
.bola-atual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0,0,0,.5);
    box-shadow: inset -12px -14px 24px rgba(0,0,0,.35), 0 0 40px rgba(255,255,255,.25);
    transition: background .4s;
}
.bola-anim { animation: bounceIn .5s ease; }
@keyframes bounceIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    70% { transform: translate(-50%, -50%) scale(1.15); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Últimas bolas */
.ultimasBolas { padding: 10px 0; }
.ultimasBolas .rotulo { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }
.bola-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 2px;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    font-size: .85rem;
    box-shadow: inset -4px -5px 8px rgba(0,0,0,.3);
}

/* Grade 1-90 */
.grade-bolas { background: #111; border-radius: 10px; border: 2px solid #333; padding: 8px; flex: 1; overflow: hidden; }
.grid-bolinhas { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.bola-grid {
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: #222;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: .8rem;
}
.bola-grid.sorteada { color: #fff; box-shadow: 0 0 8px rgba(255,255,255,.4); }

/* Ranking */
.ranking-head {
    display: grid;
    grid-template-columns: 80px 1fr 70px;
    padding: 8px 10px;
    background: #2c3e50;
    font-weight: 800;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    border-radius: 8px 8px 0 0;
}
.ranking-row { display: grid; grid-template-columns: 80px 1fr 70px; padding: 6px 10px; border-bottom: 1px solid #2d2f31; font-size: .78rem; align-items: center; }
.mini-bola-restante { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 900; margin: 1px; }
.bola-ok { background: #198754; color: #fff; }
.bola-falta { background: #343a40; color: #6c757d; }
.lista-ranking { flex: 1; overflow: hidden; }

/* Ganhadores (painel direito) */
.ganhador-item {
    background: #2c3e50;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ganhador-item .premio { font-weight: 900; font-size: .85rem; letter-spacing: .1em; }
.ganhador-item .nome { font-size: .8rem; opacity: .85; }
.ganhador-item .valor { font-weight: 900; color: #f1c40f; }

/* Cartelas ao vivo */
.cartela-bingo { background: #fff; color: #333; border-radius: 8px; padding: 10px; margin-bottom: 10px; border-left: 6px solid #3498db; }
.grid-cartela { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.num-cartela { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 4px; padding: 4px 0; text-align: center; font-weight: 800; font-size: .85rem; }
.num-cartela.marcado { background: #198754 !important; color: #fff !important; }

/* Overlay vencedor */
#overlayVencedor {
    position: absolute;
    inset: 0;
    z-index: 950;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#overlayVencedor.show { display: flex; }
.cartela-vencedora {
    background: #fff;
    color: #333;
    border-radius: 14px;
    padding: 22px 30px;
    max-width: 460px;
    text-align: center;
    box-shadow: 0 0 80px rgba(241,196,15,.6);
}
.cartela-vencedora .vc-premio { font-size: 1.2rem; font-weight: 900; color: #a30000; letter-spacing: .2em; }
.cartela-vencedora .vc-nome { font-size: 1.4rem; font-weight: 900; }
.cartela-vencedora .vc-bilhete { font-size: 1rem; font-weight: 800; color: #3498db; margin-top: 4px; }
.cartela-vencedora .vc-valor { font-size: 2.2rem; font-weight: 900; color: #27ae60; }
.vc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 14px; }
.vc-grid .cel { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 5px; padding: 9px 0; font-weight: 800; }
.vc-grid .cel.ativo { background: #27ae60; color: #fff; border-color: #27ae60; }

/* Modal de configurações */
.configurationsModal {
    position: absolute;
    z-index: 1100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ecf0f1;
    color: #2c3e50;
    width: 420px;
    max-width: 92%;
    border-radius: 12px;
    padding: 22px 28px;
    display: none;
    box-shadow: 0 10px 50px rgba(0,0,0,.5);
}
.configurationsModal.show { display: block; }
.configurationsModal h3 { margin: 0 0 16px; font-weight: 900; }
.configurationsModal label { display: block; font-weight: 700; font-size: .85rem; margin: 10px 0 4px; }
.configurationsModal input[type=range], .configurationsModal input[type=number], .configurationsModal select {
    width: 100%;
    padding: 6px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
}
.botoesModal { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.botoesModal button { flex: 1; padding: 9px; border: none; border-radius: 8px; font-weight: 800; cursor: pointer; }
.btn-azul { background: #3498db; color: #fff; }
.btn-verde { background: #27ae60; color: #fff; }
.btn-cinza { background: #95a5a6; color: #fff; }
.btn-amarelo { background: #f1c40f; color: #2c3e50; }

/* ============ MOBILE ============ */
@media (max-width: 992px) {
    html, body { overflow: auto; height: auto; }
    #sorteioScreen { height: auto; }

    .barConfig { flex-wrap: wrap; gap: 10px; padding: 8px 12px; font-size: 1rem; }

    /* Contagem regressiva */
    #countdownTimer .cd-msg { font-size: 1.1rem; }
    #seconds { width: 150px; height: 150px; font-size: 5.5rem; }

    /* Placas */
    .placa { width: 92%; padding: 20px; border-width: 7px; }
    .placa .placa-valor { font-size: 2.6rem; }

    /* Top bar */
    .topBar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
    .topBar .titulo-giro { font-size: 1.1rem; }
    .topBar .box-acumulado .valor { font-size: 1.4rem; padding: 3px 14px; }
    .premiosTop { flex-wrap: wrap; gap: 8px; }
    .premio-top { min-width: 70px; padding: 5px 10px; }
    .premio-top .valor { font-size: 1rem; }

    /* Corpo: empilha (pipoqueira -> grade -> ranking -> ganhadores) */
    .sorteioBody { flex-direction: column; height: auto; }
    .leftCol, .centerCol, .rightCol { width: 100%; }

    .centerCol { order: 1; padding: 8px; }
    .pipoqueira { height: 240px; }
    .bola-atual { width: 120px; height: 120px; font-size: 3.2rem; }

    .leftCol { order: 2; }
    .lista-ranking { max-height: 420px; overflow-y: auto; }

    .rightCol { order: 3; }

    .grade-bolas { overflow: visible; }
    .grid-bolinhas { grid-template-columns: repeat(10, 1fr); gap: 4px; }
    .bola-grid { font-size: .8rem; }

    /* Overlay vencedor */
    .cartela-vencedora { max-width: 94%; padding: 16px; }
    .vc-grid .cel { padding: 7px 0; }

    .configurationsModal { width: 92%; top: 40%; }
}

