/* =============================================================
   Shaste Hub, enhanced design
   Base palette lifted from shastes.com, pushed cleaner + gamified
   ============================================================= */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg:        #0a0b11;
  --bg-soft:   #0f121a;
  --surface:   #141824;
  --surface-2: #191e2c;
  --hairline:  rgba(255,255,255,0.06);
  --hairline-2:rgba(255,255,255,0.10);
  --line:      rgba(255,255,255,0.08);

  /* Text */
  --text:     #f5f6fa;
  --muted:    #aeb4c2;
  --subtle:   #7a8096;
  --faint:    #545a6b;

  /* Brand accents */
  --pink:       #e84393;
  --pink-hot:   #ff5ca9;
  --pink-soft:  rgba(232,67,147,0.14);
  --pink-line:  rgba(232,67,147,0.35);

  /* Gamification tones (oklch, harmonized) */
  --xp:        oklch(0.80 0.15 90);     /* warm gold for XP */
  --xp-soft:   oklch(0.80 0.15 90 / 0.16);
  --coin:      oklch(0.84 0.14 75);     /* shaste-coin amber */
  --coin-soft: oklch(0.84 0.14 75 / 0.16);
  --info:      oklch(0.78 0.12 210);    /* cyan for levels */
  --info-soft: oklch(0.78 0.12 210 / 0.16);
  --good:      oklch(0.75 0.14 160);
  --good-soft: oklch(0.75 0.14 160 / 0.15);
  --rare:      oklch(0.72 0.18 290);    /* purple rarity */

  /* Sizing */
  --nav-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ AESTHETIC MODES =============================== */
body[data-aesthetic="refined"] {
  --pink: #e84393; --pink-hot: #ff5ca9;
  --bg: #0a0b11;
}
body[data-aesthetic="evolved"] {
  --pink: #e84393; --pink-hot: #ff5ca9;
  --bg: #0a0b11;
  --bg-soft: #0f121a;
}
body[data-aesthetic="editorial"] {
  --pink: #d93d87; --pink-hot: #ff5ca9;
  --bg: #08090e;
  --bg-soft: #0c0d14;
  --surface: #10131c;
  --surface-2: #141823;
}

/* ============ LAYOUT SHELL ================================== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}
.app-shell::before {
  /* subtle top ambient glow in pink */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(232,67,147,0.12), transparent 60%),
    radial-gradient(900px 600px at 0% -20%, rgba(139,95,191,0.08), transparent 70%);
  z-index: 0;
}
body[data-show-glow="false"] .app-shell::before { display: none; }

.page {
  flex: 1;
  position: relative;
  z-index: 1;
  padding-top: calc(var(--nav-h) + 18px);
}
.page--sidebar { padding-left: 232px; padding-top: 24px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ NAV, TOP HUD ================================ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 50;
  background: rgba(10,11,17, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.topnav__inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 13px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand__dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
}
.navlinks {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.navlink {
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color .15s, background .15s;
  position: relative;
}
.navlink:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.navlink--active { color: var(--text); }
.navlink--active::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--pink);
  border-radius: 2px;
}

/* HUD chips */
.hud {
  display: flex; align-items: center; gap: 10px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--hairline);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.chip__icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.chip--coin { border-color: var(--coin-soft); background: var(--coin-soft); color: oklch(0.94 0.09 80); }
.chip--xp   { border-color: var(--xp-soft);   background: var(--xp-soft);   color: oklch(0.94 0.09 85); padding-right: 6px; }
.chip__num { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

.xpchip { display: inline-flex; align-items: center; gap: 10px; }
.xpchip__lvl {
  background: var(--info-soft);
  color: oklch(0.92 0.08 210);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.xpchip__bar {
  width: 72px; height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.xpchip__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--xp), oklch(0.88 0.15 60));
  border-radius: inherit;
  position: relative;
}
.xpchip__fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: sheen 2.6s ease-in-out infinite;
}
@keyframes sheen {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(220%); }
}

