body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1C1C1C; /* Fundo escuro */
    margin: 0;
    color: #E0E0E0; /* Cor do texto principal (clara para contrastar) */
    /* REMOVIDO: overflow: hidden; */ /* Permite a rolagem padrão da página */
    position: relative; /* Para posicionar as luzes de fundo */
}

/* Efeito de luz de fundo similar ao ao palco */
.background-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center top, rgba(128, 0, 128, 0.3) 0%, rgba(28, 28, 28, 0) 70%); /* Roxo difuso no topo */
    z-index: -1; /* Fica atrás do conteúdo */
    opacity: 0.7;
}

.container {
    background-color: transparent; /* Fundo transparente para o container principal */
    padding: 20px; /* Reduz padding para focar no painel */
    text-align: center;
    width: 95%; /* Ocupa mais largura */
    max-width: 900px; /* Maior max-width para o visual do painel */
    position: relative; /* Para posicionamento relativo de elementos internos */
    z-index: 1; /* Acima das luzes de fundo */
    box-shadow: none;
    border: none;
    border-radius: 0;
}

h1 {
    color: #f9b206; /* Cor de destaque para o título */
    margin-bottom: 25px;
    font-size: 2.2em;
    text-shadow: 0 0 8px rgba(249, 178, 6, 0.6); /* Efeito de brilho */
}

/* Estilos para a área de entrada de palavras e dicas */
.word-input-area {
    background-color: #282828;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid #f9b206;
    margin-bottom: 30px;
    display: flex; /* Adicionado para layout flexível */
    flex-direction: column; /* Itens em coluna */
    align-items: center; /* Centraliza horizontalmente */
}

.word-input-area p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.word-hint-entry {
    display: flex;
    gap: 10px; /* Espaço entre os inputs e o botão */
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap; /* Permite quebrar linha em telas menores */
}

.word-hint-entry input[type="text"] {
    flex: 1; /* Ocupa espaço disponível */
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #333;
    color: #E0E0E0;
    font-size: 1em;
    min-width: 150px; /* Largura mínima para os inputs */
}

.word-hint-entry button,
.word-input-area button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    background-color: #f9b206;
    color: #1C1C1C;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.word-hint-entry button:hover,
.word-input-area button:hover {
    background-color: #e5a400;
}

/* Estilos para a lista de palavras adicionadas */
.added-words-list-container {
    width: 100%;
    max-height: 200px; /* Altura máxima para rolagem */
    overflow-y: auto; /* Adiciona barra de rolagem se exceder a altura */
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.added-words-list-container h3 {
    color: #f9b206;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
}

#added-words-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#added-words-list li {
    background-color: #333;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
}

#added-words-list li:last-child {
    margin-bottom: 0;
}

#added-words-list li span {
    flex: 1;
    margin-right: 10px;
}

#added-words-list li .remove-word-button {
    background-color: #dc3545; /* Vermelho para remover */
    color: white;
    border: none;
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#added-words-list li .remove-word-button:hover {
    background-color: #c82333;
}

#clear-all-words-button {
    background-color: #6c757d; /* Cinza para limpar tudo */
    margin-top: 10px;
}

#clear-all-words-button:hover {
    background-color: #5a6268;
}

/* REMOVIDO: Estilo para o botão de Reset no topo do jogo */
/*
.reset-game-button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    background-color: #f9b206;
    color: #1C1C1C;
    font-size: 1.1em;
    cursor: pointer;
    margin-bottom: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: fit-content;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.reset-game-button:hover {
    background-color: #e5a400;
    transform: translateY(-2px);
}
*/

