/* Thistledown Warren on the web. The game's Hearth palette (tools/make_env.py),
   its own pixel font (ThistledownPixel, from the OFL Pixelify Sans), no requests
   to anyone else. Art is the game's pixels at whole-number scales only. */
@font-face { font-family: "Thistledown Pixel"; src: url("../fonts/ThistledownPixel.ttf") format("truetype"); font-display: swap; }

:root {
  --ink: #241c2b; --plum: #3b2a3d; --bramble: #5a3a44; --bark: #7c4c40; --chestnut: #a76c42;
  --honey: #cf9a58; --straw: #e9c67f; --cream: #f5e5c0; --milk: #fdf6e4; --oat: #d5bea4;
  --moss: #3e6350; --clover: #5e8a56; --sage: #8dac66; --dusk: #3a3452; --heather: #5c5579;
  --lavender: #837d9f; --mulberry: #7d3e55; --rose: #c66f7b; --blush: #eda8a1; --tide: #4c8591;

  --bg: var(--cream); --paper: var(--milk); --fg: var(--ink); --soft: var(--bramble);
  --line: var(--oat); --accent: var(--mulberry); --leaf: var(--moss); --chip: var(--straw); --chipfg: var(--plum);
  --btn: var(--moss); --btnfg: var(--milk); --plate: #f5ebd6; --platefg: #241c2b; --bar: var(--clover); --good: var(--moss); --bad: var(--mulberry);
  --display: "Thistledown Pixel", "Courier New", monospace;
  --body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gutr: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #241c2b; --paper: #3b2a3d; --fg: #f5e5c0; --soft: #d5bea4; --line: #5c5579;
    --accent: #eda8a1; --leaf: #bdcb83; --chip: #5c5579; --chipfg: #fdf6e4; --btn: #8dac66; --btnfg: #241c2b;
    --bar: #8dac66; --good: #bdcb83; --bad: #eda8a1; --plate: #3b2a3d; --platefg: #f5e5c0; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 18px; line-height: 1.6; }
img, canvas { max-width: 100%; }
.px, .px img, canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, .pixel { font-family: var(--display); font-weight: 400; letter-spacing: .5px; text-wrap: balance; }
h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.1; margin: 0 0 12px; }
h2 { font-size: clamp(25px, 4vw, 32px); line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 21px; line-height: 1.25; margin: 0 0 8px; }
p { margin: 0 0 14px; }
.prose p, .prose li { max-width: 66ch; }
.lede { font-size: 21px; color: var(--soft); max-width: 60ch; }
.label { display: block; font-family: var(--display); font-size: 14px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
small, .small { font-size: 15px; color: var(--soft); }
code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--paper); border: 1px solid var(--line); padding: 0 4px; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gutr); }
.narrow { max-width: 760px; }
section { padding-block: 40px; }
section + section { border-top: 2px solid var(--line); }

/* header and footer */
.site-head { border-bottom: 2px solid var(--line); background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
@media (max-width: 600px) { .site-head { position: static; } html { scroll-padding-top: 12px; } .nav { gap: 2px 10px; font-size: 15px; } .brand { font-size: 18px; } }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--display); font-size: 20px; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px 14px; flex-wrap: wrap; font-family: var(--display); font-size: 16px; }
.nav a { color: var(--fg); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.site-foot { border-top: 2px solid var(--line); margin-top: 40px; padding-block: 28px 44px; font-size: 15px; color: var(--soft); }
.site-foot .wrap { display: flex; gap: 10px 26px; flex-wrap: wrap; justify-content: space-between; }
.site-foot nav { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.crumbs { font-size: 15px; color: var(--soft); margin: 18px 0 0; }

/* buttons, chips, controls */
.btn, button { font-family: var(--display); font-size: 17px; line-height: 1.2; padding: 9px 16px; background: var(--btn); color: var(--btnfg);
  border: 2px solid var(--fg); cursor: pointer; text-decoration: none; display: inline-block; border-radius: 0; }
.btn.ghost, button.ghost { background: transparent; color: var(--fg); }
button:disabled { opacity: .5; cursor: default; }
.btn:active, button:active { transform: translateY(1px); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip { font-family: var(--display); font-size: 13px; padding: 1px 8px; background: var(--chip); color: var(--chipfg); border: 1px solid var(--fg); white-space: nowrap; display: inline-block; }
.chip.soft { background: transparent; color: var(--soft); border-color: var(--line); }
select, input[type="text"], input[type="number"], textarea {
  font: 16px var(--ui); color: var(--fg); background: var(--paper); border: 2px solid var(--soft); padding: 6px 8px; border-radius: 0; max-width: 100%; min-height: 40px; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type="range"] { accent-color: var(--btn); width: 100%; }
label.field { display: grid; gap: 4px; font-family: var(--ui); font-size: 14px; color: var(--soft); min-width: 0; }
label.field select, label.field input[type="text"] { width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--fg); }
.seg button { border: 0; border-right: 2px solid var(--fg); background: transparent; color: var(--fg); font-size: 15px; padding: 6px 12px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* panels and cards */
.panel { background: var(--paper); border: 2px solid var(--line); padding: 16px; min-width: 0; }
.panel.strong { border-color: var(--fg); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--paper); border: 2px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--fg); text-decoration: none; }
a.card:hover { border-color: var(--fg); }
.card h3 { margin: 0; }
.card p { margin: 0; font-size: 16px; }
.card .meta { font-size: 14px; color: var(--soft); margin-top: auto; }
.note { font-size: 15px; color: var(--soft); }
.warn { border-left: 6px solid var(--accent); background: var(--paper); padding: 10px 14px; font-size: 16px; }

/* pixel scenes */
.scene { display: block; width: 100%; background: var(--moss); border: 2px solid var(--fg); }
.scene-wrap { position: relative; }
.scene-cap { font-size: 14px; color: var(--soft); margin-top: 6px; }
.sprite { image-rendering: pixelated; display: block; }

/* rabbits */
.bun { display: inline-grid; justify-items: center; gap: 2px; text-align: center; font-size: 13px; color: var(--soft); line-height: 1.2; }
.bun canvas { display: block; }
.genes { display: flex; flex-wrap: wrap; gap: 4px; }
.gene { font-family: var(--display); font-size: 14px; border: 2px solid var(--line); background: var(--bg); padding: 1px 6px; white-space: nowrap; }
.gene.found { border-color: var(--accent); color: var(--accent); }
.gene.unknown { color: var(--soft); }

/* odds bars (whole-pixel boxes) */
.odds { display: grid; gap: 6px; }
.odds .o { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; font-size: 15px; }
.bar { height: 12px; background: var(--paper); border: 1px solid var(--soft); }
.bar i { display: block; height: 12px; background: var(--bar); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--soft); }
.scroll-x { overflow-x: auto; }
.num { font-variant-numeric: tabular-nums; }

/* screenshots */
.shots { display: flex; gap: 14px; overflow-x: auto; padding-block: 4px 14px; scroll-snap-type: x proximity; }
.shots figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.shots img { width: 270px; height: auto; border: 2px solid var(--fg); display: block; }
.shots figcaption { font-size: 14px; color: var(--soft); max-width: 270px; margin-top: 6px; }

.hide { display: none !important; }
.coming { display: inline-block; font-family: var(--display); font-size: 16px; color: var(--soft); border: 2px dashed var(--soft); padding: 7px 12px; }
.pausebtn { font-size: 14px; padding: 4px 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-head, .site-foot, .noprint, button { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .card { border-color: #999; }
}
