/* ==========================================================================
   ESTILOS DA PÁGINA DE SORTEIO
   ========================================================================== */

/* --- Seções de Configuração e Ações --- */
.setup-section, .actions-section {
    margin-bottom: 30px;
}

#team-count-setup {
    margin-bottom: 20px;
}

#team-count-setup label {
    font-size: 1.2em;
    margin-right: 15px;
}

#team-count-setup input[type="number"],
.setup-section input[type="text"] {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ffc107;
    background-color: #0a1428;
    color: #ffffff;
    margin-right: 10px;
}

#team-count-setup input[type="number"] {
    width: 80px;
    font-size: 1.1em;
}

/* --- Botões --- */
.btn-acao {
    padding: 12px 25px;
    background-color: #ffc107;
    color: #0a1428;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background-color 0.3s;
    margin: 5px;
}

.btn-acao:hover {
    transform: scale(1.05);
    background-color: #ffd966;
}

.btn-acao:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
}

.btn-acao.secundario {
    background-color: #1e90ff;
    color: #ffffff;
}

.btn-acao.secundario:hover {
    background-color: #4faaff;
}

/* --- Container de Inputs de Time --- */
#teams-input-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

#teams-input-container input {
    width: 200px;
}

/* --- Chaveamento (Bracket) --- */
#chaveamento-container {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    background-color: rgba(10, 20, 40, 0.5);
    text-align: left;
}

.fase {
    margin-bottom: 40px;
}

.fase-titulo {
    color: #ffc107;
    font-size: 1.4em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ffc107;
    padding-bottom: 10px;
}

.fase-repescagem .fase-titulo {
    color: #1e90ff;
    border-bottom-color: #1e90ff;
}

.fase-titulo.campeao {
    border-color: #00ddff;
    color: #00ddff;
}

.confronto {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    transition: opacity 0.3s ease;
}

.vs {
    margin: 0 15px;
    color: #ffc107;
    font-size: 1.2em;
    font-weight: bold;
}

/* --- Estilos e Estados dos Times --- */
.time {
    background-color: #0a1428;
    padding: 8px 15px;
    border-radius: 5px;
    width: 220px;
    border: 1px solid #1e90ff;
    min-height: 50px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.team-name {
    font-weight: bold;
    line-height: 1.2;
}

.status-text {
    font-size: 0.75em;
    font-weight: normal;
    color: #ccc;
    line-height: 1;
    margin-top: 2px;
}
.status-text:empty {
    display: none;
}

/* Estado de Folga (Bye) */
.time.bye {
    border-color: #00ddff;
    color: #00ddff;
    width: auto;
    padding-left: 30px;
    padding-right: 30px;
    cursor: default !important;
}

/* Estado Clicável (antes de decidir o vencedor) */
.confronto:not(.decidido) .time:not(.bye) {
    cursor: pointer;
}
.confronto:not(.decidido) .time:not(.bye):hover {
    border-color: #ffc107;
}

/* Estado de Vencedor e Perdedor */
.time.vencedor {
    background-color: #ffc107;
    color: #0a1428;
    border: 1px solid #ffd966;
}
.time.vencedor .team-name {
    font-weight: 700;
}
.time.vencedor .status-text {
    color: #0a1428;
}
.confronto.decidido .time:not(.vencedor) {
    opacity: 0.5;
}

/* --- Roleta de Sorteio --- */
#roleta-visual-container {
    margin: 20px auto 30px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid #ffc107;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#roleta-status {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #fff;
    font-weight: bold;
}

.roleta-spinner {
    font-size: 2em;
    color: #ffc107;
    height: 40px;
    overflow: hidden;
    position: relative;
    width: 100%;
    text-align: center;
}

/* --- Link de Download --- */
#download-link {
    display: block;
    margin-top: 20px;
    text-align: center;
    font-size: 1.1em;
}

/* --- Seção de Regras --- */
.regras-container {
    margin: 25px auto 40px;
    max-width: 800px; /* Limita a largura para melhor leitura */
}

.regras-container details {
    border: 1px solid rgba(255, 193, 7, 0.8);
    border-radius: 8px;
    background-color: rgba(10, 20, 40, 0.7);
    color: #ffffff;
}

/* O título clicável */
.regras-container summary {
    padding: 15px;
    font-weight: bold;
    font-size: 1.2em;
    color: #ffc107;
    cursor: pointer;
    outline: none; /* Remove a borda de foco padrão */
    transition: background-color 0.2s;
    list-style-position: inside; /* Ajusta a posição da setinha */
}

.regras-container summary:hover {
    background-color: rgba(255, 193, 7, 0.1);
}

/* O conteúdo que aparece quando expandido */
.regras-conteudo {
    padding: 0 20px 20px 20px;
    border-top: 1px solid rgba(255, 193, 7, 0.5);
    margin-top: 10px;
}

.regras-conteudo h4 {
    color: #4faaff; /* Um azul para destacar os títulos internos */
    margin-top: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 1em;
}

.regras-conteudo p, .regras-conteudo li {
    line-height: 1.6;
    color: #cccccc;
    font-size: 0.95em;
}

.regras-conteudo ul {
    padding-left: 25px;
    margin-top: 10px;
}