/* Pantalla de juego, con el estilo de la web "Las aventuras de Gurru":
   papel, azul marino y amarillo; Inter Tight para datos y botones, Newsreader para leer.
   Fondo y tinta cambian con el día y la noche (los pone main.js). */
body.juego {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background: #EAE2D2;
}
body.juego .columna {
  height: 100dvh;
  min-height: 0;
  --fondo-juego: #F5EFE3;
  --tinta-juego: #1B2A4A;
  --mar-juego: #1B2A4A;
  --mar-linea: #F5EFE3;
  --amarillo: #F4C430;
  --sans: 'Inter Tight', var(--sans);
  --serif: 'Newsreader', Georgia, serif;
  background: var(--fondo-juego);
  color: var(--tinta-juego);
  font-family: var(--sans);
}
@supports not (height: 100dvh) {
  body.juego .columna { height: 100vh; }
}

#lienzo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---- Arriba ---- */
#hud {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
.fila { display: flex; justify-content: space-between; align-items: baseline; }
.suave { opacity: 0.55; }
.pequeno { font-size: 13px; }
.datos { font-size: 16px; }
#sonido {
  position: absolute;
  top: calc(4px + env(safe-area-inset-top));
  right: var(--gutter);
  pointer-events: auto;
  border: 0;
  padding: 8px 0 8px 12px;
  background: none;
  color: var(--tinta-juego);
  font: 12px var(--sans);
  opacity: 0.5;
  cursor: pointer;
}
#mapa {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  font-size: 12px;
  opacity: 0.7;
}
#mapa .linea { position: relative; flex: 1; height: 1px; background: var(--tinta-juego); }
#punto {
  position: absolute;
  top: -4px;
  left: 0;
  width: 9px; height: 9px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--tinta-juego);
}
#diario {
  margin-top: 18px;
}
#d-texto { transition: opacity 0.35s ease; }
#diario.oculto #d-texto { opacity: 0; }
#diario { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; }
#d-dia { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }
#d-texto { font-family: var(--serif); font-size: 18px; font-style: italic; opacity: 0.85; }

/* ---- Abajo ---- */
/* El panel queda sobre el mar azul: todo en el color de la espuma (blanco) */
#panel {
  color: var(--mar-linea);
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 var(--gutter) calc(16px + env(safe-area-inset-bottom));
}
.instrumentos {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
#brujula { width: 92px; height: 92px; flex: none; }
.lecturas { font-size: 13px; }
/* Viento: con el color de tinta pleno (negro de día), letra fina */
#h-viento { opacity: 1; font-size: 16px; font-weight: 400; margin-top: 2px; }
.numero { font-size: 40px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.unidad { font-size: 14px; }

/* Mandos: cada grupo es una sola pieza con divisiones (menos ruido visual) */
.grupo {
  display: flex;
  border: 1.5px solid var(--mar-linea);
  border-radius: 999px;
  overflow: hidden;
}
.grupo + .grupo { margin-top: 8px; }
.grupo button {
  flex: 1;
  min-height: 50px;
  border: 0;
  background: transparent;
  color: var(--mar-linea);
  font: 500 15px var(--sans);
  cursor: pointer;
  touch-action: manipulation;
}
.grupo button + button { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--mar-linea) 35%, transparent); }
.grupo button.activo { background: var(--amarillo); color: #1B2A4A; font-weight: 600; box-shadow: none; }
#recoger {
  display: block;
  width: 100%;
  min-height: 92px;
  margin-bottom: 12px;
  border: 1px solid var(--tinta-juego);
  border-radius: 30px;
  background: var(--tinta-juego);
  color: var(--fondo-juego);
  font: 17px var(--sans);
  touch-action: manipulation;
}

/* ---- Inicio ---- */
#inicio {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: var(--fondo-juego);
  color: var(--tinta-juego);
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.8s ease;
}
#inicio .grande { font: 500 28px var(--sans); letter-spacing: -0.02em; }
#inicio .peque { font: 14px var(--sans); opacity: 0.55; }
#inicio.oculto { opacity: 0; pointer-events: none; }

/* ---- Saltar travesía ---- */
#saltar {
  pointer-events: auto;
  border: 0;
  padding: 6px 0 6px 12px;
  background: none;
  color: var(--tinta-juego);
  font: 13px var(--sans);
  text-decoration: underline;
  opacity: 0.55;
  cursor: pointer;
}
#confirmar {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--fondo-juego) 70%, transparent);
}
#confirmar .caja {
  width: 100%;
  padding: 24px 20px;
  border: 1.5px solid var(--tinta-juego);
  border-radius: 20px;
  background: var(--fondo-juego);
  color: var(--tinta-juego);
}
#confirmar p { font-family: var(--serif); font-size: 21px; margin-bottom: 20px; }

/* ---- Guía ---- */
#guia {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: calc(24px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: #F5EFE3;
  color: #1B2A4A;
}
#guia[hidden] { display: none; }
.guia-paso { font-size: 13px; opacity: 0.55; }
#guia h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
#guia p { font-family: var(--serif); font-size: 19px; line-height: 1.5; }
#guia b { font-family: var(--sans); font-weight: 600; }
.guia-dibujos { display: flex; justify-content: space-around; gap: 8px; }
.guia-dibujos figure { margin: 0; text-align: center; font-size: 14px; }
.guia-rosa { width: 100px; height: 100px; display: block; margin: 0 auto 4px; }
.guia-botones { display: flex; gap: 8px; margin-top: 8px; }
.guia-botones button {
  flex: 1;
  min-height: 52px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 16px var(--sans);
  cursor: pointer;
  touch-action: manipulation;
}
.guia-botones button:last-child { background: var(--amarillo); color: #1B2A4A; border-color: #1B2A4A; font-weight: 600; }
#confirmar .guia-botones button:last-child { background: var(--amarillo); color: #1B2A4A; border-color: var(--tinta-juego); }

/* Enlace "Cómo se juega" en la pantalla de inicio */
#como {
  position: absolute;
  z-index: 12;
  left: 0; right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: max-content;
  border: 0;
  background: none;
  color: var(--tinta-juego);
  font: 15px var(--sans);
  text-decoration: underline;
  cursor: pointer;
}
