/* ═══════════════════════════════════════════════════════════════════
   Wobbly Spirit — bodybalance.tech portal design system
   Shared by every page of the Netlify deployment. Matches the in-game
   palette (cyan / violet / pink / gold on deep night) and Fredoka type.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #070814;
  --bg-2: #0c0e24;
  --surface: rgba(20, 23, 54, 0.62);
  --surface-2: rgba(28, 32, 72, 0.72);
  --stroke: rgba(170, 195, 255, 0.14);
  --stroke-hi: rgba(94, 231, 255, 0.45);
  --text: #eef2ff;
  --muted: #a9b3d6;
  --dim: #7a84a8;
  --cyan: #5ee7ff;
  --violet: #8b7bff;
  --pink: #ff7ac6;
  --gold: #ffd166;
  --mint: #6dffc1;
  --grad: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--pink));
  --grad-warm: linear-gradient(120deg, var(--gold), var(--pink));
  --font-head: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --shadow: 0 1.25rem 3.5rem rgba(0, 0, 0, 0.55);
  --max: 1200px;
  --header-h: 4.25rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated cosmic backdrop ─────────────────────────────────────── */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(139, 123, 255, 0.22), transparent 60%),
    radial-gradient(50rem 35rem at -10% 20%, rgba(94, 231, 255, 0.14), transparent 60%),
    radial-gradient(45rem 30rem at 50% 110%, rgba(255, 122, 198, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.sky::before, .sky::after {
  content: ''; position: absolute; inset: -50%;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, rgba(94,231,255,.9), transparent),
    radial-gradient(1px 1px at 60px 200px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 260px 40px, rgba(255,209,102,.8), transparent);
  background-size: 300px 240px;
  animation: drift 120s linear infinite;
  opacity: .55;
}
.sky::after { background-size: 460px 380px; animation-duration: 200s; opacity: .35; }
@keyframes drift { to { transform: translate3d(-300px, -240px, 0); } }

a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 200;
  background: var(--cyan); color: #00121a; padding: .5rem 1rem; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { left: .5rem; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ── Header ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(7, 8, 20, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--stroke);
}
.header-inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark {
  width: 2.1rem; height: 2.1rem; border-radius: .65rem; display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 0 1.2rem rgba(94, 231, 255, .45);
  animation: bob 3.2s ease-in-out infinite;
}
.brand-mark svg { width: 1.2rem; height: 1.2rem; }
@keyframes bob { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-2px); } }
.brand-text span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav { display: flex; align-items: center; gap: .25rem; list-style: none; }
.nav a {
  display: inline-block; padding: .45rem .85rem; border-radius: 999px;
  color: var(--muted); font-weight: 500; font-size: .95rem;
  transition: color .2s, background .2s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a[aria-current="page"] { color: #fff; background: rgba(94, 231, 255, .12); }

.nav-toggle {
  display: none; width: 2.6rem; height: 2.6rem; border-radius: .75rem;
  background: rgba(255,255,255,.06); border: 1px solid var(--stroke); color: #fff; cursor: pointer;
  place-items: center;
}
.nav-toggle svg { width: 1.3rem; height: 1.3rem; }

@media (max-width: 880px) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .25rem;
    padding: .75rem 1rem 1.25rem;
    background: rgba(7, 8, 20, .96); border-bottom: 1px solid var(--stroke);
    transform: translateY(-.5rem); opacity: 0; visibility: hidden;
    transition: transform .25s, opacity .25s, visibility .25s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: .75rem 1rem; font-size: 1.05rem; }
  .nav .btn { justify-content: center; margin-top: .5rem; }
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06); color: #fff !important;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .18s, box-shadow .25s, background .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--stroke-hi); background: rgba(94,231,255,.1); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary {
  background: var(--grad); border-color: transparent;
  box-shadow: 0 .5rem 1.5rem rgba(139, 123, 255, .4);
}
.btn-primary:hover { background: var(--grad); box-shadow: 0 .75rem 2rem rgba(94, 231, 255, .45); }
.btn-sm { padding: .45rem 1rem; font-size: .9rem; }
.nav .btn-primary { padding: .5rem 1.15rem; }

