:root {
  --bg: #0f1216;
  --surface: #161a20;
  --surface-2: #1c2129;
  --thumb: #1d232b;
  --border: #262d37;
  --border-strong: #36404d;
  --text: #e6e9ee;
  --muted: #8d97a5;
  --faint: #5d6774;
  --accent: #2dd4bf;
  --accent-text: #5eead4;
  --accent-weak: rgba(45, 212, 191, 0.12);
  --on-accent: #062b26;
  --radius: 8px;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --thumb: #eef1f4;
  --border: #e1e5ea;
  --border-strong: #c9d0d8;
  --text: #14181d;
  --muted: #5c6673;
  --faint: #8a939f;
  --accent: #0d9488;
  --accent-text: #0f766e;
  --accent-weak: rgba(13, 148, 136, 0.1);
  --on-accent: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
h1, h2, h3 { font-weight: 600; margin: 0; }
.mono { font-family: var(--mono); font-size: 0.93em; }
.muted { color: var(--muted); }
.ti { font-size: 1.15em; vertical-align: -0.15em; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top-inner, .kinds-inner, .page, .foot {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 16px;
}
.top-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 18px; letter-spacing: -0.01em; }
.logo .ti { color: var(--accent); font-size: 24px; }
.logo b { color: var(--accent-text); font-weight: 600; }

.search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search:focus-within { border-color: var(--accent); }
.search > .ti { color: var(--faint); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
}
kbd {
  font: 11px var(--mono);
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.suggest a {
  display: grid;
  grid-template-columns: 40px 64px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
}
.suggest a.on, .suggest a:hover { background: var(--accent-weak); color: var(--text); }
.suggest img, .suggest .thumb-none { width: 40px; height: 40px; border-radius: 6px; background: var(--thumb); }
.suggest .id { font-family: var(--mono); color: var(--accent-text); }
.suggest .kind { color: var(--faint); font-size: 12px; }
.suggest .all { display: block; padding: 8px 10px; color: var(--muted); border-top: 1px solid var(--border); }
.suggest .none { padding: 10px; color: var(--muted); }

.games { display: flex; gap: 4px; }
.games a, .chip {
  padding: 4px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}
.games a.on, .chip.on {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent-text);
}
/* Language menu: a button with the current language, the list opens under it */
.languages { position: relative; }
.languages summary {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.languages summary::-webkit-details-marker { display: none; }
.languages summary:hover, .languages[open] summary { color: var(--text); border-color: var(--border-strong); }
.languages summary .ti-chevron-down { font-size: 13px; transition: transform 0.15s; }
.languages[open] summary .ti-chevron-down { transform: rotate(180deg); }
.languages ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 170px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.languages li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.languages li a:hover { background: var(--accent-weak); color: var(--text); }
.languages li a.on { color: var(--accent-text); }
.languages .check-space { display: inline-block; width: 1.15em; }
.languages ul.to-right { right: auto; left: 0; }

.theme, .icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}
.icon-button.on { color: var(--accent-text); border-color: var(--accent); }

/* Kind tabs */
.kinds { border-bottom: 1px solid var(--border); background: var(--surface); }
.kinds-inner { display: flex; gap: 4px; overflow-x: auto; }
.kinds a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  white-space: nowrap;
}
.kinds a span { color: var(--faint); font-size: 12px; }
.kinds a.on { color: var(--text); border-bottom-color: var(--accent); }

.page { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; }

