:root {
  /* Bright, friendly Minecraft palette — sky, grass, sun & dirt */
  --bg: #aee2ff;            /* daytime sky blue */
  --bg-2: #d6f0ff;          /* lighter sky */
  --surface: #ffffff;       /* clean white card */
  --surface-2: #f1faf0;     /* soft minty panel */
  --line: #cfe3d4;          /* gentle green-grey border */
  --line-2: #9cc7a6;        /* stronger grass border */

  --text: #1d3b24;          /* deep forest green, very readable */
  --text-dim: #4f6b52;      /* muted leaf */
  --text-faint: #7d9180;    /* faint sage */

  /* "violet" slot is now GRASS GREEN (primary accent) */
  --violet: #54a83a;
  --violet-bright: #3e8a2a;
  --violet-fill: rgba(84, 168, 58, 0.10);
  --violet-fill-hover: rgba(84, 168, 58, 0.20);

  /* "blurple" slot is now SKY / DIAMOND BLUE */
  --blurple: #2fa9e0;
  --blurple-fill: rgba(47, 169, 224, 0.10);
  --blurple-fill-hover: rgba(47, 169, 224, 0.20);

  /* sunny gold */
  --amber: #f0a808;
  --amber-fill: rgba(240, 168, 8, 0.12);
  --amber-fill-hover: rgba(240, 168, 8, 0.24);

  /* "pink" slot is now warm dirt/clay accent */
  --pink: #c98a4b;
  --pink-fill: rgba(201, 138, 75, 0.12);

  --green: #3fae3f;
  --red: #e0552b;

  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --pixel: 'Press Start 2P', monospace;

  --radius: 8px;
  --radius-sm: 5px;

  /* chunky Minecraft-style block shadow */
  --block-shadow: 4px 4px 0 rgba(29, 59, 36, 0.18);
  --block-shadow-sm: 3px 3px 0 rgba(29, 59, 36, 0.15);

  /* Hardcoded white used by buttons/cards — exposed so dark mode can override */
  --card-bg: #ffffff;
  --btn-bg: #ffffff;
  --on-accent: #ffffff;
}

/* ── Dark theme ───────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f1a14;            /* deep night forest */
  --bg-2: #16241b;          /* slightly lighter panel */
  --surface: #1c2a22;       /* dark card */
  --surface-2: #20301f;     /* dark minty panel */
  --line: #2f4435;          /* muted green-grey border */
  --line-2: #3f5e48;        /* stronger grass border */

  --text: #e6f0e6;          /* soft off-white green */
  --text-dim: #a7c0a8;      /* muted leaf */
  --text-faint: #bfd0c0;    /* light sage, readable on dark surfaces */

  --violet: #6fcf52;
  --violet-bright: #8be06a;
  --violet-fill: rgba(111, 207, 82, 0.14);
  --violet-fill-hover: rgba(111, 207, 82, 0.24);

  --blurple: #4db8e8;
  --blurple-fill: rgba(77, 184, 232, 0.14);
  --blurple-fill-hover: rgba(77, 184, 232, 0.24);

  --amber: #ffc233;
  --amber-fill: rgba(255, 194, 51, 0.14);
  --amber-fill-hover: rgba(255, 194, 51, 0.26);

  --pink: #d9a066;
  --pink-fill: rgba(217, 160, 102, 0.14);

  --green: #5dd06a;
  --red: #ff6b4a;

  --block-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  --block-shadow-sm: 3px 3px 0 rgba(0, 0, 0, 0.4);

  --card-bg: #1c2a22;
  --btn-bg: #22332a;
  --on-accent: #0f1a14;
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, #0f1a14 0%, #142019 40%, #16241b 100%);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.06), transparent 14%),
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.04), transparent 10%),
    radial-gradient(circle at 80% 6%, rgba(255, 255, 255, 0.05), transparent 13%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.03), transparent 9%),
    radial-gradient(ellipse at 90% -5%, rgba(255, 224, 130, 0.10), transparent 40%);
}

[data-theme="dark"] .topbar {
  background: rgba(28, 42, 34, 0.88);
}

