/* ---------- Juego: ¡Abre bien el ojo! (sección invertida: fondo negro) ---------- */
.game { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }

/* Barra fija: retratos, marcador y botones siempre a la vista mientras juegas */
.game__bar {
  position: sticky; top: var(--topbar-h); z-index: 20; background: var(--ink);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem;
  padding: 0.6rem 0; border-bottom: var(--line) solid var(--paper);
}
.targets { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.5rem; }
.target {
  position: relative; background: var(--paper); border: 0.18rem solid var(--paper);
  width: clamp(2.8rem, 5.5vw, 3.9rem); aspect-ratio: 1 / 1.1; display: grid; place-items: center; padding: 0.15rem;
  transition: background 160ms steps(3, end);
}
.target img { max-height: 100%; width: auto; max-width: 100%; transition: filter 160ms steps(3, end); }
.target__check { position: absolute; top: -0.45rem; right: -0.45rem; width: 1.25rem; height: 1.25rem; background: var(--ink); color: var(--paper); border: 0.14rem solid var(--paper); display: none; place-items: center; font-weight: 700; font-size: 0.75rem; }
.target.is-found { background: var(--ink); }
.target.is-found img { filter: invert(1); }
.target.is-found .target__check { display: grid; }

.hud { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; margin-left: auto; }
.hud__item { margin: 0; display: flex; align-items: baseline; gap: 0.4rem; }
.hud__label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--step--1); }
.hud__num { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; font-variant-numeric: tabular-nums; }
.hud__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hud__btn { font-size: var(--step--1); padding: 0.25rem 0.8rem 0.15rem; box-shadow: none; }
.hud__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--paper); }
.hud__btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* La portada de inicio cubre solo lo visible (no la escena completa que se desplaza) */
.scene-wrap { position: relative; scroll-margin-top: 5.4rem; }
/* En pantallas angostas la escena conserva un ancho mínimo y se desplaza en horizontal */
@media (max-width: 61.99rem) { .scene { min-width: 58rem; } }
/* En pantallas grandes la escena se ajusta al alto disponible para verse completa sin desplazarse */
@media (min-width: 62rem) {
  .scene-wrap {
    max-width: calc((100vh - var(--topbar-h) - 8.5rem) * 1.5);
    max-width: calc((100svh - var(--topbar-h) - 8.5rem) * 1.5);
    min-width: min(100%, 40rem); margin-inline: auto;
  }
}

/* En pantallas angostas la escena se desplaza en horizontal para que se vean los gaviotones */
.scene-scroll { overflow-x: auto; border: var(--line) solid var(--paper); -webkit-overflow-scrolling: touch; }
.scene { position: relative; line-height: 0; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.scene.is-lens { touch-action: none; }
.scene__img { width: 100%; height: auto; background: var(--paper); pointer-events: none; }
.scene__marks, .scene__zones, .scene__fx { position: absolute; inset: 0; }
.scene__marks { width: 100%; height: 100%; pointer-events: none; }
.scene__fx { pointer-events: none; }
.zone { position: absolute; background: transparent; border: 0; padding: 0; cursor: crosshair; }
.zone:focus-visible { outline: 0.25rem dashed var(--ink); outline-offset: 0.1rem; background: rgb(255 255 255 / 0.4); box-shadow: none; }
.zone.is-found { cursor: default; }

.mark { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 520ms steps(10, end) forwards; }
.mark--halo { stroke: var(--paper); stroke-width: 11; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.fx { position: absolute; translate: -50% -100%; font-family: var(--font-display); text-transform: uppercase; line-height: 1; white-space: nowrap; background: var(--paper); color: var(--ink); border: 0.2rem solid var(--ink); padding: 0.25rem 0.7rem 0.15rem; }
.fx--hit { font-size: var(--step-2); animation: stamp 360ms steps(4, end) both, fadeout 400ms 1.8s steps(4, end) forwards; }
.fx--miss { font-size: var(--step-1); animation: stamp 220ms steps(3, end) both, fadeout 300ms 0.6s steps(3, end) forwards; }
@keyframes fadeout { to { opacity: 0; } }

.hint-quad { position: absolute; width: 50%; height: 50%; pointer-events: none; border: 0.35rem dashed var(--ink); outline: 0.25rem dashed var(--paper); background: repeating-linear-gradient(45deg, rgb(0 0 0 / 0) 0 0.7rem, rgb(0 0 0 / 0.1) 0.7rem 0.9rem); }
.hint-quad[hidden] { display: none; }
.hint-quad.is-on { animation: blink 3.5s steps(2, end); }
@keyframes blink { 0%, 20%, 40%, 60% { opacity: 1; } 10%, 30%, 50% { opacity: 0.35; } 100% { opacity: 1; } }

.lens { position: absolute; width: 9.5rem; height: 9.5rem; border-radius: 50%; border: 0.3rem solid var(--ink); outline: 0.2rem solid var(--paper); background-color: var(--paper); background-repeat: no-repeat; pointer-events: none; z-index: 4; box-shadow: 0.3rem 0.3rem 0 0 rgb(0 0 0 / 0.35); }
.lens[hidden] { display: none; }

.game-cover { position: absolute; inset: 0; z-index: 5; background: var(--ink); color: var(--paper); display: grid; place-content: center; justify-items: center; gap: var(--space-4); text-align: center; padding: var(--space-4); line-height: 1.5; }
.game-cover__text { font-family: var(--font-display); text-transform: uppercase; font-size: var(--step-2); max-width: 24ch; margin: 0; line-height: 1.05; }
.game-cover[hidden] { display: none; }

.result { background: var(--paper); color: var(--ink); border: var(--line) solid var(--paper); box-shadow: 0.5rem 0.5rem 0 0 var(--paper); padding: var(--space-4); display: grid; gap: var(--space-2); justify-items: start; max-width: 36rem; justify-self: center; text-align: left; }
.result[hidden] { display: none; }
.result__title { font-size: var(--step-3); }
.result__line { font-size: var(--step-1); margin: 0; font-weight: 600; }
.result__record { font-family: var(--font-display); text-transform: uppercase; font-size: var(--step-1); margin: 0; background: var(--ink); color: var(--paper); padding: 0.2rem 0.8rem 0.1rem; transform: rotate(-2deg); }
.result__record[hidden] { display: none; }
.result__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.result .btn { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 0.35rem 0.35rem 0 0 var(--ink); }
.result .btn--ghost { background: var(--paper); color: var(--ink); }
.result__note { margin: 0; font-size: var(--step--1); min-height: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  .mark { stroke-dashoffset: 0; }
}
