/* 🧭 The tour (tour.js): the dim layer with its cut-out, the bobbing arrow, the bubble with its progress dots, and the
   little looping pictures; and ✨ What's new's card (whatsnew.js). ChefBoy's tour.css (itself ChoreBoy's), with the
   template's pictures: a new app adds its own under "the pictures". Every animation is only under .tour-move
   (✨ Animations: Full, and no reduced motion); without it each picture shows how it ends. .tour-fade (Subtle, no
   reduced motion) gets short fades only: the words changing, the bubble opening. The reduced-motion block stays last. */
.tour { position: fixed; inset: 0; z-index: 500; pointer-events: auto; --tour-dim: rgba(28, 25, 23, .58); }
@media (prefers-color-scheme: dark) { .tour { --tour-dim: rgba(0, 0, 0, .7); } }
.tour.tour-none { background: var(--tour-dim); }
.tour-hole { position: fixed; border-radius: var(--radius); box-shadow: 0 0 0 3px var(--accent), 0 0 0 200vmax var(--tour-dim); pointer-events: none; }
.tour-move .tour-hole { transition: top .38s cubic-bezier(.3, .7, .2, 1), left .38s cubic-bezier(.3, .7, .2, 1), width .38s cubic-bezier(.3, .7, .2, 1), height .38s cubic-bezier(.3, .7, .2, 1); }
.tour-still .tour-hole, .tour-still .tour-bubble { transition: none !important; }
.tour-arrow { position: fixed; width: 14px; height: 14px; pointer-events: none; }
.tour-arrow::before { content: ''; position: absolute; inset: 0; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tour-arrow.down::before { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.tour-move .tour-arrow { animation: tour-nudge 1.1s ease-in-out infinite; }
.tour-move .tour-arrow.down { animation-name: tour-nudge-down; }
@keyframes tour-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes tour-nudge-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* (A finger on the bubble scrolls it up and down; across is BoyFX.swipe's: tour.js.) */
.tour-bubble { position: fixed; width: min(22rem, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-x: hidden; overflow-y: auto; touch-action: pan-y pinch-zoom; margin: 0; padding: 1rem 1.1rem .9rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.tour-move .tour-bubble { transition: top .38s cubic-bezier(.3, .7, .2, 1), left .38s cubic-bezier(.3, .7, .2, 1); }
.tour-count { margin: 0 0 .25rem; font-size: .75rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.tour-h { margin: 0 0 .35rem; font-size: 1.08rem; line-height: 1.3; outline: none; }
.tour-text { margin: 0; font-size: .93rem; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.tour-btns { display: flex; align-items: center; gap: .5rem; margin-top: .85rem; }
.tour-skip { margin-right: auto; }
.tour-btns .btn { min-height: 2.25rem; }
.tour-docked .tour-bubble { top: auto !important; left: 16px !important; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: auto; max-height: 60vh; }
.tour-docked .tour-btns .btn { min-height: 2.75rem; }
/* 💬 Help's step on a phone: its button is at the bottom, so the bubble docks to the top. */
.tour-docked-top .tour-bubble { top: max(16px, env(safe-area-inset-top)) !important; bottom: auto; }
html[data-fx="full"] .tour, html[data-fx="subtle"] .tour { animation: tour-in .18s ease-out; }
@keyframes tour-in { from { opacity: 0; } to { opacity: 1; } }

/* ✨ What's new (whatsnew.js): a small card at the top of 🏠 Home for people who toured before the newest steps. */
.wn-card { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.wn-text { flex: 1 1 16rem; margin: 0; font-size: .92rem; color: var(--text); }
.wn-card .btn-row { flex: 0 0 auto; }
@media (max-width: 600px) { .wn-card .btn-row { flex: 1 1 100%; } .wn-card .btn { min-height: 44px; flex: 1 1 auto; } }

/* ---- the pictures (tour.js DEMOS; a new app's own go here too) ---- */
.tour-demo { margin: .7rem 0 0; }
.tour-demo-row { position: relative; display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: .9rem; }
.tour-demo-chip { flex-shrink: 0; padding: .1rem .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .78rem; font-weight: 650; }

/* badge: 🏆 a small gold medallion (celebrate.css's, in miniature) popping in with a ring. End frame: the medal, still. */
.tour-demo-badge { gap: .7rem; }
.tbg-medal { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff8dc 0%, color-mix(in srgb, var(--gold) 70%, #fff) 34%, var(--gold) 68%, color-mix(in srgb, var(--gold) 78%, #7a4b00) 100%);
  border: 2px solid color-mix(in srgb, var(--gold) 55%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.tbg-medal::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); opacity: 0; pointer-events: none; }
.tbg-emo { font-size: 1.25rem; line-height: 1; }
.tbg-words { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; }
.tbg-words small { color: var(--text-3); font-size: .76rem; }
.tour-move .tbg-medal { animation: tbg-pop 3.6s cubic-bezier(.34, 1.56, .64, 1) infinite; }
.tour-move .tbg-medal::after { animation: tbg-ring 3.6s ease-out infinite; }
@keyframes tbg-pop { 0% { opacity: 0; transform: scale(.4); } 14% { opacity: 1; transform: scale(1.15); } 22%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes tbg-ring { 0%, 14% { opacity: 0; transform: scale(1); } 18% { opacity: .9; } 40%, 100% { opacity: 0; transform: scale(1.7); } }

/* ---- moving between steps ---- */
/* The progress dots: one per step, the done ones filled, the current one a wider pill (scaleX: it glides wide at
   Full). Decorative (aria-hidden): the count above says it in words. A phone shows at most 12 (tour.js). */
.tour-dots { display: flex; flex-wrap: wrap; gap: 0; margin: -.05rem 0 .45rem; padding: 0; list-style: none; }
.tour-dots li { display: grid; place-items: center; width: 1rem; height: 6px; }
.tour-dots li[hidden] { display: none; }
.tour-dots li::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: var(--border-strong, var(--border)); }
.tour-dots li.done::before { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.tour-dots li.on::before { background: var(--accent); transform: scaleX(2.4); }
.tour-move .tour-dots li::before { transition: transform .25s cubic-bezier(.22, 1, .36, 1); }

/* The words and the picture come in from the way you're going (Full), or fade in (Subtle). */
@keyframes tour-swap-fwd { from { opacity: 0; transform: translateX(12px); } }
@keyframes tour-swap-back { from { opacity: 0; transform: translateX(-12px); } }
@keyframes tour-fade { from { opacity: 0; } }
.tour-move .tour-swap-fwd :is(.tour-h, .tour-text, .tour-demo) { animation: tour-swap-fwd .22s cubic-bezier(.22, 1, .36, 1) both; }
.tour-move .tour-swap-back :is(.tour-h, .tour-text, .tour-demo) { animation: tour-swap-back .22s cubic-bezier(.22, 1, .36, 1) both; }
.tour-fade :is(.tour-swap-fwd, .tour-swap-back) :is(.tour-h, .tour-text, .tour-demo) { animation: tour-fade .15s ease-out both; }

/* The spotlight's ring pulses once where it lands (Full only; tour.js puts .tour-landed on it after the glide). */
.tour-hole::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 3px var(--accent); opacity: 0; pointer-events: none; }
@keyframes tour-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.12, 1.25); } }
.tour-move .tour-hole.tour-landed::after { animation: tour-ring .6s ease-out; }

/* 📱 On a phone the docked bubble slides up as the tour opens (Subtle: it fades in). */
@keyframes tour-dock-in { from { opacity: 0; transform: translateY(16px); } }
.tour-move.tour-docked.tour-opening .tour-bubble { animation: tour-dock-in .28s cubic-bezier(.22, 1, .36, 1) both; }
.tour-fade.tour-docked.tour-opening .tour-bubble { animation: tour-fade .15s ease-out both; }
/* 📱 Told once on a touch phone: a swipe moves too. */
.tour-hint { margin: .5rem 0 0; font-size: .78rem; color: var(--text-3); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .tour, .tour *, .tour *::before, .tour *::after { animation: none !important; transition: none !important; }
}
