/* ============ Reset & tokens ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'ss02';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  transition: background-color .45s ease, color .45s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

:root, [data-theme="dark"] {
  --bg: #0e0918;
  --bg-soft: #130c1f;
  --surface: #1a1128;
  --surface-2: #231636;
  --border: #2b1c42;
  --border-strong: #3d2860;
  --fg: #efe7fa;
  --fg-dim: #a89bc2;
  --fg-muted: #746789;
  --accent: #a855f7;
  --accent-2: #c084fc;
  --accent-warm: #e13bbd;
  --accent-warm-dim: #f06cce;
  --success: #4ade80;
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
  --shadow-hover: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 32px rgba(0,0,0,.45);
  --grid-line: rgba(255,255,255,.03);
}

[data-theme="light"] {
  --bg: #f5f1fb;
  --bg-soft: #ede6f7;
  --surface: #ffffff;
  --surface-2: #faf6ff;
  --border: #e3d8f0;
  --border-strong: #cab8e3;
  --fg: #1e1230;
  --fg-dim: #5c4d72;
  --fg-muted: #8a7ba3;
  --accent: #8b2fe0;
  --accent-2: #a855f7;
  --accent-warm: #c026a8;
  --accent-warm-dim: #d849c0;
  --success: #15803d;
  --shadow-card: 0 1px 0 rgba(255,255,255,.8) inset, 0 2px 0 rgba(0,0,0,.02), 0 10px 24px rgba(30,20,50,.06);
  --shadow-hover: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 28px rgba(30,20,50,.1);
  --grid-line: rgba(0,0,0,.03);
}

/* ============ Layout ============ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: 1200px;
  padding: 0 32px;
  margin: 0 auto;
}
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ============ Header / nav ============ */
.hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background-color .45s ease, border-color .45s ease;
}
.hdr__inner {
  display: flex; align-items: center; gap: 32px;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; letter-spacing: .02em;
}
.brand__logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
}
.brand__logo img { width: 100%; height: auto; image-rendering: crisp-edges; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-size: 16px; letter-spacing: .14em; text-transform: uppercase; }
.brand__tag { font-size: 10px; color: var(--accent-warm); letter-spacing: .22em; margin-top: 4px; font-weight: 600; }

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  position: relative;
  isolation: isolate;
}
.nav__pill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--surface);
  border-radius: 10px;
  z-index: -1;
  transition: transform .45s cubic-bezier(.22,.9,.3,1.2), width .45s cubic-bezier(.22,.9,.3,1.2), opacity .2s;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav__pill.is-hidden { opacity: 0; }
.nav__item {
  padding: 9px 16px;
  font-size: 14px; font-weight: 600;
  color: var(--fg-dim);
  border-radius: 10px;
  transition: color .3s ease;
  position: relative;
  z-index: 1;
}
.nav__item:hover { color: var(--fg); }
.nav__item--active { color: var(--fg); }
.nav__item--active::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: 3px;
  height: 2px; border-radius: 2px;
  background: var(--accent-warm);
  animation: underlineIn .45s cubic-bezier(.22,.9,.3,1.2);
}
@keyframes underlineIn {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.hdr__actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--fg-dim);
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.icon-btn:hover { color: var(--fg); background: var(--surface); border-color: var(--border); }
.icon-btn:active { transform: scale(.94); }

/* mobile nav toggle */
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .hdr__inner { gap: 16px; }
  .hdr__actions { margin-left: auto; }
  .hdr.is-open .nav {
    display: flex; position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; padding: 12px 20px 18px;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
  }
  .hdr.is-open .nav__item { padding: 14px 16px; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700; font-size: 14px;
  letter-spacing: .01em;
  transition: transform .15s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent-warm);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 18px rgba(225,59,189,.35);
}
.btn--primary:hover { background: var(--accent-warm-dim); }
.btn--ghost {
  color: var(--fg);
  border-color: var(--border-strong);
  background: transparent;
}
.btn--ghost:hover { background: var(--surface); }
.btn--lg { padding: 16px 22px; font-size: 15px; }

