/* LevelSelect — site styles.
   Every color is lifted from the app's LSTheme, not invented:
   purple/purpleDeep/torch and the background gradient stops. The app is
   dark-only (.preferredColorScheme(.dark)), so the site commits to the same
   single visual world rather than inventing a light mode the product lacks. */

@font-face {
  font-family: "Press Start 2P";
  src: url("PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ground: #0D0A17;        /* LSTheme.background, bottom stop */
  --ground-lift: #1A1229;   /* LSTheme.background, top stop */
  --surface: #171029;
  --surface-hi: #1F1636;
  --line: #2C2145;
  --purple: #945CFA;        /* LSTheme.purple */
  --purple-deep: #4D298C;   /* LSTheme.purpleDeep */
  --torch: #F5A34D;         /* LSTheme.torch */
  --torch-deep: #8A4A12;
  --ink: #EFEAFB;
  --muted: #9990B8;
  --green: #5BD98A;
  --step: clamp(1.5rem, 4vw, 3rem);
  --measure: 64ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: #B78DFF; }
:focus-visible { outline: 2px solid var(--torch); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2.5rem, 1080px); margin-inline: auto; }
.pixel { font-family: "Press Start 2P", monospace; font-weight: 400; line-height: 1.35; }

/* Wordmark — the same two-shadow recipe as the app: a zero-blur offset for
   legibility (pixel strokes are ~2px, blur destroys the corners) plus a soft
   glow for the torch-lit feel. */
.wordmark {
  color: var(--torch);
  text-shadow: 0 3px 0 var(--torch-deep), 0 0 32px rgba(245, 163, 77, 0.45);
}

/* ── header ─────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 10, 23, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand span { font-size: 11px; }
.navlinks { display: flex; gap: 1.25rem; font-size: .9rem; }
.navlinks a { color: var(--muted); text-decoration: none; }
.navlinks a:hover, .navlinks a[aria-current="page"] { color: var(--ink); }

/* ── hero ───────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3rem, 9vw, 6rem) 0 var(--step);
  background: linear-gradient(180deg, var(--ground-lift), var(--ground));
}
.torchlight {
  position: absolute; left: 50%; top: -10%; translate: -50% 0;
  width: min(760px, 120%); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(245,163,77,.22) 0%, transparent 62%);
  animation: breathe 6.6s ease-in-out infinite;   /* matches LivePulse in the app */
}
@keyframes breathe { 0%,100% { opacity:.55; scale:1 } 50% { opacity:.85; scale:1.06 } }
.hero .wrap { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.25rem; }
.door {
  width: clamp(112px, 20vw, 164px); border-radius: 26px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.85), 0 0 60px -18px rgba(245,163,77,.55);
}
h1.wordmark { font-size: clamp(1.5rem, 5.4vw, 2.85rem); margin: 0; }
.tagline { font-size: clamp(1.05rem, 2.4vw, 1.35rem); max-width: 34ch; margin: 0; text-wrap: balance; }
.sub { color: var(--muted); max-width: 52ch; margin: 0; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: .4rem; }
.btn {
  font: inherit; font-weight: 650; font-size: .95rem;
  padding: .8rem 1.5rem; border-radius: 14px; text-decoration: none;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: .5rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #A272FF, var(--purple));
  box-shadow: 0 12px 26px -12px var(--purple), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { transform: translateY(-2px); color: #fff; }
.btn-ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--purple); transform: translateY(-2px); color: var(--ink); }
.badge { font-size: .75rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* ── continue card (mirrors the app's hero) ─────────── */
.showcase { padding: var(--step) 0; }
.card-hero {
  display: flex; align-items: center; gap: 1.1rem; padding: 1.1rem;
  border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(77,41,140,.85), #1E1436);
  box-shadow: 0 24px 50px -28px #000;
}
/* Real cover art, framed the way CoverThumb frames it in the app: a soft
   top-left gloss so the box reads as a physical object rather than a sticker. */
.cover {
  width: 76px; height: 100px; flex: none; border-radius: 12px; object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 22px -10px #000, inset 0 1px 0 rgba(255,255,255,.22);
}
.cover-wrap { position: relative; flex: none; }
.cover-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.26), transparent 46%);
}
.card-hero .meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.card-hero .title { font-weight: 650; font-size: 1.06rem; }
.card-hero .sub2 { color: var(--muted); font-size: .86rem; }
.play {
  margin-left: auto; flex: none; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .7rem 1rem; border-radius: 14px; color: var(--green);
  border: 1px solid rgba(91,217,138,.45); background: rgba(91,217,138,.12);
  font-size: .76rem; font-weight: 650;
}
.play b { font-size: 1.05rem; line-height: 1; }

/* ── sections ───────────────────────────────────────── */
section { padding: var(--step) 0; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin: 0 0 .35rem; letter-spacing: -.01em; text-wrap: balance; }
.lede { color: var(--muted); margin: 0 0 1.4rem; max-width: var(--measure); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tile {
  padding: 1.2rem; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  display: flex; flex-direction: column; gap: .4rem;
}
.tile h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }

.shelf { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: .5rem; }
.system {
  flex: none; width: 118px; text-align: center; padding: 1rem .6rem .8rem;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
}
.system img { width: 64px; height: 64px; margin: 0 auto .55rem; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.system .n { font-size: .85rem; font-weight: 600; }
.system .c { font-size: .78rem; color: var(--muted); }

/* ── document pages (privacy) ───────────────────────── */
.doc { max-width: var(--measure); padding-top: 2.5rem; }
.doc h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 .3rem; }
.doc h2 { margin-top: 2rem; }
.doc p, .doc li { color: #D6CFEA; }
.doc ul { padding-left: 1.1rem; }
.doc li { margin: .3rem 0; }
.stamp { color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem; }
.callout {
  border-left: 3px solid var(--torch); background: var(--surface);
  padding: 1rem 1.15rem; border-radius: 0 14px 14px 0; margin: 1.2rem 0;
}
.callout p { margin: 0; }
.tablewrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; min-width: 520px; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--torch); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; }

/* ── footer ─────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; margin-top: var(--step); color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
