/* Landing page: the playable Expedition preview (ui/landing-expedition.js).
   Everything is scoped under .lpx / .lpx-*; the real Expedition inside it keeps
   its own .xp-* / .x3-* styles (styles-expedition.css) and is only re-laid-out
   here for a compact, bright, SaaS-style card. Loads after styles-landing.css. */

.lpx-host { min-height: 560px; display: block; }
@media (max-width: 640px) { .lpx-host { min-height: 480px; } }

.lpx {
  --lpx-bg: #ffffff;
  --lpx-soft: #f6f7fd;
  --lpx-ink: #14162c;
  --lpx-ink-2: #4b5170;
  --lpx-ink-3: #6b7194;
  --lpx-rule: #e3e6f3;
  --lpx-a: #4f46e5;
  --lpx-b: #7c3aed;
  --lpx-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --lpx-glow: 0 8px 22px -8px rgba(79, 70, 229, 0.55);
  --lpx-shadow: 0 1px 2px rgba(20, 22, 44, 0.05), 0 24px 60px -28px rgba(56, 48, 140, 0.45);
  --lpx-key-bg: #ffffff;
  --lpx-live: #16a34a;

  position: relative;
  container: lpx / inline-size;
  overflow: clip;
  width: 100%;
  background: var(--lpx-bg);
  color: var(--lpx-ink);
  border: 1px solid var(--lpx-rule);
  border-radius: 22px;
  box-shadow: var(--lpx-shadow);
  font-family: inherit;
  text-align: left;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lpx {
    --lpx-bg: #12142a; --lpx-soft: #191c38; --lpx-ink: #eef0fb; --lpx-ink-2: #b6bcd8; --lpx-ink-3: #8b92b4;
    --lpx-rule: #272b4d; --lpx-key-bg: #232748; --lpx-live: #4ade80;
    --lpx-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 28px 70px -30px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme="dark"] .lpx {
  --lpx-bg: #12142a; --lpx-soft: #191c38; --lpx-ink: #eef0fb; --lpx-ink-2: #b6bcd8; --lpx-ink-3: #8b92b4;
  --lpx-rule: #272b4d; --lpx-key-bg: #232748; --lpx-live: #4ade80;
  --lpx-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 28px 70px -30px rgba(0, 0, 0, 0.8);
}
.lpx *, .lpx *::before, .lpx *::after { box-sizing: border-box; }

/* ------------------------------------------------------------- top bar */
.lpx-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
  border-bottom: 1px solid var(--lpx-rule);
}
.lpx-bar-t { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; color: var(--lpx-ink-2); }
.lpx-bar-t b { color: var(--lpx-ink); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.01em; }
.lpx-bar-note { font-weight: 600; color: var(--lpx-a); }
:root[data-theme="dark"] .lpx .lpx-bar-note { color: #a5b4fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lpx .lpx-bar-note { color: #a5b4fc; } }
.lpx-sep { color: var(--lpx-ink-3); }
.lpx-live { width: 8px; height: 8px; border-radius: 50%; background: var(--lpx-live); box-shadow: 0 0 0 0 color-mix(in srgb, var(--lpx-live) 55%, transparent); animation: lpx-pulse 2.2s ease-out infinite; }
@keyframes lpx-pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.lpx-bar-act { display: flex; gap: 8px; }
@container lpx (max-width: 620px) { .lpx-hide-sm { display: none; } }

/* -------------------------------------------------------------- buttons */
.lpx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--lpx-ink);
  font: inherit; font-size: 0.88rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.lpx-btn:hover { transform: translateY(-1px); }