.avatar-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--pink-hot));
  color: white;
  font-weight: 700;
  font-size: 13px;
  border: 0;
  box-shadow: 0 6px 20px -8px var(--pink);
}
.avatar-btn__av {
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: var(--pink);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
}
.avatar-btn--guest {
  background: var(--pink);
  padding: 0 18px; height: 36px;
  font-size: 13px;
}
.supporter-ring {
  position: relative;
  padding: 2px;
  border-radius: 999px;
  background: conic-gradient(var(--coin), var(--pink), var(--rare), var(--coin));
}
.supporter-ring > .avatar-btn { padding-right: 14px; }

/* ============ NAV, AUX (static pages) HAMBURGER =========== */
/* React hub uses SideNav on mobile; static aux pages use a hamburger
   menu instead, so these rules apply only to .aux-topnav. */
.aux-topnav .hamburger {
  display: none;
  width: 36px; height: 32px;
  margin-left: 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.aux-topnav .hamburger span {
  display: block;
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s, top .2s;
}
.aux-topnav .hamburger span:nth-child(1) { top: 10px; }
.aux-topnav .hamburger span:nth-child(2) { top: 15px; }
.aux-topnav .hamburger span:nth-child(3) { top: 20px; }
.aux-topnav .hamburger.active span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.aux-topnav .hamburger.active span:nth-child(2) { opacity: 0; }
.aux-topnav .hamburger.active span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .aux-topnav .hamburger { display: block; }
  .aux-topnav .navlinks {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 20px 18px;
    background: rgba(10,11,17, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--hairline);
    overflow-y: auto;
    z-index: 40;
  }
  .aux-topnav .navlinks.navlinks--open { display: flex; }
  .aux-topnav .navlinks .navlink {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
    text-align: left;
  }
  .aux-topnav .navlinks .navlink--active {
    background: rgba(255,255,255,0.05);
  }
  .aux-topnav .navlinks .navlink--active::after { display: none; }
}

/* Aux pages: give content a top offset so it clears the fixed topnav */
.aux-topnav ~ main,
.aux-topnav + main,
body:has(.aux-topnav) main { padding-top: calc(var(--nav-h) + 24px); }

/* ============ NAV, SIDEBAR ================================ */
.sidenav {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: 216px;
  padding: 20px 14px;
  background: var(--bg-soft);
  border-right: 1px solid var(--hairline);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidenav .brand { margin: 6px 8px 4px; }
.sidenav__group { display: flex; flex-direction: column; gap: 2px; }
.sidenav__label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--faint); padding: 8px 12px 4px; text-transform: uppercase;
}
.sidenav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 10px;
}
.sidenav__item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidenav__item--active {
  background: var(--pink-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--pink-line);
}
.sidenav__item svg { width: 16px; height: 16px; opacity: 0.9; }
.sidenav__footer { margin-top: auto; }

/* ============ BUTTONS ======================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  border: 0;
  transition: transform .08s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: linear-gradient(90deg, var(--pink), var(--pink-hot));
  color: white;
  box-shadow: 0 10px 28px -10px var(--pink);
}
.btn--primary:hover { box-shadow: 0 14px 32px -8px var(--pink); }
.btn--ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hairline-2);
}
.btn--ghost:hover { background: rgba(255,255,255,0.07); }
.btn--lg { height: 48px; padding: 0 22px; font-size: 14.5px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn--full { width: 100%; }

/* ============ CARDS ========================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card--flush { padding: 0; overflow: hidden; }
.card--quiet { background: transparent; border-color: var(--hairline); }
.card h3, .card h4 { margin: 0; }

/* ============ TYPE ========================================= */
h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.01em; }
.h-display {
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 0.98;
  margin: 0;
}
.h-section {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
}
.h-section .dim { color: var(--subtle); font-weight: 600; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--subtle);
  text-transform: uppercase;
}
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }
.tabular { font-variant-numeric: tabular-nums; }

/* ============ HERO STRIP (hub home) ======================== */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  margin-top: 10px;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

.hero__featured {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 360px;
  background: #111;
  isolation: isolate;
}
.hero__featured img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.1);
}
.hero__featured::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,11,17,0.15) 0%, rgba(10,11,17,0.55) 55%, rgba(10,11,17,0.94) 100%);
}
.hero__body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px 30px;
  z-index: 2;
}
.hero__tags {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  padding: 5px 10px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  text-transform: uppercase;
  color: #fff;
}
.tag--featured { background: var(--pink); border-color: transparent; }
.tag--new { background: var(--info-soft); color: oklch(0.92 0.08 210); border-color: var(--info-soft); }
.tag--coin { background: var(--coin-soft); color: oklch(0.94 0.09 80); border-color: transparent; }

