/* Reset simples */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "MedievalSharp", cursive;
}

body {
    line-height: 1.6;
    color: #333;
}

/* Cabeçalho inicial */
header {
    background: #222;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

header nav a {
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
}

header nav a:hover {
    color: #753e11b4;
}

/* Página inicial: introdução */
.introducao {
    text-align: center;
    padding:80px 60px;;
    background: url('fundologin1.jpg') no-repeat center center/cover;
    color: #ffffff;
}

.introducao h1 {
    font-size: 40px;
    padding-top: 6%;
    margin-bottom: 5px;
}

.introducao p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.introducao-buttons .btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-primary {
    background: #8f4e35;
    color: #e2c280;
}

.btn-primary:hover {
    background: #582f0d;
}

.btn-secondary {
    background: #8f4e35;
    color: #e2c280;
}

.btn-secondary:hover {
    background: #582f0d;
}

/* Página inicial :Como Funciona */
.como-funciona {
    padding: 3rem 2rem;
    text-align: center;
    background:#6d3d22cb;
}

.como-funciona h2{
    color: #fff;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.step {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Página inicial: Recursos */
.recursos {
    background: #6d3d22cb;
    
    padding: 3rem 2rem;
    text-align: center;
}

.recursos h2{
    color: #fff;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.titulo{
    font-size: 21.5px;
} 

.card:hover {
    transform: scale(1.05);
}

/* Rodapé */
footer {
    text-align: center;
    padding: 1rem;
    background: #222;
    color: white;
    margin-top: 2rem;
}

/* Página de Login */

#login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 6px;    
    background-image: url("imagem2.jpg"); 
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat; 
}

.login-container {
    background: #476153e8;
    padding: 2rem;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.login-container label {
    display: block;
    text-align: left;
    margin-bottom: 0.3rem;
    font-weight: bold;
    color: #ffffff;

}

.login-container input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.login-container button {
    margin-top: 10px;
    width: 50%;
    border-radius: 8px;
    background: #4761533f;
    color: #ffffff;
    padding: 8px 4px;
    margin: 0.5rem;
}

.extra-links {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.extra-links a {
 color: #ffffff;
text-decoration: none;
}

.extra-links a:hover {
    text-decoration: underline;
}

/* Página de Cadastro */

#cadastro{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #522e27d3; 
    padding: 6px;
}

.cadastro-container {
    background: rgba(124, 78, 69, 0.897);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    text-align: center;
    color: #ffffff;
}

.cadastro-container h2 {
    margin-bottom: 4px;
   color: #ffffff;


}

.cadastro-container label {
    display: block;
    text-align: left;
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.cadastro-container input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #834b4b;
    border-radius: 6px;
}


.cadastro-container button {
    margin-top: 10px;
    width: 70%;
    border-radius: 8px;
    background: #8d6259;
    color: #ffffff;
    padding: 8px 4px;
    margin: 0.5rem;
}

 /* Estilos específicos para o campo de avatar */
        .avatar-upload {
            text-align: center;
            margin-bottom: 1.5rem;
        }
        
        .avatar-preview {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: #5d4037;
            margin: 0 auto 1rem;
            border: 4px solid #d4a76a;
            overflow: hidden;
            cursor: pointer;
            position: relative;
        }
        
        .avatar-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: none;
        }
        
        .avatar-preview .avatar-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #d4a76a;
            font-size: 2.5rem;
        }
        
        .avatar-preview:hover .avatar-placeholder {
            background: rgba(0,0,0,0.1);
        }
        
        .avatar-upload-btn {
            display: inline-block;
            background: #8d6259;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            transition: background 0.3s;
        }
        
        .avatar-upload-btn:hover {
            background: #724f48;
        }
        
        #avatarInput {
            display: none;
        }
        
        .avatar-info {
            font-size: 0.8rem;
            color: #666;
            margin-top: 0.5rem;
        }

                /* Estilos para a foto de perfil */
        .perfil-avatar {
            text-align: center;
            margin-bottom: 2rem;
        }
        
        .avatar-grande {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: #5d4037;
            margin: 0 auto;
            border: 4px solid #d4a76a;
            overflow: hidden;
            position: relative;
        }
        
        .avatar-grande img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .avatar-grande .sem-avatar {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #d4a76a;
            font-size: 3.5rem;
        }
        
        .btn-alterar-avatar {
            display: inline-block;
            background: #8d6259;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            text-decoration: none;
            font-weight: bold;
            margin-top: 1rem;
            transition: background 0.3s;
        }
        
        .btn-alterar-avatar:hover {
            background: #724f48;
        }
        
        .estatisticas-perfil {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin: 2rem 0;
            text-align: center;
        }
        
        .estatistica-item {
            background: #f9f8f6;
            padding: 1rem;
            border-radius: 8px;
            border: 1px solid #e0dcd5;
        }
        
        .estatistica-numero {
            font-size: 1.8rem;
            font-weight: bold;
            color: #8d6259;
            display: block;
        }
        
        .estatistica-label {
            font-size: 0.9rem;
            color: #666;
        }
        
