/* ============================================
   COACH-MARKS (tips)
   ============================================
   Inline tips anchored to UI elements, triggered by a first-time interaction,
   not idle timers.

   2026-10-08: the card IS the shared guide card (css/feature-tour.css
   .fr-guide-*), the same one the tour and Show me how use, so the three read
   as one feature. This sheet places it, fades it, and styles what a tip
   adds: Show me how's labelled pictures (BoardSpecimens) and drawn buttons.
   ============================================ */

:root {
  --coach-z: 9400;
  --coach-width: 300px;
}

.coach-mark.fr-guide-card {
  position: fixed;
  z-index: var(--coach-z);
  width: var(--coach-width);
  max-width: calc(100vw - 24px);
  gap: 10px;
  padding: 14px 16px;
  opacity: 0;
  transform: scale(0.96) translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.coach-mark.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.coach-mark.hiding {
  opacity: 0;
  transform: scale(0.96) translateY(4px);
}

/* The tip's kicker is amber, like the lightbulb that marks tips in Help. */
.coach-mark .coach-mark-kicker { color: var(--amber-700, #b45309); display: inline-flex; align-items: center; gap: 6px; }
.coach-mark .coach-mark-kicker i { color: var(--amber-500); }
body.dark-mode .coach-mark .coach-mark-kicker { color: var(--amber-300, #fcd34d); }

.coach-mark .coach-mark-title { font-size: 16px; }
/* Written like Show me how (2026-10-24): a sentence, then the one action in
   bold in its own paragraph (hint-system.js formatTip). */
.coach-mark .coach-mark-content { font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.coach-mark .coach-mark-content p { margin: 0; }
.coach-mark .coach-mark-content strong { font-weight: 700; color: var(--guide-ink); }
/* "See it labelled" and "More in Help" share one row. */
.coach-mark-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }

/* A tip with a picture is as wide as Show me how's card with one. */
.coach-mark.fr-guide-card.has-sample { width: 360px; }
/* Title and buttons stay put; the words and picture between them scroll
   when the card is capped to its room (as .practice-card-scroll). */
.coach-mark.fr-guide-card { max-height: calc(100vh - 24px); }
.coach-mark .coach-mark-body {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.coach-mark .coach-mark-body > * { flex-shrink: 0; }
.coach-mark .coach-mark-body.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
}
.coach-mark .coach-mark-help { margin-top: 0; }
.coach-mark-sample { min-width: 0; }
.coach-mark-sample .bs-keyhead { margin-bottom: 6px; }
.coach-mark.pic-folded .coach-mark-sample { display: none; }
.coach-mark-picbtn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 14px; }
.coach-mark-picbtn[hidden] { display: none; }
/* The live ★ pill, copied (best-time-marker). */
.coach-mark-pill { display: flex; justify-content: center; }

/* THE BUTTON, DRAWN: a control the tip names, with its own icon, the chip
   Help's answers use (help-center.css .hc-ctl), in the guide card's ink so
   it follows dark mode. Text-flow sized: it sits inside a sentence. */
.fr-guide-card .hc-ctl {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0 1px; padding: 1px 8px; min-height: 22px;
  border: 1px solid var(--guide-line); border-radius: 7px;
  background: var(--guide-surface); color: var(--guide-ink);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  font-size: 0.92em; font-weight: 600; line-height: 1.3;
  vertical-align: 1px; white-space: nowrap;
}
.fr-guide-card .hc-ctl i { font-size: 0.95em; color: var(--primary-600, #0d9488); }
.fr-guide-card .hc-ctl b { font-weight: 600; }
.fr-guide-card .hc-ctl--icon { padding: 1px 6px; }
body.dark-mode .fr-guide-card .hc-ctl i { color: var(--primary-300, #5eead4); }

/* THE RING (2026-10-22): the part a tip is about, outlined in the teal Show
   me how rings with, so the card and the board read as one thing. No dim:
   a tip is a nudge, not a lesson. Placed by hint-system.js placeRing(). */
.coach-mark-ring {
  position: fixed;
  z-index: calc(var(--coach-z) - 1);
  box-sizing: border-box;
  border: 2px solid var(--primary-500, #14b8a6);
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.coach-mark-ring.visible { opacity: 1; }

/* Phones: full width. Vertical placement (clear of the anchor and the fixed
   bottom chrome) is computed in hint-system.js position(), so top/bottom are
   not pinned here. The height is capped and scrolls on a short phone. */
@media (max-width: 600px) {
  .coach-mark.fr-guide-card,
  .coach-mark.fr-guide-card.has-sample {
    width: calc(100vw - 24px);
    max-height: 80vh;
  }
  /* As Show me how's card (practice-mode.css): the 44px X pinned in the
     corner, so the head is one kicker line and the card is no taller than
     its words (2026-10-22). */
  .coach-mark .fr-guide-head { padding-right: 46px; min-height: 0; }
  .coach-mark .fr-guide-x { position: absolute; top: 6px; right: 6px; }
}

/* HOVER TIPS (2026-10-24, hint-system.js): a control's title in one small
   white card instead of the browser's grey box. Mouse only. */
.fr-hover-tip {
  position: fixed;
  z-index: calc(var(--coach-z) + 50);
  max-width: 280px;
  padding: 7px 10px;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(15, 23, 42, 0.03);
  color: var(--slate-800, #1e293b);
  font: 500 12.5px/1.4 var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.fr-hover-tip.visible { opacity: 1; transform: none; }
body.dark-mode .fr-hover-tip { background: var(--slate-800, #1e293b); border-color: var(--slate-700, #334155); color: var(--slate-100, #f1f5f9); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6); }

@media (prefers-reduced-motion: reduce) {
  .coach-mark.fr-guide-card { transition: none; }
  .coach-mark-ring { transition: none; }
  .fr-hover-tip { transition: none; }
}
