:root {
  --bg: #0e0f12;
  --panel: #181a20;
  --panel-2: #20232b;
  --line: #2c303b;
  --line-hi: #4a5164;
  --text: #eceff4;
  --muted: #a6adbc;
  --faint: #8a91a1;
  --grass: #6bc43a;
  --grass-d: #2f5e19;
  --grass-ink: #0b1704;
  --gold: #ffd84a;
  --red: #ff5a5a;
  --nav-h: 60px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --pixel: "Press Start 2P", "Courier New", monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Consolas, "Courier New", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  color: var(--text); font: 400 16px/1.55 var(--sans); overflow-x: hidden; -webkit-font-smoothing: antialiased;
  background: linear-gradient(rgba(14, 15, 18, 0.94), rgba(14, 15, 18, 0.94)), var(--bg) url(/tex/deepslate.svg) 0 0 / 128px 128px;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
a { color: inherit; }
ul, ol { padding: 0; }
.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.sprite { position: absolute; }
.sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 48px; pointer-events: none; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--gold); color: #1b1500; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* pixel edge: four-sided box-shadow, no corner pixels, so every surface gets the notched Minecraft corner */
.px {
  --edge: var(--line);
  box-shadow: 0 -2px 0 0 var(--edge), 0 2px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge),
    inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -2px 0 rgba(0, 0, 0, 0.28);
  transition: box-shadow 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}