/* ficha do personagem */

#ficha {
  font-family: "Times New Roman", serif;
  background: #e5e5dc;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
}

.ficha {
  background: #fdf5e6;
  width: 800px;
  min-height: 1000px;
  padding: 2rem;
  border: 3px solid #333;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  text-transform: uppercase;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  border: 2px solid #444;
  padding: 0.6rem;
  text-align: center;
}

th {
  background: #fdf5e6;
  font-weight: bold;
  text-transform: uppercase;
}

th[contenteditable="true"] {
  cursor: text;
  background: #fdf5e6;
}

input, textarea {
  width: 100%;
  border: none;
  text-align: center;
  font-size: 1rem;
  padding: 0.3rem;
}

textarea {
  resize: none;
  text-align: left;
  height: 80px;
}

.atributos td {
  width: 16.6%;
}

.extras td {
  width: 25%;
}

.botoes {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.botoes button {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #8d6259;
  color: #fff;
  transition: 0.3s;
}

.botoes button:hover {
  background-color: #724f48e8;
}

input::placeholder, textarea::placeholder {
    color: #8d6259;
    opacity: 0.7;
    font-style: italic;
}

input:not(:placeholder-shown), 
textarea:not(:placeholder-shown) {
    background-color: #fff;
}

.obrigatorio::after {
    content: " *";
    color: #ff6b6b;
}

.opcional {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}
*/


/* Estilos para perfil do usuário */
#perfil-usuario {
    background: #f4f1ea;
    min-height: 100vh;
}

