/* ==========================================================================
   REALM OF SOLANA — official site stylesheet
   Dark premium pixel/retro. Palette: near-black + gold + Solana teal/purple.
   ========================================================================== */

:root {
  --bg0: #0b0716;
  --bg1: #120c26;
  --panel: #17102e;
  --panel-2: #1c1438;
  --line: #2b2153;
  --line-soft: #241b45;
  --gold: #ffd76a;
  --gold-deep: #c9992e;
  --gold-dark: #6b4e12;
  --teal: #14f195;
  --purple: #9945ff;
  --purple-soft: #c9a2ff;
  --ink: #ece7fa;
  --muted: #a79ecb;
  --danger: #ff5a5a;
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --font-retro: 'VT323', 'Courier New', monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 68px;
  --z-nav: 50;
  --z-menu: 40;
  --z-hero: 1;
}

/* ---------- Reset / base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg0);
  background-image:
    radial-gradient(1100px 600px at 85% -10%, rgba(153, 69, 255, 0.14), transparent 60%),
    radial-gradient(900px 550px at -10% 30%, rgba(20, 241, 149, 0.07), transparent 55%),
    radial-gradient(1000px 700px at 50% 115%, rgba(255, 215, 106, 0.06), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3 { line-height: 1.35; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

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

::selection { background: var(--purple); color: #fff; }

.wrap {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Pixel sprites (SVGs injected by script.js) */
.sprite { display: inline-block; line-height: 0; }
.sprite svg { width: 100%; height: 100%; image-rendering: pixelated; shape-rendering: crispEdges; }

/* ---------- Pixel panel (stepped border via box-shadow) ---------- */

.pixel-panel {
  position: relative;
  background: var(--panel);
  box-shadow:
    0 -4px 0 var(--line), 0 4px 0 var(--line),
    -4px 0 0 var(--line), 4px 0 0 var(--line);
  margin: 4px; /* room for the stepped border */
}

.pixel-panel--gold {
  background: linear-gradient(160deg, #1f1730, #17102e 55%);
  box-shadow:
    0 -4px 0 var(--gold-dark), 0 4px 0 var(--gold-dark),
    -4px 0 0 var(--gold-dark), 4px 0 0 var(--gold-dark);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none !important;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  user-select: none;
}

.btn-gold {
  color: #241800;
  background: linear-gradient(180deg, #ffe49a 0%, var(--gold) 45%, #eab944 100%);
  border-color: var(--gold-dark);
  box-shadow: 0 4px 0 var(--gold-dark), 0 10px 26px rgba(255, 215, 106, 0.22);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--gold-dark), 0 14px 32px rgba(255, 215, 106, 0.32);
}
.btn-gold:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--gold-dark);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(153, 69, 255, 0.08);
  border-color: var(--line);
  box-shadow: 0 4px 0 var(--line);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
  box-shadow: 0 6px 0 var(--line);
}
.btn-ghost:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }

.btn-big { min-height: 56px; padding: 16px 34px; font-size: 0.82rem; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  background: rgba(11, 7, 22, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.nav.scrolled {
  background: rgba(11, 7, 22, 0.94);
  border-bottom-color: var(--line-soft);
}

.nav-inner {
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  color: var(--ink);
}
.brand-coin { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 10px rgba(255, 215, 106, 0.35)); }
.brand-name {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  white-space: nowrap;
}
.brand-name .brand-of { color: var(--muted); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links > a:not(.btn) {
  font-family: var(--font-retro);
  font-size: 1.32rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-links > a:not(.btn):hover { color: var(--ink); text-decoration: none; }
.nav-links > a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.nav-play { min-height: 40px; padding: 8px 18px; font-size: 0.62rem; }

.hamburger {
  display: none;
  width: 46px;
  height: 46px;
  padding: 10px;
  background: transparent;
  border: 2px solid var(--line);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--gold);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav.open .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav.open .hamburger span:nth-child(2) { opacity: 0; }
.nav.open .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: var(--z-hero);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 48px) 20px 72px;
  overflow: hidden;
  isolation: isolate;
}

#starfield {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.hero-glow {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}
.hero-glow--purple { width: 560px; height: 560px; top: -160px; right: -120px; background: rgba(153, 69, 255, 0.35); }
.hero-glow--teal { width: 460px; height: 460px; bottom: -140px; left: -120px; background: rgba(20, 241, 149, 0.18); }

.hero-coin {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  animation: coin-bob 5s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255, 215, 106, 0.35));
}
@keyframes coin-bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -18px; }
}

.hero-kicker {
  font-family: var(--font-retro);
  font-size: 1.35rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 18px;
}

.hero-title {
  font-family: var(--font-pixel);
  margin: 0 0 20px;
  line-height: 1.25;
}
.hero-title .t-realm {
  display: block;
  font-size: clamp(1.15rem, 4.4vw, 2.1rem);
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 215, 106, 0.45), 3px 3px 0 rgba(0, 0, 0, 0.6);
}
.hero-title .t-solana {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.9rem, 8vw, 4rem);
  background: linear-gradient(100deg, var(--teal) 15%, #6ee7c7 40%, var(--purple-soft) 65%, var(--purple) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(153, 69, 255, 0.45)) drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.55));
}

.hero-tag {
  font-family: var(--font-retro);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  color: var(--ink);
  margin: 0 0 14px;
}
.hero-tag .hl { color: var(--gold); }
.hero-tag .rug { color: var(--danger); }

