/* =====================================================================
   Primal Apes · "Carved Circuit" theme
   Stone-age totem meets HUD. Colours come straight from the logo:
   amber (PRIMAL) and venom green (APES) on pitch black, bone for text.
   Loaded after primal.css on every page; it re-points the shared tokens
   and upgrades the shared components. Page-specific CSS keeps working.
   ===================================================================== */
/* Self-hosted fonts (SIL Open Font License). No third-party request, no layout shift. */
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap; src: url(../assets/fonts/oswald-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600; font-display: swap; src: url(../assets/fonts/oswald-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 700; font-display: swap; src: url(../assets/fonts/oswald-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 400; font-display: swap; src: url(../assets/fonts/outfit-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 500; font-display: swap; src: url(../assets/fonts/outfit-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 600; font-display: swap; src: url(../assets/fonts/outfit-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 700; font-display: swap; src: url(../assets/fonts/outfit-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../assets/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(../assets/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); }
:root {
  --pitch: #060807;
  --moss: #0d1411;
  --moss-2: #131c17;
  --amber: #f7b32b;
  --amber-hi: #ffd166;
  --venom: #9be31f;
  --bone: #efe6d2;
  --ember: #ff5a1f;

  /* legacy tokens used across primal.css / social.css / page styles */
  --gold: var(--amber);
  --gold-dim: #d8951a;
  --blood: var(--ember);
  --crimson: #8a2a0c;
  --bg: var(--pitch);
  --card: var(--moss);
  --elevated: var(--moss-2);
  --fg: var(--bone);
  --muted: #a9b3a5;
  --subtle: #6f7a6d;
  --line: rgb(239 230 210 / .09);
  --line-hi: rgb(247 179 43 / .35);

  --display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 26px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --edge: linear-gradient(135deg, rgb(247 179 43 / .55), rgb(239 230 210 / .06) 38%, rgb(239 230 210 / .04) 62%, rgb(155 227 31 / .45));
}

html { background: var(--pitch); color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgb(155 227 31 / .075), transparent 60%),
    radial-gradient(900px 600px at -6% 12%, rgb(247 179 43 / .08), transparent 62%),
    var(--pitch);
  background-attachment: fixed;
}
/* carved grid, very faint, fixed behind everything */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(rgb(239 230 210 / .028) 1px, transparent 1px),
    linear-gradient(90deg, rgb(239 230 210 / .028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 85%);
}
::selection { background: var(--venom); color: var(--pitch); }
:focus-visible { outline: 2px solid var(--venom); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.display { font-family: var(--display); letter-spacing: .02em; font-weight: 600; }
.gold { color: var(--amber); }
.venom { color: var(--venom); }
.blood { color: var(--ember); }
.mono { font-family: var(--mono); font-feature-settings: normal; }
.wrap { max-width: 1240px; padding: 0 20px; }

/* ---------- surfaces: hairline amber→venom edge ---------- */
.glass, .panel, .auth-card, .wallet-menu, .up-card {
  background:
    linear-gradient(180deg, rgb(19 28 23 / .86), rgb(10 15 12 / .9)) padding-box,
    var(--edge) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 24px 60px -30px rgb(0 0 0 / .8);
}
.card { border-radius: var(--r-md); padding: 22px; }
a.glass.card { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
a.glass.card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgb(255 255 255 / .05) inset, 0 30px 70px -28px rgb(247 179 43 / .28); }

/* ---------- buttons ---------- */
.btn {
  position: relative; isolation: isolate;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-family: var(--sans); font-weight: 700; font-size: 14px; letter-spacing: .01em;
  color: #120c02;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber) 55%, #e09a16);
  box-shadow: 0 0 0 1px rgb(255 209 102 / .35) inset, 0 10px 30px -10px rgb(247 179 43 / .65);
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .2s;
}
.btn:hover { background: linear-gradient(180deg, #ffe08a, var(--amber-hi) 55%, var(--amber)); box-shadow: 0 0 0 1px rgb(255 209 102 / .5) inset, 0 14px 40px -10px rgb(247 179 43 / .8); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; }
.btn.out {
  color: var(--bone);
  background: linear-gradient(var(--moss), var(--moss)) padding-box, var(--edge) border-box;
  border: 1px solid transparent; box-shadow: none;
}
.btn.out:hover { color: var(--amber-hi); background: linear-gradient(var(--moss-2), var(--moss-2)) padding-box, linear-gradient(135deg, var(--amber), var(--venom)) border-box; }
.btn.venom { color: #071003; background: linear-gradient(180deg, #c3ff5a, var(--venom) 60%, #7cc012); box-shadow: 0 0 0 1px rgb(195 255 90 / .4) inset, 0 10px 30px -10px rgb(155 227 31 / .6); }
.btn.ghost { color: var(--muted); background: transparent; box-shadow: none; }
.btn.ghost:hover { color: var(--bone); background: rgb(239 230 210 / .06); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }

input, select, textarea {
  border-radius: var(--r-sm); background: rgb(6 8 7 / .7); border: 1px solid var(--line);
  color: var(--bone); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgb(155 227 31 / .6); box-shadow: 0 0 0 3px rgb(155 227 31 / .15); }

/* ---------- top bar ---------- */
.nav-blur {
  background: rgb(6 8 7 / .72);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgb(247 179 43 / .35), rgb(155 227 31 / .3), transparent) 1;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
header.nav-blur .inner { max-width: 1240px; padding: 0 20px; height: 68px; }
.brand { font-family: var(--display); font-weight: 600; letter-spacing: .03em; font-size: 19px; color: var(--bone); }
.brand b { color: var(--amber); font-weight: 600; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 4px 14px rgb(247 179 43 / .35)); }
nav.desk { gap: 4px; }
nav.desk a {
  position: relative; padding: 8px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s, background .2s;
}
nav.desk a:hover { color: var(--bone); background: rgb(239 230 210 / .05); }
nav.desk a.on { color: var(--pitch); background: var(--venom); font-weight: 700; }
nav.desk a.hot::after { content: ""; position: absolute; top: 6px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--venom); box-shadow: 0 0 8px var(--venom); }
nav.desk a.on.hot::after { display: none; }
.wallet-btn { font-family: var(--sans); font-weight: 700; font-size: 13px; min-height: 40px; }
.wallet-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--venom); box-shadow: 0 0 10px var(--venom); }
.wallet-menu { border-radius: var(--r-md); padding: 14px; }
.wallet-menu button:hover { background: rgb(239 230 210 / .06); }
.menu-btn { background: transparent; color: var(--bone); border: 1px solid var(--line); width: 42px; height: 42px; border-radius: 12px; font-size: 18px; }
.mob-nav { background: rgb(6 8 7 / .96); border-top: 1px solid var(--line); }
.mob-nav a { color: var(--bone); }
main { padding-top: 84px; }
@media (min-width: 1100px) { nav.desk { display: flex; } .menu-btn { display: none; } }

footer.site { border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgb(13 20 17 / .6)); }
footer.site .inner { max-width: 1240px; }
footer.site a:hover { color: var(--amber); }

/* ---------- toast ---------- */
#toast {
  background: linear-gradient(180deg, rgb(19 28 23 / .96), rgb(10 15 12 / .96)) padding-box, var(--edge) border-box !important;
  border: 1px solid transparent !important; border-radius: 14px !important; color: var(--bone) !important;
  box-shadow: 0 20px 50px -20px #000; font-weight: 500; max-width: min(420px, calc(100vw - 32px));
}

/* ---------- sign-in prompt ---------- */
.auth-prompt {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: rgb(3 4 3 / .7); backdrop-filter: blur(6px);
  animation: fadeIn .2s var(--ease);
}
.auth-card { width: min(420px, 100%); border-radius: var(--r-lg); padding: 28px; text-align: center; }
.auth-card img { margin: 0 auto 8px; filter: drop-shadow(0 8px 24px rgb(247 179 43 / .35)); }
.auth-card h2 { font-size: 28px; margin: 6px 0; }
.auth-addr { color: var(--venom); font-size: 13px; margin: 10px 0 0; }
.auth-err { color: var(--ember); min-height: 1.4em; font-size: 14px; margin: 8px 0 0; }
.auth-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- HOME ---------- */
.home-hero {
  position: relative; display: grid; gap: 28px; align-items: center;
  grid-template-columns: 1fr; padding-block: 40px 24px; min-height: calc(100svh - 120px);
}
@media (min-width: 960px) { .home-hero { grid-template-columns: 1.05fr 1fr; padding-block-start: 24px; } }
.hero-word {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(64px, 11vw, 148px); line-height: .84; letter-spacing: -.005em; margin: 0;
}
.hero-word span { display: block; }
.hero-word .w1 { background: linear-gradient(180deg, var(--amber-hi), var(--amber) 60%, #e0861a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-word .w2 { background: linear-gradient(180deg, #d4ff7a, var(--venom) 60%, #6fae0e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-chain { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.hero-chain i { width: 8px; height: 8px; border-radius: 50%; background: var(--venom); box-shadow: 0 0 10px var(--venom); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero-lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 34ch; margin: 22px 0 0; }
.hero-lead b { color: var(--bone); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 34px; max-width: 520px; }
.hero-stats div { padding: 14px 16px; border-radius: var(--r-md); }
.hero-stats b { display: block; font-family: var(--display); font-size: 30px; line-height: 1; color: var(--bone); font-weight: 600; }
.hero-stats span { font-size: 13px; color: var(--subtle); }

/* the totem: the one loud thing on the page */
.totem { position: relative; aspect-ratio: 1; width: min(620px, 100%); margin: 0 auto; display: grid; place-items: center; }
.totem::before, .totem::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.totem::before {
  inset: 4%;
  background: conic-gradient(from 0deg, transparent 0 6%, rgb(247 179 43 / .95) 13%, transparent 20% 44%, rgb(155 227 31 / .9) 53%, transparent 60% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  filter: drop-shadow(0 0 6px rgb(247 179 43 / .5));
  animation: spin 18s linear infinite;
}
.totem::after {
  inset: 12%;
  background: repeating-conic-gradient(rgb(239 230 210 / .22) 0 .6deg, transparent .6deg 6deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  animation: spin 60s linear infinite reverse;
}
.totem .glow { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, rgb(247 179 43 / .22), rgb(155 227 31 / .1) 45%, transparent 70%); filter: blur(10px); }
.totem img { position: relative; width: 74%; height: auto; filter: drop-shadow(0 30px 60px rgb(0 0 0 / .6)); animation: float 7s ease-in-out infinite; }
.totem .tag {
  position: absolute; font-size: 13px; padding: 8px 12px; border-radius: 12px; white-space: nowrap;
  display: flex; gap: 8px; align-items: center;
}
.totem .tag b { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--amber); }
.totem .tag.t1 { top: 14%; left: 0; }
.totem .tag.t2 { bottom: 16%; right: 0; }
.totem .tag.t2 b { color: var(--venom); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-10px); } }

.sec { padding-block: 56px; }
.sec-top { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sec-top h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4vw, 46px); line-height: 1; margin: 0; }
.sec-top p { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }
.sec-top a { color: var(--amber); font-weight: 600; }

/* bento floor */
.floor { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.tile {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-lg); min-height: 220px;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 22px;
  background: var(--moss) center / cover no-repeat;
  border: 1px solid var(--line);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(6 8 7 / 0) 30%, rgb(6 8 7 / .92) 100%); }
.tile:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.tile h3 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 2.4vw, 34px); line-height: 1; margin: 0 0 6px; }
.tile p { margin: 0; color: rgb(239 230 210 / .78); font-size: 15px; max-width: 40ch; }
.tile .pill { position: absolute; top: 16px; left: 16px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgb(6 8 7 / .7); color: var(--venom); border: 1px solid rgb(155 227 31 / .4); }
.tile.xl { grid-column: span 12; min-height: 340px; }
.tile.l { grid-column: span 12; min-height: 300px; }
.tile.m { grid-column: span 6; }
.tile.s { grid-column: span 6; }
@media (min-width: 760px) { .tile.xl { grid-column: span 7; min-height: 420px; } .tile.l { grid-column: span 5; min-height: 420px; } .tile.m { grid-column: span 4; } .tile.s { grid-column: span 3; } }
.tile.ball { background-image: radial-gradient(60% 60% at 70% 40%, rgb(155 227 31 / .35), transparent 70%), url(../assets/bg-jungle.jpg); }
.tile .logo { position: absolute; top: 14px; right: 16px; width: 120px; height: auto; filter: drop-shadow(0 10px 24px rgb(0 0 0 / .6)); }
@media (min-width: 760px) { .tile.xl .logo, .tile.l .logo { width: 170px; } }
.tile.ball .orb { position: absolute; right: 12%; top: 22%; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #eaffb3, var(--venom) 45%, #3c6a05 100%); box-shadow: 0 0 60px 10px rgb(155 227 31 / .45); animation: float 3.2s ease-in-out infinite; z-index: -1; }
.tile.pin { background-image: radial-gradient(70% 60% at 50% 30%, rgb(247 179 43 / .28), transparent 70%), url(../assets/bg-temple.jpg); }

.steps { display: grid; gap: 12px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { list-style: none; padding: 20px; border-radius: var(--r-md); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; margin-bottom: 14px; font-family: var(--display); font-weight: 600; color: var(--pitch); background: var(--amber); }
.steps li:nth-child(even)::before { background: var(--venom); }
.steps h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0 0 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
.steps { padding: 0; margin: 0; }

.relics { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.relic { padding: 14px; border-radius: var(--r-md); display: flex; gap: 12px; align-items: center; }
.relic img { width: 44px; height: 44px; object-fit: contain; }
.relic b { display: block; font-size: 14px; }
.relic span { display: block; font-size: 13px; color: var(--subtle); }
.relic em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; color: var(--subtle); border: 1px solid var(--line); vertical-align: 1px; }
.relic.auto em { color: var(--venom); border-color: rgb(155 227 31 / .4); }
.relic.auto span { color: var(--venom); }

.lb { display: grid; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 32px 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; }
.lb-row .n { font-family: var(--display); color: var(--subtle); font-size: 18px; text-align: center; }
.lb-row:nth-child(1) .n { color: var(--amber); } .lb-row:nth-child(2) .n { color: var(--bone); } .lb-row:nth-child(3) .n { color: #d08a4a; }
.lb-row img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.lb-row .lb-who { min-width: 0; }
.lb-row .lb-who b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .lb-who span { display: block; font-size: 13px; color: var(--subtle); }
.lb-row .xp { text-align: right; font-weight: 700; }
.lb-row .xp span { display: block; font-size: 12px; color: var(--amber); font-weight: 600; }

.troop-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.troop-strip img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.troop-strip a:hover img { transform: translateY(-3px) rotate(-1deg); border-color: var(--line-hi); }

/* ---------- upgrade preview ---------- */
.up-overlay { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgb(3 4 3 / .75); backdrop-filter: blur(6px); animation: fadeIn .2s var(--ease); }
.up-card { width: min(900px, 100%); max-height: calc(100svh - 32px); overflow: auto; border-radius: var(--r-lg); padding: 24px; }
.up-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.up-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3vw, 34px); margin: 0; line-height: 1.05; }
.up-head p { margin: 4px 0 0; color: var(--muted); }
.up-x { background: transparent; border: 1px solid var(--line); color: var(--bone); width: 40px; height: 40px; border-radius: 12px; font-size: 20px; flex: none; }
.up-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin: 20px 0; }
.up-compare figure { margin: 0; }
.up-compare img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); background: var(--moss); }
.up-compare figure.after img { border-color: rgb(155 227 31 / .55); box-shadow: 0 0 0 4px rgb(155 227 31 / .08), 0 20px 60px -20px rgb(155 227 31 / .45); }
.up-compare figcaption { margin-top: 8px; font-size: 13px; color: var(--subtle); text-align: center; }
.up-compare .arrow { font-family: var(--display); font-size: 28px; color: var(--venom); }
.up-diff { display: grid; gap: 6px; margin: 0 0 18px; padding: 0; }
.up-diff li { list-style: none; display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgb(239 230 210 / .03); border: 1px solid var(--line); font-size: 15px; }
.up-diff li span { color: var(--subtle); }
.up-diff s { color: var(--subtle); text-decoration-color: var(--ember); }
.up-diff b { color: var(--venom); font-weight: 600; }
.up-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.up-actions .note { font-size: 13px; color: var(--subtle); flex: 1 1 220px; }
.up-busy { display: grid; place-items: center; min-height: 320px; color: var(--muted); }
.up-spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgb(239 230 210 / .12); border-top-color: var(--venom); animation: spin .8s linear infinite; margin-bottom: 14px; }
@media (max-width: 640px) { .up-compare { grid-template-columns: 1fr 1fr; } .up-compare .arrow { display: none; } .up-diff li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- arcade pages ---------- */
.arcade { padding-top: 76px; }
.arcade-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 10px 20px; }
.arcade-bar h1 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 0; }
.arcade-bar .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.arcade-bar .chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.arcade-bar .chip b { color: var(--amber); }
.arcade-frame { display: block; width: 100%; height: calc(100svh - 140px); min-height: 560px; border: 0; background: #000; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.arcade-win {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120;
  padding: 14px 20px; border-radius: 16px; display: flex; gap: 14px; align-items: center;
  animation: rise .35s var(--ease);
}
.arcade-win b { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--venom); }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Auto-upgrade relics use the preview dialog instead of the old pay/apply buttons. */
#payLava, #applyLava, #payBeanie, #applyBeanie, #payRussian, #applyRussian, #payGalaxy, #applyGalaxy,
#payGold, #applyGold, #payWater, #applyWater, #payGrave, #applyGrave, #payRasta, #applyRasta { display: none !important; }

