/* Valhierro — the site speaks the game's own interface language.
   GUI grey bevels, inventory slots, purple tooltips, § formatting colours, a hotbar for navigation. */

:root {
  --u: 3px;                       /* one GUI pixel */
  --gui: #c6c6c6;
  --gui-hi: #ffffff;
  --gui-lo: #555555;
  --title: #404040;
  --slot: #8b8b8b;
  --slot-lo: #373737;
  --btn: #6f6f6f;
  --btn-hi: #a9a9a9;
  --btn-lo: #464646;
  --btn-hover: #7f7f7f;
  --tip: rgba(16, 0, 16, 0.94);
  --tip-b1: #5000ff;
  --tip-b2: #28007f;
  --ground: #141418;
  --ink: #e2e2e2;
  --ink-2: #c6c6c6;
  --ink-3: #8a8a8a;

  /* § formatting codes */
  --c6: #ffaa00;
  --c7: #aaaaaa;
  --c8: #555555;
  --c9: #8080ff;
  --ca: #55ff55;
  --cb: #55ffff;
  --cc: #ff5555;
  --cd: #ff55ff;
  --ce: #ffff55;
  --live: var(--cc);
  --action: var(--ce);

  --font-ui: 'Pixelify Sans', system-ui, sans-serif;
  --font-display: 'Jacquard 24', 'Pixelify Sans', serif;
  --fs-1: 15px;
  --fs-2: 18px;
  --fs-3: 24px;
  --fs-h: clamp(48px, 7.2vw, 92px);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --hs: min(40px, calc((100vw - 36px) / 9));   /* hotbar slot */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 900px) {
  :root { --u: 4px; --hs: 54px; }
}