.hero-sub {
  max-width: 560px;
  color: var(--muted);
  margin: 0 auto 30px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 34px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.chip {
  font-family: var(--font-retro);
  font-size: 1.12rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(23, 16, 46, 0.6);
  padding: 5px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--teal);
  flex: none;
}
.chip:nth-child(2)::before { background: var(--purple); }
.chip:nth-child(3)::before { background: var(--gold); }

.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-family: var(--font-retro);
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-cue .chev {
  width: 14px; height: 14px;
  border-right: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  transform: rotate(45deg);
  animation: cue-drop 1.6s ease-in-out infinite;
}
@keyframes cue-drop {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 1; }
  50% { transform: rotate(45deg) translate(5px, 5px); opacity: 0.35; }
}

/* ---------- Page hero (subpages) ---------- */

.page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 20px 46px;
  text-align: center;
  overflow: hidden;
}
.page-hero .hero-glow--purple { width: 420px; height: 420px; top: -180px; right: -80px; }
.page-hero h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1.25rem, 4.5vw, 2rem);
  color: var(--gold);
  text-shadow: 0 0 22px rgba(255, 215, 106, 0.35), 3px 3px 0 rgba(0, 0, 0, 0.6);
  margin-bottom: 14px;
}
.page-hero .lede {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
}

/* ---------- Sections ---------- */

.section { padding: 84px 0; position: relative; }
.section--tight { padding: 56px 0; }

.sec-head { margin-bottom: 44px; }
.sec-head.center { text-align: center; }
.kicker {
  font-family: var(--font-retro);
  font-size: 1.2rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 10px;
}
.sec-head h2 {
  font-family: var(--font-pixel);
  font-size: clamp(1.05rem, 3.4vw, 1.6rem);
  color: var(--ink);
  margin-bottom: 14px;
}
.sec-head .bar {
  width: 72px;
  height: 6px;
  background: linear-gradient(90deg, var(--gold), var(--purple));
  box-shadow: 6px 0 0 var(--teal);
}
.sec-head.center .bar { margin-inline: auto; }
.sec-head .sub { color: var(--muted); max-width: 640px; margin: 14px 0 0; }
.sec-head.center .sub { margin-inline: auto; }

/* ---------- Two-column intro + pixel scene ---------- */

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.split .lead { color: var(--muted); }
.split .lead strong { color: var(--ink); }
.split .lead .gold { color: var(--gold); }
.split .lead .teal { color: var(--teal); }

.scene {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background:
    linear-gradient(180deg, #150e2e 0%, #1d1240 52%, #241543 68%, #191026 68%, #120b1e 100%);
}
.scene::after { /* ground line */
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 68%;
  height: 3px;
  background: rgba(153, 69, 255, 0.35);
}
.scene .px-star {
  position: absolute;
  width: 4px; height: 4px;
  background: #fff;
  opacity: 0.7;
  animation: star-blink 3s ease-in-out infinite;
}
@keyframes star-blink {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 0.15; }
}
.scene .s-house { position: absolute; width: 26%; left: 7%; bottom: 24%; }
.scene .s-portal { position: absolute; width: 20%; right: 9%; bottom: 26%; animation: portal-pulse 3.2s ease-in-out infinite; }
@keyframes portal-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(153, 69, 255, 0.6)); }
  50% { filter: drop-shadow(0 0 20px rgba(153, 69, 255, 1)); }
}
.scene .s-pepe { position: absolute; width: 13%; left: 42%; bottom: 15%; }
.scene .s-doge { position: absolute; width: 12%; left: 62%; bottom: 20%; }
.scene .s-coin1, .scene .s-coin2 {
  position: absolute; width: 8%;
  animation: coin-bob 4s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 215, 106, 0.5));
}
.scene .s-coin1 { left: 30%; top: 18%; }
.scene .s-coin2 { right: 28%; top: 10%; animation-delay: 1.3s; }
.scene .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  font-family: var(--font-retro);
  font-size: 1.05rem;
  color: var(--muted);
  text-align: center;
  background: rgba(11, 7, 22, 0.78);
  border-top: 1px solid var(--line-soft);
}

/* ---------- Bestiary marquee ---------- */

