/* Fondo general (usa la misma imagen que en la app) */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-image: url("assets/Fondo.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  width: 240px;
  max-width: 40vw;
  margin: 0 auto 15px auto; /* ← Centrado horizontal */
  display: block;           /* Necesario para centrar con margin auto */
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.25));
}

/* Tarjeta central */
.overlay {
  background: rgba(255, 255, 255, 0.88);
  padding: 24px;
  border-radius: 16px;
  width: 92%;
  max-width: 430px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Título en dos líneas */
h1 {
  font-size: 26px;
  color: #4e342e;
  margin: 0 0 18px 0;
  line-height: 1.2;
}

h1 span {
  font-size: 20px;
  font-weight: 600;
  color: #6d4c41;
}

/* Botón principal */
button {
  background-color: #8d4a24;
  border: none;
  padding: 12px 26px;
  color: white;
  font-size: 18px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

button:disabled {
  background-color: #c7a48a;
  cursor: not-allowed;
  box-shadow: none;
}

/* Contenedor 2x2 de dados */
.dados {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  justify-items: center;
  margin-bottom: 16px;
}

/* Dado responsivo */
.dado {
  width: min(32vw, 110px);
  height: auto;
  transition: transform 0.2s ease-in-out;
}

/* Efecto de giro */
.roll {
  animation: spin 0.7s linear infinite;
}

/* Definición de giro */
@keyframes spin {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.05);
  }
}

/* Resultado y mensaje */
#resultado {
  font-size: 20px;
  font-weight: 700;
  color: #3e2723;
  margin-top: 8px;
}

#mensaje {
  margin-top: 6px;
  font-style: italic;
  color: #5d4037;
  font-size: 16px;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 360px) {
  h1 {
    font-size: 22px;
  }
  h1 span {
    font-size: 18px;
  }
  button {
    font-size: 16px;
  }
}

/* ==== POPUP DE INSTRUCCIONES ==== */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 999;
}

.popup-content {
  background: #fff7e9;
  border-radius: 14px;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  animation: fadeIn 0.35s ease-out;
}

.popup-content h2 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #4e342e;
}

.popup-content p {
  font-size: 16px;
  color: #5d4037;
  margin-bottom: 15px;
  line-height: 1.5;
}

.popup-btn {
  background: #8d4a24;
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.popup-btn:hover {
  background: #a85b31;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsivo para pantallas pequeñas */
@media (max-width: 400px) {
  .popup-content {
    padding: 18px;
  }
  .popup-content h2 {
    font-size: 20px;
  }
  .popup-content p {
    font-size: 14px;
  }
}