/* ── Layout ───────────────────────────────────────────────────────── */
main { flex: 1; width: 100%; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 860px; }
.section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: .85rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cyan);
}
.eyebrow::before { content: ''; width: 1.5rem; height: 2px; border-radius: 2px; background: var(--grad); }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: #fff; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .75rem; }
h3 { font-size: 1.3rem; margin-bottom: .4rem; }
p { color: var(--muted); }
p + p { margin-top: .9rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.warm-text { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.section-head { margin-bottom: 2rem; }
.section-head p { max-width: 44rem; margin-top: .5rem; }
.center { text-align: center; }
.center .section-head p, .section-head.center p { margin-left: auto; margin-right: auto; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { padding: 2.5rem 0 1.5rem; }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-top h1 { margin: .5rem 0 .4rem; }
.hero-tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: rgba(255,255,255,.05); border: 1px solid var(--stroke); color: var(--muted);
}
.tag b { color: #fff; font-weight: 600; }
.rating { color: var(--gold); letter-spacing: .1em; }

/* ── Game stage ───────────────────────────────────────────────────── */
.stage-wrap { position: relative; }
.stage-wrap::before {
  content: ''; position: absolute; inset: -2px; border-radius: calc(var(--radius) + 2px);
  background: var(--grad); opacity: .55; filter: blur(18px); z-index: -1;
  animation: glow 6s ease-in-out infinite;
}
@keyframes glow { 0%,100% { opacity: .35; } 50% { opacity: .65; } }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh;
  background: #000; border: 1px solid var(--stroke); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.stage:fullscreen { max-height: none; border-radius: 0; border: 0; }

.stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 1.1rem; background: var(--surface-2);
  border: 1px solid var(--stroke); border-radius: 0 0 var(--radius) var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .92rem; color: var(--muted);
}
.controls { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
kbd, .key {
  display: inline-grid; place-items: center; min-width: 1.85rem; height: 1.85rem; padding: 0 .45rem;
  border-radius: .45rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-bottom-width: 3px; font-family: var(--font-head); font-size: .85rem; font-weight: 600; color: #fff;
}
.stage-actions { display: flex; gap: .5rem; }

/* ── Ad slots (AdSense) ───────────────────────────────────────────── */
.ad {
  position: relative; width: 100%; margin: 2rem auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100px; padding: 1.4rem .5rem .5rem;
  background: rgba(255,255,255,.02); border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  overflow: hidden;
}
.ad::before {
  content: 'Advertisement'; position: absolute; top: .35rem; left: 50%; transform: translateX(-50%);
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}
.ad-leaderboard { max-width: 970px; min-height: 120px; }
.ad-rect { min-height: 280px; margin: 0 0 1.5rem; }
.ad ins.adsbygoogle { display: block; width: 100%; }
.ad ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad.ad-off { display: none; }

/* ── Cards & grids ────────────────────────────────────────────────── */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--radius); padding: 1.75rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card-hover:hover { transform: translateY(-4px); border-color: var(--stroke-hi); box-shadow: 0 1rem 2.5rem rgba(0,0,0,.4), 0 0 1.5rem rgba(94,231,255,.1); }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.icon {
  width: 3rem; height: 3rem; border-radius: .9rem; display: grid; place-items: center; margin-bottom: 1rem;
  font-size: 1.4rem; background: rgba(94,231,255,.1); border: 1px solid rgba(94,231,255,.25);
}
.icon.v { background: rgba(139,123,255,.12); border-color: rgba(139,123,255,.3); }
.icon.p { background: rgba(255,122,198,.12); border-color: rgba(255,122,198,.3); }
.icon.g { background: rgba(255,209,102,.12); border-color: rgba(255,209,102,.3); }
.step-num {
  font-family: var(--font-head); font-weight: 700; font-size: 2.4rem; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .5rem;
}

.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.layout-side aside { position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 960px) { .layout-side { grid-template-columns: 1fr; } .layout-side aside { position: static; } }

/* ── Worlds ───────────────────────────────────────────────────────── */
.world { overflow: hidden; padding-top: 6.5rem; }
.world::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5.5rem;
  background: var(--w, var(--grad)); opacity: .9;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
  mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.world .w-lv {
  position: absolute; top: 1rem; right: 1rem; font-size: .78rem; font-weight: 600;
  padding: .2rem .6rem; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff;
}
.world .w-ico { position: absolute; top: 1rem; left: 1.4rem; font-size: 2rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.w1 { --w: linear-gradient(135deg, #ff9a6b, #ff7ac6); }
.w2 { --w: linear-gradient(135deg, #2b3a8f, #8b7bff); }
.w3 { --w: linear-gradient(135deg, #b14dff, #5ee7ff); }
.w4 { --w: linear-gradient(135deg, #ffd166, #ff9a3c); }

/* ── Spirits ──────────────────────────────────────────────────────── */
.spirits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.spirit { text-align: center; padding: 1.4rem 1rem; }
.spirit .orb {
  width: 3.6rem; height: 3.6rem; margin: 0 auto .85rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--c) 45%, transparent 72%);
  box-shadow: 0 0 1.6rem var(--c); animation: float 3.5s ease-in-out infinite;
}
.spirit:nth-child(2n) .orb { animation-delay: -1.2s; }
.spirit:nth-child(3n) .orb { animation-delay: -2.1s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.spirit b { font-family: var(--font-head); color: #fff; display: block; }
.spirit small { color: var(--dim); font-size: .85rem; }

/* ── Stats strip ──────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { text-align: center; padding: 1.25rem; }
.stat b { display: block; font-family: var(--font-head); font-size: 2.2rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .92rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ── FAQ ──────────────────────────────────────────────────────────── */
.faq { display: grid; gap: .75rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  transition: border-color .2s, background .2s;
}
.faq details[open] { border-color: var(--stroke-hi); background: var(--surface-2); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1.08rem; color: #fff;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--cyan); font-size: 1.4rem; line-height: 1; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 1.25rem 1.2rem; }

/* ── Prose (legal / articles) ─────────────────────────────────────── */
.page-hero { padding: 3.5rem 0 1.5rem; }
.page-hero h1 { margin: .6rem 0 .6rem; }
.prose { padding: 2.25rem; }
.prose h2 { font-size: 1.45rem; margin: 2.2rem 0 .7rem; padding-top: .25rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; color: var(--cyan); }
.prose p, .prose li { color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: .75rem 0 1rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--cyan); }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: rgba(94,231,255,.4); text-underline-offset: 3px; }
.meta { color: var(--dim); font-size: .92rem; }
.toc { padding: 1.4rem 1.5rem; }
.toc h3 { font-size: 1rem; margin-bottom: .6rem; color: #fff; }
.toc ol { padding-left: 1.2rem; display: grid; gap: .3rem; font-size: .95rem; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--cyan); }
.callout {
  padding: 1rem 1.2rem; border-radius: var(--radius-sm); margin: 1rem 0;
  background: rgba(94,231,255,.07); border: 1px solid rgba(94,231,255,.25); color: var(--text);
}
.callout.warm { background: rgba(255,209,102,.07); border-color: rgba(255,209,102,.3); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-family: var(--font-head); font-weight: 500; color: #fff; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.25); border: 1px solid var(--stroke); color: var(--text);
  font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(94,231,255,.15);
}
.hidden-field { position: absolute; left: -9999px; }
.form-ok { display: none; }
.form-ok.show { display: block; }

/* ── CTA band ─────────────────────────────────────────────────────── */
.cta {
  text-align: center; padding: 3rem 1.5rem; border-radius: calc(var(--radius) + .25rem);
  background:
    radial-gradient(30rem 15rem at 20% 0%, rgba(94,231,255,.2), transparent 70%),
    radial-gradient(30rem 15rem at 80% 100%, rgba(255,122,198,.2), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--stroke);
}
.cta p { margin: .5rem auto 1.5rem; max-width: 36rem; }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(4,5,13,.6), #04050d);
}
.footer-grid {
  max-width: var(--max); margin: 0 auto; padding: 3rem 1.25rem 2rem;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem;
}
.footer-grid h4 { font-size: .95rem; margin-bottom: .8rem; letter-spacing: .04em; }
.footer-grid ul { list-style: none; display: grid; gap: .45rem; }
.footer-grid a { color: var(--muted); font-size: .95rem; }
.footer-grid a:hover { color: var(--cyan); }
.footer-grid p { font-size: .95rem; margin-top: .75rem; max-width: 22rem; }
.footer-bottom {
  max-width: var(--max); margin: 0 auto; padding: 1.25rem; border-top: 1px solid var(--stroke);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--dim); font-size: .88rem;
}
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; text-align: left; }
.link-btn:hover { color: var(--cyan); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ── Cookie consent banner ────────────────────────────────────────── */
.consent {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 300;
  max-width: 34rem; margin-left: auto;
  padding: 1.25rem 1.35rem; border-radius: var(--radius);
  background: rgba(16, 18, 44, .96); border: 1px solid var(--stroke-hi);
  box-shadow: var(--shadow), 0 0 2rem rgba(94,231,255,.12);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: translateY(130%); opacity: 0; transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .3s;
}
.consent.show { transform: none; opacity: 1; }
.consent h3 { font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.consent p { font-size: .92rem; margin: .4rem 0 1rem; }
.consent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.consent-actions .btn { flex: 1; min-width: 8rem; }

/* ── Reveal on scroll ─────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