.menu-perfil {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.menu-perfil li a {
    color: #fff;
    background: transparent;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

header .menu-perfil li a:hover {
    background: rgba(255,255,255,0.08);
    color: #e2c280;
}

.perfil-top-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.perfil-top-right span {
    color: #fff;
}

.btn-sair {
    color: #fff;
    background: #8d6259;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
}

.btn-sair:hover {
    background: #724f48;
}

.perfil-container {
    max-width: 1000px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    padding: 0 1rem;
}

.perfil-detalhes {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.perfil-detalhes h2 {
    margin-bottom: 0.75rem;
}

.perfil-atalhos {
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.perfil-atalhos ul {
    list-style: none;
    padding-left: 0;
}

.perfil-atalhos li {
    margin-bottom: 0.6rem;
}

.perfil-atalhos a {
    color: #8d6259;
    text-decoration: none;
    font-weight: bold;
}

.perfil-atalhos a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    background: #8d6259;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}

@media (max-width: 900px) {
    .perfil-container {
        grid-template-columns: 1fr;
    }

    header {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .perfil-top-right { order: 3; }
}

/* Estilos específicos para editar perfil */
#editar-perfil {
    background: #f4f1ea;
}

.editar-perfil-container {
    display: flex;
    flex-direction: column;
}

.editar-perfil-container label {
    text-align: left;
    margin-top: 0.6rem;
    font-weight: bold;
}

.editar-perfil-container input {
    padding: 0.6rem;
    margin-top: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 0 auto 12px auto;
    
}

.mensagem-erro {
    background: #ffe6e6;
    border: 1px solid #ffb3b3;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border-radius: 6px;
}

.mensagem-sucesso {
    background: #e6ffea;
    border: 1px solid #b3ffcd;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border-radius: 6px;
}

/* Botão salvar na página de editar perfil - largura específica */
.editar-perfil-container .salvar-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 0.9rem 1rem;
    margin-top: 12px;
    background: #8d6259; /* cor atual (marrom claro) */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    margin: 0 auto 12px auto;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.editar-perfil-container .salvar-btn:hover {
    background: #724f48; /* mais escuro ao passar o mouse */
}

/* Botão cancelar (link) - cor marrom, hover mais escuro */
.editar-perfil-container .cancelar-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 0.9rem 1rem;
    background: #8d6259; /* marrom */
    color: #fff;
    border-radius: 8px;
    text-align: center;
    margin: 0 auto;
    text-decoration: none;
}
.editar-perfil-container .cancelar-btn:hover {
    background: #5a3424; /* marrom mais escuro no hover */
}

input:valid, textarea:valid {
    border-left: 3px solid #28a745;
}

#nome:invalid {
    border-left: 3px solid #dc3545;
}


/*-------------------------------------------------------testes----------------------------------------------------*/
/*


/* Mensagens de erro/sucesso */
.mensagem-erro {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

.mensagem-erro p {
    margin: 5px 0;
}

.mensagem-sucesso {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
}

/* Campos inválidos */
input:invalid {
    border-color: #dc3545;
}

input:valid {
    border-color: #28a745;
}





/* Estilos para a página de sessões do usuário */
#sessoes-usuario {
    background: #f4f1ea;
    min-height: 100vh;
}

.sessoes-container {
    max-width: 1200px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 0 1rem;
}

.minhas-sessoes {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.minhas-sessoes h2 {
    margin-bottom: 1rem;
    color: #333;
}

.sessoes-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
}

.sessoes-vazia {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

.sessao-card {
    background: #f9f8f6;
    border: 1px solid #e0dcd5;
    border-left: 4px solid #8d6259;
    padding: 1rem;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.sessao-card:hover {
    box-shadow: 0 4px 12px rgba(141,98,89,0.1);
}

.sessao-card h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.sessao-descricao {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.sessao-data {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.sessao-acoes {
    display: flex;
    gap: 0.5rem;
}

.sessao-acoes .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.criar-sessao {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    height: fit-content;
}

.criar-sessao h2 {
    margin-top: 0;
    color: #333;
}

.form-criar-sessao {
    display: flex;
    flex-direction: column;
}

.form-criar-sessao label {
    text-align: left;
    margin-top: 0.8rem;
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
}

.form-criar-sessao input,
.form-criar-sessao textarea {
    padding: 0.6rem;
    margin-top: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
}

.form-criar-sessao textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-criar {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #8d6259;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-criar:hover {
    background: #724f48;
}

@media (max-width: 900px) {
    .sessoes-container {
        grid-template-columns: 1fr;
    }
    
    .criar-sessao {
        height: auto;
    }
}

@media (max-width: 600px) {
    .sessoes-container {
        padding: 0 0.5rem;
        gap: 1rem;
        margin: 1rem auto;
    }
    
    .minhas-sessoes,
    .criar-sessao {
        padding: 1rem;
    }
}

/* ===== ESTILOS MESA RPG (TESTE3.CSS) ===== */

/* Layout Principal */
.game-container {
    display: flex;
    height: 100vh;
    gap: 10px;
    padding: 10px;
}

/* Painel Esquerdo - Dados */
.left-panel {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Painel Central - Mesa */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Painel Direito - Chat */
.right-panel {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    border: 2px solid #8b4513;
}

/* === PAINEL DE DADOS === */
.dice-panel {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #8b4513;
}

.dice-panel h3 {
    color: #daa520;
    margin-bottom: 15px;
    text-align: center;
}

.dice-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 15px;
}

.dice-btn {
    background: #8b4513;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.dice-btn:hover {
    background: #daa520;
    transform: scale(1.05);
}

.custom-roll {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.custom-roll h4 {
    margin-bottom: 10px;
    color: #daa520;
}

.roll-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    justify-content: center;
}

.roll-controls input {
    width: 60px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #8b4513;
    border-radius: 5px;
    color: white;
    text-align: center;
}

#customRollBtn {
    background: #daa520;
    color: black;
    border: none;
    padding: 8px 4px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.recent-rolls {
    max-height: 200px;
    overflow-y: auto;
}

.roll-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 0.9em;
    border-left: 3px solid #daa520;
}

/* === ÁREA DA MESA === */
.table-area {
    flex: 1;
    background: radial-gradient(circle, #2c1810 0%, #1a1008 100%);
    border-radius: 10px;
    border: 2px solid #8b4513;
    position: relative;
    overflow: hidden;
}

.table-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(30deg, transparent 40%, rgba(139, 69, 19, 0.1) 40%),
        linear-gradient(-30deg, transparent 40%, rgba(139, 69, 19, 0.1) 40%);
    background-size: 60px 60px;
}

.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.table-center h2 {
    color: #daa520;
    margin-bottom: 10px;
}

/* === ÁREA DOS JOGADORES (CARTAS) === */
.players-area {
    height: 180px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    border: 2px solid #8b4513;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    overflow-x: auto;
}

/* Cartas dos Jogadores */
.player-card {
    min-width: 140px;
    height: 140px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #daa520;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.player-card.current-player {
    border-color: #ffd700;
    box-shadow: 0 0 20px gold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 20px gold; }
    50% { box-shadow: 0 0 30px #ffd700; }
    100% { box-shadow: 0 0 20px gold; }
}

.player-card.empty-card {
    border: 3px dashed #666;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #8b4513;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
}

.empty-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    border: 2px dashed #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: #666;
    font-size: 1.5em;
}

.player-name {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 3px;
    color: white;
}

.player-status {
    font-size: 0.7em;
    color: #90ee90;
    margin-bottom: 3px;
}

.player-hp {
    font-size: 0.7em;
    color: #ff6b6b;
}

.player-role {
    font-size: 0.65em;
    color: #daa520;
    margin-top: 3px;
}

/* Upload de Imagem */
.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-direction: column;
    gap: 10px;
}

.upload-overlay.show {
    display: flex;
}

.upload-btn {
    background: #8b4513;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
}

.upload-btn:hover {
    background: #daa520;
}

#avatarUpload {
    display: none;
}

/* === CHAT === */
.chat-header {
    background: #8b4513;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    text-align: center;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    word-wrap: break-word;
}

.message.system-message {
    background: rgba(218, 165, 32, 0.2);
    text-align: center;
    font-style: italic;
}

.message-player {
    color: #90ee90;
    font-weight: bold;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid #8b4513;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #8b4513;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.chat-input button {
    background: #8b4513;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.chat-input button:hover {
    background: #daa520;
}

/* Rolagem de Dados */
.dice-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #daa520;
    text-align: center;
    display: none;
    z-index: 1000;
}