.hero__title {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
.hero__blurb {
  color: rgba(255,255,255,0.82);
  max-width: 520px;
  font-size: 15px;
  margin: 0 0 20px;
}
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Side rail: quest + pitch */
.hero__rail { display: flex; flex-direction: column; gap: 16px; }

/* ============ QUEST CARD ==================================== */
.quest {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px;
  background:
    radial-gradient(340px 180px at 100% 0%, var(--coin-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.quest__eye {
  color: oklch(0.94 0.09 80);
  font-size: 11px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.quest__ttl {
  font-size: 20px; font-weight: 800; margin: 6px 0 10px;
  letter-spacing: -0.01em;
}
.quest__body { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.quest__progress {
  height: 8px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; margin-bottom: 14px;
}
.quest__fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--coin), oklch(0.88 0.15 60));
}
.quest__meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--subtle);
}
.quest__reward {
  display: inline-flex; align-items: center; gap: 6px;
  color: oklch(0.94 0.09 80); font-weight: 700;
}

/* ============ UPSELL CARDS ================================== */
.upsell {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center;
}
.upsell__ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--pink-soft); color: var(--pink);
}
.upsell__ttl { font-size: 14.5px; font-weight: 700; margin: 0 0 2px; }
.upsell__sub { color: var(--muted); font-size: 13px; margin: 0; }

.upsell--patreon { background: linear-gradient(180deg, rgba(255,88,66,0.10), transparent 80%), var(--surface); border-color: rgba(255,120,95,0.18); }
.upsell--patreon .upsell__ic { background: rgba(255,88,66,0.14); color: #ff7a5c; }
.upsell--referral { background: linear-gradient(180deg, var(--coin-soft), transparent 80%), var(--surface); border-color: var(--coin-soft); }
.upsell--referral .upsell__ic { background: var(--coin-soft); color: oklch(0.92 0.12 85); }
.upsell--follow { background: linear-gradient(180deg, var(--info-soft), transparent 80%), var(--surface); border-color: var(--info-soft); }
.upsell--follow .upsell__ic { background: var(--info-soft); color: oklch(0.92 0.09 210); }

/* ============ SECTION HEADERS =============================== */
.section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 48px 0 18px;
}
.section__ttl {
  font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.01em;
}
.section__ttl .collection { color: var(--subtle); font-weight: 500; margin-left: 8px; font-size: 16px; }
.section__more { font-size: 13px; color: var(--subtle); font-weight: 500; }
.section__more:hover { color: var(--text); }

/* ============ GAME CARD ==================================== */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.gcard {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: transform .18s ease, box-shadow .22s ease, border-color .15s;
  isolation: isolate;
}
.gcard:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-2);
  box-shadow: 0 22px 44px -18px rgba(0,0,0,.6);
}
.gcard__art {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0e1119;
}
.gcard__art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gcard:hover .gcard__art img { transform: scale(1.035); }
.gcard__art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.65) 100%);
}
.gcard__ribbons {
  position: absolute; top: 10px; left: 10px; display: flex; gap: 6px;
  z-index: 2;
}
.gcard__ribbons .tag { font-size: 10px; padding: 4px 8px; }
.gcard__play {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 10px 26px -8px var(--pink);
  display: grid; place-items: center;
  color: white;
  z-index: 2;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.gcard:hover .gcard__play { opacity: 1; transform: translateY(0); }

.gcard__body {
  padding: 14px 16px 16px;
}
.gcard__ttl {
  font-size: 15.5px; font-weight: 700; margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.gcard__blurb {
  font-size: 13px; color: var(--muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.gcard__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 14px;
  font-size: 12px; color: var(--subtle);
}
.gcard__foot .progress {
  flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.07);
  margin: 0 10px;
  overflow: hidden;
}
.gcard__foot .progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-hot));
  border-radius: inherit;
}
.gcard__collection {
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--subtle);
}

/* ============ REFERRAL ====================================== */
.ref-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  margin-top: 18px;
}
@media (max-width: 960px) { .ref-grid { grid-template-columns: 1fr; } }

