/* How-to walkthroughs: a 1280×720 stage scaled to fit, scenes revealed on a timeline (see player.js) */

:root {
  --bg: #0b0f1a;
  --surface: #0e1320;
  --panel: #141b2b;
  --panel-2: #182033;
  --line: #243049;
  --text: #e6ebf5;
  --muted: #94a3b8;
  --brand: #3b82f6;
  --brand-soft: #a9c3ff;
  --profit: #22c55e;
  --loss: #ef4444;
  --warn: #f59e0b;
  --violet: #a78bfa;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
.mono { font-family: "Roboto Mono", ui-monospace, monospace; }

/* ---------- Player chrome ---------- */
.hx-player { position: fixed; inset: 0; display: flex; flex-direction: column; background: #070a12; }
.hx-top { display: flex; height: 60px; flex: none; align-items: center; gap: 14px; padding: 0 16px; }
.hx-back { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px 0 12px; border-radius: 999px; background: #fff; color: #0b0f1a; font-size: 14px; font-weight: 600; }
.hx-back:hover { background: #dbe7ff; }
.hx-back svg { width: 16px; height: 16px; }
.hx-top-title { min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-top-title b { color: #fff; font-weight: 600; }
.hx-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.hx-stage {
  position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; border-radius: 20px; cursor: pointer;
  background:
    radial-gradient(60% 70% at 92% 8%, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 70%),
    radial-gradient(50% 60% at 0% 100%, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0) 70%),
    #0d1322;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.hx-player.no-chrome { background: #0d1322; }
.hx-player.no-chrome .hx-top, .hx-player.no-chrome .hx-controls { display: none; }
.hx-player.no-chrome .hx-stage { border-radius: 0; box-shadow: none; }
.hx-paused, .hx-paused * { animation-play-state: paused !important; }

/* ---------- Scenes and timeline states ---------- */
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0s linear 0.45s; }
.scene.active { opacity: 1; visibility: visible; transition: opacity 0.45s ease; }
/* plain [data-at] elements are revealed; clicks, toggles, typing and counters are visible from the start */
.scene :where([data-at]:not([data-click], [data-toggle], [data-type], [data-count], [data-grow], .hx-cursor)) { opacity: 0; translate: 0 10px; transition: opacity 0.4s ease, translate 0.4s ease, scale 0.4s ease; }
.scene :where(.pop[data-at]:not(.in)) { scale: 0.96; }
.scene .in { opacity: 1; translate: 0 0; scale: 1; }
.scene .out { opacity: 0 !important; pointer-events: none; }
/* .late takes no space until revealed; .shut gives its space back once out */
.scene .late:not(.in) { display: none; }
.scene .late.in { animation: hx-rise 0.4s ease; }
.scene .shut.out { display: none; }
.scene .clicked { animation: hx-press 0.45s ease; }
.scene .typing::after { content: ""; display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: currentColor; animation: hx-blink 0.9s steps(1) infinite; }
/* [data-grow] bars: width animates from data-from% to data-grow% (set by the player) */
.scene [data-grow] { transition: none; }

@keyframes hx-rise { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes hx-press { 0% { scale: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.55); } 35% { scale: 0.93; } 100% { scale: 1; box-shadow: 0 0 0 14px rgba(59, 130, 246, 0); } }
@keyframes hx-blink { 50% { opacity: 0; } }
@keyframes hx-wiggle { 0%, 100% { rotate: 0deg; } 20% { rotate: -16deg; } 40% { rotate: 13deg; } 60% { rotate: -9deg; } 80% { rotate: 5deg; } }
@keyframes hx-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); } 50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } }
@keyframes hx-flash { 0%, 100% { background: transparent; } 30% { background: rgba(239, 68, 68, 0.22); } }

/* ---------- Stage furniture ---------- */
.hx-title { position: absolute; left: 90px; top: 36px; display: flex; align-items: center; gap: 16px; font-size: 36px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.hx-title span { display: inline-grid; place-items: center; height: 40px; min-width: 52px; padding: 0 10px; border-radius: 10px; background: var(--brand); color: #fff; font-family: "Roboto Mono", monospace; font-size: 22px; font-weight: 600; }
.hx-unnumbered .hx-title span { display: none; }
.hx-browser { position: absolute; left: 90px; top: 104px; width: 1100px; height: 526px; overflow: hidden; border: 1px solid #263452; border-radius: 14px; background: var(--bg); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7); }
.hx-bar { display: flex; height: 30px; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid #1d2740; background: #111827; }
.hx-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c3955; }
.hx-url { margin-left: 14px; flex: 1; max-width: 420px; height: 20px; padding: 0 10px; border-radius: 6px; background: #1a2236; color: var(--muted); font-size: 11px; line-height: 20px; }
.hx-page { position: relative; height: calc(100% - 30px); }
.hx-caption { position: absolute; left: 190px; right: 190px; bottom: 18px; z-index: 25; padding: 14px 26px; border-radius: 14px; background: rgba(255, 255, 255, 0.96); color: #0b0f1a; font-size: 20px; line-height: 1.4; text-align: center; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
.hx-caption b { color: #1d4ed8; font-weight: 600; }
.hx-cursor {
  position: absolute; left: 1200px; top: 680px; z-index: 30; width: 28px; height: 28px; opacity: 0; pointer-events: none;
  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 2l16 10-7 1.5L9.5 21z' fill='white' stroke='%230b0f1a' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  transition: left 0.9s cubic-bezier(0.65, 0, 0.35, 1), top 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.25s;
}
.hx-cursor.in { opacity: 1; }
.hx-cursor.gone { opacity: 0; }
.hx-note { position: absolute; z-index: 22; padding: 9px 16px; border: 1.5px dashed var(--brand-soft); border-radius: 999px; background: #0b1224; color: var(--brand-soft); font-size: 15px; white-space: nowrap; }

/* ---------- Section card (tour) and outro ---------- */
.hx-section { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 120px; text-align: center; }
.hx-section .kicker { font-size: 15px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-soft); }
.hx-section h2 { margin: 0; font-size: 54px; font-weight: 700; letter-spacing: -0.025em; color: #fff; }
.hx-section p { margin: 0; max-width: 820px; font-size: 21px; line-height: 1.45; color: #b6c2d6; }
.hx-section .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.hx-section .tags span { padding: 8px 16px; border-radius: 999px; background: rgba(59, 130, 246, 0.16); color: var(--brand-soft); font-size: 16px; font-weight: 600; }
.hx-outro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.hx-outro h2 { margin: 0; font-size: 46px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.hx-recap { display: grid; grid-template-columns: repeat(2, 360px); gap: 12px 28px; margin: 0; padding: 0; list-style: none; }
.hx-recap li { display: flex; align-items: center; gap: 12px; font-size: 19px; color: #dbe3f0; }
.hx-recap li i { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-style: normal; font-weight: 600; }
.hx-cta { display: flex; gap: 12px; margin-top: 12px; }
.hx-cta a { display: inline-flex; align-items: center; height: 48px; padding: 0 26px; border-radius: 12px; font-size: 17px; font-weight: 600; }
.hx-cta .primary { background: var(--brand); color: #fff; }
.hx-cta .outline { border: 1px solid #33425f; background: #111827; color: #fff; }
.brandmark { display: inline-block; border-radius: 22%; }

/* ---------- Controls ---------- */
.hx-controls { display: flex; height: 64px; flex: none; align-items: center; gap: 10px; padding: 0 16px; color: var(--muted); }
.hx-ctl { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; font-size: 15px; }
.hx-ctl:hover { background: rgba(255, 255, 255, 0.08); }
.hx-ctl.play { width: 44px; height: 44px; background: var(--brand); }
.hx-ctl.play:hover { background: #2563eb; }
.hx-chapters { display: flex; flex: 1; min-width: 0; gap: 4px; margin: 0 10px; }
.hx-chapter { flex: 1; min-width: 0; padding: 6px 0; cursor: pointer; }
.hx-chapter .bar { height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.hx-chapter .fill { width: 0; height: 100%; background: #60a5fa; }
.hx-chapter .lbl { margin-top: 6px; overflow: hidden; font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.hx-chapter.current .lbl { color: #fff; }
.hx-time { font-family: "Roboto Mono", monospace; font-size: 13px; white-space: nowrap; }
.hx-rotate { display: none; }
@media (max-width: 640px) {
  .hx-chapter .lbl, .hx-top-title { display: none; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .hx-rotate { display: block; padding: 0 16px 10px; color: var(--muted); font-size: 13px; text-align: center; }
}

/* ---------- Mock of the LyTrade app (drawn at stage scale) ---------- */
.app svg:not([width]) { width: 14px; height: 14px; flex: none; }
.app .row { white-space: nowrap; }
.app { display: flex; height: 100%; font-size: 12px; color: var(--text); background: var(--bg); }
.app-rail { display: flex; width: 74px; flex: none; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; border-right: 1px solid #1a2236; background: var(--bg); }
.rail-item { display: flex; width: 66px; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0 6px; border-radius: 12px; color: #c6d0e0; font-size: 10px; }
.rail-item .pill { display: grid; place-items: center; width: 46px; height: 24px; border-radius: 12px; }
.rail-item svg { width: 16px; height: 16px; }
.rail-item.sel .pill, .rail-item.on .pill { background: #2a3550; color: #fff; }
.app-rail:has(.on) .rail-item.sel:not(.on) .pill { background: transparent; }
.app-main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.app-head { display: flex; height: 40px; flex: none; align-items: center; gap: 10px; padding: 0 14px; background: var(--bg); }
.app-head .logo { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; color: #fff; }
.app-head .logo img { width: 20px; height: 20px; border-radius: 5px; }
.app-head .ctx { font-size: 11.5px; color: #dbe3f0; }
.app-head .ctx.dd::after { content: " ▾"; color: var(--muted); }
.app-head .tools { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #c6d0e0; }
.app-head .tools svg { width: 16px; height: 16px; }
.app-body { position: relative; min-height: 0; flex: 1; overflow: hidden; padding: 10px 14px; }
.app-notice { display: flex; height: 22px; flex: none; align-items: center; gap: 6px; padding: 0 14px; background: var(--surface); color: #b6c2d6; font-size: 9.5px; }
.app-notice svg { width: 10px; height: 10px; }

.panel { border: 1px solid #1e2840; border-radius: 10px; background: var(--panel); }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px 0; font-size: 12.5px; font-weight: 600; color: #fff; }
.panel-h .r { margin-left: auto; font-size: 10.5px; font-weight: 400; color: #c6d0e0; }
.panel-b { padding: 9px 12px 11px; }
.grid { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 10.5px; }
.pos { color: var(--profit); }
.neg { color: var(--loss); }
.warn { color: var(--warn); }
.brand { color: var(--brand); }
.h1 { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }

.tile { padding: 9px 11px; border: 1px solid #1e2840; border-radius: 10px; background: var(--panel); }
.tile .k { font-size: 10px; color: #b6c2d6; }
.tile .v { margin-top: 3px; font-size: 19px; font-weight: 600; color: #fff; }
.tile .s { margin-top: 2px; font-size: 9.5px; color: #b6c2d6; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 26px; padding: 0 12px; border-radius: 13px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.btn svg { width: 12px; height: 12px; }
.btn.primary { background: var(--brand-soft); color: #0b1a3a; }
.btn.outline { border: 1px solid #3a4867; color: #e6ebf5; }
.btn.text { color: var(--brand-soft); padding: 0 6px; }
.btn.sell { height: 40px; flex: 1; flex-direction: column; gap: 0; border-radius: 20px; background: var(--loss); color: #fff; font-size: 10.5px; }
.btn.buy { height: 40px; flex: 1; flex-direction: column; gap: 0; border-radius: 20px; background: var(--profit); color: #06210f; font-size: 10.5px; }
.btn.danger { border: 1px solid rgba(239, 68, 68, 0.55); color: #fca5a5; }
.btn.good { background: #16a34a; color: #fff; }
.btn.disabled { background: #2a3245; color: #7b879c; }
.seg { display: flex; overflow: hidden; border: 1px solid #3a4867; border-radius: 14px; }
.seg span { flex: 1; padding: 5px 10px; text-align: center; font-size: 11px; border-left: 1px solid #3a4867; }
.seg span:first-child { border-left: 0; }
.seg span.sel { background: #2a3550; color: #fff; }

.chip { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: 5px; font-size: 9.5px; font-weight: 500; white-space: nowrap; }
.chip.blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.chip.green { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.chip.amber { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.chip.red { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.chip.slate { background: #283149; color: #c6d0e0; }
.chip.violet { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }

.field { position: relative; display: flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid #3a4867; border-radius: 4px; font-size: 12px; color: #fff; }
.field .lbl { position: absolute; left: 7px; top: -6px; padding: 0 3px; background: var(--panel); font-size: 9px; color: #c6d0e0; }
.field.ph { color: #b6c2d6; }
.field .end { margin-left: auto; color: #c6d0e0; }
.field .end svg { width: 14px; height: 14px; }

table.t { width: 100%; border-collapse: collapse; font-size: 11px; }
table.t th { padding: 6px 8px; text-align: left; font-weight: 500; color: #e6ebf5; border-bottom: 1px solid #2a3550; }
table.t td { padding: 7px 8px; border-bottom: 1px solid #1e2840; color: #dbe3f0; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }

.rule { margin-top: 9px; }
.rule:first-child { margin-top: 0; }
.rule .top { display: flex; align-items: baseline; gap: 8px; }
.rule .name { font-size: 12px; font-weight: 600; color: #fff; }
.rule .val { margin-left: auto; font-size: 11.5px; font-weight: 500; }
.rule .bar { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 3px; background: #1f2a44; }
.rule .bar > div { height: 100%; border-radius: 3px; }
.rule .sub { margin-top: 3px; font-size: 9.5px; color: #c6d0e0; }

.coach { display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px; border: 1px solid rgba(245, 158, 11, 0.55); border-radius: 10px; background: rgba(245, 158, 11, 0.09); }
.coach svg { width: 16px; height: 16px; flex: none; color: var(--warn); }
.coach .k { font-size: 10px; color: var(--warn); }
.coach .m { margin-top: 1px; font-size: 11.5px; color: #fff; }
.coach.red { border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.1); }
.coach.red svg, .coach.red .k { color: #fca5a5; }

.ai { display: flex; gap: 8px; padding: 9px 11px; border-radius: 8px; background: #1a2440; font-size: 11px; line-height: 1.45; color: #e6ebf5; }
.ai svg { width: 14px; height: 14px; flex: none; color: #60a5fa; margin-top: 1px; }
.bubble { max-width: 80%; padding: 8px 11px; border-radius: 12px; font-size: 11.5px; line-height: 1.45; }
.bubble.me { margin-left: auto; background: #2a3550; color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { background: #1a2440; color: #e6ebf5; border-bottom-left-radius: 4px; }
.link { color: var(--brand-soft); }
.strike td { text-decoration: line-through; color: #7b879c !important; }
.flash { animation: hx-flash 1.2s ease 2; }
.pulse { animation: hx-pulse 1.4s ease infinite; }
.wiggle.on { animation: hx-wiggle 0.9s ease 2; }
.toast { position: absolute; right: 14px; bottom: 14px; z-index: 20; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; background: #e6ebf5; color: #0b0f1a; font-size: 11.5px; font-weight: 500; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }
.toast svg { width: 14px; height: 14px; color: #16a34a; }
.toast.err svg { color: var(--loss); }
.dialog-scrim { position: absolute; inset: 0; z-index: 15; display: grid; place-items: center; background: rgba(3, 6, 14, 0.6); }
.dialog { width: 380px; padding: 16px 18px; border-radius: 16px; background: #1b2337; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.dialog .h { font-size: 15px; font-weight: 600; color: #fff; }
.chart { position: relative; overflow: hidden; }
.chart svg { display: block; }
