/* OpenWilds — one stylesheet for the whole site. Tokens come from DESIGN.md.
   Pixel images are 1x sprites (icons are 16x16) shown at whole multiples only: 16, 32 or 48 px. */
:root {
  --bg: #1a1b1e;
  --card: #222222;
  --raised: #2a2b2f;
  --line: #34363b;
  --ink: #f3eee4;
  --body: #d9d4c8;
  --muted: #9a968e;
  --snow-shade: #cdd4dc;

  --green: #80c85b;
  --green-hi: #96d670;
  --green-lo: #5ea442;
  --green-edge: #4a7a33;
  --wood-1: #dec496;
  --wood: #cba170;
  --wood-3: #b37f52;
  --wood-4: #a36940;
  --wood-5: #80502f;
  --brick: #d68056;
  --brick-dark: #8a482a;
  --fire: #f0aa50;
  --glacier: #4f96a6;
  --mustard: #dcac3e;
  --mustard-dark: #8a661e;
  --outline: #1f2023;
  --shadow: #121315;

  --f-display: "Pixelify Sans", "Silkscreen", monospace;
  --f-label: "Silkscreen", "Pixelify Sans", monospace;
  --f-body: "Inter", system-ui, sans-serif;

  --step: steps(5, end);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --topbar: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
img { max-width: 100%; }
.px, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--green-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd {
  font: 500 .9em/1 ui-monospace, "JetBrains Mono", Menlo, monospace;
  background: var(--raised); border: 1px solid var(--line); color: var(--ink);
  padding: .15em .4em;
}
:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
::selection { background: var(--green-edge); color: var(--ink); }
[hidden] { display: none !important; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--fire); color: var(--outline); padding: 8px 14px; font-family: var(--f-display); }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---------- labels ---------- */
.eyebrow, .tag {
  font: 400 .78rem/1.2 var(--f-label);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wood);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.eyebrow::before { content: ""; flex: none; width: 12px; height: 4px; background: currentColor; box-shadow: 16px 0 0 currentColor; margin-right: 16px; }
.tag { display: inline-block; padding: 3px 8px; border: 2px solid currentColor; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--body); max-width: 62ch; }
.pill { font: 400 .72rem/1 var(--f-label); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; background: var(--raised); color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px;
  font: 600 1.05rem/1.1 var(--f-display); letter-spacing: .02em; text-align: center;
  color: var(--wood); background: transparent;
  border: 2px solid var(--wood); border-radius: 0;
  cursor: pointer; text-decoration: none !important;
  transition: transform .12s steps(2), background-color .12s steps(2), color .12s steps(2), box-shadow .12s steps(2);
  box-shadow: 0 4px 0 var(--shadow);
}
.btn:hover { background: var(--wood); color: var(--outline); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--shadow); }
.btn--primary {
  color: var(--outline); background: var(--green); border-color: var(--green);
  box-shadow: inset 0 -4px 0 var(--green-edge), 0 4px 0 var(--shadow);
}
.btn--primary:hover { background: var(--green-hi); border-color: var(--green-hi); color: var(--outline); }
.btn--primary:active { background: var(--green-lo); border-color: var(--green-lo); box-shadow: inset 0 -2px 0 var(--green-edge), 0 2px 0 var(--shadow); }
.btn--small { min-height: 38px; padding: 6px 14px; font-size: .95rem; }
.btn--ghost { border-color: var(--line); color: var(--body); box-shadow: none; }
.btn--ghost:hover { background: var(--raised); color: var(--ink); }
.btn--danger { border-color: var(--brick); color: var(--brick); box-shadow: none; }
.btn--danger:hover, .btn--danger[data-armed] { background: var(--brick); color: var(--outline); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.link-arrow { font-family: var(--f-display); font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.link-arrow::after { content: "→"; transition: transform .15s steps(2); }
.link-arrow:hover::after { transform: translateX(4px); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar);
  background: #18191d;
  border-bottom: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--shadow);
}
.topbar__inner { height: 100%; display: flex; align-items: center; gap: 20px; width: min(100% - 2 * var(--gutter), 1400px); margin-inline: auto; }
.brand { display: block; line-height: 0; flex: none; }
.brand img { width: 132px; height: 44px; }
.mainnav { margin-inline: auto; }
.mainnav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.mainnav a {
  display: block; padding: 8px 12px; white-space: nowrap;
  font: 500 1rem/1 var(--f-display); color: var(--body);
  border-bottom: 4px solid transparent;
  text-decoration: none;
}
.mainnav a:hover { color: var(--ink); border-bottom-color: var(--line); }
.mainnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }
.topbar__end { display: flex; align-items: center; gap: 12px; flex: none; }
.icon-link { display: grid; place-items: center; width: 40px; height: 40px; color: var(--muted); }
.icon-link:hover { color: var(--ink); }
.icon-link svg { width: 22px; height: 22px; fill: currentColor; }
.account {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px 0 4px; max-width: 200px;
  font: 500 .95rem/1 var(--f-display); color: var(--ink);
  background: var(--card); border: 2px solid var(--line);
  text-decoration: none !important;
}
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account:hover { border-color: var(--wood); }
.account img { width: 28px; height: 28px; flex: none; background: var(--raised); }
.account--signed-out { padding: 0 14px; color: var(--wood); }
.navtoggle { display: none; }