/* Catalog */
.catalog { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; }
.facets { display: flex; flex-direction: column; gap: 18px; }
.facets h3 { font-size: 12px; font-weight: 500; color: var(--faint); margin-bottom: 6px; }
.facet-list { list-style: none; margin: 0; padding: 0; }
.facet-list a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  color: var(--muted);
}
.facet-list a:hover { background: var(--surface); color: var(--text); }
.facet-list a.on { background: var(--accent-weak); color: var(--accent-text); }
.facet-list em { font-style: normal; color: var(--faint); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reset { color: var(--accent-text); display: flex; align-items: center; gap: 4px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h1 { font-size: 20px; }
.toolbar h1 span { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.toolbar-end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sort { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.sort select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 34px;
  padding: 0 8px;
  font: inherit;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.grid-small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.12s, transform 0.12s;
}
.card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: var(--thumb);
  object-fit: contain;
}
.thumb-none { display: grid; place-items: center; color: var(--faint); font-size: 28px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 7px 9px 8px; }
.card-id { font-family: var(--mono); font-weight: 600; }
.card-name {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--accent-weak);
  color: var(--accent-text);
}
.badge-quiet { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.model-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.model-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.model-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.model-table tr:last-child td { border-bottom: 0; }
.model-table .num { text-align: right; }
.model-table .mini { width: 60px; }
.model-table .mini .thumb { width: 48px; border-radius: 6px; }
.model-table.compact td { padding: 4px 10px; font-size: 13px; }

.pages { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }
.pages a, .pages .gap {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: var(--radius);
  color: var(--muted);
}
.pages a { border: 1px solid var(--border); }
.pages a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* The next page loading under the list */
.pages.is-loading { opacity: 0.5; pointer-events: none; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty > .ti { font-size: 40px; color: var(--faint); }
.empty h1 { color: var(--text); margin: 10px 0; }
.empty a { color: var(--accent-text); }

/* Model page */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumbs .ti { color: var(--faint); font-size: 12px; }
.model-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 18px; }
.model-head h1 { font-size: 26px; }
.model-id { font-family: var(--mono); color: var(--accent-text); }
.badges { display: flex; gap: 6px; }
.neighbours { margin-left: auto; display: flex; gap: 6px; }
.neighbours a {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.model-body { display: grid; grid-template-columns: minmax(260px, 400px) minmax(0, 1fr); gap: 20px; }
.preview { display: flex; flex-direction: column; gap: 16px; }
.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stage .thumb { background: var(--thumb); }
.stage { position: relative; }
.stage.is-loading::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading 1s linear infinite;
}
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.stage.is-3d .thumb { display: none; }
.viewer-canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; cursor: grab; touch-action: none; }
.viewer-canvas:active { cursor: grabbing; }
.viewer { display: flex; flex-direction: column; gap: 8px; }
.viewer-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Full screen: the scene fills the screen above its buttons; .is-full fills the window where the
   browser has no full screen for it */
.viewer:fullscreen, .viewer.is-full { background: var(--bg); padding: 12px; gap: 10px; }
.viewer.is-full { position: fixed; inset: 0; z-index: 900; }
.viewer:fullscreen .stage, .viewer.is-full .stage { flex: 1; min-height: 0; }
.viewer:fullscreen .viewer-canvas, .viewer.is-full .viewer-canvas { width: 100%; height: 100%; aspect-ratio: auto; }
html.viewer-full { overflow: hidden; }
.viewer-tools[hidden] { display: none; }
.viewer-hint { color: var(--faint); font-size: 12px; }
.facts { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.props {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.props dt, .props dd { padding: 9px 14px; border-bottom: 1px solid var(--border); margin: 0; }
.props dt { color: var(--muted); }
.props dt:last-of-type, .props dd:last-of-type { border-bottom: 0; }
.props small { display: block; color: var(--faint); font-size: 12px; }
.props .files { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.props .files a, .props a.link { color: var(--accent-text); }
.flags { margin: 0; padding-left: 18px; }
.copy { cursor: copy; }
.copy.copied { color: var(--accent-text); }

.block h2 { font-size: 15px; margin-bottom: 10px; }
.block h2 span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.model > .block { margin-top: 28px; }

.code { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tabs button.on { color: var(--accent-text); border-color: var(--accent); background: var(--accent-weak); }
.code-line {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 4px 4px 12px;
}
.code-line code { flex: 1; font-family: var(--mono); font-size: 13px; overflow-x: auto; white-space: nowrap; }

/* Copied: the button turns into a check mark, the code flashes, a bubble says so */
.icon-button.copied { color: var(--accent-text); border-color: var(--accent); background: var(--accent-weak); }
.code-line.copied { animation: copied-flash 1.2s ease-out; }
@keyframes copied-flash {
  0% { background: var(--accent-weak); border-color: var(--accent); }
  100% { background: var(--surface-2); border-color: var(--border); }
}
.copied-bubble {
  position: absolute;
  z-index: 1000;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  animation: copied-in 0.15s ease-out;
  transition: opacity 0.3s;
}
.copied-bubble.gone { opacity: 0; }
@keyframes copied-in { from { opacity: 0; transform: translateY(4px); } }
.hint { color: var(--faint); font-size: 12px; margin: 8px 0 0; }

.placements-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.map { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.map canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
.map canvas:active { cursor: grabbing; }
.table-scroll { overflow-x: auto; min-width: 0; }

/* Map search: the map stays in view beside the models around the marker */
.near { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 20px; align-items: start; }
.near-map { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; }
.map-pick canvas { cursor: crosshair; }
/* The search panel: coordinates and the button, then the radius over the whole width */
.near-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}
.near-row { display: flex; align-items: center; gap: 12px; }
.near-form label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.near-form input:not([type]), .near-form button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 34px;
  padding: 0 10px;
  font: inherit;
}
.near-form input:not([type]) { width: 96px; font-family: var(--mono); }
.near-form input:not([type]):focus { outline: none; border-color: var(--accent); }
.near-form button {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
}
.near-form button:hover { filter: brightness(1.08); }
.near-radius { flex: 1; min-width: 0; }
.near-radius input { flex: 1; min-width: 60px; accent-color: var(--accent); }
.near-radius output { min-width: 52px; text-align: right; color: var(--text); font-family: var(--mono); }
.near-check input { accent-color: var(--accent); margin: 0; }
.near-results.is-loading { opacity: 0.5; transition: opacity 0.2s; }
.near-form button.near-3d { margin-left: auto; background: var(--bg); border-color: var(--border); color: var(--text); font-weight: 600; }
.near-form button.near-3d + button { margin-left: 0; }
.near-form button.near-3d:hover { border-color: var(--accent); }
.near-form button:disabled { opacity: 0.45; cursor: default; }

/* 3D scene of the map search, over the page */
.scene-view { position: fixed; inset: 0; z-index: 950; display: flex; flex-direction: column; background: var(--bg); }
.scene-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.scene-bar strong { font-family: var(--mono); font-size: 13px; }
.scene-status { color: var(--muted); font-size: 12px; }
.scene-range { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: 12px; }
.scene-range input { width: 140px; accent-color: var(--accent); }
.scene-range output { min-width: 44px; color: var(--text); font-family: var(--mono); }
.scene-fps { min-width: 54px; text-align: right; color: var(--muted); font-size: 12px; }
.scene-speed { color: var(--text); font-size: 12px; cursor: help; }
.scene-night { flex: none; }
.scene-help {
  position: absolute; left: 12px; bottom: 12px; max-width: 60%;
  padding: 6px 10px; border-radius: 6px; background: rgba(15, 18, 22, 0.7);
  color: #d8dde4; font-size: 12px; pointer-events: none;
}
/* The model clicked in the scene */
.scene-info {
  position: absolute; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: flex-start;
  padding: 8px; max-width: min(360px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.scene-info[hidden] { display: none; }
.scene-info img { width: 96px; height: 96px; object-fit: contain; background: var(--thumb); border-radius: 6px; }
.scene-info div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 2px; }
.scene-info-name { color: var(--accent-text); font-family: var(--mono); font-weight: 600; word-break: break-all; }
.scene-info-name:hover { text-decoration: underline; }
.scene-info-id, .scene-info-place { color: var(--muted); font-size: 12px; }
.scene-info-close { flex: none; }
.scene-close { margin-left: 4px; }
.scene-canvas { display: block; flex: 1; min-height: 0; width: 100%; cursor: grab; touch-action: none; }
.scene-canvas:active { cursor: grabbing; }
.card-note { flex-basis: 100%; color: var(--faint); font-size: 12px; }

/* Textures */
:root { --checker: #252c36; }
:root[data-theme="light"] { --checker: #e2e6eb; }
.checker, .tex-image {
  background-color: var(--thumb);
  background-image: linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%),
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.card .thumb.checker { display: block; }
.card .thumb.checker img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tex-grid-small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.tex {
  display: block;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.tex:hover { border-color: var(--accent); }
.tex-image { display: block; aspect-ratio: 1; background-size: 12px 12px; background-position: 0 0, 6px 6px; }
.tex-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tex-meta { display: flex; flex-direction: column; padding: 6px 8px 7px; min-width: 0; }
.tex-name, .tex-info { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tex-name { font-family: var(--mono); font-size: 12px; }
.tex-info { color: var(--faint); font-size: 11px; }
.tex-grid-small .tex-name { font-size: 11px; }
/* Color combinations of a vehicle: swatches with their IDs, copied by a click */
.color-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.color-set {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px 4px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: copy;
}
.color-set:hover { border-color: var(--accent); color: var(--text); }
.color-set.copied { border-color: var(--accent); background: var(--accent-weak); color: var(--accent-text); }
.color-set .mono { margin-left: 4px; }
.swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(127, 127, 127, 0.35); background: var(--checker); }

/* A texture the game doesn't have: a card of the same size, nothing to open */
.tex-missing { cursor: help; border-style: dashed; }
.tex-missing:hover { border-color: var(--border-strong); }
.tex-missing .tex-image { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 28px; }
.tex-missing .tex-name { color: var(--muted); }

.inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  height: 34px;
  padding: 0 10px;
  min-width: min(320px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.inline-search:focus-within { border-color: var(--accent); }
.inline-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.inline-search .ti { color: var(--faint); }
.relations { color: var(--muted); margin: -6px 0 16px; }
.relations a { color: var(--accent-text); }
.dictionary .block + .block, .textures-page .block + .block { margin-top: 28px; }

.texture-view {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
.texture-view::backdrop { background: rgba(0, 0, 0, 0.6); }
.texture-view-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.texture-view-image { display: grid; place-items: center; padding: 12px; }
/* Small textures are scaled up with sharp pixels, so their details stay visible */
.texture-view-image img {
  width: 100%;
  height: min(70vh, 520px);
  object-fit: contain;
  image-rendering: pixelated;
}
.texture-view-info { display: flex; flex-direction: column; gap: 14px; padding: 16px; min-width: 0; }
.texture-view-info header { display: flex; align-items: center; gap: 10px; }
.texture-view-info h2 { font-size: 17px; overflow-wrap: anywhere; flex: 1; }
.texture-view-info .props { grid-template-columns: 110px minmax(0, 1fr); }
.texture-view-info .props a { color: var(--accent-text); }
.texture-view .code-line code { white-space: pre-wrap; overflow-wrap: anywhere; }
.texture-view-links { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.texture-view-links a { color: var(--accent-text); display: flex; gap: 6px; align-items: center; }

.foot { color: var(--faint); font-size: 12px; padding-top: 20px; padding-bottom: 30px; border-top: 1px solid var(--border); }
.foot-owner { color: var(--muted); }
.foot a { color: var(--accent-text); }
.foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .top-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .search kbd { display: none; }
  .games { margin-left: auto; }
  .catalog, .model-body, .placements-body, .near { grid-template-columns: minmax(0, 1fr); }
  .near-map { position: static; }
  .facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .model-table th:nth-child(4), .model-table td:nth-child(4) { display: none; }
  .props { grid-template-columns: 110px minmax(0, 1fr); }
  .texture-view-body { grid-template-columns: minmax(0, 1fr); }
  .texture-view-image img { height: 45vh; }
  .inline-search { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .games a { padding: 3px 8px; font-size: 12px; }
  .logo span { display: none; }
}
