/* Animated walkthrough on the test intro page (static/tour.js). Reuses the site's colour tokens. */
.tour { position: relative; overflow: hidden; border-color: var(--accent); }
.tour-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tour-kicker { font: 700 12px var(--mono); letter-spacing: .04em; color: var(--red); }
.tour-title { font-size: 19px; font-weight: 700; margin-top: 2px; }
.tour-ctl { gap: 6px; }
.tour-count { font: 12px var(--mono); min-width: 2.6em; text-align: center; }
.tour-skip { color: var(--muted); }

.tour-dots { display: flex; gap: 5px; margin: 12px 0 10px; }
.tour-dots button { flex: 1; height: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--line); cursor: pointer; overflow: hidden; min-width: 0; }
.tour-dots button i { display: block; height: 100%; width: 0; background: var(--accent); }
.tour-dots button.done i { width: 100%; }
.tour-dots button.cur i { animation: tour-fill var(--dur, 7s) linear forwards; }
.tour-dots.paused button.cur i { animation-play-state: paused; }
@keyframes tour-fill { to { width: 100%; } }

.tour-stage { position: relative; min-height: 250px; }
.tour-frame { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); animation: tour-in .35s ease-out; }
@keyframes tour-in { from { opacity: 0; transform: translateY(8px); } }
.tour-bar { display: flex; align-items: center; gap: 5px; padding: 6px 10px; background: var(--card-2); border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.tour-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.tour-bar i:first-child { background: var(--red); }
.tour-bar span { margin-left: 8px; }
.tour-screen { padding: 14px 16px; }
.tour-screen .qcard { margin: 8px 0 0; background: var(--card); }
.tour-screen .phase { padding: 6px 0; }
.tour-screen button { pointer-events: none; }
.tour-screen .tour-result button { pointer-events: auto; }
.tour-top { display: flex; justify-content: space-between; align-items: center; }
.tour-center { justify-content: center; margin: 10px 0; }
.tour-small { text-align: center; min-height: 1.6em; }
.tour-locked .choice { opacity: .55; }

.tour-parts { display: flex; align-items: center; gap: 12px; padding: 26px 0; }
.tour-part { flex: 1; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: grid; gap: 4px; opacity: .45; transition: opacity .4s, border-color .4s; }
.tour-part.go { opacity: 1; border-color: var(--accent); }
.tour-part b { font-size: 18px; }
.tour-fill { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.tour-fill i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--red)); }
.tour-part.go .tour-fill i { animation: tour-fill 2s ease-out forwards; }
.tour-arrow { font: 700 24px var(--mono); color: var(--muted); }

button.tour-hit { border-color: var(--good) !important; box-shadow: 0 0 0 3px var(--good-soft); }
.tour-pop { animation: tour-pop .4s ease-out; }
@keyframes tour-pop { from { transform: scale(.85); opacity: 0; } }

.tour-eq { display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 34px; margin-bottom: 6px; }
.tour-eq i { width: 6px; border-radius: 2px; background: var(--red); animation: tour-eq .8s ease-in-out infinite alternate; }
.tour-eq i:nth-child(3n) { animation-duration: .6s; } .tour-eq i:nth-child(4n+1) { animation-duration: 1s; } .tour-eq i:nth-child(5n+2) { animation-delay: -.3s; }
.tour-eq.stop i { animation: none; height: 4px; background: var(--line); }
@keyframes tour-eq { from { height: 4px; } to { height: 32px; } }

.tour-tips { margin: 6px 0 12px; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.tour-tips li { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); opacity: 0; transform: translateX(-10px); transition: opacity .4s, transform .4s; }
.tour-tips.go li { opacity: 1; transform: none; }
.tour-tips.go li:nth-child(2) { transition-delay: .7s; } .tour-tips.go li:nth-child(3) { transition-delay: 1.4s; } .tour-tips.go li:nth-child(4) { transition-delay: 2.1s; }
.tour-controls { justify-content: flex-end; margin-bottom: 8px; }
.tour-result { margin: 10px 0; }

.tour-caption { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--red); background: var(--red-soft); border-radius: 0 8px 8px 0; font-size: 15.5px; min-height: 3.2em; }

.tour-cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; z-index: 3; opacity: 0;
  transition: transform .6s cubic-bezier(.3, .7, .3, 1), opacity .2s;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9-6.5 1.5L9.5 19z' fill='white' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tour-cursor.on { opacity: 1; }
.tour-cursor::after { content: ''; position: absolute; left: -9px; top: -9px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--warn); opacity: 0; }
.tour-cursor.click::after { animation: tour-click .5s ease-out; }
@keyframes tour-click { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.6); } }

.tour-replay { width: 100%; margin-bottom: 14px; padding: 10px 14px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.tour-replay:hover { border-style: solid; }

@media (max-width: 600px) {
  .tour-parts { flex-direction: column; } .tour-arrow { transform: rotate(90deg); }
  .tour-stage { min-height: 360px; }
  .tour-title { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-frame, .tour-pop, .tour-eq i, .tour-cursor::after, .tour-dots button.cur i { animation: none !important; }
  .tour-dots button.cur i { width: 100%; }
  .tour-cursor { transition: none; }
}