/* ============ Page transition ============ */
.page {
  animation: pageIn .55s cubic-bezier(.2,.7,.3,1);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.stagger > * {
  opacity: 0;
  transform: translateY(12px);
  animation: staggerIn .5s cubic-bezier(.2,.7,.3,1) forwards;
}
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .2s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }
.stagger > *:nth-child(7) { animation-delay: .35s; }
.stagger > *:nth-child(8) { animation-delay: .4s; }
@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

.tl-item { opacity: 0; transform: translateY(20px); animation: tlIn .6s cubic-bezier(.2,.7,.3,1) forwards; }
.tl-item:nth-child(1) { animation-delay: .1s; }
.tl-item:nth-child(2) { animation-delay: .2s; }
.tl-item:nth-child(3) { animation-delay: .3s; }
.tl-item:nth-child(4) { animation-delay: .4s; }
.tl-item:nth-child(5) { animation-delay: .5s; }
.tl-item:nth-child(6) { animation-delay: .6s; }
@keyframes tlIn { to { opacity: 1; transform: translateY(0); } }

.brand__logo img { transition: transform .5s cubic-bezier(.2,.8,.3,1.3); }
.brand:hover .brand__logo img { transform: rotate(-8deg) scale(1.08); }

.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s;
}
.btn--primary:hover::after { transform: translateX(120%); }

.feat, .step, .plan, .wiki-entry, .tl-item__card, .qr, .ip-card, .stat {
  transition: transform .35s cubic-bezier(.2,.8,.3,1.2), border-color .3s, box-shadow .3s;
}
.feat:hover, .step:hover, .wiki-entry:hover, .stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* ============ Hero / home ============ */
.hero {
  position: relative;
  padding: 64px 0 72px;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 20px;
}
.hero__eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-warm) 25%, transparent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-warm) 25%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent-warm) 5%, transparent); }
}
.hero__title {
  font-size: clamp(56px, 8vw, 112px);
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 0 0 20px;
}
.hero__title em {
  font-style: normal;
  color: var(--accent-warm);
}
.hero__meta {
  display: flex; gap: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--fg-dim);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta span::before {
  content: '';
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}
.hero__desc {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 520px;
  margin: 0 0 32px;
  text-wrap: pretty;
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
}
.hero__cube {
  position: relative;
  width: min(420px, 90%);
  aspect-ratio: 1;
}
.hero__cube img {
  width: 100%; height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  filter: drop-shadow(0 30px 60px rgba(225,59,189,.35)) drop-shadow(0 10px 24px rgba(168,85,247,.35));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
.hero__cube::after {
  content: '';
  position: absolute;
  inset: auto 10% -6%;
  height: 30px;
  background: radial-gradient(ellipse, rgba(0,0,0,.4), transparent 70%);
  filter: blur(12px);
  animation: shadow 6s ease-in-out infinite;
}
[data-theme="light"] .hero__cube::after { background: radial-gradient(ellipse, rgba(20,10,40,.25), transparent 70%); }
@keyframes shadow {
  0%, 100% { transform: scaleX(1); opacity: .7; }
  50% { transform: scaleX(.85); opacity: .4; }
}
.hero__badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__badge {
  position: absolute;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  display: flex; align-items: center; gap: 10px;
  animation: floatSmall 5s ease-in-out infinite;
}
.hero__badge strong { color: var(--fg); font-size: 14px; }
.hero__badge--tl { top: 10%; left: -8%; animation-delay: -1s; }
.hero__badge--br { bottom: 14%; right: -4%; animation-delay: -3s; }
@media (max-width: 900px) { .hero__badge--tl, .hero__badge--br { display: none; } }
@keyframes floatSmall {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============ Online counter ============ */
.online-counter {
  display: inline-flex;
  align-items: stretch;
  gap: 16px;
  padding: 14px 20px 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}
.online-counter__dot {
  display: grid; place-items: center;
  width: 32px;
}
.online-counter__dot span {
  width: 10px; height: 10px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 25%, transparent);
  animation: pulse 1.6s ease-in-out infinite;
}
.online-counter__body { display: flex; gap: 14px; align-items: center; }
.online-counter__num {
  font-variant-numeric: tabular-nums;
  font-size: 34px; font-weight: 800;
  letter-spacing: -.02em;
  color: var(--fg);
  line-height: 1;
  font-feature-settings: 'tnum';
}
.online-counter__meta { font-size: 12px; line-height: 1.35; color: var(--fg-dim); }
.online-counter__meta > div:first-child { font-weight: 600; color: var(--fg); font-size: 13px; }
.online-counter__peak { color: var(--fg-muted); margin-top: 2px; }

/* ============ IP cards ============ */
.ip-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}
@media (max-width: 640px) { .ip-row { grid-template-columns: 1fr; } }
.ip-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  transition: border-color .2s, transform .2s;
}
.ip-card:hover { border-color: var(--border-strong); }
.ip-card__head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  margin-bottom: 10px;
}
.ip-card__region { color: var(--fg-dim); font-weight: 600; }
.ip-card__ping { color: var(--success); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.ip-card__ip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--fg);
  letter-spacing: -.01em;
}
.ip-card__btn { width: 100%; }

