/* =========================================================
   RESPAWN, marketing site
   Theme mirrored from the app (src/theme):
   bg #1A1B26 · surface #111827 · surfaceAlt #0f172a
   accent #257bf4 / #3B82F6 · sharp 1px neon borders, radius ~0-4
   Fonts: Press Start 2P (display) · VT323 (body/mono)
   Attribute colors: STR #ef4444 DEX #f97316 SPD #f59e0b
                     STM #ec4899 INT #818cf8
   ========================================================= */

:root {
  --bg:        #0e0f16;
  --bg-2:      #1A1B26;
  --header:    #161826;
  --surface:   #111827;
  --surface-2: #0f172a;

  --accent:        #257bf4;
  --accent-strong: #3B82F6;
  --accent-soft:   rgba(37,123,244,0.12);
  --border:        rgba(37,123,244,0.40);
  --border-soft:   rgba(37,123,244,0.22);

  --text:      rgba(255,255,255,0.90);
  --text-2:    rgba(255,255,255,0.60);
  --text-3:    rgba(255,255,255,0.38);
  --label:     #7aaef8;
  --link:      #38bdf8;

  --str: #ef4444;
  --dex: #f97316;
  --spd: #f59e0b;
  --stm: #ec4899;
  --int: #818cf8;
  --hp:  #3B82F6;
  --mp:  #6366f1;
  --success: #22c55e;

  --pixel: 'Press Start 2P', system-ui, sans-serif;
  --mono:  'VT323', ui-monospace, monospace;

  --maxw: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: .3px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- ambient background ---------- */
.bg-grid, .bg-glow, .scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.bg-grid {
  background:
    linear-gradient(rgba(37,123,244,0.05) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, rgba(37,123,244,0.05) 1px, transparent 1px) 0 0 / 40px 100%,
    radial-gradient(circle at 50% -10%, #1a1c2b 0%, var(--bg) 60%);
  mask-image: radial-gradient(circle at 50% 20%, #000 30%, transparent 85%);
}
.bg-glow { filter: blur(90px); opacity: .5; z-index: 0; }
.glow-a { background: radial-gradient(circle at 20% 15%, var(--accent-strong), transparent 45%); }
.glow-b { background: radial-gradient(circle at 85% 70%, #6d28d9, transparent 40%); opacity:.35; }
.scanlines {
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.14) 2px 3px);
  opacity: .35; z-index: 3; mix-blend-mode: multiply;
}

/* keep content above ambient layers */
.nav, .hero, .marquee, .section, .cta, .footer { position: relative; z-index: 2; }

/* ---------- shared type ---------- */
.section-title, .hero-title, .stat-name, .panel-title, .cta-title,
.brand-name, .btn, .feat h3, .loop h3, .status-chip {
  font-family: var(--pixel);
  letter-spacing: -0.5px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; line-height: 1;
  padding: 16px 22px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 2px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 12px 16px; font-size: 10px; }
.btn-lg { font-size: 13px; padding: 20px 28px; }
.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0 0 rgba(59,130,246,0);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(59,130,246,.45); }
.btn-ghost { background: transparent; color: var(--label); }
.btn-ghost:hover { border-color: var(--accent-strong); color: #fff; box-shadow: 0 6px 24px rgba(59,130,246,.2); }

/* ---------- status chip ---------- */
.status-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; color: var(--success);
  border: 1px solid rgba(34,197,94,.5);
  background: rgba(34,197,94,.08);
  padding: 9px 14px; border-radius: 2px;
  text-transform: uppercase;
}
.status-chip .dot {
  width: 8px; height: 8px; background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 50% { opacity: .25; } }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 16px clamp(18px, 5vw, 48px);
  background: rgba(14,15,22,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 16px; color: #fff; }
/* Respawn app-icon logo mark */
.brand-icon { width: 28px; height: 28px; flex: none; display: block; object-fit: cover;
  border: 1px solid var(--border); border-radius: 7px; box-shadow: 0 0 14px rgba(37,123,244,.35); }
.brand-icon.small { width: 22px; height: 22px; border-radius: 6px; }

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { font-size: 18px; color: var(--text-2); text-transform: uppercase; letter-spacing: 1px; }
.nav-links a:hover { color: var(--link); text-shadow: 0 0 10px var(--link); }
.nav .btn { margin-left: 0; }

/* link back up to the parent company site */
.nav-company {
  margin-left: 22px; font-size: 15px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}
.nav-company:hover { color: var(--link); text-shadow: 0 0 10px var(--link); }

/* ---------- HERO ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(48px, 8vw, 100px) clamp(18px,5vw,48px) 40px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
}
.hero-title {
  font-size: clamp(44px, 9vw, 104px);
  margin: 18px 0 6px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 22px rgba(59,130,246,.55), 4px 4px 0 rgba(37,123,244,.25);
}
.hero-tagline { font-size: clamp(24px, 3.4vw, 34px); color: var(--label); margin: 0 0 18px; }
.hero-sub { font-size: 22px; color: var(--text-2); max-width: 46ch; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }

.hero-terminal {
  margin-top: 34px; padding: 16px 18px;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  border-radius: 2px;
  font-size: 19px; color: var(--success);
  min-height: 118px;
}
.term-line { display: block; white-space: pre; }
.term-cursor { color: var(--success); animation: blink 1s steps(1) infinite; }

/* attribute-tinted inline words */
.c-str{color:var(--str)} .c-dex{color:var(--dex)} .c-spd{color:var(--spd)}
.c-stm{color:var(--stm)} .c-int{color:var(--int)} .c-hp{color:var(--hp)} .c-mp{color:var(--mp)}

/* phone */
.hero-device { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; width: 300px; max-width: 78vw;
  border: 3px solid #2a2d40; border-radius: 42px;
  padding: 10px; background: #05060b;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(37,123,244,.25), 0 0 60px rgba(59,130,246,.18);
  z-index: 2;
  animation: float 6s ease-in-out infinite;
}
.phone img { border-radius: 32px; }
.phone-notch {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 46%; height: 22px; background: #05060b; border-radius: 0 0 14px 14px; z-index: 3;
}
.phone-glow {
  position: absolute; inset: -10% 0 0 0; z-index: 0;
  background: radial-gradient(circle at 50% 40%, rgba(59,130,246,.35), transparent 60%);
  filter: blur(30px);
}
@keyframes float { 50% { transform: translateY(-14px); } }

/* ---------- MARQUEE ---------- */
.marquee {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  overflow: hidden; padding: 14px 0;
}
.marquee-track {
  display: flex; gap: 26px; width: max-content;
  font-family: var(--pixel); font-size: 13px; color: var(--text-2);
  animation: scroll-x 28s linear infinite; white-space: nowrap;
}
.marquee-track .sep { color: var(--accent-strong); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(60px,9vw,110px) clamp(18px,5vw,48px); }
.section-head { text-align: center; max-width: 62ch; margin: 0 auto 52px; }
.section-head.left { text-align: left; margin: 0; }
.section-kicker { font-family: var(--mono); font-size: 18px; letter-spacing: 3px; color: var(--link); text-transform: uppercase; }
.section-title {
  font-size: clamp(26px, 4.6vw, 46px); color: #fff; margin: 10px 0 16px;
  text-shadow: 0 0 20px rgba(59,130,246,.35);
}
.section-lede { font-size: 21px; color: var(--text-2); margin: 0 auto; }
.section-head.left .section-lede { margin: 0; }

/* ---------- STAT CARDS (mirror the app card) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.stat-card {
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: var(--surface);
  border-radius: 2px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
}
.stat-card.wide { grid-column: 1 / -1; }
.stat-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 40%);
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 18px 40px color-mix(in srgb, var(--c) 25%, transparent);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-name { font-size: 26px; color: var(--c); text-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.stat-ic { width: 26px; height: 26px; fill: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 70%, transparent)); }
.stat-value { font-family: var(--pixel); font-size: 40px; color: #fff; margin: 12px 0 14px; line-height: 1; }
.xp-track { height: 12px; background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-radius: 2px; overflow: hidden; }
.xp-fill { display: block; height: 100%; width: 0; background: var(--c); box-shadow: 0 0 12px var(--c); transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.stat-delta { font-size: 20px; color: var(--c); margin: 10px 0 6px; }
.stat-desc { font-size: 18px; color: var(--text-3); margin: 0; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- VITALS ---------- */
.vitals-section { }
.vitals-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.vitals-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px; padding: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.panel-title { font-size: 20px; color: var(--text-2); margin-bottom: 22px; letter-spacing: 0; }
.vital-row { margin-bottom: 26px; }
.vital-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--pixel); }
.vital-head span:first-child { font-size: 22px; }
.vital-num { font-size: 14px; color: var(--text); }
.vital-track { height: 16px; margin: 10px 0 8px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 2px; overflow: hidden; }
.vital-fill { display: block; height: 100%; width: 0; transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.vital-fill.hp { background: linear-gradient(90deg,#f59e0b,#fbbf24); box-shadow: 0 0 12px #f59e0b; }
.vital-fill.mp { background: linear-gradient(90deg,#4f46e5,#6366f1); box-shadow: 0 0 12px #6366f1; }
.vital-note { font-size: 17px; color: var(--text-3); }
.vital-foot { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); font-size: 16px; color: var(--label); }

/* ---------- FEATURES ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 2px; padding: 26px;
  transition: transform .18s ease, border-color .25s ease, box-shadow .25s ease;
}
.feat:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); }
.feat-ic {
  width: 52px; height: 52px; display: grid; place-items: center;
  font-size: 24px; color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  border-radius: 2px; margin-bottom: 16px;
  text-shadow: 0 0 12px var(--c);
}
.feat h3 { font-size: 15px; color: #fff; margin: 0 0 10px; }
.feat p { font-size: 19px; color: var(--text-2); margin: 0; }

/* ---------- GAME LOOP ---------- */
.loop { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; counter-reset: step; }
.loop li {
  position: relative; border: 1px solid var(--border-soft); background: var(--surface);
  padding: 26px 22px 28px; border-radius: 2px; overflow: hidden;
  transition: transform .18s ease, border-color .25s ease;
}
.loop li:hover { transform: translateY(-4px); border-color: var(--accent-strong); }
.loop-no { font-family: var(--pixel); font-size: 30px; color: rgba(255,255,255,.08); position: absolute; top: 14px; right: 14px; }
.loop h3 { font-size: 15px; color: var(--accent-strong); margin: 0 0 12px; text-shadow: 0 0 12px rgba(59,130,246,.5); }
.loop p { font-size: 19px; color: var(--text-2); margin: 0; }

/* ---------- CTA ---------- */
.cta { max-width: var(--maxw); margin: 0 auto; padding: 20px clamp(18px,5vw,48px) clamp(60px,9vw,110px); }
.cta-inner {
  text-align: center; padding: clamp(44px,7vw,80px) 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 0%, rgba(59,130,246,.16), transparent 60%),
    var(--surface);
  border-radius: 4px;
  box-shadow: 0 0 80px rgba(59,130,246,.14) inset;
}
.app-tile { display: block; width: 88px; height: 88px; margin: 0 auto 22px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 0 40px rgba(59,130,246,.35), inset 0 0 0 1px rgba(255,255,255,.04);
  animation: float 6s ease-in-out infinite; }
.cta-title { font-size: clamp(30px,6vw,64px); color: #fff; margin: 18px 0 14px; text-shadow: 0 0 26px rgba(59,130,246,.6); }
.cta-sub { font-size: 22px; color: var(--text-2); max-width: 52ch; margin: 0 auto 30px; }
.cta-fine { font-size: 18px; color: var(--text-3); margin-top: 22px; }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px clamp(18px,5vw,48px);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto;
}
.footer-brand { display: flex; align-items: center; gap: 12px; font-family: var(--pixel); font-size: 14px; color: #fff; }
.footer-line { font-size: 18px; color: var(--text-3); margin: 0; }
.footer-tags { display: flex; gap: 8px; }
.footer-tags span { font-family: var(--pixel); font-size: 10px; color: var(--label); border: 1px solid var(--border-soft); padding: 6px 8px; border-radius: 2px; }

/* ================= EXPANDED SECTIONS ================= */

/* shared app-panel look (mirrors app surfaces) */
.app-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.a-sect { font-family: var(--pixel); font-size: 12px; color: var(--text-2); letter-spacing: 0; margin-bottom: 14px; }
.a-label { font-family: var(--pixel); font-size: 13px; }
.a-desc { font-size: 18px; color: var(--text-2); line-height: 1.4; }
.a-row { display: flex; align-items: center; justify-content: space-between; }
.a-badge { font-size: 15px; color: var(--str); border: 1px solid rgba(239,68,68,.5); padding: 4px 8px; border-radius: 2px; }

/* section variants */
.section-title.left { text-align: left; }
.section-lede.left { text-align: left; margin: 0 0 22px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split .split-copy .section-kicker { display: block; }
.split.reverse .split-copy { order: 2; }

/* ---------- NUMBERS BAR ---------- */
.numbers {
  max-width: var(--maxw); margin: 10px auto 0; padding: 0 clamp(18px,5vw,48px);
  display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; position: relative; z-index: 2;
}
.num {
  border: 1px solid var(--border-soft); background: var(--surface);
  border-radius: 3px; padding: 20px 16px; text-align: center;
}
.num-v { display: block; font-family: var(--pixel); font-size: 30px; color: #fff; text-shadow: 0 0 16px rgba(59,130,246,.5); }
.num-l { display: block; font-size: 17px; color: var(--text-2); margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- RANKS ---------- */
.rank-ladder { display: grid; grid-template-columns: repeat(7,1fr); gap: 10px; }
.rank {
  position: relative; text-align: center; padding: 22px 8px;
  border: 1px solid var(--border-soft); background: var(--surface); border-radius: 3px;
  transition: transform .18s ease, border-color .25s, box-shadow .25s;
}
.rank::after {
  content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%);
  color: var(--accent-strong); font-size: 16px; z-index: 3;
}
.rank:last-child::after { content: ""; }
.rank:hover { transform: translateY(-4px); border-color: var(--accent-strong); box-shadow: 0 12px 30px rgba(59,130,246,.2); }
.rank-lv { display: block; font-size: 17px; color: var(--label); letter-spacing: 1px; }
.rank-title { display: block; font-family: var(--pixel); font-size: 11px; color: #fff; margin-top: 10px; }
.rank.is-max { border-color: #facc15; background: linear-gradient(180deg, rgba(250,204,21,.1), var(--surface)); box-shadow: 0 0 30px rgba(250,204,21,.18); }
.rank.is-max .rank-title { color: #facc15; text-shadow: 0 0 14px rgba(250,204,21,.6); }
.rank.is-max .rank-lv { color: #fde68a; }
.rank-foot { text-align: center; color: var(--text-3); font-size: 18px; margin-top: 22px; }

/* ---------- feature list ---------- */
.feature-list { list-style: none; margin: 0 0 24px; padding: 0; }
.feature-list li {
  position: relative; padding: 10px 0 10px 26px; font-size: 20px; color: var(--text-2);
  border-bottom: 1px solid var(--border-soft);
}
.feature-list li::before { content: "▸"; position: absolute; left: 0; color: var(--accent-strong); }
.feature-list b { color: var(--text); }
.c-hp2 { color: #22c55e; }

/* ---------- QUEST BOARD ---------- */
.rating-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.rt { font-family: var(--pixel); font-size: 9px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 7px 9px; border-radius: 2px; }

.quest-board { padding: 18px; }
.qb-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.qb-title { font-family: var(--pixel); font-size: 18px; color: var(--accent-strong); text-shadow: 0 0 12px rgba(59,130,246,.5); }
.qb-sub { font-size: 17px; color: var(--text-2); margin-top: 6px; }
.qb-head-right { display: flex; align-items: center; gap: 10px; }
.qb-pill { font-size: 15px; color: var(--label); border: 1px solid var(--border-soft); padding: 6px 10px; border-radius: 2px; }
.qb-rating { font-family: var(--pixel); font-size: 18px; color: var(--c); border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 3px; }

.qb-progress { padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.qb-prog-row { display: flex; justify-content: space-between; font-family: var(--pixel); font-size: 11px; color: var(--text-2); }
.qb-prog-track { height: 12px; margin: 12px 0 8px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 2px; overflow: hidden; }
.qb-prog-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); box-shadow: 0 0 12px var(--accent-strong); transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.qb-prog-xp { font-size: 16px; color: var(--success); }

.quest { border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: var(--surface-2); border-radius: 2px; padding: 14px; margin-top: 12px; }
.quest.done-quest { opacity: .6; }
.q-top { display: flex; align-items: center; gap: 8px; }
.q-cat { font-family: var(--pixel); font-size: 12px; color: var(--c); }
.q-tier { font-size: 14px; color: #fff; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); padding: 2px 7px; border-radius: 2px; }
.q-xp { margin-left: auto; font-size: 16px; color: var(--success); }
.q-title { font-size: 20px; color: var(--text); margin: 10px 0 12px; }
.q-title s { color: var(--text-3); }
.q-actions { display: flex; gap: 8px; }
.q-btn { font-family: var(--pixel); font-size: 10px; padding: 9px 12px; border-radius: 2px; border: 1px solid var(--border-soft); }
.q-btn.done, .q-btn.complete-done { background: var(--success); border-color: var(--success); color: #04210f; }
.q-btn.quiz { background: var(--int); border-color: var(--int); color: #0b0b25; }
.q-btn.skip { color: var(--text-3); }

/* ---------- ANALYTICS ---------- */
.analytics-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.a-energy .energy-row { display: flex; align-items: center; gap: 20px; }
.ring { width: 120px; height: 120px; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
/* default offset ≈ 82% filled so the arc is correct even before JS runs */
.ring-fg { fill: none; stroke: #22c55e; stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px;
  stroke-dasharray: 327; stroke-dashoffset: 59; transition: stroke-dashoffset 1.3s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 0 6px #22c55e); }
[data-reveal]:not(.in) .ring-fg { stroke-dashoffset: 327; }
.ring-num { fill: #fff; font-family: var(--pixel); font-size: 26px; text-anchor: middle; }
.energy-meta { display: grid; gap: 6px; }
.energy-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 15px; color: var(--text-2); }
.energy-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: middle; }

.trend-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.trend-circle { width: 60px; height: 60px; flex: none; display: grid; place-items: center; border: 2px solid var(--c); border-radius: 50%; font-family: var(--pixel); font-size: 13px; color: var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent); }
.chart-label { font-family: var(--pixel); font-size: 10px; color: var(--text-2); margin-bottom: 10px; }
.mini-chart { width: 100%; height: 90px; }
.chart-area { fill: rgba(239,68,68,.15); stroke: none; }
.chart-line { fill: none; stroke: #ef4444; stroke-width: 2.5; filter: drop-shadow(0 0 5px #ef4444); stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 620; stroke-dashoffset: 620; transition: stroke-dashoffset 1.6s ease; }

.pred-stats { display: flex; align-items: center; gap: 16px; margin: 10px 0 16px; }
.pred-item { flex: 1; text-align: center; }
.pred-v { display: block; font-family: var(--pixel); font-size: 20px; }
.pred-l { display: block; font-size: 14px; color: var(--text-3); margin-top: 8px; letter-spacing: 1px; }
.pred-div { width: 1px; align-self: stretch; background: var(--border-soft); }
.pred-note { font-size: 18px; color: var(--label); margin: 0; }

.vol-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vol { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); padding: 5px 9px; border-radius: 2px; }
.vol i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.vol b { color: var(--text-2); font-weight: normal; }
.overview { list-style: none; margin: 0; padding: 0; }
.overview li { font-size: 18px; color: var(--text-2); padding: 5px 0; }

/* ---------- COACH CHAT ---------- */
.coach-chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 620px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--header); border-bottom: 1px solid var(--border-soft); }
.chat-ic { width: 34px; height: 34px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 3px; font-size: 16px; }
.chat-title { font-family: var(--pixel); font-size: 13px; color: var(--accent-strong); letter-spacing: 2px; }
.chat-book { margin-left: auto; opacity: .8; }
.chat-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; background:
  repeating-linear-gradient(to bottom, transparent 0 27px, rgba(37,123,244,.03) 27px 28px); }
.bubble { display: flex; gap: 10px; max-width: 88%; }
.bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble .avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 4px; font-size: 15px; }
.bubble p { margin: 0; font-size: 19px; line-height: 1.45; padding: 12px 14px; border-radius: 8px; }
.bubble.coach p { background: var(--surface); border: 1px solid var(--skeleton, rgba(148,163,184,.2)); color: var(--text); }
.bubble.user p { background: var(--accent-strong); color: #fff; }

.plan-card { margin-left: 42px; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: var(--surface-2); border-radius: 6px; padding: 14px; }
.plan-head { display: flex; align-items: center; gap: 8px; }
.plan-ic { font-size: 15px; }
.plan-title { font-size: 17px; color: var(--accent-strong); }
.plan-meta { font-size: 15px; color: var(--text-3); margin: 4px 0 10px; }
.plan-item { font-size: 18px; color: var(--text-2); padding: 2px 0; }
.plan-item b { color: var(--text); }
.plan-more { font-size: 15px; color: var(--text-3); font-style: italic; padding: 2px 0; }
.plan-save { margin-top: 12px; text-align: center; font-family: var(--pixel); font-size: 10px; color: #fff; background: var(--accent-strong); padding: 11px; border-radius: 3px; }
.chat-input { display: flex; gap: 10px; padding: 12px 14px; background: var(--header); border-top: 1px solid var(--border-soft); }
.ci-field { flex: 1; font-size: 18px; color: var(--placeholder, #64748b); background: var(--surface-2); border: 1px solid var(--accentOutline, rgba(37,123,244,.45)); border-radius: 4px; padding: 12px 14px; }
.ci-send { width: 44px; display: grid; place-items: center; background: var(--accent); border-radius: 4px; color: #fff; }

/* ---------- HEALTH SYNC ---------- */
.sync-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.sync-chip {
  font-size: 19px; color: var(--text); border: 1px solid var(--border-soft);
  background: var(--surface); border-radius: 3px; padding: 14px 18px;
  transition: transform .16s ease, border-color .25s, box-shadow .25s;
}
.sync-chip:hover { transform: translateY(-3px); border-color: var(--accent-strong); box-shadow: 0 10px 24px rgba(59,130,246,.18); color: #fff; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.try-chip { font-size: 17px; color: var(--link); border: 1px dashed rgba(56,189,248,.5); background: rgba(56,189,248,.06); padding: 10px 14px; border-radius: 3px; }

/* ---------- FOCUS MODE ---------- */
.focus-section { position: relative; }
.focus-halo {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(37,123,244,.14), transparent 70%);
}
.focus-section > * { position: relative; z-index: 1; }
.c-timer { color: #22c55e; }
.inline-link { color: var(--link); border-bottom: 1px dashed rgba(56,189,248,.5); }
.inline-link:hover { color: #fff; }

.focus-card { padding: 0; overflow: hidden; }
.fc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--header); border-bottom: 1px solid var(--border-soft); }
.fc-title { font-family: var(--pixel); font-size: 14px; color: var(--accent-strong); letter-spacing: 1px; text-shadow: 0 0 12px rgba(59,130,246,.5); }
.fc-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.fc-opt { font-family: var(--pixel); font-size: 9px; padding: 8px 10px; color: var(--text-3); }
.fc-opt.on { background: var(--accent-strong); color: #fff; }
.fc-desc { font-size: 18px; color: var(--text-2); margin: 0; padding: 16px 18px 4px; }
.fc-desc b { color: var(--success); }

.fc-shield { display: flex; align-items: center; gap: 14px; margin: 14px 18px; padding: 16px; border-radius: 3px;
  border: 1px solid rgba(245,158,11,.5); background: rgba(245,158,11,.08); animation: pulse-lock 2.4s ease-in-out infinite; }
.fc-lock { font-size: 28px; filter: drop-shadow(0 0 8px rgba(245,158,11,.6)); }
.fc-shield-title { font-family: var(--pixel); font-size: 13px; color: #f59e0b; }
.fc-shield-sub { font-size: 17px; color: var(--text-2); margin-top: 6px; }
@keyframes pulse-lock { 50% { box-shadow: 0 0 24px rgba(245,158,11,.25); border-color: rgba(245,158,11,.8); } }

.fc-apps { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 18px 16px; }
.fc-app { position: relative; width: 54px; height: 54px; display: grid; place-items: center; font-size: 24px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; filter: grayscale(.6) brightness(.8); }
.fc-app i { position: absolute; right: -4px; bottom: -4px; font-size: 13px; font-style: normal;
  background: var(--surface); border-radius: 50%; padding: 2px; filter: none; }
.fc-app.add { font-family: var(--pixel); font-size: 20px; color: var(--text-3); filter: none; border-style: dashed; }

.fc-ledger { border-top: 1px solid var(--border-soft); padding: 6px 18px; }
.fc-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 18px; color: var(--text-2); border-bottom: 1px solid var(--border-soft); }
.fc-row:last-child { border-bottom: 0; }
.fc-earned { color: var(--success); font-family: var(--pixel); font-size: 14px; }
.fc-banked { margin: 4px 18px 18px; padding: 12px 14px; border-radius: 3px; background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.4); color: var(--success); font-size: 18px; }
.fc-banked b { color: #4ade80; }

/* feature card fixed color icon */
.feat .feat-ic { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); text-shadow: 0 0 12px var(--c); }

/* ---------- reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .rank-ladder { grid-template-columns: repeat(4,1fr); }
  .rank::after { content: ""; }
  .numbers { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-terminal { text-align: left; }
  .hero-device { order: -1; }
  .vitals-wrap { grid-template-columns: 1fr; }
  .section-head.left { text-align: center; }
  .section-title.left, .section-lede.left { text-align: center; }
  .feature-grid { grid-template-columns: repeat(2,1fr); }
  .loop { grid-template-columns: repeat(2,1fr); }
  .nav-links { display: none; }
  .nav-company { margin-left: auto; }
  .split, .split.reverse { grid-template-columns: 1fr; }
  .split.reverse .split-copy { order: 0; }
  .analytics-grid { grid-template-columns: 1fr; }
  .feature-list, .rating-legend, .chip-row { text-align: left; }
}
@media (max-width: 560px) {
  body { font-size: 19px; }
  .stat-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .loop { grid-template-columns: 1fr; }
  .rank-ladder { grid-template-columns: repeat(2,1fr); }
  .numbers { grid-template-columns: repeat(2,1fr); }
  .footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}


/* =========================================================
   ==========  GAME LAYER  =================================
   3D world canvas, boot sequence, persistent HUD, achievement
   toasts, holographic cards and the new app-mirroring sections.
   ========================================================= */

:root {
  --gold: #facc15;
  --z-world: 1;
  --z-content: 2;
  --z-scan: 3;
  --z-hud: 40;
  --z-toast: 60;
  --z-boot: 100;
  /* the cursor must outrank everything, including the boot overlay */
  --z-reticle: 200;
}

/* ---------- 3D world canvas ---------- */
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-world);
  pointer-events: none;
  display: block;
}
/* the ambient CSS glows sit under the canvas once WebGL is live */
body.webgl .glow-a { opacity: .30; }
body.webgl .glow-b { opacity: .22; }

/* the invisible slots the 3D rig docks into */
.anchor3d { pointer-events: none; }

/* =========================================================
   BOOT / PRESS START  (mirrors the app's LEVELUP login)
   ========================================================= */
.boot {
  position: fixed;
  inset: 0;
  z-index: var(--z-boot);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, #16203a 0%, #0b0d14 55%, #06070b 100%);
  text-align: center;
  padding: 24px;
  transition: opacity .5s ease, transform .5s ease, visibility .5s;
}
.boot.done {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.06);
  pointer-events: none;
}
html.booting { overflow: hidden; }

.boot-inner { width: min(560px, 100%); }

/* diamond mark with crossed swords, straight from the login screen */
.boot-mark {
  width: 130px; height: 130px;
  margin: 0 auto 30px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #16203a, #0c1120);
  border: 1px solid rgba(59,130,246,.55);
  transform: rotate(45deg);
  box-shadow: 0 0 60px rgba(59,130,246,.45), inset 0 0 30px rgba(59,130,246,.15);
  animation: mark-pulse 2.4s ease-in-out infinite;
}
.boot-mark svg {
  width: 62px; height: 62px; transform: rotate(-45deg);
  fill: none; stroke: var(--accent-strong); stroke-width: 2.6; stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(59,130,246,.9));
}
@keyframes mark-pulse {
  50% { box-shadow: 0 0 90px rgba(59,130,246,.7), inset 0 0 30px rgba(59,130,246,.3); }
}

.boot-title {
  font-family: var(--pixel);
  font-size: clamp(30px, 7vw, 58px);
  margin: 0 0 18px;
  color: #fff;
  letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(59,130,246,.75);
}
.boot-title .b1 { color: var(--accent-strong); }

.boot-status {
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--label);
  text-transform: uppercase;
  min-height: 1.4em;
}

.boot-bar {
  height: 14px;
  margin: 22px auto 10px;
  width: min(420px, 92%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.boot-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 16px var(--accent-strong);
  transition: width .25s linear;
}
.boot-pct { font-size: 19px; color: var(--text-3); letter-spacing: 2px; }

.boot-log {
  margin: 26px auto 0;
  width: min(420px, 92%);
  text-align: left;
  font-size: 18px;
  color: var(--success);
  line-height: 1.7;
  min-height: 6em;
}
.boot-log span { display: block; opacity: 0; animation: log-in .3s forwards; }
@keyframes log-in { to { opacity: 1; } }

.boot-start {
  margin-top: 20px;
  font-family: var(--pixel);
  font-size: clamp(14px, 2.6vw, 20px);
  color: #fff;
  background: var(--accent-strong);
  border: none;
  padding: 22px 42px;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 8px 0 #1d4ed8, 0 0 50px rgba(59,130,246,.6);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .4s ease, transform .4s ease, box-shadow .15s ease;
  animation: start-blink 1.3s steps(1) infinite;
}
.boot-start.ready { opacity: 1; transform: none; pointer-events: auto; }
.boot-start:active { transform: translateY(6px); box-shadow: 0 2px 0 #1d4ed8, 0 0 50px rgba(59,130,246,.6); }
@keyframes start-blink { 50% { filter: brightness(1.35); } }

.boot-skip {
  display: block; margin: 22px auto 0;
  font-size: 17px; color: var(--text-3);
  background: none; border: 0; cursor: pointer; letter-spacing: 2px;
}
.boot-skip:hover { color: var(--link); }

/* =========================================================
   HUD
   ========================================================= */
.hud { position: fixed; inset: 0; z-index: var(--z-hud); pointer-events: none; }
.hud > * { pointer-events: auto; }

/* --- slim XP strip pinned to the very top (all viewports) --- */
.hud-strip {
  position: fixed; left: 0; right: 0; top: 0;
  height: 3px;
  background: rgba(255,255,255,.06);
  opacity: 0; transition: opacity .6s ease;
}
.hud.on .hud-strip { opacity: 1; }
.hud-strip-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #60a5fa, var(--gold));
  box-shadow: 0 0 12px var(--accent-strong);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.hud-strip-tag {
  position: absolute; right: 10px; top: 7px;
  font-family: var(--pixel); font-size: 8px;
  color: var(--label); letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0,0,0,.9);
}
.hud-strip-tag b { color: var(--gold); }

/* --- player panel, top-left --- */
/* Hidden by default and only shown once the viewport is wide enough that it
   clears the centred 1160px content column, otherwise the slim strip above
   carries the HUD role. */
.hud-player {
  display: none;
  position: fixed;
  left: 14px; top: 84px;
  width: 170px;
  padding: 12px 14px;
  background: rgba(11,15,26,.82);
  border: 1px solid var(--border);
  border-radius: 3px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,.55), inset 0 0 24px rgba(37,123,244,.08);
  transform: translateX(-130%);
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.hud.on .hud-player { transform: none; }

.hp-row { display: flex; align-items: center; gap: 10px; }
.hp-avatar {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #1e3a8a, #0b1220);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--pixel); font-size: 15px; color: #fff;
  text-shadow: 0 0 12px rgba(59,130,246,.9);
}
.hp-name { font-family: var(--pixel); font-size: 10px; color: #fff; line-height: 1.5; }
.hp-class { font-size: 16px; color: var(--label); letter-spacing: 1px; }

.hud-bar { margin-top: 9px; }
.hud-bar-label {
  display: flex; justify-content: space-between;
  font-size: 15px; letter-spacing: 1px; margin-bottom: 3px;
}
.hud-track {
  height: 9px; background: #0a1020;
  border: 1px solid rgba(255,255,255,.10); border-radius: 2px; overflow: hidden;
}
.hud-fill { display: block; height: 100%; width: 0%; transition: width .45s cubic-bezier(.2,.8,.2,1); }
.hud-fill.xp { background: linear-gradient(90deg, var(--accent), #60a5fa); box-shadow: 0 0 10px var(--accent-strong); }
.hud-fill.hp { background: linear-gradient(90deg, #dc2626, #f87171); box-shadow: 0 0 10px #ef4444; }
.hud-fill.mp { background: linear-gradient(90deg, #4f46e5, #818cf8); box-shadow: 0 0 10px #6366f1; }
.l-xp { color: #93c5fd; } .l-hp { color: #f87171; } .l-mp { color: #a5b4fc; }

.hud-player.levelup { animation: hud-flash .7s ease; }
@keyframes hud-flash {
  0%,100% { box-shadow: 0 10px 40px rgba(0,0,0,.55); }
  40%     { box-shadow: 0 0 0 2px var(--gold), 0 0 60px rgba(250,204,21,.75); }
}

/* --- waypoint minimap, right edge --- */
.hud-map {
  position: fixed; right: 20px; top: 50%;
  transform: translate(120%, -50%);
  display: grid; gap: 12px;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.hud.on .hud-map { transform: translate(0, -50%); }

.wp { display: flex; align-items: center; gap: 10px; justify-content: flex-end; cursor: pointer; }
.wp-name {
  font-family: var(--pixel); font-size: 8px; color: var(--text-3);
  opacity: 0; transform: translateX(8px);
  transition: opacity .25s, transform .25s, color .25s;
  white-space: nowrap;
}
.wp-dot {
  width: 10px; height: 10px; flex: none;
  border: 1px solid rgba(122,174,248,.55);
  transform: rotate(45deg);
  background: transparent;
  transition: background .25s, box-shadow .25s, border-color .25s, transform .25s;
}
.wp:hover .wp-name, .wp.active .wp-name { opacity: 1; transform: none; color: var(--link); }
.wp:hover .wp-dot { border-color: var(--link); }
.wp.visited .wp-dot { background: rgba(59,130,246,.45); }
.wp.active .wp-dot {
  background: var(--accent-strong);
  border-color: #93c5fd;
  box-shadow: 0 0 14px var(--accent-strong);
  transform: rotate(45deg) scale(1.35);
}

/* --- sound / controls, bottom-left --- */
.hud-ctl {
  position: fixed; left: 18px; bottom: 18px;
  display: flex; gap: 8px;
  opacity: 0; transition: opacity .6s ease .3s;
}
.hud.on .hud-ctl { opacity: 1; }
.ctl-btn {
  font-family: var(--pixel); font-size: 9px;
  color: var(--label);
  background: rgba(11,15,26,.82);
  border: 1px solid var(--border-soft);
  padding: 10px 12px; border-radius: 2px; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: color .2s, border-color .2s, box-shadow .2s;
}
.ctl-btn:hover { color: #fff; border-color: var(--accent-strong); box-shadow: 0 0 18px rgba(59,130,246,.35); }
.ctl-btn[aria-pressed="true"] { color: var(--success); border-color: rgba(34,197,94,.55); }

/* =========================================================
   ACHIEVEMENT TOASTS
   ========================================================= */
.toasts {
  position: fixed; top: 84px; right: 20px;
  z-index: var(--z-toast);
  display: grid; gap: 10px;
  width: 320px; max-width: calc(100vw - 40px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(20,26,44,.96), rgba(11,15,26,.96));
  border: 1px solid var(--gold);
  border-left-width: 4px;
  border-radius: 3px;
  box-shadow: 0 14px 44px rgba(0,0,0,.6), 0 0 34px rgba(250,204,21,.22);
  backdrop-filter: blur(10px);
  animation: toast-in .45s cubic-bezier(.2,.9,.25,1) forwards, toast-out .4s ease forwards 4.2s;
}
.toast.xp { border-color: var(--accent-strong); box-shadow: 0 14px 44px rgba(0,0,0,.6), 0 0 34px rgba(59,130,246,.28); }
.toast-ic { font-size: 22px; filter: drop-shadow(0 0 8px rgba(250,204,21,.7)); }
.toast-k { display: block; font-family: var(--pixel); font-size: 8px; color: var(--gold); letter-spacing: 1px; }
.toast-t { display: block; }
.toast.xp .toast-k { color: #93c5fd; }
.toast-t { font-size: 19px; color: #fff; margin-top: 5px; line-height: 1.25; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.96); } }

/* big centred LEVEL UP banner */
.levelup-banner {
  position: fixed; inset: 0; z-index: var(--z-toast);
  display: grid; place-items: center; pointer-events: none;
  opacity: 0;
}
.levelup-banner.show { animation: lvl 1.9s cubic-bezier(.2,.8,.2,1) forwards; }
.levelup-banner b {
  font-family: var(--pixel);
  font-size: clamp(26px, 6.5vw, 62px);
  color: var(--gold);
  text-shadow: 0 0 40px rgba(250,204,21,.85), 0 6px 0 #78350f;
  letter-spacing: -1px;
}
.levelup-banner small {
  display: block; margin-top: 14px; text-align: center;
  font-family: var(--mono); font-size: 22px; letter-spacing: 5px; color: #fff;
}
@keyframes lvl {
  0%   { opacity: 0; transform: scale(.6); }
  18%  { opacity: 1; transform: scale(1.08); }
  28%  { transform: scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.12); }
}

/* =========================================================
   CUSTOM RETICLE CURSOR
   ========================================================= */
.reticle {
  position: fixed; left: 0; top: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  z-index: var(--z-reticle);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, width .18s, height .18s, margin .18s;
  will-change: transform;
}
.reticle::before, .reticle::after {
  content: ""; position: absolute; inset: 0;
  border: 1px solid var(--accent-strong);
}
.reticle::before { border-radius: 50%; opacity: .9; box-shadow: 0 0 12px rgba(59,130,246,.7); }
.reticle::after {
  border: 0; border-radius: 50%;
  background: var(--accent-strong); width: 3px; height: 3px;
  left: 50%; top: 50%; margin: -1.5px 0 0 -1.5px;
  box-shadow: 0 0 8px var(--accent-strong);
}
body.has-reticle .reticle { opacity: 1; }
body.has-reticle .reticle.hot { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
body.has-reticle .reticle.hot::before { border-color: var(--gold); box-shadow: 0 0 20px rgba(250,204,21,.8); }
@media (hover: hover) and (pointer: fine) {
  body.has-reticle,
  body.has-reticle a,
  body.has-reticle button,
  body.has-reticle .quest-i { cursor: none; }
}

/* =========================================================
   HOLOGRAPHIC TILT CARDS
   ========================================================= */
.holo {
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
  will-change: transform;
  position: relative;
}
.holo::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(147,197,253,.16), transparent 62%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.holo:hover::after { opacity: 1; }
.holo.tilting { transition: box-shadow .35s ease; }

/* =========================================================
   HERO STAGE  (3D rig blooms behind the floating phone)
   ========================================================= */
.hero-device { position: relative; }
/* deliberately wider than the phone so the rig's ring and stat nodes
   halo out around it instead of hiding behind it */
.hero-stage {
  position: absolute;
  left: 50%; top: 50%;
  width: min(780px, 155%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 0;
}
.hero .phone { position: relative; z-index: 2; }

.hero-hint {
  display: flex; align-items: center; gap: 10px;
  margin-top: 26px; font-size: 18px; color: var(--text-3); letter-spacing: 2px;
}
.hero-hint kbd {
  font-family: var(--pixel); font-size: 9px; color: var(--label);
  border: 1px solid var(--border-soft); background: var(--surface-2);
  padding: 6px 8px; border-radius: 2px;
}

/* scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  display: grid; justify-items: center; gap: 8px;
  font-size: 15px; letter-spacing: 3px; color: var(--text-3);
}
.scroll-cue i {
  display: block; width: 1px; height: 34px;
  background: linear-gradient(var(--accent-strong), transparent);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0%,100% { opacity: .2; transform: scaleY(.5); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* =========================================================
   CLASS CARD  ("E-Rank Paladin" from the STATUS screen)
   ========================================================= */
.class-wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }

.class-card {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(250,204,21,.42);
  border-radius: 4px;
  background:
    linear-gradient(150deg, rgba(250,204,21,.10), rgba(17,24,39,.9) 42%),
    var(--surface);
  box-shadow: 0 26px 70px rgba(0,0,0,.55), inset 0 0 50px rgba(250,204,21,.05);
  overflow: hidden;
}
.class-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.10) 48%, transparent 58%);
  transform: translateX(-100%);
  animation: sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen { 0%, 62% { transform: translateX(-100%); } 82%, 100% { transform: translateX(100%); } }

.cc-top { display: flex; align-items: center; gap: 18px; }
.cc-sigil {
  width: 76px; height: 76px; flex: none;
  display: grid; place-items: center; font-size: 34px;
  border: 1px solid var(--gold);
  background: rgba(250,204,21,.10);
  border-radius: 3px;
  box-shadow: 0 0 34px rgba(250,204,21,.28), inset 0 0 20px rgba(250,204,21,.14);
}
.cc-kicker { font-size: 18px; letter-spacing: 4px; color: var(--text-3); text-transform: uppercase; }
.cc-name {
  font-family: var(--pixel); font-size: clamp(18px, 2.6vw, 28px);
  color: #fff; margin: 10px 0 0; line-height: 1.4;
  text-shadow: 0 0 26px rgba(250,204,21,.4);
}
.cc-badge {
  margin-left: auto; align-self: flex-start;
  white-space: nowrap;
  font-family: var(--pixel); font-size: 10px; color: var(--gold);
  border: 1px solid rgba(250,204,21,.5); padding: 9px 11px; border-radius: 2px;
  background: rgba(250,204,21,.08);
}
.cc-desc { font-size: 21px; color: var(--text-2); margin: 22px 0 20px; }
.cc-power {
  display: flex; align-items: baseline; gap: 12px;
  padding-top: 18px; border-top: 1px solid rgba(250,204,21,.2);
}
.cc-power span { font-size: 18px; letter-spacing: 3px; color: var(--label); text-transform: uppercase; }
.cc-power b {
  font-family: var(--pixel); font-size: 30px; color: var(--gold);
  text-shadow: 0 0 24px rgba(250,204,21,.6);
}

/* rank ladder E → S */
.erank { display: grid; gap: 10px; }
.er {
  display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 3px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.er:hover { transform: translateX(6px); border-color: var(--c); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 26%, transparent); }
.er-l {
  font-family: var(--pixel); font-size: 20px; color: var(--c);
  text-align: center; text-shadow: 0 0 16px color-mix(in srgb, var(--c) 65%, transparent);
}
.er-n { font-size: 20px; color: var(--text); letter-spacing: 1px; }
.er-r { font-size: 17px; color: var(--text-3); letter-spacing: 1px; }
.er.is-you { border-color: var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), var(--surface)); }
.er.is-you .er-r { color: var(--c); }

/* =========================================================
   PROFILE / 3D RADAR SECTION
   ========================================================= */
.profile-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.radar-stage {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  /* translucent on purpose: the WebGL rig renders behind this panel */
  background:
    radial-gradient(circle at 50% 50%, rgba(37,123,244,.10), transparent 62%),
    rgba(10,14,26,.34);
  box-shadow: inset 0 0 70px rgba(0,0,0,.5);
  overflow: hidden;
}
.radar-stage::before, .radar-stage::after {
  content: ""; position: absolute; width: 18px; height: 18px; border: 1px solid var(--accent-strong);
}
.radar-stage::before { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.radar-stage::after  { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.radar-hint {
  position: absolute; left: 0; right: 0; bottom: 14px; text-align: center;
  font-size: 16px; letter-spacing: 2px; color: var(--text-3);
}

/* 2D radar: always rendered, only shown when the WebGL rig isn't running */
.radar-2d {
  position: absolute;
  inset: 8%;
  width: 84%; height: 84%;
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}
body.no3d .radar-2d { opacity: 1; }
body.no3d .radar-2d polygon#r2shape,
body.no3d .radar-2d circle { filter: drop-shadow(0 0 6px currentColor); }
body.no3d .radar-2d #r2shape { transition: none; }
/* the stage is only see-through for WebGL; opaque it up for the 2D path */
body.no3d .radar-stage {
  background:
    radial-gradient(circle at 50% 50%, rgba(37,123,244,.10), transparent 62%),
    var(--surface);
}

.stat-readout { display: grid; gap: 10px; margin-top: 6px; }
.sr {
  display: grid; grid-template-columns: 52px 1fr 92px; align-items: center; gap: 14px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
  background: color-mix(in srgb, var(--c) 7%, var(--surface));
  border-radius: 3px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}
.sr:hover, .sr.active {
  transform: translateX(5px);
  border-color: var(--c);
  box-shadow: 0 0 26px color-mix(in srgb, var(--c) 30%, transparent);
}
.sr-k { font-family: var(--pixel); font-size: 14px; color: var(--c); text-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); }
.sr-track { height: 10px; background: #0a1020; border: 1px solid rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.sr-fill { display: block; height: 100%; width: 0; background: var(--c); box-shadow: 0 0 12px var(--c); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.sr-v { font-size: 18px; color: var(--text-2); text-align: right; letter-spacing: 1px; }

/* =========================================================
   WIDGETS SECTION  (iOS home-screen widgets)
   ========================================================= */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 940px; margin: 0 auto;
}
/* each cell stacks widget + caption, so captions line up across a row */
.widget-grid > * { display: flex; flex-direction: column; }
.widget {
  flex: 1;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(160deg, #262837, #1b1d2a);
  box-shadow: 0 22px 50px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  min-height: 178px;
  display: flex; flex-direction: column; justify-content: center;
}
.widget-grid > .w2 { grid-column: span 2; }
/* the trailing medium widget centres on row 2 rather than hanging left */
.widget-grid > .w2:last-child { grid-column: 2 / span 2; }
.widget-cap { text-align: center; font-size: 17px; color: var(--text-3); margin-top: 10px; letter-spacing: 1px; }
.wg-streak { text-align: center; }
.wg-flame { font-size: 40px; filter: drop-shadow(0 0 14px rgba(249,115,22,.75)); }
.wg-big { font-family: var(--pixel); font-size: 40px; color: #fff; margin: 10px 0 8px; }
.wg-sub { font-size: 17px; color: var(--text-3); letter-spacing: 2px; }
.wg-rows { display: grid; gap: 11px; }
.wg-row { display: grid; grid-template-columns: 42px 52px 1fr; align-items: center; gap: 12px; }
.wg-k { font-size: 18px; color: var(--c); letter-spacing: 1px; }
.wg-lv { font-size: 21px; color: #fff; }
.wg-bar { height: 9px; background: #0f1626; border-radius: 6px; overflow: hidden; }
.wg-bar i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 6px; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.wg-vit { display: grid; gap: 16px; }
.wg-vrow-top { display: flex; justify-content: space-between; font-size: 19px; margin-bottom: 7px; }
.wg-radar { display: grid; place-items: center; }
.wg-radar svg { width: 118px; height: 118px; }

/* =========================================================
   LOCK SCREEN  (Screen Time shield from the app)
   ========================================================= */
.lock-demo { display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: center; }
.ios-shield {
  width: 300px;
  border-radius: 34px;
  padding: 62px 26px 26px;
  background: #1c1c1e;
  border: 8px solid #08090d;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
  text-align: center;
  min-height: 470px;
  display: flex; flex-direction: column;
}
.shield-glass { font-size: 46px; margin-bottom: 22px; filter: drop-shadow(0 0 16px rgba(37,99,235,.8)); }
.shield-h { font-size: 27px; color: #fff; font-family: var(--mono); letter-spacing: 1px; }
.shield-p { font-size: 21px; color: rgba(255,255,255,.72); margin: 12px 0 0; line-height: 1.35; }
.shield-ok {
  margin-top: auto;
  background: #7df9ff; color: #052e33;
  border-radius: 999px; padding: 15px;
  font-size: 21px; letter-spacing: 1px;
}
.lock-note { font-size: 17px; color: var(--text-3); text-align: center; margin-top: 14px; letter-spacing: 1px; }

/* =========================================================
   LOG SCREEN  (what you can train)
   ========================================================= */
.log-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.log-row {
  display: grid; grid-template-columns: 52px 1fr 20px; align-items: center; gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 3px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.log-row:hover {
  transform: translateX(6px);
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, var(--surface));
  box-shadow: 0 0 28px color-mix(in srgb, var(--c) 22%, transparent);
}
.log-ic {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 21px;
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border-radius: 3px;
}
.log-n { font-size: 21px; color: var(--text); letter-spacing: 1px; }
.log-n b { color: var(--c); font-weight: normal; }
.log-a { color: var(--text-3); font-size: 20px; }

/* =========================================================
   INTERACTIVE QUEST BOARD
   ========================================================= */
.quest.quest-i { cursor: pointer; transition: transform .2s ease, box-shadow .25s ease, opacity .3s ease, border-color .2s; }
.quest.quest-i:hover { transform: translateX(5px); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 26%, transparent); }
.quest.cleared { opacity: .55; }
.quest.cleared .q-title { text-decoration: line-through; color: var(--text-3); }
.quest.just-cleared { animation: q-pop .55s cubic-bezier(.2,.9,.2,1); }
@keyframes q-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.035); box-shadow: 0 0 44px color-mix(in srgb, var(--c) 55%, transparent); }
  100% { transform: scale(1); }
}
.q-btn { cursor: pointer; user-select: none; }
.qb-replay {
  display: block; width: 100%; margin-top: 14px;
  font-family: var(--pixel); font-size: 10px; color: var(--label);
  background: transparent; border: 1px dashed var(--border-soft);
  padding: 12px; border-radius: 2px; cursor: pointer;
}
.qb-replay:hover { color: #fff; border-color: var(--accent-strong); }

/* floating +XP burst */
.xp-pop {
  position: fixed; z-index: var(--z-toast); pointer-events: none;
  font-family: var(--pixel); font-size: 15px; color: var(--gold);
  text-shadow: 0 0 18px rgba(250,204,21,.9);
  animation: xp-fly 1.05s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes xp-fly {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.7); }
  22%  { opacity: 1; transform: translate(-50%, -18px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -74px) scale(1); }
}

/* =========================================================
   SECTION ENTRANCE (game-feel reveal)
   ========================================================= */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }

.section-title { position: relative; }
.section-head .section-title::after {
  content: ""; display: block; width: 0; height: 2px; margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent-strong), transparent);
  box-shadow: 0 0 14px var(--accent-strong);
  transition: width 1s cubic-bezier(.2,.8,.2,1) .15s;
}
.section-head.in .section-title::after, .section.in .section-title::after { width: 190px; }

/* nav gets a scroll-aware background */
.nav { transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease; }
.nav.stuck {
  background: rgba(11,13,20,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--link); transform: scaleX(0); transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--link); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 1460px) {
  .hud-player { display: block; }
}
@media (max-width: 1080px) {
  .hud-map { display: none; }
  .widget-grid { grid-template-columns: repeat(2, 1fr); }
  .widget-grid > .w2,
  .widget-grid > .w2:last-child { grid-column: span 2; }
}
@media (max-width: 920px) {
  .class-wrap, .profile-wrap, .lock-demo { grid-template-columns: 1fr; }
  .lock-demo { justify-items: center; }
  .ios-shield { margin: 0 auto; }
  .log-list { grid-template-columns: 1fr; }
  .radar-stage { max-width: 460px; margin: 0 auto; }
  .hero-stage { width: min(520px, 96vw); }
  /* toasts move out of the heading's way on narrow screens */
  .toasts {
    top: auto; bottom: 70px; right: 10px; left: 10px;
    width: auto; justify-items: end;
  }
  .toast { width: min(300px, 100%); padding: 10px 12px; }
  .toast-t { font-size: 17px; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(20px) scale(.96); } }
}
@media (max-width: 560px) {
  .widget-grid { grid-template-columns: 1fr; }
  .widget-grid > .w2,
  .widget-grid > .w2:last-child { grid-column: span 1; }
  .hud-ctl { left: 10px; bottom: 10px; gap: 6px; }
  .ctl-btn { font-size: 8px; padding: 8px 9px; background: rgba(11,15,26,.9); }
  /* keep the rig fully tucked behind the phone on small screens */
  .hero-stage { width: min(400px, 84vw); }
  .boot-mark { width: 100px; height: 100px; }
  .boot-mark svg { width: 46px; height: 46px; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .class-card::before, .boot-mark, .scroll-cue i, .boot-start { animation: none; }
  .toast { animation: none; opacity: 1; }
  .levelup-banner.show { animation: none; opacity: 1; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .holo { transition: none; }
  #world { opacity: .55; }
}