.ref-hero {
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(600px 260px at 0% 0%, var(--coin-soft), transparent 60%),
    radial-gradient(400px 260px at 100% 100%, var(--pink-soft), transparent 60%),
    var(--surface);
  border: 1px solid var(--hairline);
  position: relative;
  overflow: hidden;
}
.ref-hero__title { font-size: 34px; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 8px; }
.ref-hero__lede  { color: var(--muted); margin: 0 0 22px; max-width: 540px; }

.ref-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  margin-bottom: 22px;
}
.ref-link input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  padding: 10px 14px;
  font-size: 13px;
}
.ref-link input:focus { outline: none; }

.ref-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline);
}
.stat__lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--subtle); text-transform: uppercase; }
.stat__num { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: 11px; color: var(--subtle); margin-top: 4px; }

/* Referral ring, progress to next tier */
.ref-ring-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.ref-ring {
  position: relative;
  width: 200px; height: 200px;
}
.ref-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ref-ring__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ref-ring__num {
  font-size: 48px; font-weight: 900; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.ref-ring__lbl {
  font-size: 10px; font-weight: 800; color: var(--subtle);
  letter-spacing: 0.2em; text-transform: uppercase;
}

/* Tier table */
.tier-table { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.tier-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 10px;
  transition: background .15s;
}
.tier-row:hover { background: rgba(255,255,255,0.025); }
.tier-row + .tier-row { border-top: 1px solid var(--hairline); }
.tier-row__icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2);
  font-size: 18px; font-weight: 900;
}
.tier-row__body h4 { font-size: 14.5px; margin: 0 0 2px; font-weight: 700; }
.tier-row__body p  { font-size: 12.5px; color: var(--subtle); margin: 0; }
.tier-row__reward {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.tier-row__reward .good { color: oklch(0.86 0.14 150); }
.tier-row__reward .coin { color: oklch(0.90 0.13 80); }

.tier-row--locked { opacity: 0.55; }
.tier-row--done .tier-row__icon { background: var(--good-soft); color: oklch(0.86 0.14 150); }
.tier-row--active .tier-row__icon { background: var(--pink-soft); color: var(--pink-hot); box-shadow: inset 0 0 0 1px var(--pink-line); }

/* ============ PROFILE ======================================= */
.profile-head {
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
}
.profile-head__av {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(145deg, oklch(0.75 0.13 260), oklch(0.65 0.14 320));
  color: white;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 900;
}
.profile-head__av--ring {
  padding: 3px;
  background: conic-gradient(from 90deg, var(--coin), var(--pink), var(--rare), var(--info), var(--coin));
}
.profile-head__av--ring > span {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(145deg, oklch(0.75 0.13 260), oklch(0.65 0.14 320));
  display: grid; place-items: center;
}
.profile-head__name { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.profile-head__xprow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.profile-head__bar {
  flex: 1; max-width: 420px;
  height: 10px; border-radius: 99px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.profile-head__bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--xp), oklch(0.88 0.15 60));
  border-radius: inherit;
}
.profile-head__meta {
  display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  color: var(--muted);
}
.pill--follower { background: var(--info-soft); color: oklch(0.92 0.09 210); border-color: var(--info-soft); }
.pill--nonfollower { background: rgba(255,255,255,0.03); color: var(--subtle); }
.pill--supporter-bronze { background: rgba(205,127,50,0.15); color: oklch(0.85 0.11 60); border-color: rgba(205,127,50,0.3); }
.pill--supporter-silver { background: rgba(192,192,192,0.15); color: oklch(0.90 0.02 260); border-color: rgba(192,192,192,0.3); }
.pill--supporter-gold   { background: var(--coin-soft); color: oklch(0.94 0.12 85); border-color: var(--coin-soft); }