/* enchantment glint */
.glint { position: relative; overflow: hidden; }
.glint::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(186, 150, 255, 0.2), transparent);
  transform: translateX(-160%) skewX(-18deg);
}

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h); transition: background-color 200ms ease, box-shadow 200ms ease; }
.nav.solid { background: var(--bg); box-shadow: 0 2px 0 var(--line); }
.nav-in { max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; }
.brand { margin-right: auto; display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 400 12px/1 var(--pixel); text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7); }
.brand-block { width: 28px; height: 28px; background: url(/tex/grass_side.svg) 0 0 / 28px 28px; box-shadow: 0 0 0 2px #000; transition: transform 200ms var(--ease-out); }
.links { display: flex; gap: 4px; }
.links a { padding: 10px 14px; color: #dfe3ec; text-decoration: none; font: 600 14px/1 var(--sans); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); transition: color 150ms ease, background-color 150ms ease; }
.links a[aria-current="true"] { color: var(--grass); box-shadow: inset 0 -3px 0 var(--grass); }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; margin: 2px; padding: 10px 18px; border: 0; cursor: pointer; text-decoration: none;
  color: var(--grass-ink); background: var(--grass); font: 700 14px/1 var(--sans);
  box-shadow: 0 -2px 0 0 #000, 0 2px 0 0 #000, -2px 0 0 0 #000, 2px 0 0 0 #000,
    inset 0 3px 0 rgba(255, 255, 255, 0.38), inset 0 -4px 0 rgba(0, 0, 0, 0.28);
  transition: transform 140ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 -2px 0 0 #000, 0 2px 0 0 #000, -2px 0 0 0 #000, 2px 0 0 0 #000, inset 0 -2px 0 rgba(255, 255, 255, 0.2), inset 0 4px 0 rgba(0, 0, 0, 0.3); }
.btn::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 34%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: translateX(-170%) skewX(-18deg);
}
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.btn-ghost { color: var(--text); background: var(--panel-2); box-shadow: 0 -2px 0 0 var(--line-hi), 0 2px 0 0 var(--line-hi), -2px 0 0 0 var(--line-hi), 2px 0 0 0 var(--line-hi), inset 0 2px 0 rgba(255, 255, 255, 0.07), inset 0 -3px 0 rgba(0, 0, 0, 0.3); }
.btn-ghost:active { box-shadow: 0 -2px 0 0 var(--line-hi), 0 2px 0 0 var(--line-hi), -2px 0 0 0 var(--line-hi), 2px 0 0 0 var(--line-hi), inset 0 3px 0 rgba(0, 0, 0, 0.35); }
.btn-ip { min-height: 60px; padding: 10px 20px; gap: 16px; }
.ip-text { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.ip-label { font: 700 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.ip-value { font: 400 14px/1 var(--pixel); }
.ip-icon { position: relative; display: grid; place-items: center; width: 22px; height: 22px; font-size: 20px; }
.ip-icon .i { position: absolute; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.ip-icon .done { opacity: 0; transform: scale(0.6); }
[data-copied="true"] .ip-icon .copy { opacity: 0; transform: scale(0.6); }
[data-copied="true"] .ip-icon .done { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; text-align: center; background: #0b1230;
  min-height: min(100svh, 900px); padding-bottom: clamp(170px, 28vh, 280px);
}
.scene { position: absolute; left: 0; top: 0; z-index: -1; image-rendering: pixelated; opacity: 0; transition: opacity 700ms ease; }
.scene.ready { opacity: 1; }
.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: calc(var(--nav-h) + clamp(32px, 8vh, 96px)) 16px 0; }
.eyebrow {
  --edge: #000; display: inline-block; padding: 8px 14px; background: rgba(5, 8, 20, 0.7); color: var(--gold);
  font: 400 11px/1.4 var(--pixel); letter-spacing: 0.04em; text-shadow: 2px 2px 0 #000;
}
.title-wrap { position: relative; display: inline-block; max-width: 100%; margin-top: 26px; }
h1 {
  font: 400 clamp(26px, 6.2vw, 68px)/1.2 var(--pixel); color: #fff; text-wrap: balance;
  text-shadow: -3px 0 #000, 3px 0 #000, 0 -3px #000, 0 3px #000, 6px 7px 0 rgba(0, 0, 0, 0.55);
}
h1 .w { display: inline-block; }
h1 .gold { color: var(--gold); }
.splash {
  position: absolute; right: -2%; bottom: -34px; z-index: 2; width: max-content; max-width: min(290px, 62vw); text-align: right; line-height: 1.5; pointer-events: none;
  color: #ffff55; font: 400 clamp(10px, 1.5vw, 16px)/1 var(--pixel); text-shadow: 2px 2px 0 #3f3f15, 0 0 0 #000;
  transform: rotate(-12deg); transform-origin: 50% 50%; animation: splash 520ms var(--ease-in-out) infinite alternate;
}
.splash span { display: block; transition: opacity 150ms ease; }
.splash.swap span { opacity: 0; }
@keyframes splash { from { transform: rotate(-12deg) scale(1); } to { transform: rotate(-12deg) scale(1.1); } }
.sub { margin-top: 84px; color: #f1f3f8; font: 500 clamp(17px, 2.4vw, 22px)/1.4 var(--sans); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7); }
.sub b { color: var(--gold); font-weight: 700; }
.join { position: relative; z-index: 6; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; margin-top: 28px; }
.status {
  position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 60px; margin: 2px; padding: 10px 20px;
  background: rgba(5, 7, 12, 0.88); color: #fff; font: 600 15px/1 var(--sans);
  box-shadow: 0 -2px 0 0 #000, 0 2px 0 0 #000, -2px 0 0 0 #000, 2px 0 0 0 #000, inset 0 2px 0 rgba(255, 255, 255, 0.06);
}
.dot { width: 12px; height: 12px; background: #7b8190; }
.status[data-state="online"] .dot { background: var(--grass); animation: pulse 1.8s var(--ease-in-out) infinite; }
.status[data-state="offline"] .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.4; } }
.players {
  --edge: #3a2a6e; position: absolute; top: calc(100% + 12px); left: 50%; z-index: 5; min-width: 200px; padding: 12px 16px; text-align: left;
  background: #120a24; opacity: 0; visibility: hidden; transform: translateX(-50%) scale(0.96); transform-origin: top center; pointer-events: none;
  transition: opacity 150ms ease, transform 150ms var(--ease-out), visibility 0s 150ms;
}
.players:empty { display: none; }
.players p { margin: 0 0 6px; color: var(--gold); font: 400 10px/1.4 var(--pixel); }
.players ul { list-style: none; font-size: 15px; max-height: 240px; overflow-y: auto; }
.status:focus-within .players { opacity: 1; visibility: visible; transform: translateX(-50%); transition-delay: 0s; }
.hint { display: inline-block; margin-top: 20px; padding: 6px 14px; min-height: 1.5em; color: #eef1f7; font-size: 15px; background: rgba(5, 8, 20, 0.62); }
.cue { --edge: #000; position: absolute; left: 50%; bottom: 96px; width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; color: #fff; font-size: 22px; background: rgba(5, 8, 20, 0.6); animation: bob 1.4s var(--ease-in-out) infinite; }
@keyframes bob { 50% { translate: 0 6px; } }
.grass { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: url(/tex/grass_side.svg) 0 0 / 64px 64px repeat-x; }

/* entrance sequence: load is the rare, first-time moment */
@keyframes drop { from { opacity: 0; transform: translateY(-30px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.eyebrow { animation: rise 500ms var(--ease-out) 80ms both; }
h1 .w { animation: drop 650ms var(--ease-out) both; }
h1 .w:nth-child(1) { animation-delay: 160ms; }
h1 .w:nth-child(2) { animation-delay: 290ms; }
h1 .w:nth-child(3) { animation-delay: 420ms; }
.splash { opacity: 0; animation: splash 520ms var(--ease-in-out) infinite alternate, fade 400ms ease 900ms both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sub { animation: rise 550ms var(--ease-out) 560ms both; }
.join { animation: rise 550ms var(--ease-out) 700ms both; }
.hint { animation: rise 550ms var(--ease-out) 820ms both; }
.cue { animation: rise 550ms var(--ease-out) 1000ms both, bob 1.4s var(--ease-in-out) 1.6s infinite; }

/* ---------- content ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 16px 96px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; background: var(--panel); }
.stat-n { font: 400 clamp(16px, 2.2vw, 24px)/1.2 var(--pixel); color: #fff; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font: 500 13px/1.3 var(--sans); }
.block { margin-top: 84px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 26px; }
.sub-head { margin-top: 56px; margin-bottom: 0; }
h2 { font: 400 clamp(16px, 2.6vw, 24px)/1.4 var(--pixel); color: #fff; text-shadow: 3px 3px 0 #000; }
h2::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.65em; vertical-align: -0.05em; background: url(/tex/grass_top.svg) center / cover; box-shadow: 0 0 0 2px #000; }
h2.h-sm { font-size: clamp(14px, 2vw, 18px); }
.lead { max-width: 60ch; color: var(--muted); }
.count { color: var(--muted); font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; background: var(--panel); }
.step-n {
  display: grid; place-items: center; width: 44px; height: 44px; color: var(--grass-ink); background: var(--grass); font: 400 18px/1 var(--pixel);
  box-shadow: 0 0 0 2px #000, inset 0 3px 0 rgba(255, 255, 255, 0.38), inset 0 -4px 0 rgba(0, 0, 0, 0.28);
}
.step h3 { font: 700 18px/1.3 var(--sans); color: #fff; }
.step p { color: #c9cfdb; }
.step .btn { margin-top: auto; }
code { padding: 2px 8px; color: var(--gold); background: #0b0c0f; font: 600 0.9em var(--mono); box-shadow: 0 0 0 2px var(--line); }
.note {
  --edge: #b8892a; position: relative; margin-top: 22px; padding: 18px 22px 18px 76px; color: #f7ecd2; font-size: 17px;
  background: linear-gradient(rgba(24, 14, 4, 0.8), rgba(24, 14, 4, 0.8)), url(/tex/planks.svg) 0 0 / 96px 96px;
}
.note::before {
  content: "!"; position: absolute; left: 22px; top: 50%; width: 34px; height: 34px; margin-top: -17px; display: grid; place-items: center;
  color: #2b2000; background: var(--gold); font: 400 16px/1 var(--pixel); box-shadow: 0 0 0 2px #000, inset 0 3px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 460px; min-width: 0; padding: 2px; }
.tab {
  --edge: var(--line); display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 13px; border: 0; cursor: pointer;
  color: #d6dbe6; background: var(--panel-2); font: 600 13px/1 var(--sans);
}
.tab .n { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { --edge: #000; color: var(--grass-ink); background: var(--grass); }
.tab[aria-selected="true"] .n { color: #234712; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; display: flex; align-items: center; margin: 2px; }
.search > .i { position: absolute; left: 14px; color: var(--faint); font-size: 18px; pointer-events: none; }
.search input {
  --edge: var(--line-hi); width: 100%; min-height: 44px; padding: 10px 40px 10px 42px; border: 0; color: #fff; background: #0a0b0e; font: 500 15px var(--sans);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { --edge: var(--grass); outline: none; }
.search kbd { position: absolute; right: 12px; padding: 2px 7px; color: var(--faint); font: 600 12px/1.4 var(--mono); box-shadow: 0 0 0 2px var(--line); pointer-events: none; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }

.grid { list-style: none; margin-top: 24px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.grid > li[hidden] { display: none; }
.card { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 68px; padding: 12px; color: var(--text); background: var(--panel); text-decoration: none; }
.icon { width: 44px; height: 44px; flex: none; object-fit: cover; background: #0a0b0e; box-shadow: 0 0 0 2px #000; }
.tile { display: grid; place-items: center; color: #d6f2c1; background: var(--grass-d); font: 400 14px/1 var(--pixel); }
.meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.name { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; font: 600 14px/1.25 var(--sans); }
.ver { overflow: hidden; color: var(--faint); font: 500 12px/1.2 var(--sans); white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ext { font-size: 15px; color: var(--faint); transition: color 150ms ease; }
.empty { margin: 32px 0 8px; text-align: center; color: var(--muted); }
.libs { margin-top: 56px; }
.libs summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; background: var(--panel); font: 700 15px/1.2 var(--sans); }
.libs summary::-webkit-details-marker { display: none; }
.libs .chev { margin-left: auto; font-size: 20px; color: var(--muted); transition: transform 220ms var(--ease-out); }
.libs[open] .chev { transform: rotate(180deg); }

/* toast: Advancement Made! */
.toasts { position: fixed; z-index: 90; top: calc(var(--nav-h) + 14px); right: 18px; pointer-events: none; }
.toast {
  --edge: #000; display: flex; align-items: center; gap: 14px; width: min(370px, calc(100vw - 36px)); padding: 12px 18px 12px 12px; background: #1c1c1f;
  transform: translateX(calc(100% + 40px)); opacity: 0; visibility: hidden;
  transition: transform 260ms var(--ease-out), opacity 200ms ease, visibility 0s 260ms;
}
.toast.show { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.toast-icon { width: 44px; height: 44px; flex: none; background: url(/tex/grass_side.svg) 0 0 / 44px 44px; box-shadow: 0 0 0 2px #000, 0 0 0 4px #8b8b8b; margin: 4px; }
.toast-title { color: var(--gold); font: 400 11px/1.4 var(--pixel); text-shadow: 2px 2px 0 #3f3300; }
.toast-text { margin-top: 5px; color: #fff; font-size: 14px; line-height: 1.35; }
.chip { position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; will-change: transform; }

.foot { border-top: 4px solid #000; padding: 52px 16px 56px; text-align: center; color: var(--muted); background: linear-gradient(rgba(10, 10, 12, 0.9), rgba(10, 10, 12, 0.9)), url(/tex/dirt.svg) 0 0 / 96px 96px; font-size: 14px; }
.foot p { margin: 6px 0; }
.foot-title { color: #fff; font: 400 14px/1.4 var(--pixel); text-shadow: 2px 2px 0 #000; margin-bottom: 14px; }
.fine { color: var(--faint); font-size: 12px; margin-top: 18px; }

/* scroll reveal: only hidden once JS is confirmed running */
.js .reveal:not(.in) { opacity: 0; transform: translateY(20px); }
.js .reveal.in { transition: opacity 500ms var(--ease-out) var(--d, 0ms), transform 500ms var(--ease-out) var(--d, 0ms); }

@media (hover: hover) and (pointer: fine) {
  .links a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
  .brand:hover .brand-block { transform: rotate(-8deg) scale(1.08); }
  .btn:hover { background-color: #7ad84a; transform: translateY(-2px); }
  .btn:hover::after { transform: translateX(480%) skewX(-18deg); transition: transform 600ms var(--ease-out); }
  .btn:active:hover { transform: translateY(2px); }
  .btn-ghost:hover { background-color: #2b2f3a; }
  .tab:hover { --edge: var(--line-hi); color: #fff; }
  .tab[aria-selected="true"]:hover { --edge: #000; color: var(--grass-ink); }
  a.card:hover { --edge: var(--grass); background-color: #1d2028; transform: translateY(-3px); }
  a.card:hover .ext { color: var(--grass); }
  .glint:hover::after { transform: translateX(420%) skewX(-18deg); transition: transform 650ms var(--ease-out); }
  .step:hover { --edge: var(--line-hi); }
  .libs summary:hover { --edge: var(--line-hi); }
  .status:hover .players { opacity: 1; visibility: visible; transform: translateX(-50%); transition-delay: 0s; }
}

@media (max-width: 1100px) {
  .splash { right: 0; }
}
@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .links { display: none; }
  .hero { padding-bottom: 190px; }
  .splash { right: 0; bottom: -36px; }
  .sub { margin-top: 90px; }
  .block { margin-top: 64px; }
  .steps { grid-template-columns: 1fr; }
  .search { flex: 1 1 100%; max-width: none; order: -1; }
  .search kbd { display: none; }
  .toasts { right: 18px; left: 18px; }
  .toast { width: 100%; }
  .cue { bottom: 88px; }
}
@media (max-width: 480px) {
  .splash { max-width: min(230px, 72vw); font-size: 10px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card { gap: 10px; padding: 10px; }
  .icon { width: 38px; height: 38px; }
  .ip-label { display: none; }
  .btn-ip { min-height: 52px; }
  .stat { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .splash, .cue, .status[data-state="online"] .dot { animation: none !important; }
  .splash { opacity: 1; }
  .js .reveal:not(.in) { transform: none; }
  .toast { transform: none; }
  .glint::after, .btn::after { display: none; }
  a.card:hover, .btn:hover { transform: none; }
}