.bestiary {
  border-block: 1px solid var(--line-soft);
  background: rgba(18, 12, 38, 0.6);
  padding: 26px 0;
  overflow: hidden;
}
.marquee { overflow: hidden; }
/* Two identical groups, each carrying its own trailing gap (padding-right),
   so translateX(-50%) wraps with even spacing — eternal continuity, no gap. */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee-group {
  display: flex;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
  flex: none;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.beast {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}
.beast .sprite { width: 52px; height: 52px; }
.beast .real-sprite { width: 56px; }
.beast .b-name {
  font-family: var(--font-retro);
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.15;
}
.beast .b-lv {
  display: block;
  font-size: 1.05rem;
  color: var(--muted);
}
.beast.vip .b-lv { color: var(--gold); }

/* ---------- Feature cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card {
  padding: 28px 24px 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 -4px 0 var(--gold-dark), 0 4px 0 var(--gold-dark),
    -4px 0 0 var(--gold-dark), 4px 0 0 var(--gold-dark);
}
.card .sprite { width: 46px; height: 46px; margin-bottom: 18px; }
.card h3 {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.card .soon {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-retro);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--purple-soft);
  border: 1px solid var(--line);
  padding: 2px 10px;
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  text-align: center;
}
.stat { padding: 26px 12px 20px; }
.stat .num {
  font-family: var(--font-retro);
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 215, 106, 0.35);
}
.stat .lbl {
  display: block;
  margin-top: 10px;
  font-family: var(--font-retro);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.num--soon { font-size: clamp(2rem, 3.6vw, 2.6rem) !important; letter-spacing: 0.04em; }
.stat--soon .lbl { color: var(--purple-soft); }

/* ---------- VIP banner ---------- */

.vip-banner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 36px;
  align-items: center;
  padding: 38px 36px;
}
.vip-banner .vip-crown {
  width: 130px; height: 130px;
  margin-inline: auto;
  filter: drop-shadow(0 0 24px rgba(255, 215, 106, 0.45));
  animation: coin-bob 5s ease-in-out infinite;
}
.vip-banner h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 6px;
}
.vip-banner .vip-price {
  font-family: var(--font-retro);
  font-size: 1.35rem;
  color: var(--teal);
  margin-bottom: 14px;
}
.vip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 26px;
}
.vip-list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}
.vip-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.52em;
  width: 9px; height: 9px;
  background: var(--gold);
}
.vip-list li strong { color: var(--ink); }
.vip-list .soon-tag { color: var(--purple-soft); font-family: var(--font-retro); font-size: 1rem; }

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  counter-reset: step;
}
.step { padding: 30px 26px; position: relative; }
.step .step-num {
  font-family: var(--font-retro);
  font-size: 3.2rem;
  line-height: 1;
  color: var(--purple);
  text-shadow: 0 0 16px rgba(153, 69, 255, 0.5);
  margin-bottom: 12px;
}
.step h3 {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.step .sprite { position: absolute; top: 24px; right: 22px; width: 36px; height: 36px; opacity: 0.9; }

/* ---------- Final CTA ---------- */

.cta-final {
  text-align: center;
  padding: 56px 30px;
}
.cta-final h2 {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3.2vw, 1.5rem);
  color: var(--gold);
  margin-bottom: 14px;
}
.cta-final p { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }

/* ---------- Footer ---------- */

.footer {
  margin-top: 60px;
  border-top: 1px solid var(--line-soft);
  background: rgba(11, 7, 22, 0.85);
  padding: 46px 0 30px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: start;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .sprite { width: 26px; height: 26px; }
.footer-brand .fb-name {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  color: var(--gold);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a {
  font-family: var(--font-retro);
  font-size: 1.2rem;
  color: var(--muted);
}
.footer-nav a:hover { color: var(--gold); text-decoration: none; }
.footer-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 640px;
  margin: 4px 0 0;
}
.footer-note a { color: var(--teal); }
.copyright {
  grid-column: 1 / -1;
  font-family: var(--font-retro);
  font-size: 1.05rem;
  color: #6f6694;
  margin: 6px 0 0;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.7, 0.3, 1);
  transition-delay: var(--rd, 0s);
}
.reveal-left { transform: translateX(-34px); }
.reveal-right { transform: translateX(34px); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Leaderboard (ranks) ---------- */

.board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
  font-family: var(--font-retro);
  font-size: 1.15rem;
  color: var(--muted);
}
.board-meta .live-dot {
  display: inline-block;
  width: 9px; height: 9px;
  background: var(--teal);
  margin-right: 8px;
  animation: star-blink 2s ease-in-out infinite;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 40px;
}
.podium-card {
  text-align: center;
  padding: 28px 18px 22px;
}
.podium-card .p-medal {
  width: 54px; height: 54px;
  margin: 0 auto 12px;
}
.podium-card .p-rank {
  font-family: var(--font-retro);
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.podium-card .p-nick {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  color: var(--ink);
  margin-bottom: 10px;
  word-break: break-word;
}
.podium-card .p-level {
  font-family: var(--font-retro);
  font-size: 1.3rem;
  color: var(--teal);
}
.podium-card .p-xp {
  font-family: var(--font-retro);
  font-size: 1.1rem;
  color: var(--muted);
}
.podium-card.p-1 {
  box-shadow:
    0 -4px 0 var(--gold-deep), 0 4px 0 var(--gold-deep),
    -4px 0 0 var(--gold-deep), 4px 0 0 var(--gold-deep),
    0 16px 44px rgba(255, 215, 106, 0.18);
  background: linear-gradient(180deg, #241a38, #17102e);
  padding-block: 38px 28px;
}
.podium-card.p-1 .p-nick { color: var(--gold); }
.podium-card.p-2 {
  box-shadow:
    0 -4px 0 #8f96a8, 0 4px 0 #8f96a8,
    -4px 0 0 #8f96a8, 4px 0 0 #8f96a8;
}
.podium-card.p-3 {
  box-shadow:
    0 -4px 0 #a86a3d, 0 4px 0 #a86a3d,
    -4px 0 0 #a86a3d, 4px 0 0 #a86a3d;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.board-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.board-table th, .data-table th {
  font-family: var(--font-retro);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
}
.board-table td, .data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 0.95rem;
}
.board-table tbody tr, .data-table tbody tr {
  transition: background-color 0.15s ease;
}
.board-table tbody tr:hover, .data-table tbody tr:hover {
  background: rgba(153, 69, 255, 0.07);
}
.board-table .rk {
  font-family: var(--font-retro);
  font-size: 1.3rem;
  color: var(--purple-soft);
  width: 64px;
}
.board-table .nick { font-weight: 600; }
.board-table .lvl { color: var(--teal); font-family: var(--font-retro); font-size: 1.25rem; }
.board-table .xp { color: var(--gold); font-variant-numeric: tabular-nums; }
.board-table .wal {
  color: var(--muted);
  font-family: var(--font-retro);
  font-size: 1.05rem;
}

.board-state {
  text-align: center;
  padding: 70px 20px;
  font-family: var(--font-retro);
  font-size: 1.4rem;
  color: var(--muted);
}
.board-state.error { color: var(--danger); }
.board-state .spinner {
  width: 34px; height: 34px;
  margin: 0 auto 18px;
  background:
    conic-gradient(var(--gold) 0 25%, var(--purple) 0 50%, var(--teal) 0 75%, var(--line) 0 100%);
  animation: spin-steps 1s steps(8) infinite;
}
@keyframes spin-steps { to { transform: rotate(1turn); } }
.board-state .btn { margin-top: 20px; }

/* ---------- Guide ---------- */

.guide-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 44px;
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  padding: 22px 20px;
}
.toc h2 {
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  color: var(--gold);
  margin-bottom: 14px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.toc a {
  display: block;
  padding: 6px 10px;
  font-family: var(--font-retro);
  font-size: 1.2rem;
  color: var(--muted);
  border-left: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.toc a:hover { color: var(--ink); text-decoration: none; background: rgba(153, 69, 255, 0.08); }
.toc a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(255, 215, 106, 0.06);
}

.guide-sec { padding: 30px 30px 24px; margin-bottom: 34px; }
.guide-sec h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 18px;
}
.guide-sec h2 .sprite { width: 34px; height: 34px; flex: none; }
.guide-sec h3 {
  font-family: var(--font-retro);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  color: var(--teal);
  margin: 22px 0 8px;
}
.guide-sec p, .guide-sec li { color: var(--muted); }
.guide-sec strong { color: var(--ink); }
.guide-sec .gold { color: var(--gold); }
.guide-sec .danger { color: var(--danger); }
.guide-sec ul { padding-left: 20px; margin: 0 0 1em; }
.guide-sec li { margin-bottom: 6px; }
.guide-sec li::marker { color: var(--purple); }

