/* RESET Y ESTILOS GENERALES */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1a2a3a;
  color: #ecf0f1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.juego-container {
  background: #2c3e50;
  width: 100%;
  max-width: 450px;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 4px solid #34495e;
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #f39c12;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
}

/* MARCADOR DE PUNTOS Y TIEMPO */
.marcador {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 15px;
}

.marcador div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.marcador span {
  font-size: 0.8rem;
  color: #bdc3c7;
  text-transform: uppercase;
}

.marcador p {
  font-size: 1.1rem;
  font-weight: bold;
}

/* TABLERO DE CELDAS */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.grid.deshabilitado {
  pointer-events: none;
  opacity: 0.6;
}

.celda {
  aspect-ratio: 1;
  background: #34495e;
  border: 3px solid #2c3e50;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 5px 0px #1a252f;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.3s;
}

.celda:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0px #1a252f;
}

.celda.libre {
  background: #27ae60;
  border-color: #2ecc71;
  box-shadow: 0 5px 0px #1e8449;
}

/* BOTONES */
.btn-principal {
  background: #f39c12;
  color: #1a252f;
  border: none;
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 5px 0px #d35400;
  transition: transform 0.1s ease;
  margin-top: 10px;
}

.btn-principal:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0px #d35400;
}

.btn-whatsapp {
  background: #25D366 !important;
  color: #ffffff !important;
  box-shadow: 0 5px 0px #128C7E !important;
}

.btn-whatsapp:active {
  box-shadow: 0 1px 0px #128C7E !important;
}

/* MODALES */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  padding: 20px;
}

.modal.oculto {
  display: none !important;
}

.modal-contenido {
  background: #2c3e50;
  border: 3px solid #f39c12;
  border-radius: 18px;
  padding: 25px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.operacion {
  font-size: 2.2rem;
  font-weight: bold;
  margin: 15px 0;
  color: #f39c12;
}

.input-respuesta {
  width: 80%;
  padding: 12px;
  font-size: 1.5rem;
  text-align: center;
  border-radius: 10px;
  border: 2px solid #7f8c8d;
  background: #ecf0f1;
  color: #2c3e50;
  margin-bottom: 15px;
  outline: none;
}

.mensaje-error {
  font-size: 0.95rem;
  font-weight: bold;
  min-height: 24px;
  margin-bottom: 10px;
}