/* Hanging IP sign: pinned to the top of the page (not the sticky bar), so it scrolls away with it. */
.plaque-wrap { position: absolute; left: 50%; top: var(--topbar); z-index: 45; transform: translateX(-50%); pointer-events: none; }
.plaque {
  pointer-events: auto;
  position: relative; display: flex; align-items: center; gap: 10px;
  margin-top: 18px; padding: 8px 16px 8px 18px;
  font: 600 1rem/1 var(--f-display); color: var(--outline); white-space: nowrap;
  background: var(--wood);
  border: 2px solid var(--outline);
  box-shadow: inset 0 -4px 0 var(--wood-3), inset 0 4px 0 var(--wood-1), 0 4px 0 var(--shadow);
  cursor: pointer;
}
.plaque::before, .plaque::after { /* ropes */
  content: ""; position: absolute; top: -20px; width: 4px; height: 18px;
  background: repeating-linear-gradient(to bottom, var(--wood-5) 0 4px, var(--wood-4) 4px 8px);
}
.plaque::before { left: 18px; }
.plaque::after { right: 18px; }
.plaque:hover { background: var(--wood-1); }
.plaque svg { width: 16px; height: 16px; fill: currentColor; }
.plaque .nail { width: 4px; height: 4px; background: var(--wood-5); }
body.app .plaque-wrap { display: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 16px); opacity: 0;
  padding: 12px 18px; display: flex; align-items: center; gap: 10px;
  font: 500 1rem/1.3 var(--f-display); color: var(--ink);
  background: var(--raised); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--shadow);
  transition: transform .2s steps(3), opacity .2s steps(3);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 0 2px var(--green-edge); }
.toast.is-error::before { background: var(--brick); box-shadow: 0 0 0 2px var(--brick-dark); }

/* Coordinates HUD (F3-style): shows while you scroll, fades when you stop. */
.hud {
  position: fixed; left: 16px; bottom: 16px; z-index: 40;
  font: 400 .72rem/1.5 var(--f-label); color: var(--ink);
  background: rgb(18 19 21 / .72); padding: 8px 10px;
  text-shadow: 2px 2px 0 var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s steps(3);
}
.hud.is-on { opacity: 1; }
.hud b { font-weight: 400; color: var(--wood); }
.hud__biome { color: var(--green-hi); }
body.app .hud { display: none; }

/* ---------- scenes (pixel canvas) ---------- */
.scene { position: relative; overflow: hidden; background: #18191d; isolation: isolate; }
.scene canvas { position: absolute; left: 0; top: 0; z-index: -1; }
.hero { min-height: 100svh; margin-top: calc(-1 * var(--topbar)); display: grid; place-items: center; text-align: center; padding: calc(var(--topbar) + 72px) var(--gutter) 120px; }
.hero__logo { width: 396px; height: 132px; display: block; margin: 0 auto 28px; animation: drop .9s steps(9) .2s both; }
.hero h1 { font-size: clamp(1.8rem, 4.4vw, 3.2rem); max-width: 18ch; margin: 0 auto 18px; text-shadow: 0 4px 0 var(--shadow); animation: rise .6s steps(6) .6s both; }
.hero .lead { margin: 0 auto 28px; animation: rise .6s steps(6) .75s both; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; animation: rise .6s steps(6) .9s both; }
.hero__status { margin-top: 26px; animation: rise .6s steps(6) 1.05s both; }
.hero__cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 400 .72rem/1 var(--f-label); color: var(--muted); text-transform: uppercase; letter-spacing: .1em;
  text-decoration: none !important;
}
.hero__cue::after { content: ""; width: 12px; height: 12px; border-right: 4px solid currentColor; border-bottom: 4px solid currentColor; transform: rotate(45deg); animation: bob 1.4s steps(4) infinite; }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } 60% { transform: translateY(6px); opacity: 1; } to { transform: translateY(0); opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
@keyframes blink { 50% { opacity: .35; } }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: rgb(18 19 21 / .7); border: 2px solid var(--line);
  font: 400 .8rem/1.3 var(--f-label); color: var(--body); text-transform: uppercase; letter-spacing: .04em;
}
.status__dot { flex: none; width: 8px; height: 8px; background: var(--muted); }
.status.is-online .status__dot { background: var(--green); animation: blink 2s steps(2) infinite; }
.status.is-offline .status__dot { background: var(--brick); }

/* Page banner for inner pages */
.banner { min-height: 440px; margin-top: calc(-1 * var(--topbar)); display: flex; align-items: flex-end; padding: calc(var(--topbar) + 110px) 0 72px; }
.banner h1 { text-shadow: 0 4px 0 var(--shadow); animation: rise .6s steps(6) .15s both; max-width: 20ch; }
.banner .lead { animation: rise .6s steps(6) .3s both; }
.banner .eyebrow { animation: rise .6s steps(6) both; }
.banner__art { display: block; margin-bottom: 20px; animation: drop .8s steps(8) both; }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(64px, 10vw, 128px) 0; background: var(--bg); }
.section--card { background: var(--card); }
.section--deep { background: #151619; }
.section__head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 48px); }
/* Snow-drift edge at the top of a section, painted in that section's colour */
.drift { position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 48px; background: inherit; pointer-events: none;
  -webkit-mask: url(/img/drift.svg) repeat-x 0 0 / 512px 48px; mask: url(/img/drift.svg) repeat-x 0 0 / 512px 48px; }

/* Scroll reveal, stepped like the pixel art. Only hides content when scripts can show it again. */
@media (scripting: enabled) {
  [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .5s var(--step), transform .5s var(--step); transition-delay: var(--d, 0s); }
  [data-reveal].is-in { opacity: 1; transform: none; }
}