/* ============ Callout / access banner ============ */
.callout {
  margin-top: 32px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.callout::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-warm);
}
.callout__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-warm) 18%, transparent);
  color: var(--accent-warm);
}
.callout__title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.callout__body { font-size: 14px; color: var(--fg-dim); line-height: 1.5; }
.callout__body code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--accent);
}
@media (max-width: 640px) {
  .callout { grid-template-columns: 1fr; }
  .callout__icon { display: none; }
}

/* ============ Sections ============ */
section.block {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}
section.block--no-border { border-top: none; }

.section-head { text-align: center; margin-bottom: 56px; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.02em;
  font-weight: 800;
  margin: 0;
}
.section-sub {
  margin: 14px auto 0;
  max-width: 560px;
  color: var(--fg-dim);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ============ Feature grid ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 800px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features-grid { grid-template-columns: 1fr; } }
.feat {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform .3s, border-color .3s;
  position: relative;
  overflow: hidden;
}
.feat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.feat__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-warm);
  margin-bottom: 18px;
  letter-spacing: .1em;
}
.feat__title { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.feat__body { font-size: 14px; color: var(--fg-dim); line-height: 1.55; margin: 0; }

/* ============ Steps ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  counter-reset: step;
}
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step {
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}
.step__num {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700;
  color: var(--accent-warm);
  margin-bottom: 18px;
}
.step__title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.step__body { font-size: 14px; color: var(--fg-dim); line-height: 1.55; margin: 0; }
.step__body code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent);
}

/* ============ QR blocks ============ */
.qr-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 680px;
  margin: 36px auto 0;
}
@media (max-width: 560px) { .qr-row { grid-template-columns: 1fr; } }
.qr {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 18px;
  align-items: center;
  transition: border-color .2s, transform .2s;
}
.qr:hover { border-color: var(--border-strong); }
.qr__code {
  width: 128px; height: 128px;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid; place-items: center;
}
.qr__code img { width: 100%; height: 100%; object-fit: contain; }
.qr__label { font-size: 12px; color: var(--accent-warm); letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }
.qr__title { font-size: 17px; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.qr__body { font-size: 13px; color: var(--fg-dim); line-height: 1.5; margin: 0 0 10px; }
.qr__link { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); }

/* ============ Lore timeline ============ */
.lore-intro { max-width: 760px; margin: 0 auto 48px; text-align: center; color: var(--fg-dim); font-size: 17px; line-height: 1.6; }
.season-tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: .1em;
  color: var(--fg-dim);
  margin-bottom: 40px;
}
.season-tag span.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-warm); }

