/* Missing Chunks — matches the look of the original ChatGPT Sites build:
   stone page background, grass-and-dirt banner, dark panels, pixel headings, Minecraft-style buttons. */

@font-face {
  font-family: "Missing Chunks Menu";
  src: url(/theme/menu-pixel.woff) format("woff");
  font-display: swap;
}

:root {
  --page: #242424;
  --shell: #171a1b;
  --panel: #272a2b;
  --panel-2: #222526;
  --line: #474747;
  --text: #e4e4e4;
  --muted: #c2c2c2;
  --dim: #a9a9a9;
  --link: #c4b9e8;
  --link-hover: #e2dcfa;
  --pixel: "Missing Chunks Menu", monospace;
  --body: Arial, Helvetica, sans-serif;
  --width: 1180px;
}

* { box-sizing: border-box; }
html { background: #2a2a2a url(/theme/bg-dark.png) 0 0 / 64px; image-rendering: pixelated; }
body { image-rendering: auto; margin: 0; color: var(--text); font: 16px/1.55 var(--body); }
img { max-width: 100%; height: auto; display: block; image-rendering: auto; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: #000; padding: 8px; z-index: 10; }

.shell { width: min(var(--width), 100% - 40px); margin: 0 auto; background: var(--shell); }

/* Masthead */
.header-inner {
  background: #563c27 url(/theme/grass-dirt.png) 0 0 / auto 220px repeat-x;
  display: flex; flex-direction: column; align-items: center;
  padding: 36px 20px 26px; min-height: 150px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #eee; text-decoration: none; text-align: center; }
.brand-logo { width: min(470px, 100%); image-rendering: pixelated; filter: drop-shadow(3px 3px 0 #2b1d10); }
.brand small { font: 16px var(--pixel); text-shadow: 2px 2px 0 #2b1d10; }
nav { background: #202222; display: flex; flex-wrap: wrap; justify-content: center; padding: 4px 12px; }
nav a { padding: 12px 16px; text-decoration: none; }
nav a[aria-current] { color: #fff; text-decoration: underline; text-underline-offset: 6px; }

main.shell { padding: 20px 20px 34px; min-height: 60vh; }

/* Footer */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 22px 20px 28px; border-top: 1px solid #333; color: #cbcbcb; font-size: 14px; }
.footer p { margin: 0 0 6px; }
.footer .fine { font-size: 12px; color: var(--dim); }
.footer strong { font-weight: 400; color: #e8e8e8; }

/* Layout */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 20px; }
.bar { font: 15px var(--pixel); text-transform: uppercase; letter-spacing: .06em; color: #ddd; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.bar h2 { font: inherit; margin: 0; }
.bar a { font: 13px var(--body); text-transform: none; letter-spacing: 0; }
.eyebrow { font: 11px/1.6 monospace; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin-bottom: 6px; }
.eyebrow span::before { content: " · "; }
.note { color: var(--dim); font-size: 14px; }
.empty { color: var(--muted); }
.kicker { font: 13px var(--pixel); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 12px; }
.crumb { font-size: 14px; margin-bottom: 10px; }
.lede { font-size: 18px; color: #ddd; }

/* Buttons and inputs */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 18px; cursor: pointer;
  font: 16px/1.35 var(--pixel); color: #fff; text-decoration: none; text-shadow: 2px 2px #303030;
  background: #737373; border: 2px solid #080808; border-radius: 0;
  box-shadow: inset -2px -3px #414141, inset 2px 2px #a9a9a9;
}
.button:hover { background: #7f86b8; color: #fff; box-shadow: inset -2px -3px #4a5080, inset 2px 2px #b8bee8; }
.button:active { box-shadow: inset 2px 3px #414141; }
.button.wide { width: 100%; }
input, select { font: 16px var(--body); color: #252525; background: #efefef; border: 2px solid #999; border-radius: 0; padding: 9px 10px; width: 100%; }
select { padding: 8px; }
input:focus, select:focus, .button:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid #e2dcfa; outline-offset: 2px; }

/* Noticeboard */
.noticeboard { background: var(--panel); border: 1px solid var(--line); padding: 0 20px; }
.side-panel { padding: 18px 0; border-bottom: 1px solid #3b3b3b; }
.side-panel:last-child { border-bottom: 0; }
.side-panel .bar { text-transform: none; letter-spacing: 0; font-size: 15px; }
.side-panel p { color: var(--muted); font-size: 15px; }
.sidebar-search { display: grid; gap: 10px; justify-items: start; }

/* Home */
.featured .hero-image img { width: 100%; aspect-ratio: 756 / 445; object-fit: cover; }
.feature-copy { padding-top: 16px; }
.feature-copy h2 { font-size: 25px; }
.feature-copy p { color: var(--muted); max-width: 520px; }
.latest-post { background: transparent; border: 0; padding: 0 6px; }

/* Browse */
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; }
#advanced summary { margin-top: 12px; cursor: pointer; color: var(--link); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; margin: 14px 0; }
.adv-grid label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.clear { font-size: 14px; }
.browse-head { display: flex; justify-content: space-between; align-items: baseline; }
.browse-head h1 { font: 700 22px var(--body); }
.count { font: 12px monospace; color: var(--dim); }
.tabs { display: flex; gap: 18px; font-size: 14px; margin: 8px 0 14px; }
.tabs a { color: #ccc; text-decoration: none; padding-bottom: 4px; }
.tabs a[aria-current="true"] { color: #fff; border-bottom: 2px solid #aaa; }
.sort { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.sort select { width: auto; background: #2b2e2f; color: #eee; border: 1px solid #555; font-size: 13px; padding: 6px 8px; }
.map-list { display: grid; }
.map-card { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px solid #3c3c3c; }
.map-card[hidden] { display: none; }
.map-thumb img { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid #333; }
.map-card h3 { font: 700 19px/1.3 var(--body); margin: 2px 0 4px; }
.map-card h3 a { color: #f1f1f1; text-decoration: none; }
.map-card h3 a:hover { text-decoration: underline; }
.by { color: var(--dim); font-size: 14px; margin-bottom: 6px; }
.summary { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #b0b0b0; }

/* Map page */
.map-page h1 { font-size: 28px; margin-bottom: 6px; }
.byline { color: var(--muted); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; margin-top: 18px; }
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0 0 20px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts.compact { grid-template-columns: 120px minmax(0, 1fr); font-size: 15px; }
.break { overflow-wrap: anywhere; }
.map-page, .doc summary, .requirements, .history, .gallery figcaption { overflow-wrap: anywhere; }
.map-main, .map-side, .columns > * { min-width: 0; }
.gallery { margin: 0 0 26px; }
.gallery-main img { width: 100%; border: 1px solid #333; }
.gallery figcaption { font-size: 13px; color: var(--dim); margin: 8px 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 2px solid #444; background: none; cursor: pointer; width: 74px; }
.thumbs button[aria-current] { border-color: #c4b9e8; }
.thumbs img { aspect-ratio: 16 / 10; object-fit: cover; }
.gallery-links { font-size: 13px; margin-top: 8px; }
.map-section { margin-bottom: 28px; }
.map-section h2 { font-size: 20px; }
.creator-words { margin: 0 0 1em; padding: 10px 16px; border-left: 3px solid #5a5a5a; background: var(--panel-2); color: #ddd; }
.creator-words cite { font-size: 13px; color: var(--dim); font-style: normal; }
.creator-words cite::before { content: "— "; }
.doc { background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.doc summary { padding: 12px 16px; cursor: pointer; }
.doc pre { margin: 0; padding: 0 16px 16px; white-space: pre-wrap; font: 14px/1.6 ui-monospace, Consolas, monospace; color: #ddd; }
.doc .note { padding: 0 16px; }
.doc-image { margin: 0 16px 16px; }
.doc-image figcaption { font-size: 12px; color: var(--dim); margin-top: 4px; }
.map-side .panel h2 { font-size: 18px; }
.files .button { margin: 6px 0 12px; }
.checksum summary, .history summary { cursor: pointer; font-size: 14px; color: var(--link); }
.checksum code { display: block; overflow-wrap: anywhere; font-size: 12px; background: #1c1e1f; padding: 8px; margin: 8px 0; }
.requirements { border-top: 1px solid #3c3c3c; margin-top: 12px; padding-top: 12px; font-size: 14px; color: var(--muted); }
.requirements h3 { font-size: 15px; color: #ddd; }
.history { font-size: 14px; color: var(--muted); }
.history p { overflow-wrap: anywhere; }
.help p { font-size: 15px; margin: 0; }

/* Prose pages */
.prose { max-width: 760px; }
.prose h1 { font-size: 28px; }
.prose h2 { font-size: 19px; margin-top: 1.6em; }
.prose li { margin-bottom: 4px; }
.post-teaser { border-top: 1px solid #3c3c3c; padding-top: 12px; }
.date { color: var(--dim); font-size: 13px; }

@media (max-width: 900px) {
  .columns, .map-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .shell { width: 100%; }
  .header-inner { background-size: auto 190px; padding-top: 28px; min-height: 120px; }
  nav a { padding: 10px 10px; }
  .map-card { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
  .map-thumb img { width: 100px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .search-row { flex-direction: column; }
}
