/* The first-run demo overlay. Deliberately NOT a scrim: dimming the board would
   hide the very thing the demo is pointing at. It draws on top and lets the
   real game show through. pointer-events stay off everywhere except Skip, so a
   player who wants to start immediately taps straight through onto the board —
   the pointerdown listener closes the demo and the tap lands on the game. */
.q4-firstrun {
  position: fixed; inset: 0;
  /* Above the toast (120) and every modal (90-110), below the consent banner
     (99999), which the demo waits for rather than fights. At 90 it was level
     with the instructions modal and *under* the toast, so anything transient
     could cover the very line the player was meant to read. */
  z-index: 130;
  pointer-events: none;
  opacity: 0; transition: opacity .22s ease;
}
.q4-firstrun.q4-fr-in  { opacity: 1; }
.q4-firstrun.q4-fr-out { opacity: 0; }

.q4-fr-ring {
  position: fixed; top: 0; left: 0;
  border: 2.5px solid currentColor; border-radius: 14px;
  opacity: 0;
  transition: transform .55s cubic-bezier(.4,0,.2,1),
              width .55s cubic-bezier(.4,0,.2,1),
              height .55s cubic-bezier(.4,0,.2,1),
              opacity .25s ease;
}
.q4-fr-dot {
  position: fixed; top: 0; left: 0;
  width: 20px; height: 20px; border-radius: 50%;
  opacity: 0;
  box-shadow: 0 2px 10px rgba(15,23,42,.35);
  transition: transform .55s cubic-bezier(.4,0,.2,1), opacity .25s ease;
}
/* The moment of contact. */
.q4-fr-dot.q4-fr-tap { animation: q4-fr-tap .36s ease; }
@keyframes q4-fr-tap {
  0%   { box-shadow: 0 2px 10px rgba(15,23,42,.35), 0 0 0 0 currentColor; }
  55%  { box-shadow: 0 2px 10px rgba(15,23,42,.35), 0 0 0 14px rgba(0,0,0,0); }
  100% { box-shadow: 0 2px 10px rgba(15,23,42,.35), 0 0 0 0 rgba(0,0,0,0); }
}

.q4-fr-bar {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .75rem;
  width: min(94vw, 32rem);
  /* MATCHED TO THE GAMES' OWN TOAST, which this is a near-twin of: fixed at the
     bottom, centred, dark slate, white and bold. It had drifted — slate-900 at
     a 1.1rem radius against the toast's slate-800 at rounded-xl — which read as
     conspicuously rounder than everything around it. Same values now, so the
     two never appear side by side looking like different components. */
  background: #1e293b; color: #fff;
  padding: .55rem .6rem .55rem 1rem;
  border-radius: .75rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  font-size: .875rem; font-weight: 700; line-height: 1.35;
}
/* The text takes the room, not the controls. At 92vw on a phone the nav and the
   Skip chip were eating over half the bar, wringing captions into eight-line
   columns. */
.q4-fr-text { flex: 1 1 auto; min-width: 0; }

.q4-fr-nav {
  pointer-events: auto;
  flex: 0 0 auto;
  display: flex; align-items: center; gap: .1rem;
}
.q4-fr-arrow {
  background: none; border: 0; color: #fff; cursor: pointer;
  font-size: 1.05rem; line-height: 1;
  padding: .15rem .3rem; border-radius: .4rem;
}
.q4-fr-arrow:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.q4-fr-arrow:disabled { opacity: .3; cursor: default; }
.q4-fr-count {
  font-size: .625rem; font-weight: 800; opacity: .55;
  font-variant-numeric: tabular-nums; min-width: 1.6rem; text-align: center;
}

.q4-fr-skip {
  pointer-events: auto;
  flex: 0 0 auto;
  background: rgba(255,255,255,.15); color: #fff;
  border: 0; border-radius: .5rem;
  padding: .3rem .65rem;
  font-size: .6875rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; cursor: pointer;
}
.q4-fr-skip:hover { background: rgba(255,255,255,.28); }

@media (prefers-reduced-motion: reduce) {
  .q4-fr-ring, .q4-fr-dot { transition: none; }
  .q4-fr-dot.q4-fr-tap { animation: none; }
}
