/* ============================================================
   Tema claro / escuro compartilhado — Sorteio de Bingo
   O atributo data-tema é aplicado em <html> por assets/tema.js
   ============================================================ */

html[data-tema="claro"] {
    color-scheme: light;
}

html[data-tema="escuro"] {
    color-scheme: dark;
}

/* Botão flutuante (usado nas páginas sem botão próprio no cabeçalho) */
.tema-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 45;
    width: 46px;
    height: 46px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(58, 52, 96, 0.72);
    color: #fff;
    font-family: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.92;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s, background 0.2s, opacity 0.2s, border-color 0.2s;
}

.tema-btn:hover {
    transform: translateY(-2px) scale(1.05);
    opacity: 1;
    background: rgba(58, 52, 96, 0.92);
}

.tema-btn:active {
    transform: translateY(0) scale(0.97);
}

.tema-btn:focus-visible {
    outline: 3px solid #ffd54f;
    outline-offset: 3px;
}

html[data-tema="claro"] .tema-btn {
    border-color: rgba(58, 52, 96, 0.35);
    background: rgba(255, 255, 255, 0.82);
    color: #3a3458;
    box-shadow: 0 10px 26px rgba(58, 52, 96, 0.18);
}

html[data-tema="claro"] .tema-btn:hover {
    background: #fff;
}

/* Variante usada dentro de um cabeçalho (não flutuante) */
.tema-btn.inline {
    position: static;
    width: auto;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    gap: 7px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: none;
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
    opacity: 0.8;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.tema-btn.inline:hover {
    background: rgba(127, 127, 127, 0.16);
    opacity: 1;
    transform: translateY(-1px) scale(1);
}

.tema-btn .tema-icone {
    font-size: 1.05em;
    line-height: 1;
}

.tema-btn .tema-texto {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .tema-btn.inline .tema-texto {
        display: none;
    }
}

@media print {
    .tema-btn {
        display: none !important;
    }
}
