/* Bright block world theme: sky, grass, dirt and chunky bevelled panels. */
@font-face {
  font-family: "Server Editor Pixel";
  src: url("../assets/fonts/pixel.woff2") format("woff2");
  font-display: swap;
}

:root {
  --sky: #d9efff;
  --panel: #fffdf7;
  --panel-shade: #f2ead8;
  --line: #e6dcc6;
  --outline: #2b1d12;
  --ink: #221c17;
  --muted: #5e554a;
  --grass: #4e9c2c;
  --grass-light: #8ad65a;
  --grass-dark: #2f6a17;
  --grass-ink: #2f6e17;
  --error: #bb2a20;
  --warning: #8a5a00;
  --focus: #1664d9;
  --pixel: "Server Editor Pixel", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* one sky from the deep blue at the top to the pale blue at the bottom */
html {
  min-height: 100%;
  background:
    url("../assets/textures/clouds.svg") repeat-x center 14px,
    linear-gradient(#3f97ee 0, #6db6f8 420px, #a5d6ff 45%, #dcf0ff 100%),
    var(--sky);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, .brand, .button, .nav-title, .language-toggle a, .hero-badges li, summary h3 {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.25;
}
/* multiples of 10px keep the pixel font crisp */
h2 { font-size: 30px; }
h3 { font-size: 20px; }
a { color: var(--focus); }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.pixel-icon { display: block; width: 24px; height: 24px; flex: none; }
.icon-large { width: 72px; height: 72px; }

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

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 20; background: var(--panel); padding: 8px 14px; }
.skip-link:focus { top: 8px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.hero { color: #fff; }
.hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 12px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; color: #fff; text-decoration: none; min-width: 0; }
.brand-logo { width: 44px; height: 44px; border: 3px solid var(--outline); box-shadow: 0 4px 0 rgb(0 0 0 / 0.25); }
/* a name plate stays readable where a cloud passes behind it */
.hero .brand span { background: #1f4a7a; border: 3px solid var(--outline); padding: 5px 14px 7px; }
.brand:hover span { text-decoration: underline; text-underline-offset: 4px; }

.language-toggle { display: flex; border: 3px solid var(--outline); background: #7f868c; flex: none; }
.language-toggle a {
  padding: 4px 14px 6px;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 0.45);
}
.language-toggle a:hover { background: #99a1a8; }
.language-toggle a[aria-current="true"] { background: var(--grass); box-shadow: inset 3px 3px 0 var(--grass-light), inset -3px -3px 0 var(--grass-dark); }

.tool-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tool-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 8px;
  background: var(--panel);
  border: 3px solid var(--outline);
  box-shadow: inset -3px -3px 0 var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}
.tool-nav a:hover { background: #fff; }
.tool-nav a[aria-current="page"] { background: #d9f2c7; box-shadow: inset 0 -5px 0 var(--grass); }

.hero-body { text-align: center; padding: 30px 0 8px; }
.hero-body h1 { font-size: 40px; text-shadow: 4px 4px 0 #1d4f86; text-wrap: balance; }
.hero-body > p { font-size: 1.1rem; font-weight: 600; color: #08294a; max-width: 660px; margin: 10px auto 0; text-wrap: balance; }
.hero-home { padding-top: 40px; }
.hero-body.hero-home h1 { font-size: 50px; text-shadow: 5px 5px 0 #1d4f86; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
.hero-badges li {
  font-size: 20px;
  background: var(--panel);
  color: var(--ink);
  border: 3px solid var(--outline);
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.2);
  padding: 3px 14px 5px;
}
.breadcrumb { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; font-size: 0.9rem; font-weight: 700; color: #08294a; }
.breadcrumb a { color: inherit; }
/* once a document is open, the editor gets the room */
body[data-view="editor"] .hero-body,
body[data-view="editor"] .landing { display: none; }

/* ── Panels & controls ─────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 3px solid var(--outline);
  box-shadow: inset -3px -3px 0 var(--line), 0 5px 0 rgb(30 60 90 / 0.18);
}
.panel-head {
  --head: #4e9c2c;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--head);
  border-bottom: 3px solid var(--outline);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.3), inset 0 -4px 0 rgb(0 0 0 / 0.18);
  color: #fff;
}
.panel-head h2 { text-shadow: 3px 3px 0 rgb(0 0 0 / 0.4); overflow-wrap: anywhere; }
.panel-head .pixel-icon {
  width: 42px;
  height: 42px;
  padding: 5px;
  background: var(--panel-shade);
  border: 2px solid var(--outline);
  box-shadow: inset 2px 2px 0 rgb(0 0 0 / 0.2);
}
.section-gameplay .panel-head { --head: #c4473c; }
.section-players .panel-head { --head: #d6791c; }
.section-world .panel-head { --head: #2f74c9; }
.section-performance .panel-head { --head: #b48600; }
.section-resourcePack .panel-head { --head: #96603a; }
.section-remote .panel-head { --head: #4d6575; }
.section-advanced .panel-head { --head: #7656a8; }
#section-icon .panel-head { --head: #138a8a; }
.preserved .panel-head { --head: #6d747b; }
.panel-body { padding: 6px 20px 20px; }

input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  border: 2px solid #7d715f;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgb(0 0 0 / 0.08);
  font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--grass-dark); }
textarea { resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--grass); }
[aria-invalid="true"] { border-color: var(--error) !important; background: #fff1ef !important; }

.button {
  --face: #7f868c;
  --light: #b4bbc1;
  --dark: #50565b;
  display: inline-block;
  padding: 7px 18px 9px;
  background: var(--face);
  color: #fff;
  border: 3px solid var(--outline);
  border-radius: 0;
  box-shadow: inset 3px 3px 0 var(--light), inset -3px -3px 0 var(--dark);
  text-shadow: 2px 2px 0 rgb(0 0 0 / 0.45);
  font-size: 20px;
  cursor: pointer;
}
.button:hover { filter: brightness(1.12); }
.button:active { box-shadow: inset 3px 3px 0 var(--dark), inset -3px -3px 0 var(--light); }
.button-primary { --face: var(--grass); --light: var(--grass-light); --dark: var(--grass-dark); }
.button-danger { --face: #c4473c; --light: #ec7d73; --dark: #8a271f; }
.button-small { padding: 3px 12px 5px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.alert { background: #ffe3df; border: 3px solid var(--error); color: #6e1510; padding: 12px 16px; margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 0.9rem; }

.version-select { display: grid; gap: 4px; font-weight: 700; }
.version-select select { min-width: 220px; font-weight: 700; }

/* ── App area & start menu ─────────────────────────────────────────────── */
#app { padding: 24px 0 40px; }
#app.wrap { margin-block: 0; }
#app.narrow { max-width: 860px; }
#content:focus { outline: none; }
.tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.panel-body.padded { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 16px; }
.section-output .panel-head { --head: #2f74c9; }
.output-row { display: grid; gap: 4px; }
.output-row label { font-weight: 700; font-size: 0.9rem; }
.output-line { display: flex; gap: 10px; }
.output-line .output { font-family: var(--mono); font-size: 0.9rem; background: var(--panel-shade); min-width: 0; }
.boot { padding: 24px; text-align: center; }

.start { max-width: 860px; margin: 0 auto; padding: 26px; display: grid; gap: 22px; }
.start-version { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 8px 20px; }
.start-version .hint { padding-bottom: 9px; }
.menu-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 26px 20px 24px;
  background: var(--panel-shade);
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #d5c8aa;
  transition: transform 0.12s;
}
.menu-card:hover { transform: translateY(-3px); }
.menu-card p { color: var(--muted); flex: 1; }
.dropzone.is-over { background: #e2f6d3; border-style: dashed; }

/* ── Editor layout ─────────────────────────────────────────────────────── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; padding: 16px 20px 20px; }
.toolbar-file { color: var(--muted); padding-bottom: 9px; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff3c4;
  border: 3px solid var(--outline);
  box-shadow: inset -3px -3px 0 #f0d675;
  padding: 14px 18px;
}
.notice-text { flex: 1; display: grid; gap: 8px; justify-items: start; min-width: 0; }
.notice details p { margin-top: 6px; overflow-wrap: anywhere; }
.notice summary { cursor: pointer; font-weight: 700; }
.notice-close { background: none; border: 0; font: 700 1.5rem/1 system-ui, sans-serif; cursor: pointer; padding: 0 4px; color: var(--ink); }

.editor-body { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
/* flex, not grid: a sticky grid item could not leave its own row */
.editor-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* ── Side menu ─────────────────────────────────────────────────────────── */
.category-nav {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: var(--panel);
  border: 3px solid var(--outline);
  box-shadow: 0 5px 0 rgb(30 60 90 / 0.18);
}
.nav-title {
  padding: 10px 14px 12px;
  background: url("../assets/textures/dirt.svg");
  border-bottom: 3px solid var(--outline);
  color: #fff;
  font-size: 20px;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 0.6);
}
.category-nav ul { display: grid; gap: 4px; padding: 8px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 5px 8px 5px 5px;
  background: transparent;
  border: 2px solid transparent;
  color: var(--ink);
  font: 600 0.93rem/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: left;
  cursor: pointer;
}
.nav-link .pixel-icon {
  width: 34px;
  height: 34px;
  padding: 4px;
  background: var(--panel-shade);
  border: 2px solid #8c7f69;
  box-shadow: inset 2px 2px 0 rgb(0 0 0 / 0.14);
}
.nav-link:hover { background: var(--panel-shade); }
.nav-link[aria-current="true"] { background: #d9f2c7; border-color: var(--grass-dark); box-shadow: inset 4px 0 0 var(--grass); }
.nav-link[aria-current="true"] .pixel-icon { background: #fff; border-color: var(--grass-dark); }
.nav-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nav-badge { min-width: 24px; padding: 0 6px; background: var(--panel-shade); color: var(--muted); font-size: 0.75rem; text-align: center; border-radius: 10px; }
.nav-badge:empty { display: none; }
.nav-badge[data-level="error"] { background: var(--error); color: #fff; }
.nav-badge[data-level="warning"] { background: #ffd23f; color: var(--ink); }

/* ── Preview ───────────────────────────────────────────────────────────── */
.preview {
  background: #33261b url("../assets/textures/dirt.svg");
  border: 3px solid var(--outline);
  padding: 12px;
  box-shadow: 0 8px 18px rgb(20 40 60 / 0.35);
}
.preview-stage { display: flex; justify-content: center; min-width: 0; overflow: hidden; }
.preview-canvas { display: block; height: auto; image-rendering: pixelated; box-shadow: 0 0 0 3px var(--outline); }
.preview-note { background: #fff3c4; color: #5c3b00; font-size: 0.85rem; padding: 4px 10px; margin-top: 10px; }
.preview-settings { margin-top: 10px; background: var(--panel); border: 2px solid var(--outline); }
.preview-settings summary { cursor: pointer; padding: 4px 10px; font-weight: 700; font-size: 0.85rem; }
.preview-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 4px 10px 10px; }
.preview-control { display: grid; gap: 2px; font-size: 0.8rem; color: var(--muted); flex: 1 1 130px; }
.preview-control input, .preview-control select { min-height: 34px; padding: 4px 8px; font-size: 0.9rem; }
.preview-hint { flex-basis: 100%; font-size: 0.78rem; color: var(--muted); }

/* ── Form ──────────────────────────────────────────────────────────────── */
.section { scroll-margin-top: 14px; }
.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 8px 28px;
  padding: 18px 0;
  border-bottom: 2px dashed var(--line);
  scroll-margin-block: 20px;
}
.field:last-child { border-bottom: 0; padding-bottom: 4px; }
.field-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.field-title label { font-weight: 700; font-size: 1.02rem; }
code { font-family: var(--mono); font-size: 0.8rem; background: var(--panel-shade); color: #4a3f31; padding: 1px 6px; overflow-wrap: anywhere; }
.field-help { color: var(--muted); font-size: 0.93rem; margin-top: 3px; }
.field-meta { color: var(--muted); font-size: 0.8rem; margin-top: 4px; overflow-wrap: anywhere; }
.field-control { align-self: start; min-width: 0; }
.field-message { font-size: 0.85rem; font-weight: 600; margin-top: 5px; overflow-wrap: anywhere; }
.field-message:empty { margin: 0; }
.field[data-level="error"] .field-message { color: var(--error); }
.field[data-level="warning"] .field-message { color: var(--warning); }
.field-motd { grid-template-columns: minmax(0, 1fr); }

.enum { display: grid; gap: 6px; }
.secret { display: flex; gap: 8px; }

.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 42px; }
.switch input {
  appearance: none;
  position: relative;
  width: 62px;
  height: 32px;
  margin: 0;
  background: #9aa1a7;
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 rgb(0 0 0 / 0.25);
  cursor: pointer;
}
.switch input::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 30px;
  height: 32px;
  background: #e4e7ea;
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #9aa1a7;
  transition: transform 0.12s;
}
.switch input:checked { background: var(--grass); }
.switch input:checked::after { transform: translateX(32px); }
.switch-label { font-weight: 700; min-width: 3em; }

/* ── MOTD editor ───────────────────────────────────────────────────────── */
.motd-editor { display: grid; gap: 10px; }
.motd-toolbar { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.motd-group { display: flex; flex-wrap: wrap; gap: 5px; }
.motd-toolbar button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 2px solid var(--outline);
  box-shadow: inset 2px 2px 0 rgb(255 255 255 / 0.35), inset -2px -2px 0 rgb(0 0 0 / 0.25);
  font: 700 0.8rem var(--mono);
  cursor: pointer;
}
.motd-toolbar button:hover { transform: translateY(-2px); }
.swatch { background: var(--swatch); color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.style-button { background: var(--panel-shade); color: var(--ink); }
.style-italic { font-style: italic !important; }
.style-underline { text-decoration: underline; }
.style-strikethrough { text-decoration: line-through; }
.motd-input { font-family: var(--mono) !important; }

/* ── Server icon ───────────────────────────────────────────────────────── */
.icon-editor { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 24px; padding-top: 14px; }
.icon-area { display: grid; gap: 8px; align-content: start; justify-items: center; }
.icon-area.is-over { outline: 3px dashed var(--grass); outline-offset: 4px; }
.checker { background: repeating-conic-gradient(#d3d8dd 0 25%, #fff 0 50%) 0 0 / 16px 16px; image-rendering: pixelated; }
.icon-stage { width: 262px; height: 262px; border: 3px solid var(--outline); cursor: grab; touch-action: none; }
.icon-stage:active { cursor: grabbing; }
.icon-empty {
  display: grid;
  gap: 14px;
  justify-items: center;
  align-content: center;
  width: 262px;
  min-height: 262px;
  padding: 16px;
  text-align: center;
  background: var(--panel-shade);
  border: 3px dashed #8c7f69;
}
.icon-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.control { display: grid; gap: 4px; font-weight: 700; font-size: 0.9rem; }
.icon-thumbs { display: flex; align-items: flex-end; gap: 14px; }
.icon-thumbs canvas { height: auto; border: 2px solid var(--outline); box-sizing: content-box; }

/* ── Preserved entries & export ────────────────────────────────────────── */
.preserved .panel-body { display: grid; gap: 12px; padding-top: 16px; }
.preserved ul { display: grid; gap: 10px; }
.preserved li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.preserved label { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.preserved input { accent-color: var(--grass); width: 18px; height: 18px; }
.badge { font-size: 0.75rem; font-weight: 700; border: 2px solid #8c7f69; padding: 0 10px; color: var(--muted); }
.badge-unsupported { color: var(--warning); border-color: var(--warning); }

.export { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px 22px; background: #e6f6d9; box-shadow: inset -3px -3px 0 #c3e3aa; }
.summary { font-weight: 700; }
.summary[data-level="ok"] { color: var(--grass-ink); }
.summary[data-level="error"] { color: var(--error); }
.summary[data-level="warning"] { color: var(--warning); }

/* ── Landing content ───────────────────────────────────────────────────── */
/* vertical rhythm of page sections */
main > .wrap:not(#app), .landing > .wrap { margin-top: 48px; }
main > .wrap:first-child { margin-top: 32px; }
.landing { padding-bottom: 8px; }
main { padding-bottom: 64px; }
main section > h2 { text-align: center; margin-bottom: 24px; color: #fff; text-shadow: 3px 3px 0 #1d4f86; text-wrap: balance; }
.landing > .wrap:first-child { margin-top: 8px; }
.codes + .landing > .wrap:first-child { margin-top: 48px; }

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.landing .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 16px 22px; transition: transform 0.12s; }
.tool-card:hover { transform: translateY(-4px); }
.tool-card p { flex: 1; color: var(--muted); }
.tool-card .button { text-decoration: none; }

.not-found { max-width: 560px; }
.not-found-card { display: grid; justify-items: center; gap: 20px; padding: 30px 20px 32px; text-align: center; }
.not-found-card p { font-size: 1.1rem; font-weight: 600; text-wrap: balance; }
.not-found-card .button { text-decoration: none; }
.icon-missing { width: 144px; height: 144px; box-shadow: 0 6px 0 rgb(30 60 90 / 0.25); }

.codes { max-width: 1000px; }
.table-wrap { overflow-x: auto; }
.code-table { width: 100%; border-collapse: collapse; }
.code-table th, .code-table td { padding: 9px 12px; text-align: left; border-bottom: 2px dashed var(--line); white-space: nowrap; }
.code-table thead th { background: var(--panel-shade); border-bottom: 3px solid var(--outline); font-size: 0.85rem; }
.code-table tbody th { font-weight: 700; }
.code-table td[data-column="copy"] .button { font-size: 16px; padding: 0 8px 2px; margin-left: 4px; }
.code-sample { display: inline-block; min-width: 96px; padding: 3px 10px; background: #14100d; color: #fff; font: 20px/1.3 var(--pixel); text-align: center; }

.gateway { display: grid; place-content: center; justify-items: center; gap: 28px; min-height: 100vh; padding: 24px; text-align: center; }
.gateway h1 { font-size: 30px; color: #fff; text-shadow: 3px 3px 0 #1d4f86; }
.gateway .button { text-decoration: none; margin: 4px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feature { display: grid; gap: 12px; justify-items: center; align-content: start; text-align: center; padding: 22px 16px; }
.shot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.shot { padding: 10px 10px 14px; display: grid; gap: 10px; align-content: start; }
.shot img { display: block; width: 100%; height: auto; border: 2px solid var(--outline); }
.shot figcaption { text-align: center; font-weight: 700; }
.step-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.step { padding: 20px 20px 24px; display: grid; gap: 10px; align-content: start; counter-increment: step; }
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--grass);
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 var(--grass-light), inset -3px -3px 0 var(--grass-dark);
  color: #fff;
  font: 30px/1 var(--pixel);
  text-shadow: 3px 3px 0 rgb(0 0 0 / 0.4);
}
.faq { max-width: 860px; display: grid; gap: 14px; }
.faq h2 { margin-bottom: 10px; }
.faq details { padding: 14px 20px 16px; }
.faq summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 30px/1 var(--pixel); color: var(--grass-ink); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--muted); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  padding: 64px 0 0;
  background: #5d3b24 url("../assets/textures/dirt.svg");
  color: #fff;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 28px;
  background: url("../assets/textures/grass-edge.svg") repeat-x;
  border-top: 3px solid var(--outline);
}
/* a calm dark layer keeps the text readable on the texture */
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 0.8fr)) 344px;
  gap: 32px;
  padding: 28px 24px;
  background: rgb(28 17 9 / 0.82);
  border: 3px solid var(--outline);
}
.site-footer h2 { font-size: 20px; color: #b6f08c; margin-bottom: 14px; }
.site-footer a { color: #fff; text-underline-offset: 3px; }
.site-footer a:hover { color: #b6f08c; }
.site-footer li { margin-bottom: 8px; }
.footer-about { display: grid; gap: 12px; align-content: start; }
.footer-note { color: #cdbfb0; font-size: 0.9rem; }
/* color-scheme must stay "normal", otherwise the browser paints the frame opaque */
.footer-card iframe { display: block; width: 100%; max-width: 344px; height: 72px; border: 0; color-scheme: normal; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding: 18px 0 26px; font-size: 0.85rem; color: #fff; text-shadow: 1px 1px 2px #000; }

/* ── Smaller screens ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-body h1 { font-size: 40px; }
  .feature-grid, .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  .category-nav { position: static; max-height: none; }
  .category-nav ul { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .shot-grid, .step-grid, .landing .tool-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; }
}

@media (max-width: 700px) {
  .field { grid-template-columns: minmax(0, 1fr); }
  .icon-editor { grid-template-columns: minmax(0, 1fr); }
  .preview-hint { display: none; }
}

@media (max-width: 600px) {
  .hero-body h1, .hero-body.hero-home h1 { font-size: 30px; text-shadow: 3px 3px 0 #1d4f86; }
  h2 { font-size: 20px; }
  .hero .brand { font-size: 16px; line-height: 1.2; gap: 8px; }
  .hero .brand span { padding: 3px 8px 5px; }
  .language-toggle a { padding-inline: 10px; }
  /* two columns show every tool at once */
  .tool-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool-nav a { white-space: normal; height: 100%; font-size: 0.85rem; padding-right: 8px; }
  main section > h2 { text-shadow: 2px 2px 0 #1d4f86; }
  .output-line { flex-wrap: wrap; }
  .start { padding: 18px 14px; }
  .panel-body { padding-inline: 14px; }
  .feature-grid, .tool-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  /* a strip that scrolls sideways keeps the menu short */
  .nav-title { display: none; }
  .category-nav ul { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
  .category-nav li { flex: none; scroll-snap-align: start; }
  .nav-link { white-space: nowrap; }
  .nav-badge:not([data-level="error"], [data-level="warning"]) { display: none; }
  .toolbar { padding-inline: 14px; }
  .toolbar .button-row, .toolbar .version-select { width: 100%; }
  .toolbar .button-row > * { flex: 1 1 auto; }
  .toolbar .file-button .button { width: 100%; }
  .button { padding-inline: 12px; }
}

/* the embedded card has a fixed layout of 344px: scale it rather than letting it cut off text */
@media (max-width: 460px) {
  .footer-grid { padding-inline: 12px; }
  .footer-card { min-width: 0; overflow: hidden; }
  .footer-card iframe { width: 344px; max-width: none; transform: scale(0.85); transform-origin: left top; }
}
@media (max-width: 370px) {
  .footer-card iframe { transform: scale(0.72); }
}

@media (prefers-reduced-motion: reduce) {
  .switch input::after, .menu-card, .tool-card { transition: none; }
}
