:root {
    --accent: #c6cdce;
    --bg: #000000;
    --surface: #050505;
    --surface2: #111111;
    --text: #e0e0e0;
    --text-strong: #ffffff;
}

:root[data-tema="claro"] {
    --bg: #f4f4f4;
    --surface: #ffffff;
    --surface2: #e0e0e0;
    --text: #121212;
    --text-strong: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none;
    -webkit-tap-highlight-color: transparent;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 70px;
}

.escondido {
    display: none !important;
}

.destaque-texto {
    color: var(--accent);
}

:root[data-tema="claro"] .destaque-texto {
    filter: brightness(0.6);
}

:root[data-tema="claro"] #btnEntrar,
:root[data-tema="claro"] #btnSortear {
    filter: brightness(0.7);
    color: #ffffff;
}

:root[data-tema="claro"] .btn-acao {
    background-color: var(--surface2);
    color: var(--text-strong);
    border: 1px solid var(--text);
}

#telaLogin {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.caixa-login {
    background-color: var(--surface);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--surface2);
    text-align: center;
}

.caixa-login h2 {
    margin-bottom: 20px;
    color: var(--text-strong);
}

.caixa-login input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--surface2);
    border-radius: 12px;
    background: var(--surface2);
    color: var(--text-strong);
    font-size: 16px;
}

button {
    cursor: pointer;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 16px;
    transition: 0.2s;
}

#btnEntrar {
    background-color: var(--accent);
    color: #121212;
    width: 100%;
    font-weight: bold;
}

header {
    background-color: var(--surface);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--surface2);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
}

#infoUsuario {
    font-weight: bold;
}

#timerStatus {
    color: var(--text);
}

#areaConfig {
    position: fixed;
    top: 65px;
    right: 20px;
    z-index: 6;
}

#btnConfig {
    width: 30px;
    height: 30px;
    cursor: pointer;
    float: right;
}

#menuConfig {
    background-color: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 20px;
    margin-top: 40px;
    clear: both;
    width: 280px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: var(--text);
    font-size: 14px;
}

.config-item:last-child {
    margin-bottom: 0;
}

#seletorCor, #seletorMusica {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 4px;
    outline: none;
    max-width: 120px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface2);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

main {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 80px;
}

#areaSorteio {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#btnSortear {
    background-color: var(--accent);
    color: #121212;
    font-size: 18px;
    padding: 15px 40px;
    font-weight: bold;
}

#btnSortear:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
    filter: none;
}

#btnSortear:hover:not(:disabled) {
    opacity: 0.8;
}

#loadingSorteio {
    margin: 30px 0;
}

.spinner {
    border: 6px solid var(--surface2);
    border-top: 6px solid var(--accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.carta-resultado {
    background-color: var(--surface2);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 20px;
    max-width: 300px;
    margin: 20px auto;
}

.carta-resultado img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--accent);
}

.carta-resultado p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

#cartaExtra {
    display: inline-block;
    margin-top: 10px;
    background-color: var(--accent);
    color: #121212;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
}

#menuBotoes {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-acao {
    background-color: var(--surface2);
    color: var(--accent);
    font-size: 16px;
    border: 1px solid var(--accent);
}

.btn-acao:hover {
    background-color: var(--surface);
}

#barraArea {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: bottom 0.4s ease-in-out;
}

body.player-ativo #barraArea {
    bottom: 80px;
}

#barraLabel {
    font-size: 13px;
    color: var(--text);
    font-weight: bold;
}

#barraContainer {
    width: 180px;
    height: 14px;
    background-color: var(--surface2);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--accent);
}

#barraProgresso {
    width: 0%;
    height: 100%;
    background-color: var(--accent);
    border-radius: 7px;
    transition: width 0.5s;
}

#miniPlayer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--surface);
    border-top: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 5;
}

#playerEsquerda {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

#playerInfo {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

#playerControles {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-player {
    background: none;
    color: var(--accent);
    font-size: 18px;
    padding: 0;
}

#playerDireita {
    display: flex;
    align-items: center;
    gap: 10px;
}

#volumeIcon {
    font-size: 16px;
}

#controleVolume {
    width: 80px;
    accent-color: var(--accent);
    cursor: pointer;
}

#barraMusicaContainer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: var(--surface2);
    overflow: hidden;
    cursor: pointer;
}

#barraMusicaProgresso {
    width: 0%;
    height: 100%;
    background-color: var(--accent);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal-conteudo {
    background-color: var(--surface);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    border-radius: 20px;
    border: 2px solid var(--accent);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--surface2);
}

.modal-cabecalho h2 {
    font-size: 20px;
    color: var(--text-strong);
}

.btn-fechar {
    background: none;
    color: var(--accent);
    font-size: 20px;
}

.descricao-colecao {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--surface2);
}

.descricao-colecao p {
    font-size: 14px;
    color: var(--text);
}

.grade-cartas {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    overflow-y: scroll;
}

.carta-item {
    background-color: var(--surface2);
    border-radius: 16px;
    padding: 10px;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.carta-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.carta-item p {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.carta-item.trancada img {
    filter: grayscale(100%);
}

.carta-item .bolinha-extra {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--accent);
    color: #121212;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.detalhe-conteudo {
    max-width: 400px;
    position: relative;
    padding: 20px;
}

.detalhe-conteudo .btn-fechar {
    position: absolute;
    top: 15px;
    right: 15px;
}

.detalhe-corpo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.detalhe-corpo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--accent);
}

.detalhe-corpo h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.detalhe-corpo p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    text-align: justify;
    margin-bottom: 10px;
}

#detalheExtra {
    display: inline-block;
    background-color: var(--accent);
    color: #121212;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
}
