/* CarkedIt Online — How to Play overlay (in-lobby)
 * Renders the how-to-play content ON TOP of the online lobby. Reuses the .htp-*
 * content styles from how-to-play.css; this file adds only the overlay chrome,
 * the live step-completion states, and the lobby entry buttons.
 * Colours: var(--color-*) tokens only (see css/colors.css).
 */

/* ── Overlay chrome ───────────────────────────────────── */
.htp-overlay {
  position: fixed;
  inset: 0;
  z-index: 400; /* above the host edit drawer (200) and inspect overlays (100) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.htp-overlay__scrim {
  position: absolute;
  inset: 0;
  background: var(--color-overlay-dim);
}

.htp-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(90dvh, 900px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px var(--color-overlay-dim);
}

.htp-overlay__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.htp-overlay__close:active {
  opacity: 0.8;
}

/* The reused .htp container is a full page normally; in the overlay it's the
 * scroll body of the panel. */
.htp--overlay {
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.htp-overlay__titles {
  text-align: center;
  padding: 0 var(--space-lg) var(--space-xs);
}

/* ── Live step completion ─────────────────────────────── */
/* Current (next) step: nudge attention with a primary ring. */
.htp-step--current {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Completed step: greyed out with a green tick. */
.htp-step--done {
  opacity: 0.62;
}

.htp-step--done .htp-step__num {
  background: var(--color-live);
}

.htp-step__done-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-bg);
  background: var(--color-live);
  border-radius: var(--radius-sm);
  padding: 0.12rem 0.4rem;
  margin-left: var(--space-xs);
  vertical-align: middle;
  white-space: nowrap;
}

/* Completed steps collapse to a compact single row: ✓ + title + Done.
 * Details are hidden — they just record the progress already made. */
.htp-step--mini {
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 10px;
}

.htp-step--mini .htp-step__num {
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  flex: 0 0 auto;
}

.htp-step--mini .htp-step__title {
  font-size: 0.85rem;
  margin: 0;
}

/* ── Tap-to-copy "Share the Link" step ────────────────── */
.htp-step--copy {
  cursor: pointer;
}

.htp-step--copy:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.htp-step__copy-hint {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.htp-step__copy-hint--copied {
  color: var(--color-live);
}

/* ── Tap-to-dismiss video-call tip step ───────────────── */
.htp-step--tip {
  cursor: pointer;
}

.htp-step--tip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.htp-tip__hint {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* ── Header help button (both lobby states) ───────────── */
.phase-header__help-btn {
  width: 44px;
  height: 44px;
  /* White chip to match the flag/link buttons; dark glyph for contrast (their
     icons carry their own dark stroke, but ours is a text "?"). */
  background: var(--color-phase-settings-bg);
  border: 1px solid var(--color-phase-settings-border);
  border-radius: 10px;
  color: var(--color-bg);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase-header__help-btn:active {
  opacity: 0.8;
}

/* ── First-game banner (slim, dismissible, in the lobby board) ───── */
.online-lobby__howto-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-primary-subtle);
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
}

.online-lobby__howto-bar:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.online-lobby__howto-bar-emoji {
  font-size: 1rem;
  line-height: 1;
  flex: 0 0 auto;
}

.online-lobby__howto-bar-text {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--color-text);
}

.online-lobby__howto-bar-link {
  color: var(--color-primary);
  font-weight: 800;
}

.online-lobby__howto-bar-x {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  flex: 0 0 auto;
}

.online-lobby__howto-bar-x:active {
  opacity: 0.7;
}