.dice-number {
    font-size: 3em;
    color: #daa520;
    font-weight: bold;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #8b4513;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #daa520;
}

/* ===== ESTILOS RECUPERAÇÃO DE SENHA ===== */

.recuperacao-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    background: linear-gradient(135deg, #f4f1ea 0%, #e8e3d8 100%);
    padding: 2rem;
}

.recuperacao-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    border-left: 5px solid #8d6259;
}

.recuperacao-box h1 {
    color: #8d6259;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8em;
}

.recuperacao-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.recuperacao-form .form-group {
    display: flex;
    flex-direction: column;
}

.recuperacao-form label {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95em;
}

.recuperacao-form input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.recuperacao-form input:focus {
    outline: none;
    border-color: #8d6259;
    box-shadow: 0 0 0 3px rgba(141, 98, 89, 0.1);
}

.recuperacao-form small {
    color: #999;
    font-size: 0.8em;
    margin-top: 0.3rem;
}

.recuperacao-form small a {
    color: #8d6259;
    text-decoration: none;
    font-weight: 600;
}

.recuperacao-form small a:hover {
    text-decoration: underline;
}

.btn-recuperar {
    background: #8d6259;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-recuperar:hover {
    background: #6a4a42;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(141, 98, 89, 0.3);
}

.btn-recuperar:active {
    transform: translateY(0);
}

.recuperacao-links {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.recuperacao-links p {
    color: #666;
}

.recuperacao-links a {
    color: #8d6259;
    text-decoration: none;
    font-weight: 600;
}

.recuperacao-links a:hover {
    text-decoration: underline;
}

.info-recuperacao {
    background: #f0f0f0;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    border-left: 4px solid #e2c280;
}

/* Mensagens de Erro e Sucesso */
.mensagem-erro {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #856404;
    text-align: center;
}

.mensagem-erro p {
    margin: 0;
}

.mensagem-sucesso {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #155724;
    text-align: center;
}

.mensagem-sucesso p {
    margin: 0;
}

.mensagem-sucesso a {
    color: #155724;
    font-weight: 600;
    text-decoration: none;
}

.mensagem-sucesso a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #222;
    color: #fff;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .recuperacao-box {
        padding: 2rem;
        margin: 1rem;
    }

    .recuperacao-box h1 {
        font-size: 1.5em;
    }

    .recuperacao-form {
        gap: 1rem;
    }
}