/* Quadro do Painel da Palavra */
.panel-frame {
    background-color: #0d121c; /* Fundo do painel, um azul muito escuro */
    border: 8px solid #0056b3; /* Borda azul interna */
    border-image: linear-gradient(to right, #6a0dad, #0056b3, #6a0dad) 1; /* Gradiente roxo-azul para a borda */
    box-shadow: 0 0 25px rgba(0, 86, 179, 0.8), inset 0 0 15px rgba(0, 86, 179, 0.5); /* Brilho externo e interno */
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 15px; /* Cantos arredondados */
    position: relative; /* Para o efeito de neon */
    z-index: 10;
}

/* Efeito de neon para o painel */
.panel-frame::before {
    content: '';
    position: absolute;
    top: -5px; bottom: -5px;
    left: -5px; right: -5px;
    border: 5px solid #6a0dad; /* Cor roxa para o neon externo */
    border-radius: 20px; /* Ligeiramente maior que o painel */
    box-shadow: 0 0 20px #6a0dad, inset 0 0 10px #6a0dad;
    z-index: -1;
}

/* Display da Palavra Secreta */
.word-display {
    display: flex;
    flex-wrap: wrap; /* Permite que as "linhas de palavras" quebrem para a próxima linha */
    justify-content: center;
    gap: 5px; /* Espaço entre as palavras (word-line divs) */
    min-height: 100px;
    align-items: center;
}

/* Estilo para cada segmento de palavra (ex: "BOM" ou "DIA") */
.word-line {
    display: flex; /* Faz com que as letras dentro de uma palavra fiquem em linha */
    gap: 5px; /* Espaço entre as letras dentro de uma palavra */
    margin-right: 15px; /* Espaço entre as palavras completas */
}

/* Células Individuais de Letra */
.letter-cell {
    background-color: #121A2B;
    width: 45px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2em;
    font-weight: bold;
    color: #f9b206;
    text-transform: uppercase;
    border: 2px solid #004d99;
    border-radius: 5px;
    box-shadow: inset 0 0 8px rgba(0, 77, 153, 0.5);
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.letter-cell.revealed {
    background-color: #E0E0E0;
    color: #1C1C1C;
    border-color: #f9b206;
}

/* Estilo para o espaço entre as palavras (agora um div separado) */
.letter-cell.space {
    background-color: transparent;
    border: none;
    box-shadow: none;
    font-size: 0;
    width: 20px; /* Largura do espaço entre as palavras */
    pointer-events: none;
}

/* Nova caixa de Dica */
.hint-box {
    background-color: #000;
    border: 3px solid #f9b206;
    border-radius: 10px;
    padding: 10px 20px;
    margin: 0 auto 20px auto; /* Ajustada a margem */
    width: fit-content;
    max-width: 80%;
    box-shadow: 0 0 10px #f9b206;
}

.hint-text {
    color: #f9b206;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
}


/* Categoria Box (agora para Letras já usadas) */
.category-box {
    background-color: #000;
    border: 3px solid #f9b206;
    border-radius: 10px;
    padding: 10px 20px;
    margin: 0 auto 30px auto;
    width: fit-content;
    max-width: 80%;
    box-shadow: 0 0 10px #f9b206;
}

.category-text {
    color: #f9b206;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
}

/* Mensagens principais do jogo */
.main-game-message {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 20px;
    color: #f9b206;
    text-shadow: 0 0 8px rgba(249, 178, 6, 0.6);
}

.main-game-message.error {
    color: #FF6347;
    text-shadow: 0 0 8px rgba(255, 99, 71, 0.6);
}

/* Área de input e botões */
.input-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.input-area input[type="text"] {
    padding: 12px 15px;
    border: 1px solid #f9b206;
    border-radius: 5px;
    font-size: 1em;
    width: 120px;
    text-transform: uppercase;
    background-color: #333;
    color: #E0E0E0;
    text-align: center;
}

#word-guess-input {
    width: 200px;
}

.input-area button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    background-color: #f9b206;
    color: #1C1C1C;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.input-area button:hover {
    background-color: #e5a400;
    transform: translateY(-2px);
}

/* NOVO ESTILO (ou revertido) para #reset-button na parte inferior */
#reset-button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    background-color: #555; /* Cor cinza, como era antes */
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    margin-top: 20px; /* Margem superior para separar dos inputs */
    transition: background-color 0.3s ease;
    /* Certifica-se que ele é um bloco para centralizar se necessário */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#reset-button:hover {
    background-color: #777;
}

.hidden {
    display: none !important;
}

/* Responsividade básica */
@media (max-width: 768px) {
    body {
        /* Adicionado para permitir rolagem vertical em telas menores se o conteúdo exceder a altura */
        align-items: flex-start; /* Alinha o conteúdo ao topo para permitir rolagem do body */
        min-height: 100vh; /* Garante que o body ainda ocupe toda a altura */
    }
    .panel-frame {
        padding: 10px;
    }
    .letter-cell {
        width: 35px;
        height: 45px;
        font-size: 1.8em;
    }
    .category-box, .hint-box {
        width: auto;
        padding: 10px 15px;
    }
    .category-text, .hint-text {
        font-size: 1em;
    }
    .input-area {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .input-area input[type="text"],
    .input-area button,
    .word-input-area textarea,
    .word-input-area button {
        width: 80%;
        max-width: 300px;
    }
    #guess-input {
        width: 60px;
    }
    #word-guess-input {
        width: 80%;
        max-width: 300px;
    }
    h1 {
        font-size: 1.8em;
    }
    .word-hint-entry {
        flex-direction: column;
        align-items: center;
    }
    .word-hint-entry input[type="text"] {
        width: 80%;
        max-width: 300px;
    }
    #reset-button { /* Ajuste para responsividade do botão de reset */
        padding: 10px 20px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    .letter-cell {
        width: 30px;
        height: 40px;
        font-size: 1.5em;
    }
    .panel-frame {
        margin-bottom: 20px;
    }
    .category-box, .hint-box {
        margin-bottom: 20px;
    }
    .main-game-message {
        font-size: 1.2em;
    }
}