.timeline {
  position: relative;
  padding: 12px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 22px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border-strong);
}
@media (min-width: 820px) {
  .timeline::before { left: 50%; }
}
.tl-item {
  position: relative;
  padding-left: 64px;
  padding-bottom: 36px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item__dot {
  position: absolute;
  left: 16px; top: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-warm);
}
.tl-item__date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-warm);
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.tl-item__card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .2s;
}
.tl-item__card:hover { border-color: var(--border-strong); }
.tl-item__title { font-size: 18px; font-weight: 700; margin: 0 0 8px; letter-spacing: -.01em; }
.tl-item__body { font-size: 14.5px; color: var(--fg-dim); line-height: 1.6; margin: 0; }

@media (min-width: 820px) {
  .tl-item { width: 50%; padding-left: 0; padding-right: 48px; }
  .tl-item__dot { left: auto; right: -7px; top: 24px; }
  .tl-item--right { margin-left: 50%; padding-left: 48px; padding-right: 0; }
  .tl-item--right .tl-item__dot { left: -7px; right: auto; }
}

/* ============ Rules ============ */
.rule-groups { display: flex; flex-direction: column; gap: 16px; max-width: 820px; margin: 0 auto; }
.rule-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.rule-group__head {
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.rule-group__title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 14px; }
.rule-group__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-warm);
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  letter-spacing: .1em;
}
.rule-group__chev { color: var(--fg-muted); transition: transform .3s; }
.rule-group--open .rule-group__chev { transform: rotate(90deg); }
.rule-group__body {
  overflow: hidden;
  transition: max-height .4s ease, opacity .3s;
  max-height: 0;
  opacity: 0;
}
.rule-group--open .rule-group__body { max-height: 6000px; opacity: 1; }
.rule-group__intro {
  margin: 0 24px 8px;
  padding: 0 0 10px 28px;
  font-size: 13.5px;
  color: var(--fg-muted);
  font-style: italic;
}
.rule-group__list {
  margin: 0;
  padding: 0 24px 22px 24px;
  list-style: none;
  display: flex; flex-direction: column;
  gap: 4px;
}
.rule-group__list > li {
  padding: 10px 0 10px 28px;
  font-size: 14.5px;
  color: var(--fg-dim);
  line-height: 1.55;
  position: relative;
  border-top: 1px solid var(--border);
}
.rule-group__list > li::before {
  content: '';
  position: absolute;
  left: 0; top: 19px;
  width: 14px; height: 1px;
  background: var(--accent-warm);
}
.rule-item__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-warm);
  margin-right: 6px;
  font-weight: 600;
}
.rule-group__sublist {
  margin: 8px 0 0;
  padding: 0 0 0 16px;
  list-style: none;
  display: flex; flex-direction: column;
  gap: 6px;
}
.rule-group__sublist li {
  position: relative;
  padding: 4px 0 4px 16px;
  font-size: 13.5px;
  color: var(--fg-muted);
  line-height: 1.55;
}
.rule-group__sublist li::before {
  content: '•';
  position: absolute;
  left: 0; top: 3px;
  color: var(--accent-cool);
}

/* ============ Wiki ============ */
.wiki-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap; margin-bottom: 28px;
}
.wiki-head__auth { display: flex; align-items: center; gap: 12px; }

.wiki-me { display: flex; align-items: center; gap: 12px; }

.wiki-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 880px) { .wiki-layout { grid-template-columns: 1fr; } }

.wiki-sidebar {
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}
@media (max-width: 880px) { .wiki-sidebar { position: static; max-height: none; } }

.wiki-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 8px;
}
.wiki-cat__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--fg-dim);
  margin-bottom: 10px;
}
.wiki-cat__icon { font-size: 16px; }
.wiki-cat__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }

.wiki-link {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--fg-dim);
  background: transparent; border: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.wiki-link:hover { color: var(--fg); background: var(--surface-2); }