/* ===== ESTILOS PARA PÁGINAS DE SESSÕES ===== */

 #criar-sessao {
            background: #f4f1ea;
            min-height: 100vh;
        }
        
        .criar-sessao-container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 0 1rem;
        }
        
        .criar-sessao-form {
            background: #fff;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }
        
        .criar-sessao-form h1 {
            color: #333;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        
        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        
        .form-group {
            margin-bottom: 1.2rem;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: bold;
            color: #333;
        }
        
        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-family: inherit;
        }
        
        .form-group textarea {
            min-height: 120px;
            resize: vertical;
        }
        
        .form-group-full {
            grid-column: 1 / -1;
        }
        
        .switch-container {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: #f9f8f6;
            border-radius: 6px;
            margin-bottom: 1rem;
        }
        
        .switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 34px;
        }
        
        .switch input {
            /* checkbox invisível, mas ocupa toda a área para receber cliques */
            opacity: 0;
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            cursor: pointer;
            z-index: 2;
        }
        
        .slider {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 34px;
            /* deixar o slider visual sem interceptar cliques (input cobre a área) */
            pointer-events: none;
        }
        
        .slider:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        
        input:checked + .slider {
            background-color: #8d6259;
        }
        
        input:checked + .slider:before {
            transform: translateX(26px);
        }
        
        .btn-criar-sessao {
            background: #8d6259;
            color: white;
            border: none;
            padding: 1rem 2rem;
            border-radius: 6px;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            width: 100%;
            margin-top: 1rem;
        }
        
        .btn-criar-sessao:hover {
            background: #724f48;
        }
        
        .mensagem {
            padding: 1rem;
            margin-bottom: 1rem;
            border-radius: 6px;
            text-align: center;
        }
        
        .mensagem.sucesso {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .mensagem.erro {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        .senha-container {
            display: none;
            padding: 1rem;
            background: #f0f0f0;
            border-radius: 6px;
            margin-top: 1rem;
        }
        
        .senha-container.visivel {
            display: block;
            animation: fadeIn 0.3s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @media (max-width: 768px) {
            .form-grid {
                grid-template-columns: 1fr;
            }
            
            .criar-sessao-container {
                padding: 0 0.5rem;
            }
            
            .criar-sessao-form {
                padding: 1.5rem;
            }
        }

/* Minhas Sessões */
#minhas-sessoes {
    background: #f4f1ea;
    min-height: 100vh;
}

.minhas-sessoes-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.minhas-sessoes-container h1 {
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2em;
}

.minhas-sessoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.btn-excluir-sessao {
background-color: #772b0d;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
            text-decoration: none;
            display: inline-block;            
margin-left: 8px;
}
        
        .btn-excluir-sessao:hover {
            background-color: #42240a;
        }
        
        .modal-exclusao {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
        }
        
        .modal-exclusao-content {
            background-color: white;
            margin: 15% auto;
            padding: 20px;
            border-radius: 8px;
            width: 400px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        
        .modal-exclusao-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }
        
        .btn-modal-cancelar {
            background-color: #6c757d;
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .btn-modal-confirmar {
            background-color: #dc3545;
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .mensagem-sucesso-sessao {
            background-color: #d4edda;
            color: #155724;
            padding: 12px;
            border-radius: 4px;
            margin-bottom: 20px;
            border: 1px solid #c3e6cb;
        }
        
        .sessao-minha-acoes {
            display: flex;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
        }
        
        .btn-acessar-mesa {
            background-color: #772b0d;
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            text-decoration: none;
            display: inline-block;
            transition: background-color 0.3s;
        }
        
        .btn-acessar-mesa:hover {
            background-color: #42240a;
        }
        
        .btn-gerenciar-sessao {
            background-color: #772b0d;
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            text-decoration: none;
            display: inline-block;
            transition: background-color 0.3s;
        }
        
        .btn-gerenciar-sessao:hover {
            background-color: #42240a;
        }
        
        .btn-editar-sessao {
            background-color: #772b0d;
            color: #ffffff;
            padding: 8px 16px;
            border-radius: 4px;
            text-decoration: none;
            display: inline-block;
            transition: background-color 0.3s;
        }
        
        .btn-editar-sessao:hover {
            background-color: #42240a;
        }

.sessao-minha-card {
    background: #fff;
    border: 1px solid #e0dcd5;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.sessao-minha-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #8d6259;
}

.sessao-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sessao-papel {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.sessao-papel.mestre {
    background: #8d6259;
    color: white;
}

.sessao-papel.jogador {
    background: #6c757d;
    color: white;
}

.sessao-minha-card h3 {
    color: #333;
    margin: 0 0 1rem 0;
    font-size: 1.4em;
}

.sessao-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    background: rgba(141, 98, 89, 0.05);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.sessao-descricao {
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.sessao-acoes {
    display: flex;
    gap: 0.8rem;
}

.btn-acessar {
    flex: 1;
    background: #8d6259;
    color: white;
    padding: 0.8rem;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-acessar:hover {
    background: #724f48;
}

.btn-gerenciar {
    flex: 1;
    background: #6c757d;
    color: white;
    padding: 0.8rem;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-gerenciar:hover {
    background: #5a6268;
}

.botoes-acao {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.btn-buscar {
    background: #8d6259;
    color: white;
    padding: 1rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.btn-criar {
    background: #28a745;
    color: white;
    padding: 1rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.btn-buscar:hover {
    background: #724f48;
}

.btn-criar:hover {
    background: #218838;
}

/* Responsividade */
@media (max-width: 768px) {
    .minhas-sessoes-grid {
        grid-template-columns: 1fr;
    }
    
    .sessao-acoes {
        flex-direction: column;
    }
    
    .botoes-acao {
        flex-direction: column;
        align-items: center;
    }
}
        #buscar-sessoes header {
            background: linear-gradient(90deg, #2b2b2b, #3a2a20);
            color: #fff;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 2rem;
        }

        #buscar-sessoes header .logo {
            font-size: 1.5rem;
            font-weight: bold;
            color: #e2c280;
        }

        #buscar-sessoes header nav ul {
            list-style: none;
            display: flex;
            gap: 1rem;
        }

        #buscar-sessoes header nav a {
            color: #fff;
            text-decoration: none;
            transition: 0.3s;
        }

        #buscar-sessoes header nav a:hover {
            color: #e2c280;
        }

        #buscar-sessoes header nav a.active {
            color: #e2c280;
            font-weight: bold;
        }

.aviso-visitante {
    background: #fff3cd;
            border: 1px solid #ffeaa7;
            border-radius: 8px;
            padding: 1rem;
            margin: 1rem 0;
            text-align: center;
            color: #856404;
        }
        
        .criar-sessao-btn {
            display: inline-block;
            background: #8d6259;
            color: white;
            padding: 0.8rem 1.5rem;
            border-radius: 6px;
            text-decoration: none;
            font-weight: bold;
            margin-top: 1rem;
            text-align: center;
        }
        
        .criar-sessao-btn:hover {
            background: #724f48;
        }

/* ===== ESTILOS EDITAR SESSÃO ===== */

/* Link de voltar na mensagem de sucesso */
.mensagem-sucesso .link-voltar {
    color: #155724;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.mensagem-sucesso .link-voltar:hover {
    background: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
}

/* Container de senha para sessões privadas */
.senha-container {
    background: #f0f0f0;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #e2c280;
    transition: all 0.3s ease;
    display: none; /* escondido por padrão, mostrado quando .visivel */
}

.senha-container.visivel {
    display: block;
}

.senha-container .form-group {
    margin-bottom: 0;
}

.senha-container small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85em;
}

/* Estilo do checkbox de sessão privada */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.form-group-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-group-checkbox label {
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

/* Toggle visual (switch) básico usado em criar_sessao.php */
.switch {
    display: inline-block;
    position: relative;
    width: 48px;
    height: 26px;
}

.switch input[type="checkbox"] {
    /* garantir que o input cubra o switch para capturar cliques */
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    cursor: pointer;
    z-index: 2;
}

.switch .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.2s;
    /* deixar o slider visual sem interceptar cliques (input cobre a área) */
    pointer-events: none;
}

.switch .slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Estado quando marcado: mudamos cor e deslocamos o knob */
.switch input[type="checkbox"]:checked + .slider {
    background-color: #8d6259;
}

.switch input[type="checkbox"]:checked + .slider:before {
    transform: translateX(22px);
}

/* Garantir que o slider seja clicável */
.switch .slider {
    pointer-events: none;
}