/* ===========================================================
   INOVAPOLLO — design system
   Black void, starfield, warm accretion-disk gold, ice-blue accents.
   =========================================================== */
:root {
  --void: #000000;
  --space: #04060b;
  --panel: rgba(12, 15, 24, 0.72);
  --panel-solid: #0b0e16;
  --panel-2: rgba(22, 27, 40, 0.75);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --text-2: #b9c1d1;
  --muted: #7f889b;
  --gold: #ebbd78;
  --gold-2: #c98b3e;
  --gold-glow: rgba(235, 189, 120, 0.35);
  --ice: #9cc8ff;
  --good: #7fd8a6;
  --bad: #ff8a7a;
  --radius: 14px;
  --radius-lg: 22px;
  --display: 'Syncopate', 'Manrope', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --top-h: 64px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--void); }
body {
  margin: 0; min-height: 100vh; background: var(--void); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: #000; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

#starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------------- warp loading screen ---------------- */
#warp { position: fixed; inset: 0; z-index: 1000; background: #000; display: none; }
#warp.on { display: block; }
#warp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.warp-title { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; opacity: 0; transition: opacity 1.2s ease, letter-spacing 3s ease; pointer-events: none; }
#warp.show-title .warp-title { opacity: 1; }
.warp-logo { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 6vw, 54px); letter-spacing: .5em; padding-left: .5em; color: #fff; text-shadow: 0 0 30px rgba(255,255,255,.35); }
.warp-sub { margin-top: 14px; font-family: var(--display); font-size: clamp(9px, 2.2vw, 12px); letter-spacing: .6em; padding-left: .6em; color: var(--gold); text-transform: uppercase; }
.warp-skip { position: absolute; right: 18px; bottom: calc(22px + var(--safe-b)); background: rgba(255,255,255,.06); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; color: var(--text-2); }
.warp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#warp.flash .warp-flash { animation: flash 1.1s ease-out forwards; }
@keyframes flash { 0% { opacity: 0 } 12% { opacity: .95 } 100% { opacity: 0 } }

/* ---------------- top bar & tab bar ---------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.45));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; position: relative; background: radial-gradient(circle at 50% 50%, #000 0 34%, transparent 36%), conic-gradient(from 200deg, #fff6, var(--gold), var(--gold-2), #fff3, var(--gold), #fff6); box-shadow: 0 0 18px var(--gold-glow); }
.brand-mark::after { content: ''; position: absolute; left: -6px; right: -6px; top: 11px; height: 4px; border-radius: 50%; background: linear-gradient(90deg, transparent, var(--gold), #fff, var(--gold), transparent); opacity: .85; }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .38em; }
.topnav { display: flex; gap: 6px; margin-left: 8px; }
.topnav a { color: var(--text-2); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.topnav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.topnav a.active { color: var(--gold); }
.topright { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #000; background: linear-gradient(135deg, var(--gold), var(--gold-2)); font-size: 14px; text-decoration: none !important; }

.tabbar { display: none; }
@media (max-width: 860px) {
  :root { --top-h: 54px; }
  .topnav { display: none; }
  .brand-word { font-size: 12px; letter-spacing: .32em; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(3,4,8,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-decoration: none; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--gold); }
}

/* ---------------- layout ---------------- */
#app { position: relative; z-index: 1; min-height: 100vh; padding-top: calc(var(--top-h) + var(--safe-t)); outline: none; }
@media (max-width: 860px) { #app { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); } }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.page { padding: 40px 0 80px; animation: rise .5s ease both; }
.wrap.page { padding-left: 20px; padding-right: 20px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

.eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5.4vw, 60px); font-weight: 300; letter-spacing: -.02em; }
h2 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 400; }
h3 { font-size: 20px; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { height: 28px; }
hr.rule { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 48px 0; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-decoration: none !important; transition: background .2s, border-color .2s, transform .1s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.3); }
.btn:active { transform: scale(.98); }
.btn.gold { background: linear-gradient(135deg, #f3cf93, var(--gold) 45%, var(--gold-2)); color: #120c03; border-color: transparent; box-shadow: 0 8px 30px -10px var(--gold-glow); }
.btn.gold:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 14px; font-size: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- panels & cards ---------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.card { position: relative; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; color: var(--text); text-decoration: none !important; overflow: hidden; transition: border-color .25s, transform .25s, background .25s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
a.card:hover { border-color: rgba(235,189,120,.45); transform: translateY(-2px); background: rgba(16,20,32,.8); }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--text-2); margin: 0; font-size: 15px; }
.card .tag { font-family: var(--display); font-size: 9.5px; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; margin-bottom: 14px; display: block; }
.card .art { height: 130px; margin: -24px -24px 18px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.card .go { position: absolute; right: 20px; bottom: 18px; color: var(--gold); font-size: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,.03); }
.chip.gold { color: var(--gold); border-color: rgba(235,189,120,.4); }
.chip.good { color: var(--good); border-color: rgba(127,216,166,.4); }

/* ---------------- hero ---------------- */
.hero { min-height: calc(100vh - var(--top-h)); display: flex; align-items: center; padding: 60px 0; position: relative; }
.hero h1 { font-size: clamp(40px, 8vw, 92px); line-height: 1.02; margin-bottom: 22px; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #fff 10%, var(--gold) 55%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin-bottom: 34px; }
.gargantua { position: absolute; right: -8%; top: 50%; transform: translateY(-50%); width: min(62vw, 720px); aspect-ratio: 1; pointer-events: none; opacity: .9; z-index: -1; }
@media (max-width: 860px) { .gargantua { right: -40%; width: 110vw; opacity: .45; top: 38%; } .hero { min-height: auto; padding: 60px 0 40px; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stats > div { background: rgba(5,7,12,.85); padding: 22px; }
.stats b { display: block; font-size: 30px; font-weight: 300; color: #fff; }
.stats span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.journey { counter-reset: step; display: grid; gap: 0; }
.journey li { list-style: none; position: relative; padding: 0 0 26px 54px; }
.journey li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: var(--display); font-size: 12px; color: var(--gold); letter-spacing: .1em; width: 38px; height: 38px; border: 1px solid rgba(235,189,120,.4); border-radius: 50%; display: grid; place-items: center; }
.journey li::after { content: ''; position: absolute; left: 19px; top: 42px; bottom: 4px; width: 1px; background: var(--line-2); }
.journey li:last-child::after { display: none; }
.journey h4 { margin: 6px 0 4px; font-size: 17px; }
.journey p { margin: 0; color: var(--text-2); font-size: 15px; }

/* ---------------- forms ---------------- */
.auth-box { max-width: 440px; margin: 40px auto; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.input, select.input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.5); color: var(--text); font: inherit; font-size: 16px; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(235,189,120,.15); }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------------- academy ---------------- */
.course-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 26px; }
@media (max-width: 700px) { .course-head { grid-template-columns: 1fr; } }
.progress { height: 6px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold), #fff3d8); border-radius: 99px; transition: width .6s ease; }
.ring { width: 76px; height: 76px; }
.units { display: grid; gap: 14px; }
.unit { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.unit.locked { opacity: .55; }
.unit-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; cursor: pointer; width: 100%; text-align: left; background: none; border: 0; }
.unit-num { font-family: var(--display); font-size: 13px; color: var(--gold); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(235,189,120,.35); display: grid; place-items: center; }
.unit.passed .unit-num { background: var(--gold); color: #000; border-color: var(--gold); }
.unit-title { font-size: 18px; font-weight: 600; }
.unit-meta { font-size: 13px; color: var(--muted); }
.unit-body { display: none; border-top: 1px solid var(--line); padding: 8px 12px 16px; }
.unit.open .unit-body { display: block; }
.lesson-link { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 11px 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; font-size: 15px; }
.lesson-link:hover { background: rgba(255,255,255,.04); }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; }
.tick.on { background: var(--good); border-color: var(--good); color: #000; }
.unit-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 10px 0; }

/* lesson reader */
.reader { padding: 34px 0 90px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.lesson-title { font-size: clamp(30px, 5vw, 48px); font-weight: 300; margin-bottom: 10px; }
.prose { font-size: 18px; line-height: 1.75; color: #dfe4ee; }
.prose h2 { font-size: 26px; margin: 1.8em 0 .6em; color: #fff; font-weight: 500; }
.prose h3 { font-size: 20px; margin: 1.6em 0 .5em; color: var(--gold); font-weight: 600; }
.prose p { margin: 0 0 1.15em; }
.prose strong { color: #fff; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-left: 3px solid var(--gold); background: rgba(235,189,120,.06); border-radius: 0 14px 14px 0; color: var(--text); }
.prose blockquote p:last-child { margin: 0; }
.prose code { font-family: var(--mono); font-size: .88em; background: rgba(255,255,255,.07); padding: 2px 6px; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.prose th { color: var(--gold); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.prose img { border-radius: 14px; margin: 1.4em auto .4em; border: 1px solid var(--line); }
.prose img + em { display: block; text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 1.4em; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 8px 0; }
.prose .katex { font-size: 1.08em; }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 2.4em 0; }
.callout { margin: 1.6em 0; padding: 18px 22px; border-radius: 16px; border: 1px solid rgba(156,200,255,.3); background: rgba(156,200,255,.06); }
.callout b:first-child { color: var(--ice); display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 50px; flex-wrap: wrap; }

/* quiz */
.q { margin-bottom: 26px; }
.q-text { font-size: 18px; font-weight: 500; margin-bottom: 12px; }
.q-num { font-family: var(--display); font-size: 11px; letter-spacing: .3em; color: var(--gold); margin-bottom: 8px; }
.opt { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); cursor: pointer; font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
.opt:hover { border-color: rgba(235,189,120,.5); }
.opt.sel { border-color: var(--gold); background: rgba(235,189,120,.12); }
.opt.right { border-color: var(--good); background: rgba(127,216,166,.12); }
.opt.wrong { border-color: var(--bad); background: rgba(255,138,122,.1); }
.why { font-size: 15px; color: var(--text-2); padding: 10px 14px; border-left: 2px solid var(--gold); margin-top: 6px; }
.score-big { font-size: 72px; font-weight: 200; line-height: 1; }
.sticky-submit { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); z-index: 5; }
@media (min-width: 861px) { .sticky-submit { bottom: 16px; } }

/* ---------------- tools: full-screen surfaces ---------------- */
.fullscreen-tool { position: fixed; inset: calc(var(--top-h) + var(--safe-t)) 0 0 0; z-index: 2; background: #000; }
@media (max-width: 860px) { .fullscreen-tool { bottom: calc(var(--tab-h) + var(--safe-b)); } }
.fullscreen-tool canvas, .fullscreen-tool video { position: absolute; inset: 0; width: 100%; height: 100%; }
.fullscreen-tool video { object-fit: cover; }
.hud { position: absolute; z-index: 3; display: flex; gap: 8px; flex-wrap: wrap; }
.hud.tl { top: 12px; left: 12px; right: 12px; }
.hud.bl { bottom: 12px; left: 12px; right: 12px; justify-content: space-between; align-items: flex-end; }
.hud .btn { background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hud .btn.on { border-color: var(--gold); color: var(--gold); }
.info-card { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 70px; max-width: 420px; margin: 0 auto; background: rgba(6,8,14,.92); border: 1px solid var(--line-2); border-radius: 18px; padding: 16px 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: none; }
.info-card.show { display: block; }
.info-card h4 { margin: 0 0 4px; font-size: 18px; }
.info-card p { margin: 0; font-size: 14px; color: var(--text-2); }
.info-card .x { position: absolute; right: 10px; top: 8px; background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; }
.readout { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: rgba(0,0,0,.55); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.slider-row { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
input[type=range] { accent-color: var(--gold); width: 100%; }
.search-pop { position: absolute; z-index: 5; top: 60px; left: 12px; right: 12px; max-width: 420px; background: rgba(6,8,14,.96); border: 1px solid var(--line-2); border-radius: 16px; padding: 12px; display: none; max-height: 60%; overflow: auto; }
.search-pop.show { display: block; }
.search-pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.search-pop button:hover { background: rgba(255,255,255,.06); }

/* stacker */
.drop { border: 1.5px dashed rgba(235,189,120,.45); border-radius: var(--radius-lg); padding: 44px 20px; text-align: center; cursor: pointer; background: rgba(235,189,120,.03); transition: background .2s; }
.drop.over { background: rgba(235,189,120,.1); }
.stack-out { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .stack-out { grid-template-columns: 1fr; } }
.stack-out figure { margin: 0; background: #000; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stack-out canvas { width: 100%; height: auto; display: block; image-rendering: auto; }
.stack-out figcaption { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); }
.log { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: rgba(0,0,0,.5); border: 1px solid var(--line); border-radius: 12px; padding: 12px; max-height: 160px; overflow: auto; white-space: pre-wrap; }

/* games */
.game-stage { position: relative; background: #000; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.game-stage canvas { display: block; width: 100%; touch-action: none; }
.lineup { display: grid; gap: 8px; }
.lineup-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.5); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.lineup-item.dragging { opacity: .6; border-color: var(--gold); }
.lineup-item.right { border-color: var(--good); }
.lineup-item.wrong { border-color: var(--bad); }
.lineup-item .ball { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.lineup-item .handle { margin-left: auto; color: var(--muted); font-size: 20px; }
.lineup-item .arrows { margin-left: auto; display: flex; gap: 4px; }
.lineup-item .arrows button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); cursor: pointer; }

/* scale gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.gallery .ph { aspect-ratio: 16/10; background: #05070b center/cover no-repeat; position: relative; }
.gallery figcaption { padding: 18px 20px 20px; }
.gallery figcaption h4 { margin: 0 0 6px; font-size: 18px; }
.gallery figcaption p { margin: 0; font-size: 15px; color: var(--text-2); }
.credit { font-size: 11px; color: var(--muted); margin-top: 8px !important; }

/* shop */
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--gold); color: #000; }
.product { display: flex; flex-direction: column; }
.product .pimg { height: 190px; margin: -24px -24px 18px; background: radial-gradient(ellipse at 50% 120%, rgba(235,189,120,.16), transparent 60%), #05070c; border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.product .pimg svg { height: 150px; width: auto; }
.product .price { color: var(--gold); font-weight: 600; margin: 8px 0 4px; }
.product ul { margin: 10px 0 18px; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.product .btn { margin-top: auto; }
.level-head { display: flex; align-items: baseline; gap: 14px; margin: 44px 0 16px; flex-wrap: wrap; }
.level-head h2 { margin: 0; }
.disclosure { font-size: 12px; color: var(--muted); margin-top: 30px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translateX(-50%) translateY(20px); z-index: 200; background: rgba(10,12,20,.96); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 861px) { #toast { bottom: 28px; } }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 34px 0 40px; color: var(--muted); font-size: 13px; position: relative; z-index: 1; }
.footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.locked-note { text-align: center; padding: 70px 20px; }
.locked-note .ring-lock { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 22px; border: 1px solid rgba(235,189,120,.4); display: grid; place-items: center; color: var(--gold); font-size: 28px; }

/* mobile overflow guards */
html, body { overflow-x: hidden; max-width: 100%; }
@media (max-width: 860px) {
  .topright .btn.ghost { display: none; }
  .topright .btn { padding: 7px 12px; font-size: 11px; }
  .eyebrow { letter-spacing: .26em; font-size: 10px; }
  .warp-logo { letter-spacing: .32em; padding-left: .32em; }
}
@media (max-width: 860px) {
  .hud .btn.sm { padding: 7px 11px; font-size: 11px; letter-spacing: .05em; }
  .hud.tl { gap: 6px; }
}

.hud .btn.gold { background: linear-gradient(135deg, #f3cf93, var(--gold) 45%, var(--gold-2)); color: #120c03; }
.hud .btn.gold.on { filter: brightness(1.25); color:#120c03; }

/* ===========================================================
   THE CLUB
   =========================================================== */
.nbadge { display: inline-block; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--gold); color: #120c02; font: 700 10.5px/17px var(--body); letter-spacing: 0; text-align: center; vertical-align: 2px; font-style: normal; }
.nbadge[hidden] { display: none; }
.tabbar a { position: relative; }
.tabbar .nbadge { position: absolute; top: 7px; left: 54%; margin: 0; }
@media (max-width: 380px) { .tabbar a { font-size: 9.5px; letter-spacing: .02em; } }

.club-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 18px; padding: 30px; background: radial-gradient(circle at 92% 50%, rgba(235,189,120,.16), transparent 50%), var(--panel); }
.club-band p { max-width: 640px; }
.club-band .btn { flex: none; }
@media (max-width: 700px) { .club-band { flex-direction: column; align-items: flex-start; padding: 22px; } }

.cl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.cl-main { min-width: 0; }
.cl-side { display: grid; gap: 14px; }
.cl-sidecard { padding: 18px; }
.cl-sidecard .eyebrow { margin-bottom: 12px; }
.cl-upcoming-m { display: none; }
@media (max-width: 960px) {
  .cl-wrap { grid-template-columns: minmax(0, 1fr); }
  .cl-side { display: none; }
  .cl-upcoming-m { display: block; padding: 0; margin: 0 0 14px; }
  .cl-upcoming-m summary { padding: 14px 16px; cursor: pointer; color: var(--gold); font-weight: 600; font-size: 14px; list-style: none; }
  .cl-upcoming-m summary::-webkit-details-marker { display: none; }
  .cl-upcoming-m[open] summary { border-bottom: 1px solid var(--line); }
  .cl-upcoming-m .cl-ev { padding: 12px 16px; }
}

.cl-av { flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; text-decoration: none; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.cl-badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.cl-badge.l1 { color: var(--ice); border-color: rgba(156,200,255,.35); }
.cl-badge.l2 { color: #c7a6ff; border-color: rgba(199,166,255,.4); }
.cl-badge.l3 { color: #120c02; background: linear-gradient(90deg, var(--gold), #fff0d2); border-color: transparent; }
.cl-badge.staff { color: var(--gold); border-color: rgba(235,189,120,.5); }

.cl-chans { display: flex; gap: 8px; overflow-x: auto; margin: 18px -20px 16px; padding: 2px 20px 6px; scrollbar-width: none; }
.cl-chans::-webkit-scrollbar { display: none; }
.cl-chan { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13.5px; font-weight: 600; text-decoration: none; background: rgba(255,255,255,.02); }
.cl-chan:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.cl-chan.on { color: #120c02; background: var(--gold); border-color: var(--gold); }

.cl-compose { padding: 16px; margin-bottom: 16px; }
.cl-ta { width: 100%; min-height: 84px; resize: vertical; font: inherit; line-height: 1.5; }
.cl-prev { position: relative; align-items: center; gap: 10px; margin-top: 10px; }
.cl-prev img { max-height: 120px; max-width: 200px; border-radius: 10px; border: 1px solid var(--line); }
.cl-x { border: 0; background: rgba(0,0,0,.6); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.cl-prev .cl-x { position: absolute; top: -8px; left: 190px; }
.cl-ref .chip .cl-x { width: 18px; height: 18px; font-size: 13px; background: rgba(255,255,255,.08); }

.cl-feed { display: grid; gap: 14px; }
.cl-post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cl-post.pinned { border-color: rgba(235,189,120,.4); box-shadow: 0 0 0 1px rgba(235,189,120,.12), 0 10px 40px -20px var(--gold-glow); }
.cl-post.hidden-post { opacity: .6; border-style: dashed; }
.cl-head { display: flex; gap: 12px; align-items: flex-start; }
.cl-who { flex: 1; min-width: 0; line-height: 1.35; }
.cl-who .small a { text-decoration: none; }
.cl-name { color: #fff; font-weight: 700; text-decoration: none; }
.cl-name:hover { text-decoration: underline; }
.cl-menu { position: relative; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 8px; cursor: pointer; }
.cl-menu:hover { color: #fff; background: rgba(255,255,255,.06); }
.cl-pop { position: absolute; right: 0; top: 30px; z-index: 30; min-width: 170px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.cl-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: 500 14px var(--body); padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.cl-pop button:hover { background: rgba(255,255,255,.06); }
.cl-ref { margin: 10px 0 0; }
.cl-ref .chip { text-decoration: none; }
.cl-body { margin-top: 10px; color: var(--text); font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; }
.cl-body.clamp { display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.cl-body a { color: var(--ice); }
.cl-img { display: block; width: 100%; margin: 12px 0 0; padding: 0; border: 0; background: #000; border-radius: 14px; overflow: hidden; cursor: zoom-in; }
.cl-img img { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.cl-actions { display: flex; gap: 4px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 4px; }
.cl-act { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: 600 14px var(--body); padding: 9px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; min-height: 40px; }
.cl-act:hover { color: #fff; background: rgba(255,255,255,.05); }
.cl-act.on { color: var(--gold); }
.cl-act.pop { animation: clpop .35s ease; }
@keyframes clpop { 40% { transform: scale(1.25); } }
.cl-act:last-child { margin-left: auto; }
@media (max-width: 480px) { .cl-act-label { display: none; } .cl-post { padding: 14px 14px 6px; border-radius: 18px; } .cl-chans { margin-left: -20px; } }

.cl-ev { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cl-ev:first-of-type { border-top: 0; }
.cl-ev-date { flex: none; width: 46px; text-align: center; border: 1px solid rgba(235,189,120,.3); border-radius: 10px; padding: 5px 0; color: var(--gold); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2; }
.cl-ev-date b { display: block; font-size: 18px; color: #fff; letter-spacing: 0; }
.cl-ev-title { font-weight: 600; font-size: 14.5px; color: #fff; }
.cl-ev a { text-decoration: none; }

.cl-comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.cl-comment:first-child { border-top: 0; }
.cl-cbody { flex: 1; min-width: 0; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.cl-cbody .cl-badge { font-size: 9.5px; }
.cl-link { border: 0; background: none; color: var(--muted); font: 600 12.5px var(--body); padding: 4px 0; cursor: pointer; }
.cl-link:hover { color: #fff; }

.cl-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.94); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.cl-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.cl-lightbox button { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(0,0,0,.6); color: #fff; font-size: 24px; cursor: pointer; }

.cl-dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #120c02; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; margin-left: 4px; }
.cl-actrow { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; color: var(--text); text-decoration: none; }
.cl-actrow:hover { background: rgba(255,255,255,.04); }
.cl-actrow.unread { background: rgba(235,189,120,.07); }
.cl-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-profile .stats { margin-bottom: 0; }
@media (max-width: 520px) { .cl-profile .stats { grid-template-columns: repeat(2, 1fr) !important; } }
.lesson-club { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 34px; padding: 18px 20px; }
@media (max-width: 640px) { .lesson-club { flex-direction: column; align-items: flex-start; } }
@media (max-width: 560px) {
  .cl-compose { padding: 12px; }
  .cl-compose > .row > .cl-av { display: none; }
  .cl-compose .row[style*="space-between"] { flex-wrap: nowrap; gap: 8px; }
  .cl-compose .row[style*="space-between"] > .row { flex: 1; min-width: 0; flex-wrap: nowrap; }
  .cl-compose #c-ch { flex: 1; min-width: 0; }
  .cl-compose .btn.sm { padding-left: 12px; padding-right: 12px; }
}
#cm-body { flex: 1; min-width: 0; }