/* Override hardcoded whites */
[data-theme="dark"] .btn { background: var(--btn-bg); }
[data-theme="dark"] .btn-ghost { background: var(--btn-bg); }
[data-theme="dark"] .hero-logo { background: var(--card-bg); }
[data-theme="dark"] .status-card { background: var(--card-bg); }
[data-theme="dark"] .vote-block {
  background: linear-gradient(135deg, #16241b, #1c2a22);
}
[data-theme="dark"] .footer {
  background: linear-gradient(180deg, #16241b, #0f1a14);
}

/* These buttons use a dark surface in the dark theme, so match their labels
   to the light navigation text instead of the dark accent-text colour. */
[data-theme="dark"] .btn-violet,
[data-theme="dark"] .btn-violet:hover,
[data-theme="dark"] .btn-blurple,
[data-theme="dark"] .btn-blurple:hover,
[data-theme="dark"] .btn-amber,
[data-theme="dark"] .btn-amber:hover { color: var(--text-dim); }

/* A few labels use dark gold in the light theme. Use the bright accent instead
   when their background is dark, so they remain readable. */
[data-theme="dark"] .nav-link-gold { color: var(--amber) !important; }
[data-theme="dark"] .rules-list li strong,
[data-theme="dark"] .info-card .val,
[data-theme="dark"] .info-card .val a { color: var(--amber); }

/* Amber CTA cards keep their bright background, so they retain dark text. */
[data-theme="dark"] .cta-amber { color: #2a1d00; }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  background: var(--btn-bg);
  border: 2px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  box-shadow: var(--block-shadow-sm);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover {
  color: var(--amber);
  border-color: var(--amber);
  transform: translateY(-2px);
}
.theme-toggle:active { transform: translateY(0); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: linear-gradient(180deg, #aee2ff 0%, #cdeeff 40%, #e8f7e4 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Soft drifting clouds + sunshine glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.85), transparent 14%),
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.65), transparent 10%),
    radial-gradient(circle at 80% 6%, rgba(255, 255, 255, 0.8), transparent 13%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.6), transparent 9%),
    radial-gradient(ellipse at 90% -5%, rgba(255, 224, 130, 0.45), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--violet-bright); text-decoration: none; font-weight: 600; }
a:not(.btn):not(.cta-card):not(.nav-link):not(.brand):hover { color: var(--amber); }

.topbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border-bottom: 4px solid var(--violet);
  box-shadow: 0 3px 0 rgba(62, 138, 42, 0.25), 0 6px 16px rgba(29, 59, 36, 0.08);
  z-index: 100;
  padding: 12px 28px;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  border: 3px solid var(--violet);
  box-shadow: var(--block-shadow-sm);
}

.brand .wordmark {
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--violet-bright);
  line-height: 1.3;
  text-shadow: 1px 1px 0 rgba(62, 138, 42, 0.18);
}

.brand .tagline {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-family: var(--body);
  font-size: 14px;
  padding: 8px 14px;
  color: var(--text-dim);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-weight: 700;
}

.nav-link:hover {
  color: var(--violet-bright);
  background: var(--violet-fill);
  border-color: var(--line-2);
}

.nav-link.active {
  color: var(--on-accent);
  background: var(--violet);
  border-color: var(--violet-bright);
  box-shadow: var(--block-shadow-sm);
}

.nav-link-gold {
  color: #8a5e00 !important;
  background: var(--amber-fill) !important;
  border-color: rgba(240, 168, 8, 0.5) !important;
  font-weight: 700 !important;
}
.nav-link-gold:hover {
  background: var(--amber) !important;
  border-color: #c98a04 !important;
  color: #3b2a00 !important;
}
.nav-link-gold.active {
  background: var(--amber) !important;
  border-color: #c98a04 !important;
  color: #3b2a00 !important;
}

.topbar-actions { display: flex; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border: 2px solid rgba(29, 59, 36, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--block-shadow-sm);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s,
    transform 0.08s, box-shadow 0.08s;
  white-space: nowrap;
  text-decoration: none;
  background: var(--btn-bg);
  color: var(--text);
}

.btn:hover { filter: brightness(1.06); }
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 rgba(29, 59, 36, 0);
}

