:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --line: #243049;
  --text: #eef3ff;
  --muted: #9aa8c2;
  --gold: #f5c542;
  --green: #3dd68c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #14301c;
  color: var(--text);
  font-family: Outfit, system-ui, sans-serif;
}

.mc-world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mc-world::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(6, 16, 22, 0.18), rgba(6, 16, 22, 0.34));
  z-index: 1;
}

.mc-world-img {
  display: block;
  width: 100%;
  height: 180vh;
  min-height: 180vh;
  object-fit: cover;
  object-position: center 40%;
  image-rendering: auto;
  will-change: transform;
}

.topbar,
main,
.admin-main,
.site-footer,
.legal-main {
  position: relative;
  z-index: 1;
}

.brand-home {
  display: flex;
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 28px 7vw 40px;
  margin-top: 12px;
}

.site-footer a {
  color: #f4f7ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
}

.site-footer a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.legal-main {
  padding: 8px 7vw 40px;
  max-width: 820px;
  margin: 0 auto;
}

.legal-card {
  background: rgba(10, 16, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 28px 28px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.legal-card h2 {
  margin: 6px 0 8px;
  font-size: 2rem;
}

.legal-card h3 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  color: var(--gold);
}

.legal-card p,
.legal-card a {
  color: #e8eefc;
  line-height: 1.55;
}

.legal-card a {
  color: #9fd0ff;
}

.legal-lead {
  margin-top: 0;
  color: var(--muted) !important;
}

.legal-label {
  color: var(--muted);
  margin-right: 6px;
}

.about-main {
  padding: 8px 7vw 40px;
  max-width: 860px;
  margin: 0 auto;
}

.about-card h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.about-card ul {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  color: #e8eefc;
  line-height: 1.55;
}

.about-card li {
  margin: 0.25rem 0;
}

.about-card code {
  font-family: "Press Start 2P", monospace;
  font-size: 0.58rem;
  color: var(--gold);
}

.about-votes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-ip {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #9fd0ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-ip:hover {
  color: var(--gold);
}

a.shop-nav-btn,
.shop-nav-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.about-shop-cta {
  margin-top: 28px;
  margin-bottom: 4px;
}

a.shop-cta-btn,
.shop-cta-btn {
  display: inline-flex;
  width: auto;
  min-width: 180px;
  text-align: center;
  text-decoration: none;
  justify-content: center;
}

.shop-coming-soon {
  opacity: 0.72;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
  filter: grayscale(0.15);
}

.wiki-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 8px 7vw 48px;
  max-width: 1180px;
  margin: 0 auto;
}

.wiki-nav {
  position: sticky;
  top: 16px;
  padding: 18px 16px 20px;
}

.wiki-nav .pixel {
  margin-bottom: 10px;
}

.wiki-search-label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.wiki-search-label input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  padding: 10px 12px;
  font: inherit;
}

.wiki-nav nav {
  display: grid;
  gap: 6px;
}

.wiki-nav a {
  color: #e8eefc;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 8px;
  border-radius: 8px;
}

.wiki-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

.wiki-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.wiki-article h2 {
  margin-top: 0;
}

.cmd-list {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
}

.cmd-list > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cmd-list dt {
  margin: 0;
}

.cmd-list dd {
  margin: 0;
  color: #d7e0f5;
  line-height: 1.5;
}

.az-list {
  columns: 2;
  column-gap: 24px;
}

.az-list li {
  break-inside: avoid;
  margin: 0.35rem 0;
}

@media (max-width: 900px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }

  .wiki-nav {
    position: static;
  }

  .az-list {
    columns: 1;
  }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 7vw;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand h1,
.section-head h3,
.hero h2 {
  margin: 0;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.12em;
  font-size: 12px;
  text-transform: uppercase;
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: transparent;
  display: block;
  flex-shrink: 0;
}

.cube {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #5dce6a, #2f8a45);
  box-shadow: 6px 6px 0 #1d4d2a, inset 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.map-btn {
  display: inline-flex;
  align-items: center;
}