.wiki-link.is-active { color: var(--fg); background: var(--surface-2); border: 1px solid var(--border-strong); }
.wiki-link.is-empty { color: var(--fg-dim); opacity: .8; }
.wiki-link__stub {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--border); color: var(--fg-dim);
}

.wiki-main { min-width: 0; }
.wiki-empty {
  padding: 60px 24px; text-align: center; color: var(--fg-dim);
  background: var(--surface); border: 1px dashed var(--border); border-radius: 14px;
}

.wiki-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px 36px;
}
.wiki-article__head { margin-bottom: 24px; }
.wiki-article__cat { font-size: 12px; font-weight: 700; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .5px; }
.wiki-article__title { font-size: 28px; font-weight: 800; margin: 6px 0 16px; line-height: 1.15; }
.wiki-article__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.wiki-article__placeholder-author { font-size: 13px; color: var(--fg-dim); font-style: italic; }
.wiki-article__empty { padding: 24px 0; color: var(--fg-dim); }

.wiki-article__body {
  font-size: 15.5px; line-height: 1.7; color: var(--fg);
}
.wiki-article__body h1, .wiki-article__body h2, .wiki-article__body h3 {
  margin: 28px 0 12px; font-weight: 700; line-height: 1.25;
}
.wiki-article__body h1 { font-size: 24px; }
.wiki-article__body h2 { font-size: 20px; }
.wiki-article__body h3 { font-size: 17px; }
.wiki-article__body p { margin: 0 0 14px; }
.wiki-article__body ul, .wiki-article__body ol { padding-left: 22px; margin: 0 0 14px; }
.wiki-article__body li { margin-bottom: 4px; }
.wiki-article__body code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  padding: 2px 6px; border-radius: 4px;
  color: var(--accent);
  font-size: 13px;
}
.wiki-article__body pre {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  margin: 0 0 14px;
}
.wiki-article__body pre code { background: transparent; padding: 0; }
.wiki-article__body a { color: var(--accent); text-decoration: underline; }
.wiki-article__body blockquote {
  border-left: 3px solid var(--accent); padding-left: 14px;
  color: var(--fg-dim); margin: 0 0 14px;
}
.wiki-article__body img { max-width: 100%; border-radius: 10px; }

/* Author badge */
.wiki-author { display: flex; align-items: center; gap: 10px; }
.wiki-author__avatar {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  image-rendering: pixelated;
}
.wiki-author__avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.wiki-author__avatar-fallback {
  font-weight: 700; font-size: 16px; color: var(--fg-dim);
}
.wiki-author__label { font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .5px; }
.wiki-author__nick { font-size: 14px; font-weight: 600; }

/* Editor */
.wiki-editor { display: flex; flex-direction: column; gap: 12px; }
.wiki-editor__bar {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.wiki-editor__bar .btn { padding: 6px 12px; font-size: 13px; }
.wiki-editor__bar .btn.is-active { background: var(--surface-2); color: var(--fg); }
.wiki-editor__hint { margin-left: auto; font-size: 12px; color: var(--fg-dim); }
.wiki-editor__textarea {
  width: 100%; min-height: 360px; resize: vertical;
  padding: 14px 16px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--fg); font-size: 14px; line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
}
.wiki-editor__actions { display: flex; justify-content: flex-end; gap: 10px; }

.wiki-notice {
  padding: 12px 16px; border-radius: 10px;
  background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .3);
  color: var(--fg); font-size: 14px; margin-bottom: 16px;
}