.btn-violet {
  border-color: #3e8a2a;
  background: var(--violet);
  color: var(--on-accent);
}
.btn-violet:hover { background: #62bd45; color: var(--on-accent); }

.btn-blurple {
  border-color: #1f8bbd;
  background: var(--blurple);
  color: var(--on-accent);
}
.btn-blurple:hover { background: #45b9ec; color: var(--on-accent); }

.btn-amber {
  border-color: #c98a04;
  background: var(--amber);
  color: #3b2a00;
}
.btn-amber:hover { background: #ffbe1f; color: #3b2a00; }

.btn-ghost {
  border-color: var(--line-2);
  background: var(--btn-bg);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet-bright); }

.btn-lg { padding: 15px 24px; font-size: 15px; border-radius: var(--radius); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  margin-bottom: 48px;
}

.hero-text h1 {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 14px;
  color: var(--text);
  text-shadow: 2px 2px 0 rgba(84, 168, 58, 0.18);
}

.hero-text p {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 24px;
}

.hero-text .accent {
  color: var(--violet-bright);
  font-weight: 700;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-logo {
  width: 168px;
  height: 168px;
  border-radius: var(--radius);
  border: 4px solid var(--violet);
  image-rendering: pixelated;
  background: var(--card-bg);
  box-shadow:
    var(--block-shadow),
    0 14px 34px rgba(84, 168, 58, 0.22);
}

.status-card {
  background: var(--card-bg);
  border: 3px solid var(--line-2);
  border-radius: var(--radius);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  box-shadow: var(--block-shadow);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 2px solid var(--line-2);
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.2s;
}

.status-pill.online {
  border-color: rgba(74, 222, 128, 0.5);
  color: var(--green);
  background: rgba(74, 222, 128, 0.06);
}

.status-pill.offline {
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--red);
  background: rgba(239, 68, 68, 0.06);
}

.status-pill.checking { color: var(--text-faint); }

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px transparent;
}

.status-pill.online .status-dot {
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: glow 1.8s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 6px var(--green), 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { box-shadow: 0 0 12px var(--green), 0 0 0 6px rgba(74, 222, 128, 0); }
}

.ip-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ip-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}

.ip-block code {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--amber);
}

.copy-btn {
  font-family: var(--body);
  font-size: 12px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.copy-btn:hover { color: var(--violet-bright); border-color: var(--violet); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

.cta-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 56px;
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border: 3px solid;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: var(--block-shadow);
  transition: filter 0.15s ease,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
}

.cta-card:hover { transform: translateY(-4px); filter: brightness(1.05); box-shadow: 6px 8px 0 rgba(29, 59, 36, 0.2); }
.cta-card:active { transform: translate(3px, 3px); box-shadow: 0 0 0 rgba(29, 59, 36, 0); }

.cta-blurple {
  border-color: #1f8bbd;
  background: var(--blurple);
  color: var(--on-accent);
}

.cta-amber {
  border-color: #c98a04;
  background: var(--amber);
  color: #3b2a00;
}

.cta-violet {
  border-color: #3e8a2a;
  background: var(--violet);
  color: var(--on-accent);
}

.cta-card .cta-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.85;
  font-weight: 700;
}

.cta-card h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.cta-card p {
  font-size: 13px;
  opacity: 0.92;
  margin-top: 4px;
}

.cta-card.cta-large h3 { font-size: 28px; }
.cta-card.cta-large p { font-size: 14px; }

.section-head {
  margin-bottom: 32px;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--violet);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 700;
  box-shadow: var(--block-shadow-sm);
}

.section-title {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-dim);
  max-width: 64ch;
  font-size: 16px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.about-card {
  background: var(--surface);
  border: 3px solid var(--line-2);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--block-shadow);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.18s ease, box-shadow 0.12s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
  box-shadow: 6px 8px 0 rgba(29, 59, 36, 0.18);
}

.about-card h4 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--violet-bright);
}

.about-card p { font-size: 14px; color: var(--text-dim); line-height: 1.65; }

.rules-section { margin-bottom: 44px; }

.rules-section h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.rules-section h2 .num {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--on-accent);
  background: var(--violet);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-weight: 400;
  box-shadow: var(--block-shadow-sm);
}

.rules-section h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin: 18px 0 10px;
  color: var(--violet-bright);
}

.rules-section h3.h3-spaced { margin-top: 24px; }

.rules-section .lede {
  color: var(--text-dim);
  margin-bottom: 18px;
  max-width: 64ch;
}

.rules-section .lede strong { color: var(--amber); }

.rules-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.rules-list li {
  background: var(--surface);
  border: 2px solid var(--line);
  border-left: 5px solid var(--violet);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  box-shadow: var(--block-shadow-sm);
  transition: border-left-width 0.15s ease, transform 0.15s ease,
    border-color 0.15s ease;
}

.rules-list li:hover {
  transform: translateX(4px);
  border-color: var(--line-2);
  border-left-width: 8px;
}

.rules-list li.warn {
  border-color: #e8b84b;
  border-left-color: var(--amber);
  background: var(--amber-fill);
}

.rules-list li strong { color: #b5760a; font-weight: 700; }
.rules-list li a { color: var(--violet-bright); text-decoration: underline; text-underline-offset: 3px; }
.rules-list li a:hover { color: var(--amber); }

.inline-code {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--violet-bright);
  font-size: 0.9em;
}