/* ── Base & browser surfaces ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  background-color: var(--ground);
  background-image: linear-gradient(rgba(14, 14, 18, 0.7), rgba(14, 14, 18, 0.7)), var(--tex-bricks, none);
  background-size: auto, 64px 64px;
  image-rendering: pixelated;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s5);
  scrollbar-color: var(--slot) var(--ground);
}
body {
  margin: 0;
  image-rendering: auto;
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 1.5;
  color: var(--ink);
  padding-bottom: calc(var(--hs) + var(--s7));
  overflow-x: hidden;
}
::selection { background: rgba(85, 85, 255, 0.9); color: #fff; }
::-webkit-scrollbar { width: 14px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb {
  background: var(--slot);
  border: 2px solid var(--ground);
  box-shadow: inset 2px 2px 0 var(--gui), inset -2px -2px 0 var(--gui-lo);
}
a { color: var(--action); text-underline-offset: 4px; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
input { caret-color: #fff; }
button { font: inherit; color: inherit; }
img, canvas { display: block; }
.px, canvas { image-rendering: pixelated; }
.px { display: block; background-size: 100% 100%; background-repeat: no-repeat; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  padding: var(--s2) var(--s4); background: #000; color: #fff;
}
.skip:focus { top: var(--s4); }

/* Text shadow: the game's hard one-pixel drop, a quarter of the text colour. */
.sh { text-shadow: 2px 2px 0 #3f3f3f; }
.c6 { color: var(--c6); } .sh .c6, .c6.sh { text-shadow: 2px 2px 0 #3f2a00; }
.c7 { color: var(--c7); } .sh .c7 { text-shadow: 2px 2px 0 #2a2a2a; }
.c8 { color: var(--c8); } .sh .c8 { text-shadow: 2px 2px 0 #151515; }
.c9 { color: var(--c9); }
.ca { color: var(--ca); } .sh .ca { text-shadow: 2px 2px 0 #153f15; }
.cb { color: var(--cb); } .sh .cb { text-shadow: 2px 2px 0 #153f3f; }
.cc { color: var(--cc); } .sh .cc { text-shadow: 2px 2px 0 #3f1515; }
.cd { color: var(--cd); } .sh .cd { text-shadow: 2px 2px 0 #3f153f; }
.ce { color: var(--ce); } .sh .ce { text-shadow: 2px 2px 0 #3f3f15; }
.cf { color: #fff; }
.c0 { color: #000; } .c1 { color: #0000aa; } .c2 { color: #00aa00; } .c3 { color: #00aaaa; }
.c4 { color: #aa0000; } .c5 { color: #aa00aa; }
.b { font-weight: 700; } .i { font-style: italic; } .u { text-decoration: underline; } .st { text-decoration: line-through; }
.c-gold { color: var(--c6); } .c-pink { color: var(--cd); } .c-aqua { color: var(--cb); }
.c-green { color: var(--ca); } .c-yellow { color: var(--ce); } .c-red { color: var(--cc); }

/* ── Primitives: GUI panel, slot, button, tooltip ───────── */
.gui {
  --n: var(--u);
  background: var(--gui);
  color: var(--title);
  border: var(--u) solid #000;
  box-shadow: inset var(--u) var(--u) 0 var(--gui-hi), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 var(--gui-lo);
  padding: calc(var(--u) * 4);
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n)), 0 var(--n), var(--n) var(--n));
}
.gui__title { margin: 0 0 var(--s3); font-size: var(--fs-2); font-weight: 500; color: var(--title); line-height: 1.2; }

.slot {
  position: relative;
  display: grid; place-items: center;
  width: calc(var(--u) * 18); height: calc(var(--u) * 18);
  padding: 0; border: 0;
  background: var(--slot);
  box-shadow: inset var(--u) var(--u) 0 var(--slot-lo), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #fff;
}
.slot .px { width: calc(var(--u) * 16); height: calc(var(--u) * 16); }
.slot--item { cursor: pointer; }
.slot--item::after {
  content: ''; position: absolute; inset: var(--u);
  background: rgba(255, 255, 255, 0.45); opacity: 0; pointer-events: none;
}
.slot--item:hover::after, .slot--item:focus-visible::after { opacity: 1; }
.slot--item:focus-visible { outline-offset: 0; }
.slot.is-active { outline: var(--u) solid #fff; outline-offset: calc(var(--u) * -1); z-index: 1; }

.mc-btn {
  --n: 3px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s4);
  min-height: 52px; padding: 0 var(--s5);
  font-family: var(--font-ui); font-size: var(--fs-2); font-weight: 500; line-height: 1.1;
  color: #fff; text-decoration: none; text-align: center;
  text-shadow: 2px 2px 0 #3f3f3f;
  background: var(--btn);
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 var(--btn-hi), inset -3px -4px 0 var(--btn-lo);
  cursor: pointer;
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
  transition: background-color 80ms linear;
}
.mc-btn:hover { background: var(--btn-hover); border-color: #fff; }
.mc-btn:active { box-shadow: inset 3px 3px 0 var(--btn-lo), inset -3px -3px 0 var(--btn-hi); }
.mc-btn:focus-visible { border-color: #fff; outline: 3px solid var(--action); outline-offset: 2px; clip-path: none; }
.mc-btn[disabled], .mc-btn[aria-disabled='true'] {
  background: #2c2c2c; color: #a0a0a0; box-shadow: none; cursor: default; border-color: #000;
}
.mc-btn--primary { color: var(--action); text-shadow: 2px 2px 0 #3f3f15; min-height: 64px; font-size: var(--fs-3); }
.mc-btn--small { min-height: 44px; font-size: var(--fs-2); padding: 0 var(--s4); }
.mc-btn__ip { color: #fff; text-shadow: 2px 2px 0 #3f3f3f; font-size: var(--fs-2); }
.mc-btn.is-done { color: var(--ca); text-shadow: 2px 2px 0 #153f15; }

.tip {
  color: #fff;
  border: var(--u) solid transparent;
  background: linear-gradient(var(--tip), var(--tip)) padding-box, linear-gradient(var(--tip-b1), var(--tip-b2)) border-box;
  box-shadow: 0 0 0 var(--u) var(--tip);
  text-shadow: 2px 2px 0 #3f3f3f;
}
.tip p { margin: 0; }
.tip--float {
  position: fixed; z-index: 80; left: 0; top: 0;
  max-width: 320px; padding: var(--s2) var(--s3);
  font-size: var(--fs-2); line-height: 1.35; pointer-events: none;
}
.tip--float .tip__sub { color: var(--c7); font-size: var(--fs-1); }

/* ── Hero: title screen + multiplayer entry ─────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
  background: #0b0d26;
  isolation: isolate;
}
.hero__pano { position: absolute; left: 0; top: 0; z-index: -1; }
.hero__inner {
  width: min(100% - 32px, 920px);
  display: flex; flex-direction: column; align-items: center; gap: var(--s5);
  padding: clamp(40px, 9vh, 96px) 0 calc(var(--hs) + var(--s9));
}
.logo { position: relative; display: inline-flex; margin: 0; line-height: 1; }
.logo__text { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h); color: #fff; text-shadow: 4px 4px 0 #3f3f3f; }
.logo__canvas { display: none; max-width: 100%; height: auto; }
.logo.is-drawn .logo__canvas { display: block; }
.logo.is-drawn .logo__text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.splash {
  position: absolute; right: -2%; bottom: 2%;
  font-size: clamp(15px, 2vw, 24px); font-weight: 600; white-space: nowrap;
  color: var(--ce); text-shadow: 2px 2px 0 #3f3f15;
  transform: translate(30%, 20%) rotate(-18deg);
  pointer-events: none;
}
.splash > span { display: inline-block; animation: splash 0.9s ease-in-out infinite; }
@keyframes splash { 50% { transform: scale(1.09); } }

.hero__sub { margin: calc(var(--s4) * -1) 0 0; color: #fff; font-size: var(--fs-2); text-align: center; text-wrap: balance; }

.serverlist {
  width: 100%;
  background: rgba(0, 0, 0, 0.62);
  border-block: 2px solid rgba(255, 255, 255, 0.2);
  padding: var(--s3);
}
.entry {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4);
  padding: var(--s2);
  border: 3px solid transparent;
}
.entry.is-selected { border-color: #c6c6c6; box-shadow: inset 0 0 0 3px #000; }
.entry__icon {
  position: relative; width: 96px; height: 96px; padding: 0; border: 0; background: #000; cursor: pointer;
  align-self: start;
}
.entry__favicon { width: 100%; height: 100%; }
.entry__play {
  position: absolute; inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  background-size: 66% 66%; background-position: center; background-repeat: no-repeat;
  image-rendering: pixelated;
  opacity: 0; transition: opacity 90ms linear;
}
.entry__icon:hover .entry__play, .entry__icon:focus-visible .entry__play { opacity: 1; }
.entry__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.entry__name { font-size: var(--fs-3); color: #fff; line-height: 1.1; }
.entry__right { display: inline-flex; align-items: center; gap: var(--s3); flex: none; }
.entry__count { color: var(--c7); font-variant-numeric: tabular-nums; cursor: default; }
.entry__count .sep { color: var(--c8); }
.entry__motd { margin: var(--s2) 0 0; min-height: 2.8em; line-height: 1.4; white-space: pre-line; color: var(--c7); overflow-wrap: anywhere; }
.entry__meta { margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--fs-1); color: var(--c7); }
.entry__ip { color: #fff; }
.tag-sample {
  display: inline-block; padding: 0 var(--s2); white-space: nowrap;
  font-size: var(--fs-1); line-height: 1.6; color: var(--c7);
  border: 2px solid var(--c8); text-shadow: none;
}
.tag-sample--gui { color: var(--title); border-color: var(--slot); }

.ping { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; }
.ping i { width: 4px; background: #3f3f3f; }
.ping i:nth-child(1) { height: 4px; } .ping i:nth-child(2) { height: 8px; } .ping i:nth-child(3) { height: 12px; }
.ping i:nth-child(4) { height: 16px; } .ping i:nth-child(5) { height: 20px; }
.ping[data-level='1'] i:nth-child(-n+1), .ping[data-level='2'] i:nth-child(-n+2),
.ping[data-level='3'] i:nth-child(-n+3), .ping[data-level='4'] i:nth-child(-n+4),
.ping[data-level='5'] i:nth-child(-n+5) { background: var(--ca); }
.entry[data-status='pinging'] .ping i { animation: pingscan 1s steps(1) infinite; }
.entry[data-status='pinging'] .ping i:nth-child(2) { animation-delay: 0.2s; }
.entry[data-status='pinging'] .ping i:nth-child(3) { animation-delay: 0.4s; }
.entry[data-status='pinging'] .ping i:nth-child(4) { animation-delay: 0.6s; }
.entry[data-status='pinging'] .ping i:nth-child(5) { animation-delay: 0.8s; }
@keyframes pingscan { 0% { background: #8a8a8a; } 20% { background: #3f3f3f; } }
.entry[data-status='offline'] .entry__name { color: var(--c7); }

.hero__live { margin: var(--s3) 0 0; display: flex; align-items: center; gap: var(--s2); color: var(--live); }
.hero__live a { color: var(--live); text-shadow: 2px 2px 0 #3f1515; }
.live-dot { display: inline-block; width: 10px; height: 10px; background: var(--live); animation: blink 1.2s steps(2, jump-none) infinite; flex: none; }
@keyframes blink { 50% { opacity: 0.25; } }

@media (min-width: 1100px) {
  .hero { place-items: center start; }
  .hero__inner { width: min(860px, 62vw); margin-left: max(32px, calc((100vw - 1200px) / 2)); align-items: flex-start; }
  .hero__sub { text-align: left; }
}
.hero__actions { width: 100%; display: grid; gap: var(--s3); }
.hero__actions .mc-btn--primary { width: 100%; }
.hero__row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s3); }

.chat {
  position: absolute; left: var(--s4); bottom: var(--s4);
  width: min(440px, calc(50vw - 260px)); margin: 0; padding: 0; list-style: none;
  display: none; flex-direction: column;
}
.chat li {
  padding: 2px var(--s2); background: rgba(0, 0, 0, 0.5);
  font-size: var(--fs-1); color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  transition: opacity 600ms linear;
}
.chat li.is-old { opacity: 0; }
@media (min-width: 1240px) { .chat { display: flex; } }

/* ── Hotbar navigation ───────────────────────────────────── */
.hotbar {
  position: fixed; z-index: 50; left: 50%; bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
.hotbar__slots {
  display: flex; margin: 0; padding: 3px; list-style: none;
  background: rgba(10, 10, 10, 0.8);
  border: 3px solid #000;
  box-shadow: inset 0 0 0 3px #5e5e5e;
}
.hotbar__slot {
  position: relative; display: grid; place-items: center;
  width: var(--hs); height: var(--hs);
  box-shadow: inset 0 0 0 3px #5e5e5e;
}
.hotbar__slot .px { width: calc(var(--hs) * 0.6); height: calc(var(--hs) * 0.6); }
.hotbar__slot:hover { background: rgba(255, 255, 255, 0.12); }
.hotbar__slot:focus-visible { outline-offset: -3px; }
.hotbar__key { display: none; }
.hotbar__sel {
  position: absolute; left: 3px; top: 3px;
  width: calc(var(--hs) + 6px); height: calc(var(--hs) + 6px);
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 3px #000, inset 0 0 0 6px #a0a0a0;
  transform: translateX(calc(var(--i, 0) * var(--hs)));
  transition: transform 110ms var(--ease-out);
  pointer-events: none;
}
.hotbar__name {
  position: absolute; left: 50%; bottom: calc(100% + 10px); margin: 0;
  transform: translateX(-50%);
  white-space: nowrap; color: #fff; font-size: var(--fs-2);
  opacity: 0; transition: opacity 400ms linear;
}
.hotbar__name.is-show { opacity: 1; transition-duration: 60ms; }

/* ── Sections ────────────────────────────────────────────── */
.sec { width: min(100% - 32px, 1200px); margin-inline: auto; padding-top: var(--s10); }
.sec-head { max-width: 780px; margin-bottom: var(--s7); }
.sec-head--side { margin-bottom: 0; }
.sec-title {
  margin: 0 0 var(--s4);
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h); line-height: 0.95;
  color: #fff; text-shadow: 0.05em 0.05em 0 #3f3f3f; text-wrap: balance;
}
.sec-lede { margin: 0; max-width: 62ch; color: var(--ink-2); text-wrap: pretty; }
.sec-lede + .sec-lede { margin-top: var(--s3); }

/* Advancements */
.adv {
  position: relative; height: 380px;
  background-image: linear-gradient(rgba(8, 8, 12, 0.5), rgba(8, 8, 12, 0.5)), var(--tex-bricks, none);
  background-size: auto, 48px 48px;
  image-rendering: pixelated;
  box-shadow: inset var(--u) var(--u) 0 var(--slot-lo), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #fff;
  overflow: hidden;
}
.adv__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.adv__lines path { fill: none; stroke-linejoin: miter; }
.adv__lines .ln-back { stroke: #000; stroke-width: 7; }
.adv__lines .ln-front { stroke: #fff; stroke-width: 3; }
.adv-node {
  --n: 4px;
  position: absolute;
  left: calc(8% + var(--x) * 21%); top: calc(17% + var(--y) * 33%);
  width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0;
  display: grid; place-items: center;
  background: #b4b4b4;
  border: 4px solid #000;
  box-shadow: inset 4px 4px 0 #fff, inset -4px -4px 0 #5a5a5a;
  cursor: pointer;
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
  transition: background-color 80ms linear;
}
.adv-node .px { width: 32px; height: 32px; }
.adv-node--goal { --n: 14px; }
.adv-node--challenge {
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  clip-path: polygon(50% 0, 62% 14%, 82% 8%, 86% 30%, 100% 50%, 86% 70%, 82% 92%, 62% 86%, 50% 100%, 38% 86%, 18% 92%, 14% 70%, 0 50%, 14% 30%, 18% 8%, 38% 14%);
  border-width: 0; box-shadow: inset 0 0 0 5px #000, inset 9px 9px 0 #fff, inset -9px -9px 0 #5a5a5a;
}
.adv-node:hover, .adv-node[aria-pressed='true'] { background: #e2b02c; box-shadow: inset 4px 4px 0 #ffe88a, inset -4px -4px 0 #8a5f12; }
.adv-node--challenge:hover, .adv-node--challenge[aria-pressed='true'] { box-shadow: inset 0 0 0 5px #000, inset 9px 9px 0 #ffe88a, inset -9px -9px 0 #8a5f12; }
.adv-node:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; clip-path: none; }
.adv-detail { margin-top: var(--s3); display: grid; }
.adv-detail p { margin: 0; padding: var(--s2) var(--s4); border: 3px solid #000; text-shadow: 2px 2px 0 #3f3f3f; }
.adv-detail__title { background: #1f5ba8; color: #fff; font-size: var(--fs-3); }
.adv-detail__desc { background: #212121; color: var(--ca); border-top: 0 !important; }
.adv-detail[data-frame='challenge'] .adv-detail__title { background: #6a2a9a; }
.adv-detail[data-frame='challenge'] .adv-detail__desc { color: var(--cd); }

/* The island: a filled map in its paper, with banner markers, and its legend */
.isla { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: var(--s7); align-items: start; }
.mapframe {
  --n: var(--u);
  padding: calc(var(--u) * 4);
  background: #d6c296;
  border: var(--u) solid #4a3218;
  box-shadow: inset var(--u) var(--u) 0 #efe0b8, inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #a88e5c;
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
}
.mapframe__inner { position: relative; aspect-ratio: 1; box-shadow: 0 0 0 var(--u) #8a6c3e; background: #2d2db4; }
.mapframe__canvas { width: 100%; height: 100%; }
.mapframe__caption { margin: var(--s3) 0 0; text-align: center; color: #4a3218; font-size: var(--fs-1); }
.marker {
  position: absolute; left: calc(var(--mx) / 128 * 100%); top: calc(var(--my) / 128 * 100%);
  padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 120ms var(--ease-out);
}
.marker--banner { transform: translate(-50%, -100%); transform-origin: 50% 100%; }
.marker__banner { display: block; width: 22px; height: 44px; background-size: 100% 100%; image-rendering: pixelated; }
.marker--dragon .px { width: 56px; height: 56px; }
.marker--dragon::after {
  content: ''; position: absolute; inset: -6px;
  border: 3px solid rgba(255, 170, 0, 0.9);
  animation: ring 1.8s steps(6) infinite;
  pointer-events: none;
}
@keyframes ring { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.marker--port .px { width: 24px; height: 24px; }
.marker:hover, .marker.is-active { transform: translate(-50%, -50%) scale(1.2); z-index: 2; }
.marker--banner:hover, .marker--banner.is-active { transform: translate(-50%, -100%) scale(1.25); }
.marker:focus-visible { outline-offset: 2px; }
.legend { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.legend__item {
  width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s4); align-items: center;
  padding: var(--s3) var(--s4); text-align: left;
  background: rgba(0, 0, 0, 0.4); border: 3px solid transparent; cursor: pointer;
  transition: background-color 120ms linear;
}
.legend__item:hover, .legend__item.is-active { border-color: #c6c6c6; box-shadow: inset 0 0 0 3px #000; background: rgba(0, 0, 0, 0.62); }
.legend__icon { display: grid; place-items: center; }
.legend__icon .px { width: 48px; height: 48px; }
.legend__banner {
  display: block; width: 44px; height: 88px; background-size: 100% 100%; image-rendering: pixelated;
  transform-origin: 50% 4px; animation: sway 5s ease-in-out infinite alternate;
}
.legend li:nth-child(3) .legend__banner { animation-delay: -1.3s; }
.legend li:nth-child(4) .legend__banner { animation-delay: -2.6s; }
.legend li:nth-child(5) .legend__banner { animation-delay: -3.9s; }
@keyframes sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.legend__text { display: grid; gap: var(--s1); }
.legend__name { font-size: var(--fs-3); line-height: 1.15; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.legend__lore { color: var(--ink-2); }

/* Crafting: how to join */
.entrar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s7); align-items: start; }
.gui--craft { position: sticky; top: var(--s5); }
.craft { display: flex; align-items: center; gap: calc(var(--u) * 5); }
.craft__grid { display: grid; grid-template-columns: repeat(3, calc(var(--u) * 18)); }
.craft__arrow { width: calc(var(--u) * 16); height: calc(var(--u) * 16); }
.slot--out { width: calc(var(--u) * 26); height: calc(var(--u) * 26); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.step { padding: var(--s4) var(--s5); background: rgba(0, 0, 0, 0.4); border: 3px solid transparent; transition: background-color 120ms linear; }
.step.is-active { border-color: #c6c6c6; box-shadow: inset 0 0 0 3px #000; background: rgba(0, 0, 0, 0.62); }
.step__title { margin: 0; font-size: var(--fs-3); font-weight: 500; color: #fff; line-height: 1.2; text-shadow: 2px 2px 0 #3f3f3f; }
.step__text { margin: var(--s2) 0 0; color: var(--ink-2); max-width: 60ch; }
.step .mc-btn { margin-top: var(--s4); }

/* Creative inventory: mod list */
.inv__tabs { display: flex; gap: var(--s1); margin: 0 0 var(--s4); overflow-x: auto; scrollbar-width: none; }
.inv__tabs::-webkit-scrollbar { display: none; }
.inv__tab {
  flex: none; display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s3) var(--s2) var(--s2);
  font-size: var(--fs-2); color: #1b1b1b;
  background: #9b9b9b; border: 3px solid #000;
  box-shadow: inset 3px 3px 0 #d0d0d0, inset -3px -3px 0 #555;
  cursor: pointer;
}
.inv__tab .px { width: 32px; height: 32px; }
.inv__tab:hover { background: #ababab; }
.inv__tab[aria-selected='true'] { background: var(--gui); color: var(--title); box-shadow: inset 3px 3px 0 #fff, inset -3px 0 0 #555; }
.inv__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: var(--s5); align-items: start; }
.inv__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.inv__bar .gui__title { margin: 0; }
.inv__search input {
  width: 240px; max-width: 100%;
  padding: var(--s1) var(--s3);
  font: inherit; font-size: var(--fs-2); color: #fff;
  background: #000; border: 3px solid #a0a0a0; border-radius: 0;
  outline: none;
}
.inv__search input::placeholder { color: #8a8a8a; }
.inv__search input:focus { border-color: #fff; }
.inv__search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); }
.inv__grid { display: grid; grid-template-columns: repeat(auto-fill, calc(var(--u) * 18)); justify-content: start; }
.inv__empty { margin: var(--s3) 0 0; color: var(--title); }
.tip--panel { padding: var(--s4); display: grid; gap: var(--s2); align-content: start; min-height: 100%; }
.tip__head { display: flex; align-items: center; gap: var(--s3); }
.tip__icon { width: 48px; height: 48px; flex: none; }
.tip__name { font-size: var(--fs-3); line-height: 1.15; }
.tip__cat { color: var(--c9); }
.tip__id { color: var(--ink-3); font-size: var(--fs-1); }
.tip__link { justify-self: start; margin-top: var(--s2); color: var(--action); text-shadow: 2px 2px 0 #3f3f15; }

.modindex { margin-top: var(--s7); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s5) var(--s6); }
.modindex__cat { margin: 0; font-size: var(--fs-2); font-weight: 500; }
.modindex ul { margin: var(--s2) 0 0; padding: 0; list-style: none; font-size: var(--fs-1); line-height: 1.75; color: var(--ink-2); }

/* Twitch: live chroniclers */
.tw__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.tw__bar .gui__title { margin: 0; }
.tw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: var(--s4); }
.tw__screen {
  position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
  box-shadow: inset var(--u) var(--u) 0 var(--slot-lo), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #fff;
}
.tw__pano, .tw__screen > img, .tw__screen > iframe { position: absolute; inset: var(--u); width: calc(100% - var(--u) * 2) !important; height: calc(100% - var(--u) * 2) !important; border: 0; object-fit: cover; }
.tw__screen > img { image-rendering: auto; }
.tw__overlay {
  position: absolute; left: var(--u); right: var(--u); bottom: var(--u);
  padding: var(--s4); display: grid; gap: var(--s2); background: rgba(0, 0, 0, 0.66);
}
.tw__live { margin: 0; display: flex; align-items: center; gap: var(--s2); color: var(--live); text-shadow: 2px 2px 0 #3f1515; }
.tw__live.is-off { color: var(--c7); text-shadow: 2px 2px 0 #2a2a2a; }
.tw__live.is-off .live-dot { background: var(--c8); animation: none; }
.tw__title { margin: 0; color: #fff; font-size: var(--fs-3); line-height: 1.2; }
.tw__title:empty { display: none; }
.tw__actions:empty { display: none; }
.tw__list {
  margin: 0; padding: var(--s2); list-style: none;
  display: grid; gap: var(--s1); align-content: start;
  background: #1c1c1c;
  box-shadow: inset var(--u) var(--u) 0 var(--slot-lo), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #fff;
  max-height: 480px; overflow: auto;
}
.tw-row {
  width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s3); align-items: center;
  padding: var(--s2); text-align: left;
  background: rgba(255, 255, 255, 0.04); border: 3px solid transparent; cursor: pointer;
}
.tw-row:hover { background: rgba(255, 255, 255, 0.1); }
.tw-row.is-active { border-color: #c6c6c6; box-shadow: inset 0 0 0 3px #000; }
.tw-row__avatar { width: 40px; height: 40px; background-size: 100% 100%; image-rendering: pixelated; }
img.tw-row__avatar { image-rendering: auto; }
.tw-row__name { display: block; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-row__status { display: block; font-size: var(--fs-1); color: var(--ink-3); }
.tw-row__status.is-live { color: var(--live); }
.tw-row__banner { width: 12px; height: 24px; background-size: 100% 100%; image-rendering: pixelated; }
.tw__empty { margin: 0; padding: var(--s3); color: var(--c7); font-size: var(--fs-1); }

/* Book: rules */
.leyes { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s8); align-items: center; }
.book {
  --n: var(--u);
  width: min(100%, 470px);
  padding: var(--s6) var(--s6) var(--s4);
  background: #ead9b2;
  color: #000;
  border: var(--u) solid #2a1c0f;
  box-shadow: inset var(--u) var(--u) 0 #f7ebcd, inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #c2a776, inset calc(var(--u) * 3) 0 0 #d9c393;
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)), calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
}
.book__page { min-height: 380px; }
.book__count { margin: 0 0 var(--s4); text-align: right; font-size: var(--fs-1); color: #000; }
.book__rules { margin: 0; padding-left: 1.6em; display: grid; gap: var(--s4); line-height: 1.5; }
.book__rules li::marker { color: #6b3410; font-weight: 700; }
.book__rules strong { font-weight: 700; }
.book.is-js .book__sheet[data-hidden] { display: none; }
.book.is-js .book__sheet.is-turning { animation: pageturn 260ms var(--ease-out); }
@keyframes pageturn { from { opacity: 0; transform: translateX(var(--dir, 12px)); } }
.book__nav { display: none; justify-content: space-between; margin-top: var(--s4); }
.book.is-js .book__nav { display: flex; }
.book__turn {
  width: 46px; height: 46px; padding: 0; border: 0; cursor: pointer;
  background-color: #6b4524;
  -webkit-mask: var(--arrow-url) center / 100% 100% no-repeat; mask: var(--arrow-url) center / 100% 100% no-repeat;
}
.book__turn:hover { background-color: #c47f2c; }
.book__turn--prev { transform: scaleX(-1); }
.book__turn[disabled] { visibility: hidden; }

/* Council: staff */
.council { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s7) var(--s5); }
.lord { display: grid; justify-items: center; gap: var(--s3); text-align: center; }
.nametag { margin: 0; padding: 2px var(--s2); background: rgba(0, 0, 0, 0.5); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; white-space: nowrap; }
.lord__head { width: 96px; height: 96px; background-size: 100% 100%; image-rendering: pixelated; }
.lord__duty { margin: 0; max-width: 22ch; color: var(--ink-2); font-size: var(--fs-1); }

/* Heralds: Discord */
.heraldos { display: grid; grid-template-columns: minmax(0, 760px); }
.chatbox { display: grid; gap: var(--s5); }
.chatbox__lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.chatbox__lines li { padding: var(--s1) var(--s3); background: rgba(0, 0, 0, 0.55); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.chatbox__lines .chatbox__input { margin-top: var(--s2); background: rgba(0, 0, 0, 0.8); }
.chatbox__input .caret { display: inline-block; width: 0.6em; color: #fff; animation: blink 1s steps(2, jump-none) infinite; }

/* Close: the panorama returns, night falls on the island */
.end { margin-top: var(--s10); display: grid; justify-items: center; text-align: center; }
.end__stage {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; min-height: min(78vh, 720px);
  display: grid; justify-items: center; align-content: start; gap: var(--s5);
  padding: var(--s9) var(--s4) var(--s8);
  background: #0b0d26;
  border-top: 3px solid #000;
}
.end__pano { position: absolute; inset: 0; width: 100% !important; height: 100% !important; z-index: -1; }
.end__line { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h); line-height: 0.95; color: #fff; text-shadow: 0.05em 0.05em 0 #3f3f3f; }
.end .mc-btn--primary { width: min(100%, 600px); }
@media (min-width: 1100px) {
  .end__stage { justify-items: start; text-align: left; padding-left: max(32px, calc((100vw - 1200px) / 2)); }
  .end .mc-btn--primary { width: min(100%, 560px); }
}
.legal { margin: 0; padding: var(--s5) var(--s4) 0; max-width: 62ch; color: var(--ink-3); font-size: var(--fs-1); }

/* Toasts */
.toasts { position: fixed; z-index: 90; top: var(--s4); right: var(--s4); display: grid; gap: var(--s2); pointer-events: none; }
.toast {
  width: min(340px, calc(100vw - 32px));
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4);
  background: #212121; border: 3px solid #000;
  box-shadow: inset 0 0 0 3px #5e5e5e;
  animation: toast-in 420ms var(--ease-out) both;
}
.toast.is-out { animation: toast-out 320ms ease-in both; }
.toast .px { width: 32px; height: 32px; }
.toast__title { margin: 0; color: var(--ce); text-shadow: 2px 2px 0 #3f3f15; line-height: 1.2; }
.toast__text { margin: 0; color: #fff; font-size: var(--fs-1); text-shadow: 2px 2px 0 #3f3f3f; line-height: 1.35; }
@keyframes toast-in { from { transform: translateX(calc(100% + 24px)); } }
@keyframes toast-out { to { transform: translateX(calc(100% + 24px)); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1080px) {
  .inv__body, .tw { grid-template-columns: minmax(0, 1fr); }
  .tw__list { max-height: none; }
}
@media (max-width: 900px) {
  .entrar, .leyes, .heraldos, .isla { grid-template-columns: minmax(0, 1fr); }
  .gui--craft { position: static; }
  .leyes { gap: var(--s6); }
  .book { justify-self: center; }
  .mapframe { width: min(100%, 560px); justify-self: center; }
  .craft { justify-content: center; }
}
@media (max-width: 640px) {
  .sec { padding-top: var(--s9); }
  .entry { grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3); padding: var(--s1); }
  .entry__icon { width: 64px; height: 64px; }
  .entry__top { flex-wrap: wrap; row-gap: var(--s1); }
  .entry__name { font-size: var(--fs-2); }
  .serverlist { padding: var(--s2); }
  .hero__inner { gap: var(--s4); }
  .hero__sub { margin-top: calc(var(--s2) * -1); font-size: var(--fs-1); }
  .hero__row { grid-template-columns: 1fr 1fr; }
  .hero__row .mc-btn--icon { grid-column: 1 / -1; }
  .mc-btn--primary { font-size: var(--fs-2); flex-wrap: wrap; gap: 0 var(--s3); min-height: 60px; }
  .mc-btn { padding: 0 var(--s3); }
  .splash { top: -30px; bottom: auto; right: -4px; transform: rotate(-9deg); }
  .tw__screen { aspect-ratio: auto; }
  .tw__pano, .tw__screen > img, .tw__screen > iframe { bottom: auto; height: auto !important; aspect-ratio: 16 / 9; }
  .tw__screen::before { content: ''; display: block; aspect-ratio: 16 / 9; }
  .tw__overlay { position: relative; left: auto; right: auto; bottom: auto; margin: 0 var(--u) var(--u); background: #000; }
  .adv { height: 600px; }
  .adv-node { left: calc(20% + var(--y) * 30%); top: calc(8% + var(--x) * 21%); }
  .adv-node--challenge { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
  .marker--dragon .px { width: 40px; height: 40px; }
  .marker__banner { width: 16px; height: 32px; }
  .legend__item { grid-template-columns: 44px minmax(0, 1fr); padding: var(--s3); }
  .legend__banner { width: 33px; height: 66px; }
  .legend__name { font-size: var(--fs-2); }
  .inv__search, .inv__search input { width: 100%; }
  .inv__bar { flex-direction: column; align-items: stretch; }
  .book { padding: var(--s5) var(--s5) var(--s3); }
  .book__page { min-height: 420px; }
  .tw__title { font-size: var(--fs-2); }
  .tw__overlay { padding: var(--s3); }
}

@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 > span, .legend__banner, .live-dot, .marker--dragon::after { animation: none !important; }
}