.kbd {
  display: inline-block;
  min-width: 30px;
  padding: 2px 8px 4px;
  font-family: var(--font-retro);
  font-size: 1.15rem;
  line-height: 1.2;
  text-align: center;
  color: var(--gold);
  background: var(--panel-2);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
}

.callout {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--gold);
  background: rgba(255, 215, 106, 0.06);
  color: var(--muted);
  font-size: 0.95rem;
}
.callout.danger {
  border-left-color: var(--danger);
  background: rgba(255, 90, 90, 0.07);
}
.callout strong { color: var(--ink); }

/* ---------- Wiki ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}
.tab-btn {
  font-family: var(--font-pixel);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 12px 20px;
  min-height: 46px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.tab-btn:hover { color: var(--ink); border-color: var(--purple); }
.tab-btn[aria-selected="true"] {
  color: #241800;
  background: linear-gradient(180deg, #ffe49a, var(--gold));
  border-color: var(--gold-dark);
}

.wiki-filter {
  margin: 0 0 22px;
}
.wiki-filter input {
  width: min(340px, 100%);
  min-height: 46px;
  padding: 10px 16px;
  font-family: var(--font-retro);
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--line);
}
.wiki-filter input::placeholder { color: #6f6694; }
.wiki-filter input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Gear category filter (wiki Gear tab) ---------- */
.gear-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}
.gear-filter-btn {
  font-family: var(--font-retro);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 7px 16px;
  min-height: 40px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.gear-filter-btn:hover { color: var(--ink); border-color: var(--purple); }
.gear-filter-btn.is-active {
  color: #241800;
  background: linear-gradient(180deg, #ffe49a, var(--gold));
  border-color: var(--gold-dark);
}
/* Category filter: hide every group that isn't the chosen slot. */
.gear-groups[data-cat="set"] .g-group:not([data-gkey="set"]),
.gear-groups[data-cat="weapon"] .g-group:not([data-gkey="weapon"]),
.gear-groups[data-cat="helmet"] .g-group:not([data-gkey="helmet"]),
.gear-groups[data-cat="armor"] .g-group:not([data-gkey="armor"]),
.gear-groups[data-cat="legs"] .g-group:not([data-gkey="legs"]),
.gear-groups[data-cat="boots"] .g-group:not([data-gkey="boots"]),
.gear-groups[data-cat="shield"] .g-group:not([data-gkey="shield"]) {
  display: none !important;
}

.guide-play { margin: 4px 0 6px; }

.data-table .mon-cell { display: flex; align-items: center; gap: 14px; }
.data-table .mon-cell .sprite { width: 40px; height: 40px; flex: none; }
.data-table .mon-name { font-weight: 600; }
.data-table .tier {
  font-family: var(--font-retro);
  font-size: 1.05rem;
  padding: 2px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.data-table .tier.t-easy { color: var(--teal); border-color: rgba(20, 241, 149, 0.4); }
.data-table .tier.t-mid { color: var(--purple-soft); border-color: rgba(153, 69, 255, 0.45); }
.data-table .tier.t-vip { color: var(--gold); border-color: rgba(255, 215, 106, 0.5); }
.data-table .vip-flag {
  font-family: var(--font-retro);
  font-size: 1rem;
  color: var(--gold);
  border: 1px solid rgba(255, 215, 106, 0.5);
  padding: 1px 8px;
  white-space: nowrap;
}
.data-table .muted { color: var(--muted); }
.data-table .price { color: var(--gold); font-variant-numeric: tabular-nums; }

.tab-panel[hidden] { display: none; }
.wiki-note {
  margin-top: 18px;
  font-family: var(--font-retro);
  font-size: 1.1rem;
  color: var(--muted);
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-bottom: 20px;
}
.contact-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 20px 30px;
  text-decoration: none !important;
  text-align: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.contact-btn:hover {
  transform: translateY(-5px);
  box-shadow:
    0 -4px 0 var(--gold-dark), 0 4px 0 var(--gold-dark),
    -4px 0 0 var(--gold-dark), 4px 0 0 var(--gold-dark);
}
.contact-btn .c-icon { width: 58px; height: 58px; color: var(--teal); }
.contact-btn:nth-child(2) .c-icon { color: var(--ink); }
.contact-btn:nth-child(3) .c-icon { color: var(--purple-soft); }
.contact-btn .c-name {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  color: var(--gold);
}
.contact-btn .c-sub {
  font-family: var(--font-retro);
  font-size: 1.1rem;
  color: var(--muted);
}

.screenshot-invite {
  text-align: center;
  padding: 44px 28px;
  border: 2px dashed rgba(255, 215, 106, 0.45);
  background: rgba(255, 215, 106, 0.04);
  margin: 4px;
}
.screenshot-invite .sprite { width: 60px; height: 60px; margin: 0 auto 18px; }
.screenshot-invite h2 {
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: var(--gold);
  margin-bottom: 12px;
}
.screenshot-invite p { color: var(--muted); max-width: 560px; margin: 0 auto 0.9em; }

.more-soon {
  text-align: center;
  margin-top: 54px;
  font-family: var(--font-retro);
  font-size: 1.45rem;
  color: var(--muted);
}
.more-soon .dots::after {
  content: "";
  animation: dots 1.8s steps(4) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .cards, .steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .guide-layout { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 8px; }
  .toc ol { grid-template-columns: repeat(2, 1fr); }
  .vip-banner { grid-template-columns: 1fr; text-align: center; }
  .vip-list { text-align: left; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    z-index: var(--z-menu);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 22px;
    background: #0c0818;
    border-bottom: 2px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }
  .nav.open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links > a:not(.btn) {
    padding: 13px 6px;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav-links > a[aria-current="page"] { border-bottom-color: var(--gold); }
  .nav-play { margin-top: 16px; min-height: 50px; justify-content: center; }
  .hamburger { display: flex; }

  .section { padding: 62px 0; }
  .podium { grid-template-columns: 1fr; gap: 18px; }
  .podium-card.p-1 { order: -1; }
  /* floating hero sprites collide with copy on narrow screens */
  .hero-coin { display: none; }
}

@media (max-width: 560px) {
  .cards, .steps, .stats { grid-template-columns: 1fr; }
  .toc ol { grid-template-columns: 1fr; }
  .brand-name { font-size: 0.58rem; }
  .guide-sec { padding: 24px 18px 18px; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; }
  .board-table .wal-col, .board-table .wal { display: none; }
  .board-table { min-width: 0; }
  .data-table { min-width: 680px; }
  .data-table td { font-size: 0.9rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; width: auto; }
  .marquee-group { flex-wrap: wrap; justify-content: center; padding-right: 0; }
  .marquee-group[aria-hidden] { display: none; }
  .hero-coin, .vip-banner .vip-crown, .scene .s-coin1, .scene .s-coin2 { animation: none; }
}

/* ==========================================================================
   REAL GAME SPRITES (canvases rendered from the actual in-game pixel grids)
   ========================================================================== */

.real-sprite { display: inline-block; line-height: 0; }
.real-sprite canvas { width: 100%; height: auto; image-rendering: pixelated; }
.data-table .mon-cell .real-sprite { width: 44px; flex: none; }

/* ---------- Cavern background (all pages) ---------- */

#cave-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.cave-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(11, 7, 22, 0) 34%, rgba(8, 5, 16, 0.5) 78%, rgba(5, 3, 10, 0.78) 100%),
    linear-gradient(180deg, rgba(8, 5, 16, 0.35) 0%, rgba(11, 7, 22, 0) 18%, rgba(11, 7, 22, 0) 82%, rgba(8, 5, 16, 0.45) 100%);
}

/* ---------- Scroll-equip hero (landing, descends the page side) ---------- */

#equip-hero {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 104px;
}
#equip-hero canvas {
  width: 121px;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(255, 215, 106, 0.12));
}
#equip-hero .eq-label {
  font-family: var(--font-retro);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(11, 7, 22, 0.78);
  border: 1px solid var(--line);
  padding: 2px 9px;
  white-space: nowrap;
}
#equip-hero.eq-pop canvas { animation: eq-pop 0.4s steps(3); }
@keyframes eq-pop {
  0% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
@media (max-width: 1023px) {
  /* Keep the assembling hero visible on mobile — smaller, pinned to the
     bottom-right corner so it never covers the copy (taps pass through). */
  #equip-hero {
    right: 8px;
    top: auto;
    bottom: 10px;
    transform: none;
    width: 60px;
    gap: 4px;
  }
  #equip-hero canvas { width: 71px; }
  #equip-hero .eq-label { display: none; }
}