.mods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  list-style: none;
}

.mods-grid li {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--block-shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.mods-grid li:hover { transform: translateY(-2px); border-color: var(--violet); }

.mods-grid li strong {
  display: block;
  color: var(--violet-bright);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}

.mods-grid li span { color: var(--text-dim); font-size: 13px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  list-style: none;
}

.info-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-top: 5px solid var(--blurple);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--block-shadow-sm);
}

.info-card .key {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.info-card .val {
  font-family: var(--mono);
  font-size: 14px;
  color: #b5760a;
  font-weight: 600;
  word-break: break-all;
}

.info-card .val.text {
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.5;
}

.info-card .val a { color: #b5760a; }

.vote-block {
  background: linear-gradient(135deg, #eafbe4, #fff7e0);
  border: 3px solid var(--violet);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  box-shadow: var(--block-shadow);
}

.vote-block h3 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--violet-bright);
}

.vote-block p { color: var(--text-dim); margin-bottom: 16px; }

.vote-block .vote-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.shop-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 16px;
  pointer-events: none;
}

.shop-search {
  width: 100%;
  background: var(--surface);
  border: 3px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 16px 14px 44px;
  outline: none;
  box-shadow: var(--block-shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.shop-search:focus {
  border-color: var(--violet);
  box-shadow: 4px 4px 0 rgba(84, 168, 58, 0.25);
}

.shop-search::placeholder { color: var(--text-faint); }

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-right: 4px;
  font-weight: 500;
}

.tag-chip {
  font-family: var(--body);
  font-size: 12px;
  padding: 5px 12px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
  font-weight: 700;
}

.tag-chip:hover { color: var(--violet-bright); border-color: var(--violet); }

.tag-chip.active {
  background: var(--violet);
  border-color: var(--violet-bright);
  color: var(--on-accent);
}

.shop-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-faint);
}

.shop-meta-row .legend { display: flex; gap: 14px; flex-wrap: wrap; }
.shop-meta-row .legend span { display: inline-flex; align-items: center; gap: 6px; }
.shop-meta-row .legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.shop-meta-row .legend .dot.spec { background: var(--amber); }
.shop-meta-row .legend .dot.gen { background: var(--text-faint); }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.shop-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--block-shadow-sm);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.12s;
}

.shop-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--block-shadow); }

.shop-card.specialized {
  border-left: 6px solid var(--amber);
}
.shop-card.specialized:hover { border-color: var(--amber); border-left-color: var(--amber); }

.shop-card.general {
  border-left: 6px solid var(--blurple);
}
.shop-card.general:hover { border-color: var(--violet); border-left-color: var(--violet); }

.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.shop-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.2;
  color: var(--text);
}

.shop-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  font-weight: 500;
}

.badge-spec {
  border: 1px solid var(--amber);
  color: var(--amber);
  background: var(--amber-fill);
}

.badge-gen {
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  background: var(--bg-2);
}

.shop-meta {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-meta .row { display: flex; gap: 8px; align-items: center; }

.shop-meta .key {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  width: 56px;
  flex-shrink: 0;
}

.shop-meta .owner { color: var(--violet-bright); font-weight: 500; }

.shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.shop-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
}

.shop-items {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.shop-items .label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: block;
}

.item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.item-list .item {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}

.item-list .item.more {
  color: var(--text-faint);
  background: transparent;
  border-style: dashed;
}

.item-list mark {
  background: rgba(251, 191, 36, 0.25);
  color: var(--amber);
  padding: 0 2px;
  border-radius: 2px;
}

.shop-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}

.results-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.results-count strong { color: var(--violet-bright); font-weight: 600; }

.footer {
  border-top: 5px solid var(--violet);
  margin-top: 80px;
  padding: 28px;
  background: linear-gradient(180deg, #e8f7e4, #d8efd2);
  color: var(--text-dim);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-faint);
}

.footer-inner code {
  font-family: var(--mono);
  font-size: 12px;
}

.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-links > *:not(:last-child) { display: inline-flex; align-items: center; }
.footer-links > *:not(:last-child)::after {
  content: "·";
  margin-left: 14px;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--violet-bright); }

.disclaimer {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
}

.disclaimer code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--violet-bright);
}

