/* Colours and type are taken from the client: Tahoma, the default HUD colour
   (67, 90, 209), the ClickGUI panel black (9, 9, 9 @ 200) and its greys. */
:root {
  --accent: #435ad1;
  --accent-dark: #2b3a87;
  --accent-text: #93a3f6;
  --text: #e1e4e4;
  --text-soft: #d2cdd1;
  --text-grey: #bebcbd;
  --text-dim: #a3a2a6;
  --panel: rgba(9, 9, 9, 0.78);
  --added: #aacdbe;
  --removed: #e95050;
  --bg: #2e3247;
  --font: Tahoma, Verdana, "DejaVu Sans", sans-serif;
  --mono: Consolas, "Cascadia Mono", Menlo, "DejaVu Sans Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-grey);
  font: 0.9375rem/1.6 var(--font);
}

#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

a { color: var(--accent-text); }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

strong { color: var(--text); font-weight: 700; }

code { font-family: var(--mono); font-size: 0.875em; color: var(--text); }

.dim { color: var(--text-dim); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- watermark + nav ---------------------------------------------------- */

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
}

.watermark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.watermark img { align-self: center; }

.name { color: var(--text); font-size: 1.0625rem; }
.name b { color: var(--accent-text); }

.edition { color: var(--text-dim); font-size: 0.75rem; }

.hud nav { display: flex; gap: 4px; }

.hud nav a {
  padding: 6px 9px;
  color: var(--text-grey);
  font-size: 0.8125rem;
  text-decoration: none;
}

.hud nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* ---- main menu ---------------------------------------------------------- */

.menu {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 84px 20px 96px;
  text-align: center;
}

.menu-logo {
  width: clamp(104px, 15vw, 152px);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

h1 { margin: 10px 0 0; font-weight: 400; line-height: 1; }

.wordmark {
  display: block;
  color: var(--text-soft);
  font-size: clamp(3.5rem, 10vw, 5.75rem);
  letter-spacing: -0.01em;
}

.wordmark b { color: var(--accent); font-weight: 700; }

.menu-edition {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.3;
}

.menu-lede {
  max-width: 58ch;
  margin: 20px 0 28px;
  font-size: 1rem;
}

.menu-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.menu-buttons-sm { margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(150, 150, 156, 0.36);
  background: rgba(45, 45, 48, 0.6);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  border-color: rgba(205, 205, 210, 0.5);
  background: rgba(72, 72, 77, 0.7);
  color: #fff;
}

.btn-primary { border-color: #6278e2; background: var(--accent); color: #fff; }
.btn-primary:hover { border-color: #8496f0; background: #4e66dd; }

.btn-sm { min-width: 110px; height: 30px; font-size: 0.8125rem; }

.tip {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 22px;
  margin: 0;
  color: var(--text-grey);
  font-size: 0.8125rem;
}

.tip b { color: #fff; }

/* ---- sections ----------------------------------------------------------- */

section:not(.menu) { padding: 56px 0; }

h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 { margin: 0 0 8px; color: var(--text); font-size: 0.9375rem; }

p { margin: 0 0 12px; }

.lede { max-width: 62ch; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: start;
}

.panel { background: var(--panel); }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.8125rem;
}

.panel ul { margin: 0; padding: 0; list-style: none; }

/* ---- changelog ---------------------------------------------------------- */

.changelog li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 9px 11px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.changelog li:nth-child(even) { background: rgba(255, 255, 255, 0.025); }

.tag.added { color: var(--added); }
.tag.improved { color: var(--accent-text); }
.tag.removed { color: var(--removed); }

.changelog li > span:last-child { color: var(--text); }

/* ---- ClickGUI ----------------------------------------------------------- */

.gui-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 8px;
  font-size: 0.8125rem;
}

.gui-search input {
  width: 240px;
  max-width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.gui-search input::placeholder { color: var(--text-dim); opacity: 1; }
.gui-search input:focus-visible { outline-offset: 0; }

.gui {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.tab button {
  display: block;
  width: 100%;
  height: 27px;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-grey);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tab li:nth-child(even) button { background: rgba(255, 255, 255, 0.025); }
.tab li button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.tab li button.on { background: var(--accent); color: #fff; }
.tab li button.on:hover { background: #4e66dd; }
.tab li button:focus-visible { outline-offset: -2px; outline-color: #fff; }

.tab li[hidden] { display: none; }
.tab.empty { opacity: 0.4; }

.commands { margin-top: 6px; }

.commands ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 11px;
}

.commands li {
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
}

/* ---- build -------------------------------------------------------------- */

.reqs { margin: 20px 0 0; }
.reqs dt { color: var(--text); font-weight: 700; }
.reqs dd { margin: 0 0 12px; }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li { counter-increment: step; margin-bottom: 22px; }
.steps li:last-child { margin-bottom: 0; }
.steps h3::before { content: counter(step) ". "; color: var(--accent-text); }
.steps p { margin: 8px 0 0; font-size: 0.875rem; }

.cmd { display: flex; background: var(--panel); }

.cmd code {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.copy {
  flex: none;
  width: 68px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-grey);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.copy:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ---- credits ------------------------------------------------------------ */

.quote { color: var(--text); font-style: italic; }

.credits dl { margin: 0; }

.credits dl > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 9px 11px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.credits dl > div:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.credits dt { color: var(--text); }
.credits dd { margin: 0; }

/* ---- links -------------------------------------------------------------- */

.links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 22px;
}

.link {
  display: block;
  padding: 16px;
  border-left: 2px solid var(--accent);
  color: var(--text-grey);
  text-decoration: none;
  transition: background-color 0.15s;
}

.link:hover { background: rgba(26, 26, 30, 0.86); color: var(--text-grey); }

.link span { display: block; }
.link-kind { color: var(--text-dim); font-size: 0.75rem; }
.link-title { margin: 2px 0 6px; color: var(--text); font-size: 1rem; overflow-wrap: anywhere; }
.link:hover .link-title { color: #fff; }
.link-note { font-size: 0.8125rem; line-height: 1.45; }

/* ---- footer ------------------------------------------------------------- */

footer {
  padding: 28px 0 36px;
  background: var(--panel);
  font-size: 0.8125rem;
  text-align: center;
}

footer p { margin: 0; }
footer .name { font-size: inherit; }

/* ---- small screens ------------------------------------------------------ */

@media (max-width: 900px) {
  .gui { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .links { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  section:not(.menu) { padding: 40px 0; }
  .gui { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab button { height: 36px; }
  .gui-search input { flex: 1; width: auto; height: 40px; font-size: 1rem; }
  .btn { min-width: 0; flex: 1 1 30%; height: 44px; padding: 0 10px; }
  .btn-sm { flex: 0 1 auto; min-width: 110px; height: 40px; }
  .copy { width: 64px; }
  .credits dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 440px) {
  .edition, .nav-build { display: none; }
  .hud { padding: 10px 10px 10px 14px; }
  .hud nav a { padding: 8px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .link { transition: none; }
}