.tabs {
  display: inline-flex;
  padding: 5px;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  margin: 22px 0;
}
.tab {
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
  background: transparent; border: 0;
  transition: background .15s, color .15s;
}
.tab--active {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 4px 14px -6px var(--pink);
}
.tab:not(.tab--active):hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* Perks list */
.perk {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.perk + .perk { margin-top: 8px; }
.perk__ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--muted);
}
.perk--unlocked .perk__ic { background: var(--good-soft); color: oklch(0.88 0.14 155); }
.perk--unlocked .perk__ttl::after {
  content: "UNLOCKED"; margin-left: 10px;
  font-size: 10px; color: oklch(0.88 0.14 155); font-weight: 800; letter-spacing: 0.15em;
}
.perk__ttl { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.perk__sub { color: var(--subtle); font-size: 12.5px; margin: 0; }
.perk__req { font-size: 11px; color: var(--subtle); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* ============ REWARDS / ACHIEVEMENTS ======================== */
.ach-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.ach-stat {
  padding: 22px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  text-align: center;
}
.ach-stat__num {
  font-size: 36px; font-weight: 900; font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.ach-stat__num--coin { color: oklch(0.90 0.13 80); }
.ach-stat__num--unlock { color: oklch(0.84 0.14 155); }
.ach-stat__num--rare { color: oklch(0.75 0.15 290); }
.ach-stat__lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--subtle); margin-top: 8px; }

.ach-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  align-items: center;
}
.ach-row + .ach-row { margin-top: 8px; }
.ach-row__name { font-weight: 700; font-size: 14.5px; margin: 0 0 8px; }
.ach-row__bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.ach-row__fill { height: 100%; background: linear-gradient(90deg, var(--xp), oklch(0.88 0.15 60)); border-radius: inherit; }
.ach-row__meta { text-align: right; font-size: 12px; color: var(--subtle); }
.ach-row__coin { color: oklch(0.90 0.13 80); font-weight: 700; font-variant-numeric: tabular-nums; }
.ach-row__count { font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", monospace; }

/* ============ FOOTER ======================================== */
.foot {
  margin-top: 80px;
  padding: 30px 0 40px;
  border-top: 1px solid var(--hairline);
  color: var(--subtle);
  font-size: 12.5px;
  position: relative; z-index: 1;
}
.foot__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot__row a { color: var(--muted); margin: 0 10px; }
.foot__row a:hover { color: var(--text); }

/* ============ TWEAKS PANEL ================================== */
.tweaks {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 100;
  width: 300px;
  max-height: 78vh;
  overflow: auto;
  background: rgba(18,20,28,0.94);
  backdrop-filter: blur(18px);
  border: 1px solid var(--hairline-2);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  color: var(--text);
  font-size: 13px;
}
.tweaks__h {
  font-size: 12px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.tweaks__grp { margin-bottom: 14px; }
.tweaks__lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--subtle); text-transform: uppercase; margin-bottom: 6px; }
.tweaks__opts { display: flex; flex-wrap: wrap; gap: 4px; }
.tweaks__opt {
  flex: 1 1 auto;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}
.tweaks__opt--active { background: var(--pink); color: #fff; border-color: transparent; }
.tweaks__opt:hover:not(.tweaks__opt--active) { color: var(--text); background: rgba(255,255,255,0.07); }

/* ============ UTILITIES ===================================== */
.hbar { height: 1px; background: var(--hairline); margin: 28px 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.fade-in { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }

.coin-ic {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(0.95 0.1 85), oklch(0.72 0.16 55) 75%);
  box-shadow: inset -1px -1px 2px oklch(0.55 0.15 40);
  flex: none;
  display: inline-block;
}
.coin-ic--lg { width: 22px; height: 22px; }

/* Placeholder art fallback stripe */
.gcard__art.placeholder {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #1a1d28, #0e1119);
  display: grid; place-items: center;
}
.gcard__art.placeholder span {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--subtle);
  letter-spacing: 0.1em;
}