.lpx-btn:active { transform: translateY(0); }
.lpx-btn:focus-visible { outline: 2px solid var(--lpx-a); outline-offset: 2px; }
.lpx-btn-primary { background: var(--lpx-grad); color: #fff; box-shadow: var(--lpx-glow); }
.lpx-btn-primary:hover { box-shadow: 0 10px 26px -8px rgba(79, 70, 229, 0.7); }
.lpx-btn-ghost { color: var(--lpx-ink); border-color: var(--lpx-rule); background: var(--lpx-bg); }
.lpx-btn-ghost:hover, .lpx-btn-outline:hover { border-color: var(--lpx-a); }
.lpx-btn-outline { border-color: var(--lpx-rule); background: var(--lpx-bg); color: var(--lpx-ink); }
.lpx-btn-lg { min-height: 46px; padding: 0 20px; font-size: 0.95rem; }

/* ---------------------------------------------------------------- stage */
.lpx-stage { padding: 14px; }
.lpx-loading {
  min-height: 420px; display: grid; place-content: center; justify-items: center; gap: 12px;
  border-radius: 16px; color: var(--lpx-ink-2); font-size: 0.92rem;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.04));
}
.lpx-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--lpx-rule); border-top-color: var(--lpx-a); animation: lpx-spin 0.9s linear infinite; }
@keyframes lpx-spin { to { transform: rotate(360deg); } }
.lpx-loading.is-failed { gap: 14px; }

/* the real Expedition, re-laid-out as a compact card ----------------------- */
.lpx .xp {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start;
  max-width: none; margin: 0; padding: 0;
  color: var(--lpx-ink);
  --xp-card: var(--lpx-bg);
  --xp-rule: var(--lpx-rule);
}
.lpx .xp-main, .lpx .xp-rail { display: contents; }
.lpx .xp-bar, .lpx .xp-mission, .lpx .xp-next { display: none; }
.lpx .xp-world { order: 1; }
.lpx .xp-detail { order: 2; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lpx .xp-chapter { order: 3; }
.lpx .xp-quests { order: 4; }
.lpx .xp-rewards { order: 5; }
.lpx .xp-locker { order: 6; }
.lpx .xp-card { border-radius: 16px; border-color: var(--lpx-rule); background: var(--lpx-bg); box-shadow: none; }
.lpx .xp-card-h h2, .lpx .xp-detail-body h2 { font-size: 1.12rem; }
.lpx .xp-lede, .lpx .xp-small, .lpx .xp-rail-h { color: var(--lpx-ink-2); }
.lpx .x3 { --x3-h: clamp(430px, 58vh, 580px); }
.lpx .btn { border-radius: 11px; min-height: 38px; font-weight: 600; }
.lpx .btn.primary, .lpx .btn.primary:hover {
  background: var(--lpx-grad); color: #fff; border-color: transparent; box-shadow: var(--lpx-glow);
}
.lpx .xp-seg-b.is-on { color: var(--lpx-ink); }
.lpx .xp-hero { border-radius: 12px; }

/* 3D map: the peek strip under the map is the station panel on a narrow
   card; on a wide card the detail panel beside the map takes over. */
.lpx .xp:has(.xp-world.is-3d) .xp-detail { display: none; }
@container lpx (min-width: 940px) {
  .lpx .xp {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    grid-template-areas:
      "world detail"
      "chapter rewards"
      "quests locker";
    align-items: stretch;
  }
  .lpx .xp-detail { align-content: start; }
  .lpx .xp-world { grid-area: world; }
  .lpx .xp-detail { grid-area: detail; }
  .lpx .xp-chapter { grid-area: chapter; }
  .lpx .xp-quests { grid-area: quests; }
  .lpx .xp-rewards { grid-area: rewards; }
  .lpx .xp-locker { grid-area: locker; }
  .lpx .xp-world, .lpx .xp-detail, .lpx .xp-chapter, .lpx .xp-quests, .lpx .xp-rewards, .lpx .xp-locker { order: 0; }
  .lpx .xp:has(.xp-world.is-3d) .xp-detail { display: grid; }
  .lpx .xp:has(.xp-world.is-3d) .x3-peek { display: none; }
}
@container lpx (max-width: 560px) {
  .lpx-stage { padding: 10px; }
  .lpx .x3 { --x3-h: 440px; }
  .lpx-bar { padding: 10px 12px; }
  .lpx-btn { min-height: 36px; padding: 0 13px; }
}

/* --------------------------------------------------------------- legend */
.lpx-legend {
  display: grid; gap: 8px; padding: 14px 18px 18px;
  border-top: 1px solid var(--lpx-rule); background: var(--lpx-soft);
  font-size: 0.82rem; color: var(--lpx-ink-2);
}
.lpx-keys { display: none; margin: 0; padding: 0; list-style: none; gap: 6px 22px; flex-wrap: wrap; }
.lpx-keys li { line-height: 1.9; }
.lpx-keys-flat { display: flex; }
.lpx:has(.xp-world.is-3d) .lpx-keys-3d { display: flex; }
.lpx:has(.xp-world.is-3d) .lpx-keys-flat { display: none; }
.lpx-keys b { color: var(--lpx-ink); }
.lpx kbd {
  display: inline-block; min-width: 22px; margin: 0 2px; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--lpx-rule); border-bottom-width: 2px; background: var(--lpx-key-bg); color: var(--lpx-ink);
  font: 600 0.72rem/1.5 "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace; text-align: center;
}
.lpx-fine { margin: 0; font-size: 0.78rem; color: var(--lpx-ink-3); }
.lpx-fine b { color: var(--lpx-ink-2); }