/* ---------- Landing intro (single column, art removed) ---------- */

.intro { max-width: 800px; }
.intro .lead { color: var(--muted); }
.intro .lead strong { color: var(--ink); }
.intro .lead .gold { color: var(--gold); }
.intro .lead .teal { color: var(--teal); }
.intro .lead em { color: var(--ink); font-style: normal; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.hub-line {
  display: inline-block;
  font-family: var(--font-retro);
  font-size: 1.25rem;
  color: var(--purple-soft);
  border-left: 4px solid var(--purple);
  padding: 6px 14px;
  background: rgba(153, 69, 255, 0.07);
  margin: 6px 0 0;
}

/* ---------- Holder sets (token-gated gear showcase) ---------- */

.holder-panel {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 38px;
  align-items: center;
  padding: 38px 36px;
}
.holder-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.holder-hero { display: inline-block; line-height: 0; }
.holder-hero canvas {
  width: 168px;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 26px rgba(255, 215, 106, 0.28)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}
.holder-cap {
  font-family: var(--font-retro);
  font-size: 1.08rem;
  color: var(--muted);
  text-align: center;
}
.holder-copy h3 {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.holder-copy p { color: var(--muted); }
.holder-copy p strong { color: var(--ink); }
.holder-items {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 0;
}
.holder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-retro);
  font-size: 1rem;
  color: var(--muted);
}
.holder-item .real-sprite {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 7, 22, 0.55);
  border: 1px solid var(--line);
  padding: 5px;
}
.holder-item .real-sprite canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}
.holder-soon {
  font-family: var(--font-retro);
  font-size: 1.18rem;
  color: var(--teal);
  margin: 0;
}
@media (max-width: 960px) {
  .holder-panel { grid-template-columns: 1fr; text-align: center; }
  .holder-copy { text-align: left; }
  .holder-items { justify-content: center; }
}

