* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 112.5%; /* sube la base de 16px a 18px, todo el rem se escala */
  -webkit-text-size-adjust: 100%; /* evita que Safari en iPad/iPhone reduzca el
                                      texto solo por considerar que una columna
                                      es "angosta" — sin esto, el editor se ve
                                      chico en iPad sin importar el font-size
                                      que le pongamos en CSS */
  text-size-adjust: 100%;
}

html, body {
  height: 100%;
  background: var(--negro-abismo);
  color: var(--hueso);
  font-family: var(--fuente-cuerpo);
  overflow: hidden; /* la app siempre muestra una sola pantalla a la vez */
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.pantalla {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transicion-suave);
}

.pantalla[data-activa="true"] {
  opacity: 1;
  pointer-events: auto;
}

.marcador-fase {
  color: var(--hueso-tenue);
  font-family: var(--fuente-mono);
  font-size: 0.9rem;
}

#lienzo-decoraciones {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 8, 0.75);
}

.modal.oculto { display: none; }

.modal-contenido {
  background: var(--negro-panel);
  border: 1px solid var(--negro-borde);
  border-radius: var(--radio-borde);
  padding: 2rem;
  max-width: 380px;
  text-align: center;
}

.modal-botones {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.boton-secundario, .boton-peligro {
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  border: 1px solid var(--negro-borde);
  font-family: var(--fuente-cuerpo);
  font-weight: 500;
  cursor: pointer;
  transition: transform 150ms ease, background var(--transicion-suave);
}

.boton-secundario {
  background: transparent;
  color: var(--hueso);
}

.boton-peligro {
  background: var(--carmesi);
  color: var(--hueso);
  border-color: var(--carmesi);
}

.boton-secundario:hover, .boton-peligro:hover {
  transform: translateY(-1px);
}

.boton-volver {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: transparent;
  border: 1px solid var(--negro-borde);
  color: var(--hueso-tenue);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--fuente-cuerpo);
  cursor: pointer;
  z-index: 999999;
  transition: color 200ms ease, border-color 200ms ease;
}

.boton-volver:hover {
  color: var(--hueso);
  border-color: var(--carmesi);
}

.boton-pequeno {
  min-width: auto;
  padding: 0.5rem 1.1rem;
  font-size: 1rem;
}

.barra-titulo {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--negro-panel);
  border-bottom: 1px solid var(--negro-borde);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  transform: translateY(-100%);
  transition: transform 200ms ease;
  z-index: 1000;
}

.barra-titulo.visible {
  transform: translateY(0);
}

.barra-titulo-nombre {
  font-family: var(--fuente-cuerpo);
  font-size: 0.85rem;
  color: var(--hueso-tenue);
}

.barra-titulo-botones {
  display: flex;
  gap: 0.5rem;
}

.barra-titulo-botones button {
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--hueso-tenue);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 150ms ease, color 150ms ease;
}

.barra-titulo-botones button:hover {
  background: rgba(139, 30, 47, 0.25);
  color: var(--hueso);
}

#barra-titulo-cerrar:hover {
  background: var(--carmesi);
  color: white;
}

.oculto { display: none !important; }