.ip-chip,
.map-btn,
.cart-btn,
.primary,
.ghost,
.product button {
  border: 1px solid var(--line);
  background: #172033;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.cart-btn,
.primary,
.product button {
  background: var(--gold);
  color: #1a1403;
  border-color: transparent;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: #1a1403;
  color: var(--gold);
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

main,
.admin-main {
  padding: 0 7vw 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  align-items: center;
  margin: 12px 0 48px;
}

.pixel {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: var(--green);
}

.lead,
.section-head p,
.hint,
.muted {
  color: var(--muted);
}

.on-bg,
.section-head p.on-bg {
  color: #ffffff;
  background: rgba(8, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  max-width: 58ch;
}

.hero-card,
.product,
.drawer-panel,
.modal-card,
.login-card,
.order-card {
  background: rgba(18, 26, 43, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
}

.hero-card ol {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}

.grid.perms {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.grid.perms .product {
  padding: 12px 10px 14px;
  gap: 6px;
}

.grid.perms h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  padding-right: 52px;
}

.grid.perms .muted {
  font-size: 12px;
}

.grid.perms .price {
  font-size: 20px;
}

.grid.perms .duration {
  font-size: 12px;
}

.grid.perms ul {
  margin: 0 0 4px;
  padding-left: 16px;
  font-size: 12px;
}

.grid.perms button {
  padding: 8px 10px;
  font-size: 13px;
}

.grid.perms .ribbon {
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 3px 6px;
}

.grid.ranks {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.grid.ranks .product {
  padding: 14px 12px;
  gap: 6px;
}

.grid.ranks h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.grid.ranks .muted {
  font-size: 12px;
  line-height: 1.35;
}

.product {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.product.featured {
  outline: 2px solid var(--gold);
}

.ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--gold);
  color: #1a1403;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}

.price {
  font-size: 28px;
  font-weight: 800;
}

.duration {
  color: var(--muted);
  font-size: 14px;
}

.product ul {
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--muted);
  flex: 1;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
  display: none;
  justify-content: flex-end;
}

.drawer.is-open {
  display: flex;
}

.drawer-panel {
  width: min(420px, 100%);
  height: 100%;
  border-radius: 0;
  padding: 22px;
  overflow: auto;
}

.drawer-head,
.checkout label,
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  min-height: 120px;
  margin: 16px 0;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d1524;
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}

.checkout,
.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card {
  max-width: 420px;
  padding: 24px;
  margin: 20px 0 32px;
}

.primary {
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 20px;
}

.modal-card {
  max-width: 520px;
  width: 100%;
  padding: 24px;
}

.pay-box {
  background: #0d1524;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0 18px;
  color: var(--muted);
  white-space: pre-wrap;
}

.orders {
  display: grid;
  gap: 14px;
}

.order-card {
  padding: 18px;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

button.danger {
  background: #8b2a2a;
  color: #fff7f7;
  border-color: transparent;
  font-weight: 700;
}

.status.cancelled,
.status.refunded {
  background: #3a1520;
  color: #fca5a5;
}

.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #243049;
}

.status.pending {
  background: #4a3b12;
  color: var(--gold);
}

.status.paid,
.status.delivered {
  background: #12351f;
  color: var(--green);
}

.status.paid_pending_rcon,
.status.checkout_failed {
  background: #4a1f12;
  color: #fdba74;
}

.lookup-card,
.progress-card {
  background: rgba(18, 26, 43, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.rank-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.rank-tools .lookup-card {
  grid-column: 1;
}

.rank-tools .buyers-board {
  grid-column: 3;
}

.rank-tools .lookup-card,
.rank-tools .buyers-board {
  margin-bottom: 0;
}

.lookup-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: end;
}

.lookup-card label {
  display: grid;
  gap: 6px;
}

.lookup-card input,
.checkout input {
  width: 100%;
}

.lookup-card .hint {
  grid-column: 1 / -1;
  margin: 0;
}

.progress-card h4,
.progress-card h5 {
  margin: 6px 0;
}

.owned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.owned-list li {
  background: #172033;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
}

.product.owned {
  opacity: 0.48;
  filter: grayscale(0.85);
  pointer-events: none;
}

.product.locked {
  opacity: 0.42;
  filter: grayscale(1);
  pointer-events: none;
}

.progress-card.staff {
  outline: 2px solid var(--gold);
}

.progress-card.unknown {
  outline: 2px solid #c45b5b;
}

.buyers-board {
  display: grid;
  grid-template-columns: 220px 220px;
  gap: 10px;
  margin-bottom: 18px;
}

.buyers-top,
.buyers-recent {
  background: rgba(18, 26, 43, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.buyers-top {
  outline: 2px solid var(--gold);
}

.buyers-top .eyebrow,
.buyers-recent .eyebrow {
  margin-bottom: 8px;
}

.buyers-top h4 {
  margin: 0;
  font-size: 22px;
}

.buyers-top .price {
  margin-top: 8px;
  color: var(--gold);
}

.buyers-list {
  display: grid;
  gap: 2px;
}

.buyers-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.buyers-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.product.current-rank {
  outline: 2px solid var(--green);
}

.ribbon.owned {
  background: #12351f;
  color: var(--green);
}

.product button:disabled {
  background: #243049;
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .hero,
  .buyers-board,
  .rank-tools {
    grid-template-columns: 1fr;
  }

  .rank-tools .lookup-card,
  .rank-tools .buyers-board {
    grid-column: auto;
  }

  .grid.ranks,
  .grid.perms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .top-actions {
    flex-wrap: wrap;
  }

  .lookup-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: max(14px, env(safe-area-inset-top)) 16px 8px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand h1 {
    font-size: 1.45rem;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .top-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 15px;
    white-space: nowrap;
    text-align: center;
  }

  main,
  .admin-main {
    padding: 0 16px 56px;
  }

  .hero {
    gap: 16px;
    margin: 8px 0 28px;
  }

  .hero h2 {
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .on-bg,
  .section-head p {
    max-width: none;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-head p {
    margin: 0;
    line-height: 1.45;
    color: #ffffff;
    background: rgba(8, 14, 22, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 12px 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  }

  .hero-card,
  .lookup-card,
  .progress-card,
  .product {
    border-radius: 16px;
  }

  .grid.ranks {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .grid.perms {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .buyers-board {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .buyers-top h4 {
    font-size: 20px;
  }

  .drawer-panel {
    width: 100%;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  }
}
