/* ============================================================
   tutorial.css — the interface explained before the first decision.

   A veil with a hole cut over one fragment of the real screen, a
   pulsing ring around the hole, and a card of words beside it.
   The veil takes no touch: only the card does, so the visitor can
   still drag the sphere or press a key while the words are read.

   z 9400 — over the film (8000-9200) and the tablet (8600),
   under the challenge (9500), the till (9600), the hall (9700).
   ============================================================ */

#tut-veil {
  position: fixed;
  inset: 0;
  z-index: 9400;
  overflow: visible;
  pointer-events: none;
  font-family: var(--px-ui, 'Pixelify Sans', monospace);
}

/* the hole: the element itself, untouched, with the dark laid all round it
   by one enormous shadow spread — the two rectangles are the same rectangle */
#tut-veil .tv-hole {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(2, 10, 7, 0.72);
  outline: 3px solid var(--px-green, #3cffa0);
  outline-offset: 3px;
  animation: tv-pulse 1.2s linear infinite;
}
/* a square wave, not a fade: the ring is lit for half the beat and dim for the
   other half, and it is lit on the very first frame */
@keyframes tv-pulse {
  0%, 49.9%  { outline-color: var(--px-green, #3cffa0); }
  50%, 100%  { outline-color: rgba(60, 255, 160, 0.16); }
}

/* the card */
#tut-veil .tv-card {
  position: fixed;
  left: 0;
  top: 0;
  width: 420px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  pointer-events: auto;
  padding: 14px 16px 12px;
  background: rgba(8, 20, 15, 0.94);
  border: 2px solid var(--px-green, #3cffa0);
  box-shadow: 0 0 0 3px #04070b, 6px 6px 0 3px rgba(0, 0, 0, 0.55);
  color: #eafff5;
  image-rendering: pixelated;
  text-align: left;
}

#tut-veil .tv-t {
  font-family: var(--px-title, 'Press Start 2P', monospace);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--px-green, #3cffa0);
  text-shadow: 2px 2px 0 #000;
  margin: 0 0 10px;
}

#tut-veil .tv-x {
  margin: 0;
  font-family: var(--px-ui, 'Pixelify Sans', monospace);
  font-size: 19px;
  line-height: 1.35;
  color: #eafff5;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  text-wrap: pretty;
}

#tut-veil .tv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
#tut-veil .tv-n {
  flex: 1 1 auto;
  font-family: var(--px-title, 'Press Start 2P', monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--px-green-dim, #62d88f);
  opacity: 0.85;
}
#tut-veil .tv-k {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  background: rgba(4, 12, 9, 0.95);
  border: 2px solid var(--px-green-dim, #62d88f);
  color: var(--px-green, #3cffa0);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#tut-veil .tv-k b { font-weight: 400; display: block; }
#tut-veil .tv-k:hover,
#tut-veil .tv-k:focus-visible {
  outline: none;
  border-color: var(--px-green, #3cffa0);
  background: rgba(10, 44, 26, 0.95);
  color: #fff;
}
#tut-veil .tv-k:active { transform: translate(2px, 2px); }
#tut-veil .tv-skip { color: var(--px-amber, #ffb257); border-color: rgba(255, 178, 87, 0.7); }
#tut-veil .tv-skip:hover,
#tut-veil .tv-skip:focus-visible { border-color: var(--px-amber, #ffb257); background: rgba(52, 34, 8, 0.9); color: #ffd39a; }

/* the tutorial is the only voice on screen: the film's karaoke line waits */
body.tut-on #game-sub { display: none !important; }

/* the notch, the bar and the rounded corners, in numbers the script can read:
   its computed padding IS the four insets (a hidden one-pixel box) */
#tut-veil .tv-safe {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  visibility: hidden;
  pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
           env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* a phone: smaller words, and the card takes the width it is given */
@media (max-width: 520px) {
  #tut-veil .tv-card { width: calc(100vw - 24px); padding: 12px 13px 10px; }
  #tut-veil .tv-t { font-size: 10px; margin-bottom: 8px; }
  #tut-veil .tv-x { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  #tut-veil .tv-hole { animation: none; }
}