/* ============ MOBILE RESPONSIVE OVERRIDES ==================== */
@media (max-width: 720px) {
  .page--sidebar { padding-left: 0; padding-top: calc(var(--nav-h) + 6px); }
  .sidenav {
    left: 0; right: 0; top: 0; bottom: auto;
    width: auto; height: var(--nav-h);
    flex-direction: row;
    padding: 0 12px;
    gap: 0;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    background: rgba(10,11,17, 0.85);
    backdrop-filter: blur(14px);
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav .brand { margin: 0 10px 0 4px; flex: 0 0 auto; white-space: nowrap; }
  .sidenav__group { flex-direction: row; flex: 0 0 auto; gap: 4px; }
  .sidenav__label { display: none; }
  .sidenav__item { padding: 8px 10px; font-size: 12.5px; flex: 0 0 auto; white-space: nowrap; }
  .sidenav__footer { margin-top: 0; margin-left: auto; flex: 0 0 auto; padding-left: 8px; }
  .sidenav__footer .btn { height: 34px; padding: 0 12px; font-size: 12px; }
  .sidenav__footer .upsell { padding: 6px 10px !important; grid-template-columns: 24px 1fr !important; gap: 8px; }
  .sidenav__footer .upsell__ic { width: 24px !important; height: 24px !important; }

  .container { padding: 0 16px; }
  .hero { grid-template-columns: 1fr; }
  .hero__featured { min-height: 260px; }
  .hero__body { padding: 18px 20px; }
  .hero__actions .btn { flex: 1 1 140px; }
  .ref-grid, .profile-head {
    grid-template-columns: 1fr !important;
  }
  .profile-head { text-align: center; }
  .profile-head__av { margin: 0 auto; }
  .profile-head__name { justify-content: center; }
  .profile-head__xprow { justify-content: center; }
  .profile-head__meta { justify-content: center; }
  .section { margin: 28px 0 14px; }

  .topnav__inner { padding: 0 14px; gap: 12px; }
  .navlinks { display: none; }
  .hud { margin-left: auto; padding-left: 0; border-left: 0; gap: 8px; }
  .chip { height: 30px; padding: 0 10px; font-size: 12px; }
  .xpchip__bar { width: 48px; }
  .avatar-btn { height: 34px; font-size: 12px; padding: 3px 10px 3px 3px; }
  .avatar-btn__av { width: 26px; height: 26px; font-size: 12px; }
  .avatar-btn--guest { height: 32px; padding: 0 14px; font-size: 12px; }
  .ach-head { grid-template-columns: 1fr 1fr 1fr; }
  .ach-stat { padding: 14px 10px; }
  .ach-stat__num { font-size: 28px; }
  .tier-row { grid-template-columns: 40px 1fr; }
  .tier-row__reward { grid-column: 1 / -1; align-items: flex-start; padding-top: 4px; }
  .foot__row { flex-direction: column; gap: 10px; }
  .h-display { font-size: clamp(28px, 7vw, 38px) !important; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .gcard__ttl { font-size: 14px; }
  .gcard__blurb { font-size: 12px; }
}

/* Tablet intermediate */
@media (min-width: 721px) and (max-width: 960px) {
  .page--sidebar { padding-left: 216px; }
  .hero { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: 1fr; }
}

/* Sidebar footer upsell scaling (desktop default) */
.sidenav__footer .upsell { padding: 12px; grid-template-columns: 32px 1fr; }
.sidenav__footer .upsell__ic { width: 32px; height: 32px; }

/* Progress helper, thin filled bar for shelf cards */
.progress {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-hot));
  border-radius: inherit;
}

/* Focus states */
.btn:focus-visible, .tab:focus-visible, .navlink:focus-visible, .sidenav__item:focus-visible {
  outline: 2px solid var(--pink-hot);
  outline-offset: 2px;
}

/* Evolved aesthetic refinement, stronger glow, cleaner contrast */
body[data-aesthetic="evolved"] .app-shell::before {
  background:
    radial-gradient(1200px 600px at 85% -8%, rgba(232,67,147,0.16), transparent 60%),
    radial-gradient(900px 700px at 0% -15%, rgba(139,95,191,0.12), transparent 70%),
    radial-gradient(700px 500px at 50% 110%, rgba(74,176,196,0.06), transparent 65%);
}
body[data-aesthetic="evolved"] .gcard {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
}
body[data-aesthetic="evolved"] .card,
body[data-aesthetic="evolved"] .quest {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(20,24,36,0.65) 100%);
}

/* Supporter tier rings on avatar */
.profile-head__av--ring-bronze { background: conic-gradient(from 90deg, oklch(0.85 0.11 60), oklch(0.70 0.13 35), oklch(0.85 0.11 60)) !important; }
.profile-head__av--ring-silver { background: conic-gradient(from 90deg, oklch(0.92 0.02 260), oklch(0.75 0.02 260), oklch(0.92 0.02 260)) !important; }

/* Small utility, row gap */
.row-gap { gap: 10px; }