/* Login modal */
.wiki-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.wiki-modal__inner {
  position: relative; width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 28px 28px 24px;
}
.wiki-modal__close {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: none; font-size: 24px; color: var(--fg-dim);
  cursor: pointer; line-height: 1;
}
.wiki-modal__close:hover { color: var(--fg); }
.wiki-modal__title { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.wiki-modal__sub { font-size: 14px; color: var(--fg-dim); line-height: 1.5; margin: 0 0 16px; }
.wiki-modal__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.wiki-modal__field span { font-size: 13px; font-weight: 600; color: var(--fg-dim); }
.wiki-modal__field input {
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--fg); font-size: 15px;
}
.wiki-modal__field input:focus { outline: none; border-color: var(--accent); }
.wiki-modal__error {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(239, 68, 68, .12); color: #fca5a5;
  font-size: 13px; margin-bottom: 14px;
}
.wiki-modal__hint { font-size: 13px; color: var(--fg-dim); margin: 12px 0 0; }
.wiki-modal__ok { text-align: center; padding: 24px 0; color: #22c55e; }
.wiki-modal__ok h3 { color: var(--fg); margin: 12px 0 0; }

.wiki-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px; font-weight: 700;
  text-align: center; letter-spacing: 6px;
  padding: 18px; margin: 14px 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--accent);
}

.btn--sm { padding: 6px 14px; font-size: 13px; }

.wiki-article__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wiki-delete-btn:hover { color: #fca5a5; border-color: rgba(239, 68, 68, .4); }
.wiki-create-btn { width: 100%; justify-content: center; margin-top: 8px; }

.wiki-modal__inner--wide { max-width: 620px; }
.wiki-modal__field select {
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--fg); font-size: 15px;
}
.wiki-modal__field textarea {
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--fg); font-size: 14px; line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
  resize: vertical;
}

/* ============ Shop ============ */
.shop-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 900px) { .shop-grid { grid-template-columns: 1fr; } }
.plan {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .3s;
}
.plan:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan--featured { border-color: var(--accent-warm); }
.plan--featured::before {
  content: 'Популярный';
  position: absolute;
  top: -12px; left: 20px;
  padding: 5px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  background: var(--accent-warm);
  color: #fff;
  border-radius: 6px;
}
.plan { position: relative; }
.plan--soon { opacity: .55; filter: saturate(.7); }
.plan--soon button { cursor: not-allowed; }
.plan__badge {
  position: absolute;
  top: -12px; right: 20px;
  padding: 5px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  background: var(--surface-2);
  color: var(--fg-dim);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  text-transform: uppercase;
}
.plan__name { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.plan__price {
  font-size: 40px; font-weight: 800; letter-spacing: -.02em;
  color: var(--accent-warm);
  margin-bottom: 20px;
  line-height: 1;
}
.plan__perks { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan__perks li {
  padding-left: 26px;
  position: relative;
  font-size: 14px; color: var(--fg-dim); line-height: 1.45;
}
.plan__perks li::before {
  content: '';
  position: absolute;
  left: 0; top: 5px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--accent-warm);
  border-bottom: 2px solid var(--accent-warm);
  transform: rotate(-45deg);
}
.plan__tagline {
  margin: 0 0 24px;
  font-size: 14px; color: var(--fg-dim); line-height: 1.5;
  flex: 1;
}

.sponsor-included {
  margin: 8px auto 36px;
  max-width: 820px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-warm);
  border-radius: 16px;
}
.sponsor-included__title {
  margin: 0 0 14px;
  font-size: 18px; font-weight: 700;
  color: var(--accent-warm);
}
.sponsor-included__intro {
  margin: 0 0 14px;
  font-size: 14.5px; color: var(--fg-dim); line-height: 1.6;
}
.sponsor-included__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.sponsor-included__list li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px; color: var(--fg); line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.sponsor-included__list li::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--accent-warm);
  border-bottom: 2px solid var(--accent-warm);
  transform: rotate(-45deg);
}
.sponsor-included code {
  padding: 1px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
@media (max-width: 600px) {
  .sponsor-included { padding: 22px 18px; }
  .sponsor-included__list li { padding-left: 22px; font-size: 14px; }
  .sponsor-included code { font-size: 12.5px; }
}
.shop-note {
  text-align: center; margin-top: 28px;
  font-size: 14px; color: var(--fg-dim);
}
.shop-note strong { color: var(--accent-warm); }

.checkout {
  margin: 36px auto 0;
  max-width: 780px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
}
.checkout__title {
  margin: 0 0 18px;
  font-size: 20px; font-weight: 700;
}
.checkout__empty {
  margin: 0 0 18px;
  color: var(--fg-muted);
  font-size: 14.5px;
}
.checkout__items {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border);
}
.checkout__item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.checkout__item-name { font-weight: 600; color: var(--fg); }
.checkout__item-qty {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
}
.checkout__item-qty button {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 16px; line-height: 1;
  transition: border-color .15s, color .15s;
}
.checkout__item-qty button:hover { border-color: var(--accent-warm); color: var(--accent-warm); }
.checkout__item-qty span { min-width: 20px; text-align: center; font-weight: 600; }
.checkout__item-sum {
  font-weight: 700;
  color: var(--accent-warm);
  min-width: 80px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}