@media (max-width: 520px) {
  header.nav-blur .inner { padding: 0 12px; gap: 8px; }
  .brand { font-size: 0; gap: 0; }
  .brand img { width: 36px; height: 36px; }
  .wallet-btn { padding: 0 14px; font-size: 12px; }
  .hero-stats b { font-size: 24px; }
  .hero-stats div { padding: 12px; }
  .totem .tag { font-size: 12px; }
}

/* Den: no anchor jumps under the fixed header */
.dash-page { padding-top: 100px; }
.dash-pane { scroll-margin-top: 110px; }

/* ---- Arcade pages on phones: the game fills the screen under a compact bar ---- */
body[data-page="arcade"] .social-tab { display: none !important; }
@media (max-width: 760px) {
  .arcade { padding-top: 68px; }
  .arcade-bar { padding: 6px 12px; gap: 6px; flex-wrap: nowrap; }
  .arcade-bar h1 { font-size: 17px; white-space: nowrap; }
  .arcade-bar .meta { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .arcade-bar .meta::-webkit-scrollbar { display: none; }
  .arcade-bar .chip { padding: 4px 9px; font-size: 12px; white-space: nowrap; }
  .arcade-bar .chip:nth-child(3) { display: none; }
  .arcade { display: flex; flex-direction: column; height: 100svh; box-sizing: border-box; overflow: hidden; }
  .arcade > p { display: none; }
  .arcade-frame { flex: 1 1 auto; height: auto; min-height: 0; }
  body[data-page="arcade"] { overflow: hidden; overscroll-behavior: none; }
}
