/* Boton para alternar entre tema claro y oscuro */
.theme-cambiar {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 1rem;
    transition: background 0.2s;
}

.tema-cambiar:hover {
    background: rgba(255, 255, 255, 0.1);
}
/* Variables del tema claro (por defecto) */
:root {
    --bg-color: #eee;
    --text-color: #222;
    --header-bg: #444;
    --form-bg: #fff;
    --input-bg: #f9f9f9;
    --input-border: #bbb;
    --celda-bg: #bbb;
    --celda-border: #999;
    --celda-revelada: #e0e0e0;
    --tablero-bg: #ccc;
    --modal-bg: #fff;
}
/* Variables del tema oscuro */
[data-tema="oscuro"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --header-bg: #2d2d2d;
    --form-bg: #2d2d2d;
    --input-bg: #3a3a3a;
    --input-border: #555;
    --celda-bg: #404040;
    --celda-border: #555;
    --celda-revelada: #505050;
    --tablero-bg: #333;
    --modal-bg: #2d2d2d;
}
/* Configuracion base del cuerpo del documento */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}
/* Estilo del encabezado principal */
.header {
    background: var(--header-bg);
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
}
nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
nav button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s, transform 0.1s;
}
nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s, transform 0.1s;
    font-weight: 500;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}
.titulo {
    font-size: 2rem;
}
/* Contenedor principal del contenido */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: 2rem;
}
/* Contenedor de formularios del jugador */
.form-jugador {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--form-bg);
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);  
    max-width: 380px;    
    width: 100%;         
    box-sizing: border-box;
    margin-bottom: 2rem;
    align-items: stretch;
}

.form-jugador label {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #444;
}
.form-jugador input,
.form-jugador textarea {
    padding: 0.7rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-color);
}
.form-jugador button {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background 0.2s, transform 0.1s;
}
/* Contenedor principal del juego */
.juego {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}
/* Barra de informacion del juego (tiempo, minas, etc.) */
.barra {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}
.reiniciar-btn {
    font-size: 1.5rem;
    cursor: pointer;
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
}
/* Contenedor del tablero de minas */
.tablero {
    display: flex;
    flex-wrap: wrap;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    background: var(--tablero-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-bottom: 2rem;
    position: relative;
}
/* Celdas individuales del tablero */
.celda {
    width: 12.5%;
    height: 12.5%;
    box-sizing: border-box;
    background: var(--celda-bg);
    border: 1px solid var(--celda-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
/* Celdas clickeadas */
.celda.revelada {
    background: var(--celda-revelada);
    cursor: default;
    color: var(--text-color)
}
/* Celdas con bandera */
.celda.bandera {
    background: #ffe082;
    color: #d32f2f;
    font-size: 1.2rem;
}
.celda.mina {
    background: #ff5252;
    color: #fff;
}
/* modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    z-index: 100;
}
/* Clase para ocultar elementos */
.oculto {
    display: none !important;
}
/* Mensajes de error */
.errores {
    color: #d32f2f;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    max-width: 100%;
    font-weight: 500;
}

/* Contenido del modal */
.modal-contenido {
    background: var(--modal-bg);
    padding: 2rem;
    border-radius: 12px;
    min-width: 250px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    color: var(--text-color);
}

/* Botón de cerrar modal */
#modalCerrar {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1rem;
    padding: 0.5rem 1.2rem;
    background: #38ada9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#mensajeContacto {
    resize: vertical;           /* Solo permite expandir hacia abajo */
    max-height: 220px;          
    min-height: 80px;           
    width: 100%;                
  
}
/* Boton de tema en modo oscuro */
[data-tema="oscuro"] .tema-cambiar {
    border-color: #fff;
    color: #fff;
}
/* Etiquetas de formulario en tema oscuro */
[data-tema="oscuro"] .form-jugador label {
    color: #e0e0e0;
}
/* Mensajes de error en tema oscuro */
[data-tema="oscuro"] .errores {
    color: #ff6b6b;
}
/* Ajustes para dispositivos moviles */

.nivel-dificultad {
    margin-bottom: 20px;
    text-align: center;
}

.nivel-dificultad label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--texto-color);
}

.nivel-dificultad select {
    padding: 10px;
    font-size: 16px;
    border: 2px solid var(--borde-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--texto-color);
    width: 250px;
    cursor: pointer;
}

.nivel-dificultad select:focus {
    outline: none;
    border-color: var(--acento-color);
}

@media (max-width: 480px) {
    .tablero {
        width: 240px;
        height: 240px;
    }
    .main {
        margin-top: 1rem;
    }
}