.panel { background: var(--card); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--shadow); padding: 28px; }
.panel--raised { background: var(--raised); }
a.panel { color: inherit; text-decoration: none; transition: border-color .15s steps(2); }
a.panel:hover { border-color: var(--wood); }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.story { gap: 56px; align-items: center; }
.split { gap: 56px; align-items: start; }
.stack { gap: 16px; margin-top: 24px; }
.cards { margin-top: 40px; }
.cta { text-align: center; }
.cta .lead { margin: 0 auto 28px; }
.icon { width: 32px; height: 32px; flex: none; }
.feature { display: flex; gap: 18px; align-items: flex-start; }
.feature h3 { font-size: 1.2rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--body); }

/* Mode select (mirrors the in-game lobby screen) */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.mode {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--shadow);
  color: var(--body); text-decoration: none !important;
  transition: transform .18s steps(3), box-shadow .18s steps(3), border-color .18s steps(3);
}
.mode__banner { height: 136px; background: #18191d no-repeat center / 600px 136px; image-rendering: pixelated; border-bottom: 2px solid var(--line); transition: background-position .4s steps(8); }
.mode__body { padding: 24px 56px 28px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mode__body h3 { margin: 0; }
.mode__body .tag { align-self: flex-start; }
.mode__body p { margin: 0; }
.mode__go { position: absolute; right: 22px; bottom: 24px; font: 600 1.4rem/1 var(--f-display); color: var(--wood); transition: transform .15s steps(2); }
.mode:focus-visible { border-color: var(--wood); }

/* Two worlds */
.worlds { display: grid; grid-template-columns: 1fr 120px 1fr; align-items: stretch; }
.world { padding: 32px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 4px 0 var(--shadow); }
.world--wilds { background: linear-gradient(#1f262d 0 25%, #20262b 25% 50%, #212527 50% 75%, #222 75%); }
.world h3 { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; }
.world ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.world li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.world li img { width: 32px; height: 32px; margin-top: 2px; }
.world li b { display: block; color: var(--ink); font-family: var(--f-display); font-weight: 600; }
.bridge { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; font: 400 .7rem/1.3 var(--f-label); color: var(--muted); text-transform: uppercase; }
.bridge::before { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 4px;
  background: repeating-linear-gradient(90deg, var(--wood) 0 8px, transparent 8px 16px); background-size: 32px 4px; animation: march 1s steps(4) infinite; }
.bridge span { position: relative; background: var(--card); padding: 6px 4px; }
.bridge img { position: relative; width: 32px; height: 32px; }
@keyframes march { to { background-position: 32px 0; } }

/* Radio transmission */
.radio {
  position: relative;
  background: #141518; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--shadow);
  padding: 22px 24px 24px;
  font: 400 1.05rem/1.7 var(--f-display); color: var(--snow-shade);
}
.radio__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font: 400 .72rem/1 var(--f-label); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.radio__bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.radio__bars i { width: 4px; background: var(--green); animation: bars 1.2s steps(3) infinite; }
.radio__bars i:nth-child(1) { height: 6px; } .radio__bars i:nth-child(2) { height: 10px; animation-delay: .2s; }
.radio__bars i:nth-child(3) { height: 16px; animation-delay: .4s; } .radio__bars i:nth-child(4) { height: 12px; animation-delay: .1s; background: var(--line); }
@keyframes bars { 50% { opacity: .3; } }
.radio__line { min-height: 1.7em; }
.radio__line .who { color: var(--fire); }
.radio__cursor { display: inline-block; width: 10px; height: 1em; background: var(--snow-shade); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
.radio__static { position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background: repeating-linear-gradient(0deg, #fff 0 2px, transparent 2px 4px); animation: static .3s steps(3) infinite; }
@keyframes static { 50% { transform: translateY(2px); } }
.radio + .callout { margin-top: 28px; }

/* Journal pages */
.pages { position: relative; height: 300px; margin-top: 32px; }
.jpage {
  position: absolute; width: min(210px, 64%); padding: 18px 18px 22px;
  background: #e8dcc0; color: #3b2a1a;
  font: 500 .95rem/1.5 var(--f-display);
  box-shadow: 0 6px 0 var(--shadow);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 92%, 96% 96%, 88% 100%, 0 100%, 0 12%, 4% 8%, 0 4%);
  transition: transform .4s steps(5);
}
.jpage small { display: block; font: 400 .65rem/1 var(--f-label); color: #7a5f40; margin-bottom: 10px; text-transform: uppercase; }
.jpage .redact { background: #3b2a1a; color: transparent; user-select: none; }
.jpage:nth-child(1) { left: 0; top: 30px; transform: rotate(-6deg); }
.jpage:nth-child(2) { left: 30%; top: 0; transform: rotate(3deg); z-index: 2; }
.jpage:nth-child(3) { right: 0; top: 50px; transform: rotate(-2deg); }

/* Inventory grid with a tooltip panel */
.kit { --slot: 72px; display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
.inv { display: grid; grid-template-columns: repeat(4, var(--slot)); gap: 6px; padding: 14px; width: max-content; background: #2b2c30; border: 2px solid var(--outline); box-shadow: inset 4px 4px 0 #3a3c42, inset -4px -4px 0 #1c1d20, 0 4px 0 var(--shadow); }
.slot {
  width: var(--slot); height: var(--slot); display: grid; place-items: center;
  background: #1f2023; border: 0; padding: 0; cursor: pointer;
  box-shadow: inset 4px 4px 0 #141518, inset -4px -4px 0 #34363b;
}
.slot img { width: 32px; height: 32px; transition: transform .15s steps(2); }
.slot[aria-pressed="true"] { background: #34363b; box-shadow: inset 0 0 0 4px var(--wood), inset 6px 6px 0 #26272b; }
.slot:focus-visible { outline-offset: -2px; }
.kit__detail { min-height: 160px; }
.kit__detail .tooltip {
  display: inline-block; padding: 10px 14px; margin-bottom: 18px;
  background: #16111c; border: 2px solid #2a1f3a; box-shadow: inset 0 0 0 2px #3b2d55, 0 4px 0 var(--shadow);
  font: 500 1.4rem/1.2 var(--f-display); color: var(--ink);
}
.kit__detail .tooltip small { display: block; margin-top: 4px; font: 400 .7rem/1 var(--f-label); color: var(--glacier); text-transform: uppercase; }
.kit__detail p { max-width: 52ch; animation: rise .35s steps(4) both; }

.checklist { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 28px; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 6px; border-left: 4px solid var(--green); border-bottom: 4px solid var(--green); transform: rotate(-45deg); }

/* Community */
.discord-card {
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  padding: 40px; background: #1d2026; border: 2px solid var(--line); box-shadow: 0 6px 0 var(--shadow);
  position: relative; overflow: hidden;
}
.discord-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; background: radial-gradient(circle, rgb(214 128 86 / .22), transparent 65%); pointer-events: none; }
.discord-card .lead { margin: 0; }

/* Scoreboard mock (Minecraft sidebar) */
.scoreboard { width: min(260px, 100%); margin-top: 24px; background: rgb(18 19 21 / .78); font: 400 1rem/1.55 var(--f-display); color: var(--ink); padding: 4px 0 8px; box-shadow: 0 4px 0 var(--shadow); }
.scoreboard + p { margin-top: 12px; }
.scoreboard__title { text-align: center; padding: 4px 0 6px; background: rgb(0 0 0 / .3); margin-bottom: 6px; }
.scoreboard__title img { width: 132px; height: 44px; vertical-align: middle; }
.scoreboard .row { display: flex; justify-content: space-between; padding: 0 12px; }
.scoreboard .k { color: var(--muted); }
.scoreboard .gold { color: var(--mustard); }
.scoreboard .ok { color: var(--green-hi); }

/* Loop diagram */
.loop { display: grid; grid-template-columns: repeat(4, 1fr); }
.loop__step { position: relative; padding: 24px 22px; background: var(--card); border: 2px solid var(--line); margin-right: -2px; }
.loop__step img { width: 32px; height: 32px; margin-bottom: 12px; }
.loop__step h4 { margin-bottom: 6px; }
.loop__step p { margin: 0; font-size: .95rem; }
.loop__step:nth-child(-n+3)::after { content: ""; position: absolute; right: -14px; top: 32px; z-index: 2; border: 12px solid transparent; border-left-color: var(--wood); border-right: 0; }
.loop__back { grid-column: 1 / -1; height: 40px; position: relative; margin: 0 40px; border: 4px dashed var(--wood); border-top: 0; opacity: .7; }
.loop__back span { position: absolute; left: 50%; bottom: -12px; translate: -50% 0; background: var(--bg); padding: 0 12px; font: 400 .7rem/1.5 var(--f-label); text-transform: uppercase; color: var(--wood); white-space: nowrap; }

/* Events */
.rounds { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.round { background: var(--card); border: 2px solid var(--line); padding: 28px; box-shadow: 0 4px 0 var(--shadow); position: relative; }
.round img { display: block; width: 32px; height: 32px; margin-bottom: 16px; }
.round p { margin: 0; }
.round__no { position: absolute; right: 20px; top: 22px; font: 400 .72rem/1 var(--f-label); color: var(--brick); text-transform: uppercase; }
.round--finale { border-color: var(--brick-dark); }

/* Prose / docs / rules */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: calc(var(--topbar) + 24px); max-height: calc(100vh - var(--topbar) - 48px); overflow: auto; padding-right: 8px; }
.toc input { width: 100%; margin-bottom: 18px; }
.toc ol, .toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; color: var(--muted); font: 500 .98rem/1.2 var(--f-display); border-left: 4px solid var(--line); text-decoration: none; }
.toc a:hover { color: var(--ink); background: var(--card); }
.toc a.is-active { color: var(--ink); border-left-color: var(--green); background: var(--card); }
.toc img { flex: none; width: 16px; height: 16px; }
.prose { max-width: 74ch; min-width: 0; }
.prose > section { padding-bottom: 56px; margin-bottom: 56px; border-bottom: 2px solid var(--line); }
.prose > section:last-child { border-bottom: 0; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2rem); display: flex; gap: 14px; align-items: center; }
.prose h2 img { flex: none; width: 32px; height: 32px; }
.prose h3 { margin-top: 1.8em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--wood); }
.callout { margin: 1.4em 0; padding: 16px 20px; background: var(--card); border-left: 4px solid var(--glacier); }
.callout--warn { border-left-color: var(--brick); }
.callout p:last-child { margin: 0; }
.cmd-table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .95rem; }
.cmd-table th, .cmd-table td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); vertical-align: top; }
.cmd-table th { font: 400 .72rem/1 var(--f-label); color: var(--muted); text-transform: uppercase; }
.cmd-table code { white-space: nowrap; }
.doc-empty { padding: 24px; background: var(--card); }

.rules-chapter { margin-bottom: 64px; }
.rules-chapter h2 { display: flex; align-items: baseline; gap: 16px; }
.rules-chapter h2 .no { font: 400 1rem/1 var(--f-label); color: var(--wood); }
.rule { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-bottom: 2px solid var(--line); }
.rule:target { background: linear-gradient(90deg, rgb(203 161 112 / .12), transparent); animation: flash 1.2s steps(4); }
@keyframes flash { 0%, 50% { background-color: rgb(203 161 112 / .25); } }
.rule__no { font: 400 .9rem/1.6 var(--f-label); color: var(--wood); text-decoration: none !important; }
.rule__no:hover { color: var(--ink); }
.rule p { margin: 0; }
.rule p + p { margin-top: .4em; color: var(--muted); font-size: .95rem; }
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 24px 0; }
.ladder li { list-style: none; padding: 20px; border: 2px solid var(--line); margin: 0 -2px -2px 0; background: var(--card); }
.ladder li b { display: block; font-family: var(--f-display); color: var(--ink); font-size: 1.15rem; margin-bottom: 4px; }

/* Steps (real sequences only) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.steps li { counter-increment: s; padding: 22px; background: var(--card); border: 2px solid var(--line); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px; background: var(--wood); color: var(--outline); font: 600 1.1rem/1 var(--f-display); box-shadow: inset 0 -4px 0 var(--wood-3); }
.steps b { display: block; color: var(--ink); font-family: var(--f-display); font-size: 1.15rem; margin-bottom: 4px; }
.steps + p { margin-top: 36px; }

/* Forms */
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field > span, .label { font: 500 1rem/1.2 var(--f-display); color: var(--ink); }
.field small { color: var(--muted); font-size: .88rem; }
input[type="text"], input[type="search"], input[type="password"], textarea, select {
  width: 100%; padding: 12px 14px;
  font: 400 1rem/1.5 var(--f-body); color: var(--ink); /* 16px keeps iOS from zooming in on focus */
  background: #18191c; border: 2px solid var(--line); border-radius: 0;
  box-shadow: inset 0 4px 0 #141518;
}
input::placeholder, textarea::placeholder { color: #6f6c66; }
input:focus, textarea:focus, select:focus { border-color: var(--wood); outline: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
select { appearance: none; padding-right: 36px; max-width: 100%; background-image: linear-gradient(45deg, transparent 50%, var(--wood) 50%), linear-gradient(-45deg, transparent 50%, var(--wood) 50%); background-size: 6px 6px; background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 120px; }
.form-error { color: var(--brick); font-weight: 500; margin: 0 0 16px; }
.form-error:empty { display: none; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: 2px solid var(--line); cursor: pointer; font: 500 1rem/1.2 var(--f-display); color: var(--body); height: 100%; }
.choice label img { flex: none; width: 32px; height: 32px; }
.choice input:checked + label { border-color: var(--green); color: var(--ink); background: var(--raised); }
.choice input:focus-visible + label { outline: 2px solid var(--fire); outline-offset: 2px; }

/* ---------- footer ---------- */
.footer { position: relative; }
.footer__scene { height: 200px; }
.footer__body { background: #121315; padding: 48px 0 32px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer h4 { font: 400 .75rem/1 var(--f-label); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--body); overflow-wrap: anywhere; }
.footer a:hover { color: var(--green-hi); }
.footer__legal { margin-top: 40px; padding-top: 20px; border-top: 2px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.footer .brand img { width: 198px; height: 66px; margin-bottom: 14px; }

/* ---------- route rail (home): scroll = travel ---------- */
.route { position: fixed; right: 20px; top: 50%; translate: 0 -50%; z-index: 40; display: flex; flex-direction: column; align-items: center; }
.route ol { position: relative; list-style: none; margin: 0; padding: 10px 0; display: flex; flex-direction: column; gap: 26px; }
.route ol::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; translate: -50% 0;
  background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 10px); }
.route__trail { position: absolute; left: 50%; top: 0; width: 4px; translate: -50% 0; height: var(--p, 0%); background: var(--wood); }
.route a { position: relative; display: block; width: 14px; height: 14px; background: var(--bg); border: 4px solid var(--line); }
.route a.is-passed { border-color: var(--wood); background: var(--wood); }
.route a.is-active { border-color: var(--green); background: var(--green); }
.route a span { position: absolute; right: 26px; top: 50%; translate: 0 -50%; white-space: nowrap; font: 400 .7rem/1 var(--f-label); text-transform: uppercase; color: var(--ink); background: var(--raised); padding: 6px 8px; opacity: 0; pointer-events: none; transition: opacity .15s steps(2); }
.route a:hover span, .route a:focus-visible span { opacity: 1; }
.route__walker { position: absolute; left: 50%; width: 27px; height: 30px; translate: -50% -50%; top: var(--p, 0%); z-index: 2; pointer-events: none; transition: top .25s steps(4); }
.route__walker.is-walking { animation: walk .3s steps(2) infinite; }
@keyframes walk { 50% { margin-top: -3px; } }

/* ---------- support app ---------- */
body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.desk { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.desk.is-gate { grid-template-columns: minmax(0, 1fr); }
.desk__side { display: flex; flex-direction: column; min-height: 0; background: #1c1d20; border-right: 2px solid var(--line); }
.me { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 2px solid var(--line); }
.me > div { min-width: 0; }
.me img { flex: none; width: 48px; height: 48px; background: var(--raised); box-shadow: 0 4px 0 var(--shadow); }
.me b { display: block; font: 600 1.15rem/1.2 var(--f-display); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; border-bottom: 2px solid var(--line); }
.tabs button { flex: 1; padding: 12px 6px; background: none; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; color: var(--muted); font: 500 .98rem/1 var(--f-display); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }
.tabs button .n { font: 400 .7rem/1 var(--f-label); background: var(--brick); color: var(--outline); padding: 2px 5px; margin-left: 6px; }
.filters { display: flex; gap: 8px; padding: 12px; border-bottom: 2px solid var(--line); }
.filters select { flex: 1; min-width: 0; padding: 8px 28px 8px 10px; font-size: .9rem; background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%; }
.tlist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.tlist a { display: block; padding: 14px 18px; border-bottom: 2px solid var(--line); color: var(--body); text-decoration: none; border-left: 4px solid transparent; }
.tlist a:hover { background: var(--card); }
.tlist a[aria-current="true"] { background: var(--raised); border-left-color: var(--wood); }
.tlist .row1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tlist .subj { font: 600 1rem/1.3 var(--f-display); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlist .when { font-size: .78rem; color: var(--muted); flex: none; }
.tlist .prev { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 4px 0 8px; }
.tlist .row3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tlist .needs { width: 8px; height: 8px; background: var(--brick); }
.tlist-empty { padding: 28px 20px; color: var(--muted); }
.side-foot { padding: 14px; border-top: 2px solid var(--line); }
.side-foot .btn { width: 100%; }

.st { display: inline-flex; align-items: center; gap: 6px; font: 400 .68rem/1 var(--f-label); text-transform: uppercase; padding: 4px 6px; border: 2px solid currentColor; }
.st--open { color: var(--green); }
.st--in_progress { color: var(--glacier); }
.st--waiting { color: var(--wood); }
.st--resolved { color: var(--muted); }
.st--closed { color: #6f6c66; }
.role { font: 400 .66rem/1 var(--f-label); text-transform: uppercase; padding: 3px 5px; background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.role--helper { color: var(--wood-1); border-color: var(--wood-5); }
.role--moderator { color: var(--ink); border-color: var(--wood); background: var(--wood-5); }
.role--admin, .role--owner { color: var(--outline); background: var(--wood); border-color: var(--wood-1); }

.desk__main { min-height: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.convo-head { padding: 18px 28px; border-bottom: 2px solid var(--line); background: #1c1d20; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.convo-head > div:first-child { min-width: 0; }
.convo-head h1 { font-size: 1.5rem; margin: 0 0 6px; }
.convo-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools select { width: auto; padding: 8px 34px 8px 10px; font-size: .9rem; }
.back { display: none; }
.thread { flex: 1; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; max-width: min(760px, 100%); animation: rise .3s steps(3) both; }
.msg img { width: 40px; height: 40px; background: var(--raised); box-shadow: 0 3px 0 var(--shadow); }
.msg__by { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-bottom: 6px; font-size: .82rem; color: var(--muted); }
.msg__by b { font: 600 1rem/1 var(--f-display); color: var(--ink); }
.msg__text { padding: 12px 16px; background: var(--card); border: 2px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--body); }
.msg--staff .msg__text { background: #232a22; border-color: #33432b; }
.msg--mine { align-self: flex-end; grid-template-columns: minmax(0, 1fr) 40px; }
.msg--mine img { order: 2; }
.msg--mine .msg__by { justify-content: flex-end; }
.msg--internal .msg__text { background: #2a2618; border: 2px dashed var(--mustard-dark); }
.msg--internal .msg__by::after { content: "Staff note · players can't see this"; font: 400 .62rem/1 var(--f-label); color: var(--mustard); text-transform: uppercase; }
.evt { align-self: center; max-width: 100%; text-align: center; font-size: .82rem; color: var(--muted); padding: 6px 12px; background: #1c1d20; border: 2px solid var(--line); }
.evt b { color: var(--body); font-weight: 600; }
.composer { border-top: 2px solid var(--line); background: #1c1d20; padding: 14px 28px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.composer form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.composer textarea { min-height: 52px; max-height: 220px; }
.composer__opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; align-items: center; font-size: .85rem; color: var(--muted); }
.composer__opts label { display: inline-flex; gap: 8px; align-items: center; color: var(--mustard); cursor: pointer; }
.composer.is-internal textarea { border-color: var(--mustard-dark); border-style: dashed; }
.composer__closed { padding: 18px 28px; border-top: 2px solid var(--line); color: var(--muted); background: #1c1d20; }
.empty { margin: auto; text-align: center; max-width: 420px; padding: 40px 24px; }
.empty img { width: 64px; height: 64px; margin-bottom: 18px; }
.newt { overflow-y: auto; padding: 32px 28px 48px; }
.newt form { max-width: 760px; }
.hint { margin: -6px 0 20px; padding: 12px 16px; background: var(--card); border-left: 4px solid var(--glacier); font-size: .93rem; }
.staff-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.staff-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; background: var(--card); border: 2px solid var(--line); }
.staff-list img { width: 40px; height: 40px; }
.staff-list select { width: auto; padding: 8px 34px 8px 10px; }

/* Login */
.login-card { max-width: 560px; margin: 0 auto; position: relative; }
.code { display: flex; gap: 8px; justify-content: center; margin: 18px 0 22px; }
.code span { width: clamp(38px, 11vw, 52px); height: clamp(50px, 14vw, 64px); display: grid; place-items: center; font: 700 clamp(1.4rem, 6vw, 2rem)/1 var(--f-display); color: var(--ink); background: #18191c; border: 2px solid var(--line); box-shadow: inset 0 -4px 0 #141518; animation: rise .3s steps(3) both; }
.cmd { display: flex; align-items: stretch; border: 2px solid var(--line); background: #141518; margin-bottom: 14px; }
.cmd code { flex: 1; min-width: 0; border: 0; background: none; padding: 14px 16px; font-size: 1.05rem; overflow-wrap: anywhere; }
.cmd button { border: 0; border-left: 2px solid var(--line); background: var(--raised); color: var(--wood); font: 600 .95rem/1 var(--f-display); padding: 0 16px; cursor: pointer; }
.cmd button:hover { background: var(--wood); color: var(--outline); }
.waiting { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .95rem; }
.waiting i { flex: none; width: 8px; height: 8px; background: var(--wood); animation: blink 1s steps(2) infinite; }
.waiting i:nth-child(2) { animation-delay: .33s; } .waiting i:nth-child(3) { animation-delay: .66s; }
.timer { height: 6px; background: var(--line); margin-top: 18px; }
.timer i { display: block; height: 100%; background: var(--wood); transition: width 1s linear; }
.welcome { text-align: center; }
.welcome img { width: 96px; height: 96px; margin: 0 auto 16px; display: block; box-shadow: 0 6px 0 var(--shadow); animation: drop .6s steps(6) both; }

/* ---------- hover-only motion (no sticky hover on touch screens) ---------- */
@media (hover: hover) {
  .mode:hover { transform: translateY(-6px); box-shadow: 0 12px 0 var(--shadow); border-color: var(--wood); }
  .mode:hover .mode__banner { background-position: calc(50% - 16px) 50%; }
  .mode:hover .mode__go { transform: translateX(6px); }
  .slot:hover img { transform: translateY(-4px); }
  .pages:hover .jpage:nth-child(1) { transform: rotate(-9deg) translate(-12px, 6px); }
  .pages:hover .jpage:nth-child(2) { transform: rotate(0) translateY(-8px); }
  .pages:hover .jpage:nth-child(3) { transform: rotate(2deg) translate(12px, 6px); }
}

/* ---------- responsive ---------- */
/* Small laptops and landscape tablets */
@media (max-width: 1180px) {
  .topbar__inner { gap: 14px; }
  .mainnav a { padding: 8px 8px; font-size: .95rem; }
  .account { max-width: 150px; }
  .route { display: none; }
}

/* Tablets (portrait) and below: menu button, stacked layouts */
@media (max-width: 1024px) {
  .navtoggle { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--card); border: 2px solid var(--line); color: var(--ink); font: 500 .95rem/1 var(--f-display); cursor: pointer; }
  .navtoggle i { width: 16px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor; }
  .mainnav { position: fixed; inset: var(--topbar) 0 auto 0; max-height: calc(100dvh - var(--topbar)); overflow-y: auto; background: #18191d; border-bottom: 2px solid var(--line); box-shadow: 0 6px 0 var(--shadow); padding: 12px var(--gutter) 20px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: transform .2s steps(3), opacity .2s steps(3), visibility .2s steps(3); }
  .mainnav.is-open { transform: none; opacity: 1; visibility: visible; }
  .mainnav ul { flex-direction: column; }
  .mainnav a { padding: 14px 6px; font-size: 1.1rem; border-bottom: 2px solid var(--line); }
  .topbar__end { margin-left: auto; }
  .hud { display: none; }

  .grid--3, .rounds { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .worlds { grid-template-columns: 1fr; }
  .bridge { flex-direction: row; padding: 20px 0; }
  .bridge::before { left: 50%; right: auto; top: 0; bottom: 0; width: 4px; height: auto; background: repeating-linear-gradient(to bottom, var(--wood) 0 8px, transparent 8px 16px); background-size: 4px 32px; animation: none; }
  .kit { grid-template-columns: 1fr; gap: 28px; }
  .loop, .steps, .ladder { grid-template-columns: 1fr 1fr; }
  .loop__step { margin-bottom: -2px; }
  .loop__step:nth-child(2)::after { display: none; }
  .loop__back { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }

  /* Docs and rules: the contents become a sticky, swipeable row */
  .doc { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .toc { position: sticky; top: var(--topbar); z-index: 30; max-height: none; overflow: visible; margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter); background: var(--bg); border-bottom: 2px solid var(--line); }
  .toc input { margin-bottom: 10px; }
  .toc ol, .toc ul { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .toc ol::-webkit-scrollbar, .toc ul::-webkit-scrollbar { display: none; }
  .toc li { flex: none; }
  .toc a { white-space: nowrap; border-left: 0; border: 2px solid var(--line); padding: 8px 12px; }
  .toc a.is-active { border-color: var(--green); }
  html:has(.doc) { scroll-padding-top: calc(var(--topbar) + 140px); }

  /* Support desk: one pane at a time */
  .desk { grid-template-columns: minmax(0, 1fr); }
  .desk__side { border-right: 0; }
  .desk.has-ticket .desk__side { display: none; }
  .desk:not(.has-ticket) .desk__main { display: none; }
  .desk.is-gate .desk__main { display: flex; }
  .back { display: inline-flex; }
}

/* Text next to a visual needs room; stack them on portrait tablets */
@media (max-width: 900px) {
  .story, .split { grid-template-columns: minmax(0, 1fr); }
  .pages { max-width: 520px; }
}

/* Phones (and narrow tablets) */
@media (max-width: 760px) {
  .modes, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .story, .split { gap: 40px; }
  .discord-card { grid-template-columns: 1fr; padding: 28px 24px; }
  .discord-card .btn { justify-self: start; }
  .banner { min-height: 380px; padding-bottom: 56px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar__inner { gap: 10px; }
  .brand img { width: 99px; height: 33px; }
  .account { padding: 0 4px; }
  .account span { display: none; }
  .account--signed-out { padding: 0 12px; }
  .hero { padding-top: calc(var(--topbar) + 84px); padding-bottom: 96px; }
  .hero__logo { width: 264px; height: 88px; }
  .hero__actions .btn, .actions .btn { flex: 1 1 100%; }
  .panel, .world, .round { padding: 22px; }
  .kit { --slot: clamp(56px, 17vw, 72px); }
  .inv { gap: 4px; padding: 10px; }
  .loop, .steps, .ladder { grid-template-columns: 1fr; }
  .loop__step::after { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__scene { height: 140px; }
  .pages { height: 420px; }
  .jpage:nth-child(2) { left: 18%; top: 120px; }
  .jpage:nth-child(3) { top: 230px; }
  .rule { grid-template-columns: 48px minmax(0, 1fr); }
  .cmd-table { display: block; overflow-x: auto; }
  .thread, .composer, .convo-head, .newt { padding-left: 16px; padding-right: 16px; }
  .composer__opts > span { display: none; }
  .staff-list li { grid-template-columns: 40px minmax(0, 1fr); }
  .staff-list li > :last-child { grid-column: 1 / -1; }
  .login-card { padding: 22px 18px; }
}

/* Very small phones: keep the top bar on one line */
@media (max-width: 400px) {
  .icon-link { display: none; }
  .navtoggle { font-size: 0; gap: 0; width: 44px; justify-content: center; }
  .plaque { font-size: .9rem; padding: 7px 12px; }
}

/* ---------- Season 2 countdown (shown on every URL until launch) ---------- */
.cd { margin-top: 0; padding: 48px var(--gutter) 140px; }
.cd__inner { width: min(100%, 720px); }
.cd__logo { display: block; width: 264px; height: 88px; margin: 0 auto 28px; animation: drop .9s steps(9) .2s both; }
.cd .eyebrow { animation: rise .6s steps(6) .5s both; }
.cd h1 { margin: 0 auto 8px; text-shadow: 0 4px 0 var(--shadow); animation: rise .6s steps(6) .6s both; }
/* Four wooden signs hanging from ropes, like the IP sign on the rest of the site. */
.cd__signs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 2.4vw, 24px); margin: 40px auto 28px; max-width: 600px; }
.cd__sign {
  position: relative; display: grid; gap: 2px; padding: 14px 4px 10px;
  background: var(--wood); border: 2px solid var(--outline);
  box-shadow: inset 0 -6px 0 var(--wood-3), inset 0 4px 0 var(--wood-1), 0 6px 0 var(--shadow);
  transform-origin: 50% -22px;
  animation: drop .8s steps(8) both;
}
.cd__sign:nth-child(2) { animation-delay: .75s; }
.cd__sign:nth-child(3) { animation-delay: .85s; }
.cd__sign:nth-child(4) { animation-delay: .95s; }
.cd__sign:first-child { animation-delay: .65s; }
.cd__sign::before, .cd__sign::after { /* ropes */
  content: ""; position: absolute; top: -24px; width: 4px; height: 22px;
  background: repeating-linear-gradient(to bottom, var(--wood-5) 0 4px, var(--wood-4) 4px 8px);
}
.cd__sign::before { left: 14%; }
.cd__sign::after { right: 14%; }
.cd__sign b { font: 700 clamp(2.1rem, 9vw, 4.6rem)/1 var(--f-display); color: var(--outline); font-variant-numeric: tabular-nums; }
.cd__sign span { font: 400 clamp(.6rem, 1.8vw, .78rem)/1.2 var(--f-label); text-transform: uppercase; letter-spacing: .06em; color: var(--wood-5); }
.cd__sign.is-tick { animation: swing .5s steps(4) both; }
@keyframes swing { 0% { rotate: 2deg; } 40% { rotate: -1.2deg; } 75% { rotate: .5deg; } 100% { rotate: 0deg; } }
.cd__when { font: 500 1.1rem/1.4 var(--f-display); color: var(--ink); margin: 0 0 32px; animation: rise .6s steps(6) 1.1s both; }
.cd .hero__actions { animation-delay: 1.2s; }
.is-live .cd__sign { background: var(--green); box-shadow: inset 0 -6px 0 var(--green-lo), inset 0 4px 0 var(--green-hi), 0 6px 0 var(--shadow); }
.is-live .cd__sign span { color: var(--green-edge); }

.cd__staff { position: absolute; left: 50%; bottom: 20px; translate: -50% 0; width: max-content; max-width: calc(100% - 2 * var(--gutter)); text-align: center; }
.cd__staff summary { cursor: pointer; list-style: none; font: 400 .72rem/1 var(--f-label); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; }
.cd__staff summary::-webkit-details-marker { display: none; }
.cd__staff summary:hover, .cd__staff[open] summary { color: var(--ink); }
.cd__form { display: flex; gap: 8px; margin-top: 6px; }
.cd__error { margin: 8px 0 0; font-size: .9rem; color: var(--brick); }
.cd__error:empty { display: none; }
.cd__form input { width: 220px; min-height: 38px; padding: 6px 12px; }

@media (max-width: 400px) {
  .cd__signs { gap: 6px; }
  .cd__form { flex-direction: column; }
  .cd__form input { width: 100%; }
}

/* Short landscape phones: don't force a full-height hero */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .banner { min-height: auto; }
}

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