.checkout__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 600px) { .checkout__form { grid-template-columns: 1fr; } }
.checkout__field { display: flex; flex-direction: column; gap: 6px; }
.checkout__field span {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.checkout__field input {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color .15s;
}
.checkout__field input:focus {
  outline: none;
  border-color: var(--accent-warm);
}
.checkout__error {
  padding: 10px 14px;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: 10px;
  color: #ef4444;
  font-size: 13.5px;
}
.checkout__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.checkout__total {
  display: flex; align-items: baseline; gap: 10px;
}
.checkout__total span { color: var(--fg-muted); font-size: 14px; }
.checkout__total strong {
  font-size: 24px; font-weight: 800;
  color: var(--accent-warm);
  font-family: 'JetBrains Mono', monospace;
}
.checkout__total small { color: var(--fg-muted); font-size: 13px; }

/* ============ Screenshots gallery ============ */
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}
.gallery > :nth-child(1) { grid-row: span 2; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: none; } .gallery > :nth-child(1) { grid-row: auto; grid-column: span 2; } }
.gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0;
  cursor: zoom-in;
  transition: transform .25s, border-color .2s;
}
.gallery__item:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.gallery__item:hover img { transform: scale(1.03); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  cursor: zoom-out;
  animation: fade-in .2s ease;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ============ Placeholder ============ */
.ph {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: oklch(32% 0.08 var(--ph-hue));
  border: 1px solid var(--border);
}
[data-theme="light"] .ph { background: oklch(88% 0.04 var(--ph-hue)); }
.ph__stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 14px,
    rgba(255,255,255,.04) 14px, rgba(255,255,255,.04) 28px
  );
}
[data-theme="light"] .ph__stripes {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 14px,
    rgba(0,0,0,.05) 14px, rgba(0,0,0,.05) 28px
  );
}
.ph__label {
  position: absolute;
  left: 16px; bottom: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}
.ph__tag {
  align-self: flex-start;
  font-size: 10px; letter-spacing: .1em;
  padding: 4px 8px;
  background: rgba(0,0,0,.5);
  color: #fff;
  border-radius: 4px;
}
[data-theme="light"] .ph__tag { background: rgba(0,0,0,.75); }
.ph__text {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  letter-spacing: .02em;
}
[data-theme="light"] .ph__text { color: rgba(20,10,40,.6); }

/* ============ About page ============ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.stat__n {
  font-size: 36px; font-weight: 800;
  letter-spacing: -.02em;
  color: var(--accent-warm);
  line-height: 1;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}
.stat__n small { font-size: 18px; color: var(--fg-muted); margin-left: 4px; font-weight: 600; }
.stat__label { font-size: 13px; color: var(--fg-dim); margin-top: 10px; }

.about-prose { max-width: 720px; margin: 0 auto; font-size: 17px; line-height: 1.7; color: var(--fg-dim); }
.about-prose p + p { margin-top: 16px; }
.about-prose strong { color: var(--fg); }

/* ============ Footer ============ */
.ftr {
  margin-top: auto;
  padding: 48px 0 36px;
  border-top: 1px solid var(--border);
}
.ftr__inner {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.ftr__brand { display: flex; align-items: center; gap: 10px; }
.ftr__brand-logo { height: 32px; }
.ftr__links { display: flex; gap: 10px; }
.ftr__social {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--fg-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color .2s, border-color .2s, transform .2s;
}
.ftr__social:hover { color: var(--accent-warm); border-color: var(--accent-warm); transform: translateY(-2px); }
.ftr__copy { font-size: 13px; color: var(--fg-muted); font-family: 'JetBrains Mono', monospace; }
.ftr__ip { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--fg-muted); }
.ftr__ip strong { color: var(--fg-dim); }

