/* styles.css */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #ffeb3b;
}

.scoreboard {
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 20px;
}
.ship_explote {
    background-image: url("./ship_explode.webp");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1002;
    position: fixed;
    overflow: hidden;
}



#correctAnswers {
    color: #4caf50; /* Verde para preguntas correctas */
}

.board {
    display: grid;
    grid-template-columns: repeat(18, 50px); /* Ajustado para la tabla periódica */
    grid-gap: 5px;
    background-color: #f5faff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    overflow-x: auto;
}

.cell {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #030404;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    background: #a5dadc;
}

.cell.blue {
    background-color: #2980b9;
}

.cell.purple {
    background-color: #aa2ef2;
}

.cell:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.hit {
    background-color: #ff1900; /* Rojo */
    color: #fff;
    box-shadow: 0 0 10px rgb(255, 0, 0), 0 0 20px rgb(255, 68, 0);
    transform: scale(1);
}

.miss {
    background-color: #000000;
    color: #fff;
    box-shadow: inset 0 0 50px rgb(0, 0, 0);
    transform: scale(1);
}

.ship-sunk {
    color: red;
}

/* Estilos para el popup */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 30px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #ffffff;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: fadeIn 0.5s ease-out;
}

/* Estilos para el modal */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 1001; /* Superior al popup */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.7); /* Fondo negro más oscuro con transparencia */
    animation: fadeInBackground 0.5s ease;
}

.modal-content {
    background: #2a2a2a;
    margin: 2% auto;         /* Reducir el margen para no empujar demasiado hacia abajo */
    padding: 30px 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;        /* Limitar la altura al 80% del viewport */
    overflow-y: auto;        /* Habilitar scroll si se supera la altura */
    text-align: center;
    position: relative;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.5s ease;
}

.close,
.close-question {
    color: #ffffff;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus,
.close-question:hover,
.close-question:focus {
    color: #ffeb3b;
    text-decoration: none;
}

#restartButton {
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    background: #2980b9;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    transition: background 0.3s, transform 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

#restartButton:hover {
    background: #1c5980;
    transform: translateY(-2px);
}

#restartButton:active {
    background: #145a86;
    transform: translateY(0);
}

/* Modal de Pregunta */
#questionModal .modal-content {
    max-width: 600px;
}

#questionText {
    margin-bottom: 15px;
}

#timer {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #ffeb3b; /* Color amarillo para resaltar el temporizador */
}

#optionsContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background: #4caf50;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    transition: background 0.3s, transform 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.option-button:hover {
    background: #388e3c;
    transform: translateY(-2px);
}

.option-button.correct {
    background: #2e7d32;
}

.option-button.incorrect {
    background: #c62828;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInBackground {
    from { opacity: 0; }
    to { opacity: 0.7; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}