/* -------------------------------------------------- the sign-in prompt */
.lpx-gate {
  position: absolute; inset: 0; z-index: 20;
  display: grid; justify-items: center; align-items: start; padding: 24px 16px;
}
.lpx-gate[hidden] { display: none; }
.lpx-gate-scrim { position: absolute; inset: 0; background: rgba(15, 17, 40, 0.5); backdrop-filter: blur(3px); animation: lpx-fade 0.18s ease-out; }
.lpx-gate-card {
  position: sticky; top: 90px; width: min(460px, 100%);
  padding: 26px 26px 20px; border-radius: 20px;
  background: var(--lpx-bg); color: var(--lpx-ink); border: 1px solid var(--lpx-rule);
  box-shadow: 0 30px 80px -24px rgba(20, 20, 70, 0.6);
  animation: lpx-rise 0.22s cubic-bezier(0.22, 0.9, 0.28, 1);
  outline: none;
}
.lpx-gate-lock {
  display: block; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 14px;
  background: var(--lpx-grad) center / cover; box-shadow: var(--lpx-glow); position: relative;
}
.lpx-gate-lock::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2.5'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.lpx-gate-k { margin: 0 0 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lpx-a); }
:root[data-theme="dark"] .lpx .lpx-gate-k { color: #a5b4fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lpx .lpx-gate-k { color: #a5b4fc; } }
.lpx-gate-t { margin: 0 0 10px; font-size: 1.32rem; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.lpx-gate-mod {
  background: var(--lpx-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lpx-gate-hook { margin: 0 0 8px; font-size: 0.92rem; color: var(--lpx-ink); line-height: 1.5; }
.lpx-gate-p { margin: 0 0 18px; font-size: 0.88rem; color: var(--lpx-ink-2); line-height: 1.55; }
.lpx-gate-act { display: flex; gap: 10px; flex-wrap: wrap; }
.lpx-gate-act .lpx-btn { flex: 1 1 170px; }
.lpx-gate-x {
  display: block; margin: 14px auto 0; padding: 6px 10px; border: 0; background: none;
  color: var(--lpx-ink-3); font: inherit; font-size: 0.84rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.lpx-gate-x:hover { color: var(--lpx-ink); }
.lpx-gate-x:focus-visible { outline: 2px solid var(--lpx-a); border-radius: 6px; }
@keyframes lpx-fade { from { opacity: 0; } }
@keyframes lpx-rise { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  .lpx-live, .lpx-spin, .lpx-gate-scrim, .lpx-gate-card { animation: none; }
  .lpx-spin { border-top-color: var(--lpx-rule); }
  .lpx-btn { transition: none; }
  .lpx-btn:hover { transform: none; }
}
:root[data-reduced-motion="true"] .lpx-live,
:root[data-reduced-motion="true"] .lpx-spin,
:root[data-reduced-motion="true"] .lpx-gate-scrim,
:root[data-reduced-motion="true"] .lpx-gate-card { animation: none; }