/* ============ Background grid effect ============ */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 20%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, black 20%, transparent 75%);
}

/* ============ Selection ============ */
::selection { background: var(--accent-warm); color: #fff; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 100;
  display: flex; align-items: center; gap: 10px;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { color: var(--success); }

/* ============ Status page ============ */
.status-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  --tone: var(--fg-muted);
}
.status-hero--ok  { --tone: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.status-hero--warn { --tone: #f59e0b; border-color: color-mix(in srgb, #f59e0b 40%, var(--border)); }
.status-hero--err { --tone: #ef4444; border-color: color-mix(in srgb, #ef4444 40%, var(--border)); }
.status-hero__dot {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 15%, transparent);
}
.status-hero__dot span {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone) 25%, transparent);
  animation: pulse 1.8s ease-in-out infinite;
}
.status-hero__title { font-size: 18px; font-weight: 700; color: var(--fg); }
.status-hero__meta { font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.status-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .25s, transform .25s;
  --tone: var(--fg-muted);
}
.status-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.status-card--ok  { --tone: var(--success); border-left: 3px solid var(--success); }
.status-card--warn { --tone: #f59e0b; border-left: 3px solid #f59e0b; }
.status-card--err { --tone: #ef4444; border-left: 3px solid #ef4444; }
.status-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-card__label { font-size: 15px; font-weight: 700; color: var(--fg); }
.status-card__badge {
  padding: 3px 10px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  border-radius: 999px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  white-space: nowrap;
}
.status-card__desc { font-size: 12.5px; color: var(--fg-dim); font-family: 'JetBrains Mono', monospace; }
.status-card__detail { font-size: 12px; color: var(--fg-muted); }
.status-card__latency { font-size: 12px; color: var(--fg-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

.status-foot { display: flex; justify-content: center; margin-top: 8px; }

@media (max-width: 600px) {
  .status-hero { grid-template-columns: auto 1fr; padding: 18px 18px; }
  .status-hero .btn { grid-column: 1 / -1; justify-self: stretch; }
}

/* ============ Adaptive refinements ============ */
@media (max-width: 900px) {
  section.block { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero { padding: 40px 0 48px; }
  section.block { padding: 52px 0; }
  .hdr__inner { gap: 12px; height: 60px; }
  .hdr.is-open .nav { top: 60px; }
  .brand__text { display: none; }
  .brand__logo { width: 36px; height: 36px; }
  .online-counter { display: flex; width: 100%; align-items: center; padding: 12px 14px; gap: 12px; }
  .online-counter__num { font-size: 28px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
  .callout { padding: 22px; }
  .callout__title { font-size: 16px; }
  .shop-grid { grid-template-columns: 1fr; }
  .checkout { padding: 22px 20px; }
  .checkout__item { grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 6px; }
  .checkout__item-name { grid-column: 1 / -1; }
  .checkout__item-qty { justify-self: start; }
  .checkout__item-sum { justify-self: end; }
  .checkout__foot { flex-direction: column; align-items: stretch; gap: 14px; }
  .checkout__foot .btn { width: 100%; }
  .status-grid { grid-template-columns: 1fr; }
  .status-card__head { flex-wrap: wrap; }
  .ftr__ip { text-align: center; }
}
@media (max-width: 420px) {
  .hdr__actions { gap: 4px; }
  .icon-btn { width: 34px; height: 34px; }
  .hero__title { font-size: clamp(40px, 12vw, 72px); }
}