/* ---------- Gear wiki (data-driven from the real item registry) ---------- */

.g-group { margin: 0 0 48px; }
.g-group-title {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--gold);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.g-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}
.g-grid--sets { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.g-card { padding: 18px; display: flex; flex-direction: column; }
.g-fig {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  margin-bottom: 14px;
  background: rgba(11, 7, 22, 0.55);
  border: 1px solid var(--line-soft);
}
.g-fig canvas {
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: 86px;
  image-rendering: pixelated;
}
.g-fig--hero { height: 156px; }
.g-fig--hero canvas { max-height: 144px; }
.g-body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.g-name {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  color: var(--ink);
  margin: 0 0 8px;
}
.g-rarity {
  font-family: var(--font-retro);
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  padding: 1px 8px;
  margin-bottom: 10px;
  display: inline-block;
}
.g-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.st {
  font-family: var(--font-retro);
  font-size: 1.02rem;
  padding: 1px 8px;
  border: 1px solid var(--line);
  background: rgba(11, 7, 22, 0.4);
}
.st-atk { color: #ff9a5a; }
.st-def { color: #7fd3ff; }
.st-spd { color: #7ce04a; }
.st-0 { opacity: 0.35; }
.g-sum { font-family: var(--font-retro); font-size: 0.95rem; color: var(--muted); }
.g-desc { color: var(--muted); font-size: 0.92rem; margin: 0 0 12px; flex: 1; }
.g-src {
  font-family: var(--font-retro);
  font-size: 1.05rem;
  color: var(--gold);
  margin: 0;
}

/* =========================================================================
   CREATE / VOTE / ADMIN — community creation studio, voting & admin panel
   ========================================================================= */

.muted { color: var(--muted); }
.linkbtn { background: none; border: none; color: var(--teal); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.btn-danger {
  color: #fff; background: linear-gradient(180deg, #ff6a6a, #c93d3d);
  border: 2px solid #7a1f1f; box-shadow: 0 4px 0 #5c1616;
}
.btn-danger:hover { transform: translateY(-1px); }
.btn-danger:active { transform: translateY(2px); box-shadow: 0 2px 0 #5c1616; }

/* form fields shared by create + admin */
.fld { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.fld > span { font-family: var(--font-retro); font-size: 1.1rem; letter-spacing: 0.04em; color: var(--muted); }
.fld input, .fld select, .fld textarea,
.create-login input, .admin-login input {
  font-family: var(--font-retro); font-size: 1.2rem; color: var(--ink);
  background: var(--panel); border: 2px solid var(--line); padding: 9px 12px; width: 100%;
}
.fld textarea { font-family: "Courier New", monospace; font-size: 0.9rem; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---------- CREATE ---------- */
.create-gate { max-width: 560px; margin: 0 auto; padding: 28px; text-align: center; }
.create-gate h2 { margin: 0 0 10px; }
.create-login { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 8px; }
.create-err { min-height: 1.2em; font-family: var(--font-retro); font-size: 1.15rem; margin: 8px 0 0; }
.create-err.is-err { color: #ff8a6a; }
.create-err.is-ok { color: var(--teal); }

.create-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.create-canvas-col, .create-form-col { padding: 20px; }
.create-whoami { font-family: var(--font-retro); font-size: 1.1rem; color: var(--muted); margin: 0 0 12px; }
.create-canvas-wrap { background: #0e0a1c; border: 2px solid var(--line); padding: 8px; }
#pad { width: 100%; height: auto; display: block; image-rendering: pixelated; cursor: crosshair; touch-action: none; aspect-ratio: 1 / 1; }
.create-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; align-items: center; }
.tool-btn {
  font-family: var(--font-retro); font-size: 1.1rem; color: var(--ink);
  background: var(--panel); border: 2px solid var(--line); padding: 6px 12px; cursor: pointer;
}
.tool-btn.is-active { background: linear-gradient(180deg, #ffe49a, var(--gold)); color: #241800; border-color: var(--gold-dark); }
.toggle { font-family: var(--font-retro); font-size: 1.05rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.create-palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.swatch { width: 30px; height: 30px; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatch.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dark); }
.create-addcolor { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#color-input { width: 44px; height: 34px; background: none; border: 2px solid var(--line); padding: 0; cursor: pointer; }
.create-preview-lbl { font-family: var(--font-retro); color: var(--muted); margin-left: auto; }
#preview { image-rendering: pixelated; border: 2px solid var(--line); background: #0e0a1c; width: 64px; height: 64px; }
.create-form-col h2 { margin: 0 0 16px; }

.create-mine { margin-top: 46px; }
.create-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.create-card { display: flex; gap: 14px; padding: 14px; align-items: center; }
.cc-fig { flex: none; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; background: #0e0a1c; border: 1px solid var(--line-soft); }
.cc-fig canvas { max-width: 76px; max-height: 76px; }
.cc-body h3 { margin: 0 0 4px; font-family: var(--font-pixel); font-size: 0.72rem; color: var(--ink); }
.cc-kind, .cc-status, .cc-votes, .cc-royal, .vc-meta { margin: 2px 0; font-family: var(--font-retro); font-size: 1.05rem; color: var(--muted); }
.cc-status.cc-approved { color: var(--teal); }
.cc-status.cc-voting { color: var(--gold); }
.cc-status.cc-rejected { color: #ff8a6a; }
.cc-royal { color: var(--gold); }

/* ---------- VOTE ---------- */
.vote-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.vote-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px; gap: 10px; }
.vc-fig { width: 100%; display: flex; align-items: center; justify-content: center; background: #0e0a1c; border: 1px solid var(--line-soft); padding: 12px; }
.vc-fig canvas { max-width: 160px; max-height: 160px; }
.vc-body { width: 100%; }
.vc-body h3 { margin: 0 0 4px; font-family: var(--font-pixel); font-size: 0.74rem; color: var(--ink); }
.vc-actions { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.vote-btn {
  font-family: var(--font-retro); font-size: 1.3rem; color: var(--ink);
  background: var(--panel); border: 2px solid var(--line); padding: 8px 16px; cursor: pointer; min-width: 74px;
}
.vote-btn.up.is-on { background: rgba(20, 241, 149, 0.18); border-color: var(--teal); color: var(--teal); }
.vote-btn.down.is-on { background: rgba(255, 138, 106, 0.18); border-color: #ff8a6a; color: #ff8a6a; }

/* ---------- ADMIN ---------- */
.admin-main { max-width: 1180px; margin: 0 auto; padding: 96px 20px 60px; }
.admin-login { max-width: 420px; margin: 40px auto; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.admin-login h1 { margin: 0; }
.admin-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 12px; }
.admin-topbar h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tabs.sub { gap: 6px; }
.atab, .cfilter {
  font-family: var(--font-retro); font-size: 1.1rem; color: var(--muted);
  background: var(--panel); border: 2px solid var(--line); padding: 7px 14px; cursor: pointer;
}
.atab.is-active, .cfilter.is-active { background: linear-gradient(180deg, #ffe49a, var(--gold)); color: #241800; border-color: var(--gold-dark); }
.abadge { display: inline-block; background: #ff6a6a; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 0.9rem; margin-left: 4px; }
.admin-top-actions { margin-left: auto; display: flex; gap: 8px; }
.admin-top-actions .btn { padding: 8px 14px; }
.admin-status { min-height: 1.3em; font-family: var(--font-retro); font-size: 1.15rem; margin: 4px 0 14px; }
.admin-status.is-ok { color: var(--teal); }
.admin-status.is-err { color: #ff8a6a; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.admin-toolbar input[type="search"] { font-family: var(--font-retro); font-size: 1.2rem; color: var(--ink); background: var(--panel); border: 2px solid var(--line); padding: 8px 12px; min-width: 260px; }

.admin-cols { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-list { display: flex; flex-direction: column; gap: 4px; max-height: 620px; overflow-y: auto; padding-right: 4px; }
.pl-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: var(--panel); border: 1px solid var(--line-soft); padding: 9px 12px; cursor: pointer; color: var(--ink); }
.pl-row:hover { border-color: var(--purple); }
.pl-row.is-sel { border-color: var(--gold); background: var(--panel-2); }
.pl-nick { font-weight: 600; }
.pl-meta { font-family: var(--font-retro); font-size: 1rem; color: var(--muted); flex: none; }
.admin-edit { padding: 20px; }
.admin-edit h3 { margin: 0 0 4px; }
.pl-wallet { font-family: "Courier New", monospace; font-size: 0.78rem; color: var(--muted); word-break: break-all; margin: 0 0 14px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.pl-vip { font-family: var(--font-retro); font-size: 1.15rem; padding: 9px 12px; border: 2px solid var(--line); }
.pl-vip.on { color: var(--gold); border-color: var(--gold-dark); }
.pl-vip.off { color: var(--muted); }
.give-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 10px; align-items: end; margin: 6px 0 14px; }
.adv { margin: 8px 0 14px; }
.adv summary { cursor: pointer; font-family: var(--font-retro); font-size: 1.1rem; color: var(--purple-soft); margin-bottom: 10px; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.itbl { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 18px; overflow-x: auto; }
.itbl-head, .itbl-row { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(3, 70px) 110px; gap: 8px; align-items: center; }
.itbl.mon .itbl-head, .itbl.mon .itbl-row { grid-template-columns: minmax(110px, 1.2fr) repeat(6, 78px); }
.itbl-head { font-family: var(--font-retro); font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 2px 6px; border-bottom: 1px solid var(--line-soft); }
.itbl-row { padding: 3px 2px; }
.it-name { font-family: var(--font-retro); font-size: 1.15rem; color: var(--ink); }
.it-stat, .it-price, .mon-stat { font-family: "Courier New", monospace; font-size: 0.9rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); padding: 6px 6px; width: 100%; }
.it-price:disabled { opacity: 0.35; }
.it-stat:focus, .it-price:focus, .mon-stat:focus { outline: 1px solid var(--gold); }

.adm-cre { flex-direction: column; align-items: stretch; text-align: left; }
.adm-cre .cc-fig { width: 100%; height: 120px; margin-bottom: 8px; }
.adm-cre .cc-fig canvas { max-width: 108px; max-height: 108px; }
.cre-royal label { font-family: var(--font-retro); font-size: 1.05rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.cre-royal input { width: 80px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); padding: 5px; font-family: "Courier New", monospace; }
.cre-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cre-actions .btn { padding: 8px 12px; font-size: 0.6rem; }

.house-row { display: grid; grid-template-columns: 44px minmax(120px, 1fr) minmax(180px, 1.5fr) minmax(120px, 1fr) auto; gap: 12px; align-items: end; padding: 12px; margin-bottom: 10px; }
.hr-id { font-family: var(--font-pixel); font-size: 0.8rem; color: var(--gold); }
.hr-owner { font-family: var(--font-retro); font-size: 1.05rem; color: var(--muted); }

@media (max-width: 900px) {
  .create-layout { grid-template-columns: 1fr; }
  .admin-cols { grid-template-columns: 1fr; }
  .house-row { grid-template-columns: 1fr; }
}

/* ---------- ADMIN STUDIO + GM ---------- */
.studio-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0 16px; }
.studio-toolbar input[type="search"] { font-family: var(--font-retro); font-size: 1.15rem; color: var(--ink); background: var(--panel); border: 2px solid var(--line); padding: 8px 12px; min-width: 200px; }
.studio-cols { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.studio-list { display: flex; flex-direction: column; gap: 4px; max-height: 660px; overflow-y: auto; padding-right: 4px; }
.studio-row { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--panel); border: 1px solid var(--line-soft); padding: 6px 10px; cursor: pointer; color: var(--ink); }
.studio-row:hover { border-color: var(--purple); }
.studio-row.is-sel { border-color: var(--gold); background: var(--panel-2); }
.sr-fig { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; background: #0e0a1c; border: 1px solid var(--line-soft); }
.sr-fig canvas { max-width: 40px; max-height: 40px; image-rendering: pixelated; }
.sr-meta { display: flex; flex-direction: column; min-width: 0; }
.sr-meta b { font-family: var(--font-retro); font-size: 1.15rem; color: var(--ink); }
.sr-meta small { font-family: "Courier New", monospace; font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.studio-edit { padding: 18px; }
.studio-preview-wrap { display: flex; justify-content: center; align-items: flex-end; gap: 22px; background: #0e0a1c; border: 2px solid var(--line); padding: 10px; margin-bottom: 14px; }
.studio-prev-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.studio-prev-cap { font-family: var(--font-retro); color: var(--muted); font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; }
#studio-preview { image-rendering: pixelated; width: 232px; height: 272px; }
#studio-icon-preview { image-rendering: pixelated; width: 96px; height: 96px; }
.studio-sliders { border: 1px solid var(--line-soft); padding: 10px 12px; margin: 4px 0 12px; }
.ss-title { font-family: var(--font-retro); color: var(--gold); display: block; margin-bottom: 8px; }
.srng span b { color: var(--gold); }

/* ---- Map editor ---- */
.map-editor { margin-top: 8px; }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.map-toolbar .map-sep { flex: 1 1 auto; }
.map-toolbar .btn.is-active { outline: 2px solid var(--gold); }
.map-cols { display: flex; gap: 16px; align-items: flex-start; }
.map-canvas-wrap { flex: 1 1 auto; min-width: 0; background: #0e0a1c; border: 2px solid var(--line); padding: 6px; }
#map-canvas { display: block; width: 100%; height: auto; image-rendering: auto; background: #223; touch-action: none; cursor: default; }
.map-inspector { flex: 0 0 260px; min-height: 200px; }
.map-insp-h { font-family: var(--font-retro); color: var(--gold); font-size: 13px; margin: 0 0 8px; }
.map-coord { font-family: 'Courier New', monospace; color: var(--muted); font-size: 12px; margin: 6px 0; }
.map-inspector .btn { width: 100%; margin-top: 8px; }
.map-inspector .fld { display: block; margin-top: 10px; }
@media (max-width: 820px) { .map-cols { flex-direction: column; } .map-inspector { flex: 1 1 auto; width: 100%; } }
.srng input[type="range"] { width: 100%; accent-color: var(--gold); }
.mon-grid .fld { margin-bottom: 8px; }
.gm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line-soft); padding: 10px 12px; margin: 12px 0; font-family: var(--font-retro); font-size: 1.1rem; color: var(--muted); }
.gm-row.on { border-color: var(--gold-dark); color: var(--gold); }
@media (max-width: 900px) { .studio-cols { grid-template-columns: 1fr; } }

/* set builder */
.set-pieces { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.set-piece { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line-soft); padding: 8px; }
.set-piece > span { font-family: var(--font-retro); font-size: 1.05rem; color: var(--muted); }
.set-piece small { color: var(--gold); font-family: "Courier New", monospace; font-size: 0.7rem; }
.set-thumb { color: var(--teal); font-weight: bold; }
