/* POSMaster product tour player */
:root { --blue: #3b82f6; --ink: #0f172a; --bar: rgba(13, 18, 38, .94); }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #070b18; color: #e5e7eb; font: 15px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* stage: the screenshot fills the screen */
#stage { position: fixed; inset: 0; overflow: hidden; }
#shot { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; transition: opacity .35s ease; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
#shot.fade { opacity: .25; }

/* spotlight: everything outside the box is dimmed */
#hole { position: absolute; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(7, 11, 24, .58); outline: 2px solid rgba(96, 165, 250, .95); outline-offset: 2px;
    transition: left .7s cubic-bezier(.65, 0, .35, 1), top .7s cubic-bezier(.65, 0, .35, 1), width .7s cubic-bezier(.65, 0, .35, 1), height .7s cubic-bezier(.65, 0, .35, 1); pointer-events: none; }
#hole::after { content: ''; position: absolute; inset: -6px; border-radius: 14px; border: 2px solid rgba(96, 165, 250, .35); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { opacity: .9; transform: scale(.98); } 100% { opacity: 0; transform: scale(1.04); } }

/* typed text inside a field */
#typed { position: absolute; display: flex; align-items: center; padding: 0 14px; border: 3px solid transparent; border-radius: 10px; background: #fff padding-box; color: #0f172a; font-weight: 600; pointer-events: none; white-space: nowrap; overflow: hidden; }
#typed[hidden] { display: none; }
#typed::after { content: ''; width: 2px; height: 1.2em; margin-inline-start: 2px; background: #0f172a; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* popover */
#pop { position: absolute; width: 330px; padding: 18px 18px 16px; border-radius: 16px; background: #fff; color: #0f172a; box-shadow: 0 24px 60px rgba(0, 0, 0, .35), 0 0 0 1px rgba(15, 23, 42, .06);
    opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease, left .5s ease, top .5s ease; z-index: 5; }
#pop.show { opacity: 1; transform: none; }
#pop .arrow { position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }
#pop[data-side="right"] .arrow { left: -7px; top: var(--ay, 28px); }
#pop[data-side="left"] .arrow { right: -7px; top: var(--ay, 28px); }
#pop[data-side="bottom"] .arrow { top: -7px; left: var(--ax, 28px); }
#pop[data-side="top"] .arrow { bottom: -7px; left: var(--ax, 28px); }
#pop[data-side="inside"] .arrow { display: none; }
#pop .tag { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #2563eb; }
#pop .tag i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
body.paused #pop .tag i { background: #f59e0b; }
#pop h2 { margin-top: 8px; font-size: 19px; font-weight: 800; letter-spacing: -.3px; line-height: 1.25; }
#pop p { margin-top: 6px; color: #475569; font-size: 14.5px; }
#pop .act { margin-top: 14px; padding: 8px 12px; border-radius: 10px; background: #eff6ff; color: #1d4ed8; font-size: 13.5px; font-weight: 600; }
#pop .end { display: none; gap: 10px; margin-top: 14px; }
#pop.last .end { display: flex; }
#pop.last .act { display: none; }
#bReplay { padding: 10px 14px; border-radius: 10px; border: 1px solid #cbd5e1; font-weight: 600; }
#bStart { flex: 1; text-align: center; padding: 10px 14px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; }

/* fake cursor */
#cur { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; transition: transform .8s cubic-bezier(.65, 0, .35, 1); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
#cur svg { display: block; }
#cur .ripple { position: absolute; left: -16px; top: -16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(59, 130, 246, .45); transform: scale(0); opacity: 0; }
#cur.click .ripple { animation: ripple .6s ease-out; }
#cur.click svg { animation: press .3s ease; }
@keyframes ripple { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes press { 50% { transform: scale(.85); } }

/* control bar */
#bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 6px; width: min(880px, calc(100% - 24px));
    padding: 10px 12px; border-radius: 18px; background: var(--bar); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#bar .logo { display: flex; align-items: center; gap: 8px; padding-inline-end: 12px; margin-inline-end: 4px; border-inline-end: 1px solid rgba(255, 255, 255, .1); font-weight: 800; font-size: 14px; white-space: nowrap; }
#bar .logo .mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, #4f46e5, #3b82f6); color: #fff; }
#bar .logo b { color: #a5b4fc; }
#bar .info { flex: 1; min-width: 0; padding: 0 6px; }
#bar .ttl { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#chap { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
#stepno { color: #94a3b8; font-size: 12.5px; }
#bar .demo { margin-inline-start: auto; padding: 2px 8px; border-radius: 6px; background: rgba(59, 130, 246, .2); color: #93c5fd; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; }
#segs { display: flex; gap: 4px; margin-top: 7px; }
#segs span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
#segs span i { display: block; height: 100%; width: 0; background: #60a5fa; }
.btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #e2e8f0; transition: background .2s; flex-shrink: 0; }
.btn:hover { background: rgba(255, 255, 255, .08); }
.btn.play { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #0f172a; }
.btn.play:hover { background: #e2e8f0; }
.btn.play::before { content: ''; width: 0; height: 0; border-left: 13px solid #0f172a; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
body.playing .btn.play::before { width: 12px; height: 14px; border: 0; margin: 0; background: linear-gradient(90deg, #0f172a 0 4px, transparent 4px 8px, #0f172a 8px 12px); }
.btn.speed { font-size: 12.5px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .18); width: 42px; height: 30px; border-radius: 9px; }
:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }

/* chapters menu */
#list { position: fixed; z-index: 11; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(420px, calc(100% - 24px)); padding: 8px; border-radius: 16px; background: var(--bar); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); backdrop-filter: blur(12px); }
#list button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-align: start; font-weight: 600; }
#list button:hover, #list button[aria-current="true"] { background: rgba(59, 130, 246, .18); }
#list button span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .08); font-size: 12.5px; }
#list button small { margin-inline-start: auto; color: #94a3b8; font-weight: 500; }

/* phones: the popover becomes a sheet above the bar */
@media (max-width: 700px) {
    #pop { left: 12px !important; right: 12px; top: auto !important; bottom: 92px; width: auto; }
    #pop .arrow { display: none; }
    #bar { bottom: 10px; gap: 2px; padding: 8px; }
    #bar .logo, #bar .demo, #bSpeed, #stepno { display: none; }
    .btn { width: 36px; height: 36px; }
    #list { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
