:root {
  color-scheme: dark;
  --fondo: #0b0a10;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--fondo);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#juego canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Las fotos de los recuerdos: son fotos, no pixel art. Van en una capa por encima del canvas
   (que mide 480 × 270 y se agranda en bloques) para que se vean con toda su resolución. */
#fotos {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

#fotos img {
  position: absolute;
  display: block;
  object-fit: cover;
  /* Las tarjetas del álbum recortan la foto a lo ancho: un poco hacia arriba, donde están las caras. */
  object-position: 50% 35%;
  image-rendering: auto;
  pointer-events: none;
}

#girar {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 16, 0.96);
  padding: 1.5rem;
  text-align: center;
}

#girar[hidden] {
  display: none;
}

.girar-caja {
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.girar-icono {
  width: 3.4rem;
  height: 5.6rem;
  border: 3px solid #ffd23f;
  border-radius: 0.6rem;
  animation: girar-aviso 2.6s ease-in-out infinite;
}

.girar-titulo {
  margin: 0.6rem 0 0;
  color: #ffd23f;
  font-size: 1.25rem;
  font-weight: 700;
}

.girar-texto {
  margin: 0;
  color: #f6e7c6;
  font-size: 0.95rem;
}

#girar-seguir {
  margin-top: 0.9rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid rgba(255, 248, 236, 0.5);
  border-radius: 999px;
  background: transparent;
  color: #fff8ec;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

#girar-seguir:active {
  background: rgba(255, 248, 236, 0.14);
}

@keyframes girar-aviso {
  0%,
  40% {
    transform: rotate(0deg);
  }
  60%,
  100% {
    transform: rotate(90deg);
  }
}

/* Pantalla completa: fondo negro también en el elemento en fullscreen. */
:fullscreen,
:-webkit-full-screen {
  background: var(--fondo);
}

/* iPhone (sin Fullscreen API): se fija la página y se estira al alto real para que la
   barra del navegador coma lo menos posible. */
body.pantalla-ios {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
}

#sin-js {
  color: #ffd666;
  font-size: 1rem;
  text-align: center;
  padding: 2rem;
}
