/* How to Play tour chrome (wave 1). Sits above the board on its own fixed
   layer; captions are TV-scale, arrows are an SVG overlay positioned over
   the board, and highlights never intercept pointer events. */

.tour-root {
  position: fixed;
  inset: 0;
  pointer-events: none; /* children re-enable */
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tour-arrow {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 201;
}

.tour-caption {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  max-width: min(1000px, calc(100vw - 32px));
  padding: calc(14px * var(--text-scale, 1)) calc(20px * var(--text-scale, 1));
  background: rgba(9, 13, 22, 0.92);
  color: #fffef8;
  border-radius: 14px;
  font-size: calc(22px * var(--text-scale, 1));
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), inset 0 0 0 2px rgba(245,197,66,0.45);
  pointer-events: none;
  z-index: 205;
}

/* TV form shifts the caption up to 10-foot sizes */
@media (min-width: 1200px) {
  .tour-caption {
    font-size: calc(26px * var(--text-scale, 1));
    bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    padding: 16px 24px;
  }
}

.tour-chrome {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(9, 13, 22, 0.92);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.06);
  pointer-events: auto;
  z-index: 206;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 16px);
}

.tour-btn {
  min-height: var(--tap, 48px);
  min-width: var(--tap, 48px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-weight: 700;
  font-size: calc(15px * var(--text-scale, 1));
}
.tour-btn:disabled { opacity: 0.35; }

.tour-btn--primary {
  background: #f5c542;
  color: #14181f;
}
.tour-btn--replay {
  background: #4fa3d1;
  color: #fff;
}
.tour-btn--end {
  background: rgba(255,255,255,0.16);
}
/* Skip keeps a 48px floor even if --tap is ever lowered. */
.tour-btn--skip {
  min-height: max(48px, var(--tap, 48px));
  min-width: max(48px, var(--tap, 48px));
}

.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  min-width: 12px;
  min-height: 12px;
}
.tour-dot.is-done { background: rgba(245,197,66,0.65); }
.tour-dot.is-current {
  background: #f5c542;
  transform: scale(1.35);
  box-shadow: 0 0 0 3px rgba(245,197,66,0.28);
}
.tour-dot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Glow: the tour applies this class to highlighted cells. The glow
   itself must never intercept pointer events - that inertness lives
   on the ::after overlay below. The CELL must stay tappable: it is
   the very cell the player is being taught to tap, so no
   pointer-events declaration belongs on this rule at all. */
.tour-glow {
  position: relative;
}
/* Re-enable clicks on the cell wrapping content: the cell is still a
   button and must be tappable; only the visual glow overlay is inert. */
.tour-glow::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  box-shadow: 0 0 0 3px #f5c542, 0 0 18px 4px rgba(245,197,66,0.55);
  pointer-events: none;
  animation: tour-pulse 1.4s ease-in-out infinite;
  z-index: 2;
}
/* Card faces are absolutely placed in their pile fan; the glow rule
   above must not pull a highlighted card out of the fan. Grid cards
   (Pyramid, TriPeaks) sit outside .card-pile and keep their own rule. */
.card-pile .card-el.tour-glow {
  position: absolute;
}
@keyframes tour-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.45; }
}

/* Arrow path paint tuned for the dark overlay */
.tour-arrow-path {
  filter: drop-shadow(0 0 6px rgba(245,197,66,0.7));
}

/* Hint chip on the board HUD */
.tour-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 4px 6px 8px;
  background: rgba(245,197,66,0.16);
  color: #ffe9a6;
  border: 1px solid rgba(245,197,66,0.4);
  border-radius: 999px;
  font-size: calc(14px * var(--text-scale, 1));
  align-self: flex-start;
}
.tour-hint-chip .tour-hint-text { flex: 1; }
.tour-hint-chip .tour-hint-dismiss {
  min-width: 32px; min-height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: #ffe9a6;
  font-weight: 700;
}

/* Small screens: keep chrome reachable, caption above it */
@media (max-width: 700px) {
  .tour-caption {
    font-size: calc(17px * var(--text-scale, 1));
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .tour-btn { padding: 6px 12px; font-size: calc(13px * var(--text-scale, 1)); }
}