@media (max-width: 860px) {
  .topbar { padding: 12px 16px; }
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .nav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
  .nav-link { font-size: 13px; padding: 7px 11px; flex-shrink: 0; }
  .topbar-actions { margin-left: auto; }
  .btn { font-size: 12px; padding: 7px 11px; }

  main { padding: 32px 16px 60px; }

  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-text h1 { font-size: 38px; letter-spacing: -1px; }
  .hero-text p { font-size: 15px; }
  .hero-logo { width: 110px; height: 110px; justify-self: start; }

  .status-card { padding: 14px; }
  .cta-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .mods-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 28px; }
  .cta-card.cta-large h3 { font-size: 22px; }
}

/* ── Smooth interactions & motion ─────────────────────────────────── */

/* Logo / brand polish */
.brand img { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand:hover img { transform: rotate(-4deg) scale(1.06); }

.hero-logo {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease;
}
.hero-logo:hover {
  transform: translateY(-4px) rotate(2deg);
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.25),
    0 20px 50px rgba(167, 139, 250, 0.28),
    0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Buttons get a gentle lift */
.btn { transition: background-color 0.15s ease, border-color 0.15s ease,
  color 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
  box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); }
.btn:active { transform: translateY(0); }

/* Animated underline for footer & inline links */
.footer-links a { position: relative; }
.footer-links a::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--violet-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.footer-links a:hover::before { transform: scaleX(1); }

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger children within a revealed grid */
.cta-grid.is-visible .cta-card,
.about-grid.is-visible .about-card { /* placeholder for grid-level reveals */ }

/* ── Mobile navigation toggle ─────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 38px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.nav-toggle:hover { border-color: var(--line-2); background: var(--surface); }
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-dim);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, background-color 0.15s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; order: 2; margin-left: auto; }
  .topbar-actions { order: 3; }

  /* Collapsible nav */
  .nav {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding-bottom 0.25s ease;
  }
  .nav.open {
    max-height: 320px;
    opacity: 1;
    padding-bottom: 4px;
  }
  .nav-link { width: 100%; }
}

/* ── Respect reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ── Statistics page ──────────────────────────────────────────────── */

/* Summary table: quick at-a-glance totals, styled as a compact stats-table */
.stats-summary-wrap {
  margin-bottom: 28px;
}

.stats-summary-table thead th {
  text-align: center;
}

.stats-summary-table tbody td {
  text-align: center;
  padding: 18px;
}

.stats-summary-table tbody tr:hover {
  background: transparent;
}

.stats-summary-table .num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--violet-bright);
}

/* Controls row: just the search field now (sorting lives in the table headers) */
.stats-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

/* Meta row: result count on the left, last-updated on the right */
.stats-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-faint);
  gap: 12px;
  flex-wrap: wrap;
}

.stats-updated {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* Table wrapper gives the card-like surface + horizontal scroll on mobile */
.stats-table-wrap {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--block-shadow-sm);
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.stats-table thead th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  text-align: left;
  padding: 14px 18px;
  border-bottom: 2px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}

.stats-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.stats-table thead th.sortable:hover {
  color: var(--violet-bright);
  background: var(--violet-fill);
}

.stats-table thead th.sortable.active {
  color: var(--violet-bright);
}

.sort-arrow {
  display: inline-block;
  width: 10px;
  font-family: var(--mono);
}

.stats-table .col-rank {
  width: 1%;
  text-align: center;
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 13px;
}

.stats-table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table tbody tr {
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.stats-table tbody tr:hover {
  background: var(--violet-fill);
}

/* Player column: head + name (data cells only, not the sortable header) */
.stats-table tbody .col-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-head {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-2);
  image-rendering: pixelated;
  background: var(--surface-2);
  flex-shrink: 0;
}

.player-name {
  font-family: var(--display);
  font-weight: 600;
  color: var(--text);
}

/* Numeric columns */
.stats-table .num {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--violet-bright);
  white-space: nowrap;
}

.stats-table .col-advancements,
.stats-table .col-playtime {
  text-align: right;
}

/* Loading / empty / error states */
.stats-loading,
.stats-empty,
.stats-error {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  font-size: 15px;
}

.stats-error {
  color: var(--red);
}

/* Mobile: keep the table scrollable instead of overflowing the layout */
@media (max-width: 640px) {
  .stats-table thead th,
  .stats-table tbody td {
    padding: 10px 12px;
    font-size: 14px;
  }
  .player-head { width: 28px; height: 28px; }
  .stats-meta-row { flex-direction: column; align-items: flex-start; }
  .stats-summary-table thead th,
  .stats-summary-table tbody td { padding: 10px 8px; font-size: 12px; }
  .stats-summary-table .num { font-size: 20px; }
}
