/* =========================
   Reset básico
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================
   Layout geral
   ========================= */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #5dade2, #1b4f72 55%, #0b2239);
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 16px;
    /* espaço pra não ficar atrás do rodapé fixo */
    padding-bottom: 64px;
}

.page-wrapper {
    max-width: 1080px;
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
   Cabeçalho
   ========================= */
.top-header {
    text-align: center;
    color: #ecf0f1;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.top-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* =========================
   Container principal
   ========================= */
.container {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    padding: 20px 20px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
    gap: 18px;
}

@media (max-width: 880px) {
    .container {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Área de sorteio
   ========================= */
.sorteio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#roleta-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

#roleta {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #3498db, #5dade2);
    border-radius: 50%;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

#roleta::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
}

.roleta-label {
    position: relative;
    z-index: 1;
    font-size: 20px;
    font-weight: 600;
}

/* animações */
.bingo-animation {
    animation: bingo-pulse 1.8s ease-out;
}

.bingo-animation.desempate {
    animation: bingo-pulse-desempate 1.8s ease-out;
}

@keyframes bingo-pulse {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bingo-pulse-desempate {
    0% {
        transform: scale(0.4) rotate(-10deg);
        opacity: 0;
    }
    40% {
        transform: scale(1.25) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* =========================
   Cards de informação
   ========================= */
.info-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.info-card {
    background: #f4f6f7;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.info-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.info-value {
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
}

.ultimos-numeros {
    font-weight: 600;
    font-size: 0.95rem;
}

/* =========================
   Botões
   ========================= */
.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.btn {
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.12s ease-out,
        box-shadow 0.12s ease-out,
        filter 0.12s ease-out;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn.primary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #ffffff;
}

.btn.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #ffffff;
}

.btn.warning {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #ffffff;
}

.btn:hover {
    filter: brightness(1.05);
}

/* =========================
   Legenda
   ========================= */
.legend {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 6px;
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.legend-color.sorteado {
    background-color: #2ecc71;
}

.legend-color.desempate {
    background-color: #e74c3c;
}

/* =========================
   Cartela / histórico
   ========================= */
.cartela-section {
    background: #f9f9fb;
    border-radius: 14px;
    padding: 10px 12px 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.cartela-section h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #34495e;
    text-align: center;
}

.cartela {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
    justify-items: center;
}

@media (max-width: 520px) {
    .cartela {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

.quadrado {
    width: 40px;
    height: 40px;
    background-color: #ecf0f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #34495e;
    transition:
        background-color 0.15s ease-out,
        color 0.15s ease-out,
        transform 0.12s ease-out,
        box-shadow 0.12s ease-out;
}

.quadrado.sorteado {
    background-color: #2ecc71;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.5);
    transform: translateY(-1px);
}

.quadrado.desempate {
    background-color: #e74c3c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.6);
    transform: translateY(-1px) scale(1.03);
}

/* =========================
   Rodapé fixo no fim da tela
   ========================= */
.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.8rem;
    color: #ecf0f1;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
