@font-face { font-family: "Raleway"; src: url("fonts/raleway-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/open-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }

:root {
  --ink: #1b1d3a;
  --muted: #5d6178;
  --primary: #20205e;
  --accent: #4f46e5;
  --gold: #f2b441;
  --green: #1f9d62;
  --glass: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 50px rgba(12, 14, 40, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e1020; color: var(--ink); font: 15px/1.45 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2 { font-family: "Raleway", "Open Sans", system-ui, sans-serif; margin: 0; line-height: 1.15; }
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#view.pointing { cursor: pointer; }
#view:active { cursor: grabbing; }

.panel { position: fixed; background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); margin: 6px 0 0; }
.small { font-size: 13px; }
.error { color: #b3261e; margin: 10px 0 0; font-weight: 600; }
.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

button { font: inherit; cursor: pointer; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: #2c2c7a; }
.primary[disabled] { opacity: 0.6; cursor: progress; }
.ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px rgba(32, 32, 94, 0.25); }
.ghost:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.ghost.light { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45); }
.wide { width: 100%; margin-top: 12px; }
.big { font-size: 18px; padding: 14px 30px; }
.row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

#hud { top: 18px; left: 18px; width: 318px; max-height: calc(100% - 36px); overflow: auto; }
#hud h1 { font-size: 22px; }
.progress { height: 8px; border-radius: 99px; background: rgba(32, 32, 94, 0.12); margin-top: 12px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width 0.6s ease; }
#stops { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
#stops button { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; background: transparent; border-radius: 12px; padding: 7px 8px; font-weight: 600; color: var(--ink); }
#stops button:hover { background: rgba(79, 70, 229, 0.08); }
#stops .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: var(--primary); box-shadow: inset 0 0 0 2px rgba(32, 32, 94, 0.3); }
#stops .next .dot { background: var(--gold); box-shadow: none; }
#stops .done .dot { background: var(--green); color: #fff; box-shadow: none; }
#stops .started .dot { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
#stops small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }

#card { left: 50%; bottom: 26px; transform: translateX(-50%); width: min(520px, calc(100% - 36px)); animation: rise 0.35s ease both; }
#card h2 { font-size: 24px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

#toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; font-weight: 700; padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow); animation: rise 0.35s ease both; }

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 8px 26px rgba(12, 14, 40, 0.3); font-weight: 700; color: var(--ink); white-space: nowrap; will-change: transform, opacity; transition: opacity 0.25s ease; }
.pin .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.pin.next .dot { background: var(--gold); color: var(--primary); }
.pin.done .dot { background: var(--green); }
.pin small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.pin.far { padding: 4px; }
.pin.far > span:last-child { display: none; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; z-index: -1; }

.cover { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, rgba(14, 16, 40, 0.5), rgba(14, 16, 40, 0.72)); color: #fff; transition: opacity 0.9s ease; z-index: 5; }
.cover.leaving { opacity: 0; pointer-events: none; }
.cover-inner { width: min(620px, calc(100% - 40px)); text-align: center; }
.cover h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 700; }
.cover p { font-size: 18px; color: rgba(255, 255, 255, 0.9); }
.cover .eyebrow { color: var(--gold); font-size: 13px; }
.cover .muted { color: rgba(255, 255, 255, 0.72); }
.loadbar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); margin: 26px auto 22px; width: 260px; overflow: hidden; }
.loadbar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width 0.25s ease; }
.cover .primary { background: #fff; color: var(--primary); }
.cover .primary:hover { background: #f3f1ff; }

#player { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-rows: auto 1fr; background: #0e1020; animation: playerIn 0.45s ease both; }
#player header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; color: #fff; }
#player header strong { font-family: "Raleway", sans-serif; font-size: 16px; }
#player header .light { color: rgba(255, 255, 255, 0.7); margin: 0 0 0 auto; font-size: 13px; }
#player iframe { width: 100%; height: 100%; border: 0; background: #fff; }
@keyframes playerIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  #hud { width: calc(100% - 24px); left: 12px; top: 12px; padding: 12px 14px; }
  #hud .hint, #stops small { display: none; }
  #stops { grid-template-columns: repeat(7, 1fr); }
  #stops button { grid-template-columns: 26px; padding: 4px; justify-content: center; }
  #stops button > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
