/*
VOICE: a campfire character bible: confident, a little rough, easy to scan.
IDEA: a frontier wanted-poster board meets a dime-novel field guide.
PICTURE: the four sheriff-star badges as the roster; illustration slots fill the boards.
COLOUR and TYPE: parchment and ink, one accent per character; Anton poster caps, Bitter slab labels, Lora body.
LAYOUT: tabbed single page (Characters, Armory, Hat Rack); cards one per character; boards as responsive grids.
*/
:root {
  color-scheme: light dark;
  --paper: light-dark(#f3ead8, #1f1914);
  --paper-2: light-dark(#ece0c6, #2a221b);
  --ink: light-dark(#2b2118, #efe4cf);
  --soft: light-dark(#5a4a36, #c9b896);
  --muted: light-dark(#8a6d3f, #b39563);
  --line: light-dark(#cdbb98, #4a3d2f);
  --line-strong: light-dark(#2b2118, #d9c9a8);
  --wyatt: light-dark(#2f4a6b, #8fb0d6);
  --kid: light-dark(#1f7a78, #6cc7c3);
  --bill: light-dark(#7a2a24, #e08a7f);
  --doc: light-dark(#4c6340, #a7c493);
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16.5px/1.55 'Lora', Georgia, serif; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font-family: 'Anton', Impact, sans-serif; font-size: clamp(40px, 6.4vw, 76px); line-height: 1; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
h2 { font-family: 'Anton', Impact, sans-serif; font-size: clamp(26px, 3vw, 34px); line-height: 1.05; text-transform: uppercase; margin-bottom: 18px; }
.band { padding: clamp(24px, 4vw, 56px) max(5vw, 16px); max-width: 1320px; margin: 0 auto; }
.kicker { font: 700 13px/1.2 'Bitter', serif; color: var(--muted); margin: 0 0 8px; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--soft); max-width: 62ch; margin: 12px 0 0; }

/* Header + tabs */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
       padding: 10px max(5vw, 16px); background: var(--paper); border-bottom: 1.5px solid var(--line-strong); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 20px/1 'Anton', Impact, sans-serif; text-transform: uppercase; color: var(--ink); }
.brand-star { width: 30px; height: 30px; color: var(--ink); }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tabs a { font: 700 15px/1 'Bitter', serif; text-decoration: none; padding: 13px 16px; border-radius: 4px; color: var(--soft); min-height: 44px; }
.tabs a:hover { background: var(--paper-2); color: var(--ink); }
.tabs a[aria-current=page] { background: var(--ink); color: var(--paper); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--muted); outline-offset: 2px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.chips { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font: 600 13.5px/1 'Bitter', serif; border: 1px solid var(--line); background: var(--paper-2); color: var(--soft); padding: 7px 11px; border-radius: 3px; }
.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px 16px; border-radius: 6px; text-decoration: none;
         background: var(--paper-2); border: 1px solid var(--line); transition: transform .2s ease; }
.badge:hover { transform: translateY(-3px); }
.badge svg { width: clamp(64px, 9vw, 96px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 3px 0 color-mix(in srgb, currentColor 25%, transparent)); }
.badge .bn { font: 400 clamp(22px, 2.6vw, 30px)/1 'Anton', Impact, sans-serif; text-transform: uppercase; }
.badge .bt { font: 700 13px/1 'Bitter', serif; color: var(--soft); }
.star-wrap { display: inline-flex; flex: none; }

/* Grid table */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { font: 700 13px/1.2 'Bitter', serif; text-align: left; color: var(--muted); padding: 0 12px 10px; border-bottom: 2px solid var(--line-strong); }
table.grid td { vertical-align: top; padding: 16px 12px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
table.grid tr:last-child td { border-bottom: 2px solid var(--line-strong); }
.who { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.who .star-wrap svg { width: 44px; height: 44px; }
.who-n { font: 400 22px/1 'Anton', Impact, sans-serif; text-transform: uppercase; }
.who-t { font: 700 12.5px/1.2 'Bitter', serif; margin-top: 3px; }
.strong { font: 700 15.5px/1.35 'Bitter', serif; }
.soft { color: var(--soft); font-size: 14.5px; }
.hook { font-style: italic; }
.tbd { display: inline-block; font: 700 13px/1 'Bitter', serif; border: 1.5px dashed var(--line); color: var(--muted); padding: 6px 9px; border-radius: 3px; text-decoration: none; white-space: nowrap; }
.tbd:hover { border-color: var(--muted); }

/* Character cards */
.card, .item, .who, .gs { --t: color-mix(in srgb, var(--c, var(--muted)) 13%, var(--paper)); }
.cards { display: grid; gap: clamp(36px, 5vw, 64px); }
.card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.card-band { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 24px; background: var(--c); color: var(--paper); }
.card-band .star-wrap { color: var(--c); }
.card-band .star-wrap svg { width: 76px; height: 76px; }
.portrait { border-radius: 50%; background: var(--paper); object-fit: cover; }
.card-name { font: 400 clamp(36px, 5vw, 54px)/.95 'Anton', Impact, sans-serif; text-transform: uppercase; }
.card-title { font: 700 14px/1 'Bitter', serif; margin-top: 6px; opacity: .9; }
.card-meta { margin: 0 0 0 auto; display: grid; grid-template-columns: auto auto; gap: 4px 14px; font: 600 15px/1.3 'Bitter', serif; }
.card-meta dt { font-weight: 500; opacity: .78; text-align: right; font-size: 13.5px; }
.card-meta dd { margin: 0; }

/* Full-width sections: label column + content */
.sec { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 28px; padding: 22px 24px; border-top: 1px solid var(--line); }
.sec-head h3 { font: 400 22px/1.05 'Anton', Impact, sans-serif; text-transform: uppercase; color: var(--c); }
.sec-head span { display: block; font: 600 13.5px/1.3 'Bitter', serif; color: var(--soft); margin-top: 4px; }
b.lead { font-family: 'Bitter', serif; font-weight: 700; }
/* Legend: five across whenever the list is 640px+ wide; 2 + 2 + 1 (last spans) in between; one column on a phone */
.traits-wrap { container-type: inline-size; }
ol.traits { list-style: none; padding: 0; margin: 0; counter-reset: t; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@container (min-width: 420px) { ol.traits { grid-template-columns: repeat(2, minmax(0, 1fr)); } ol.traits li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@container (min-width: 640px) { ol.traits { grid-template-columns: repeat(5, minmax(0, 1fr)); } ol.traits li:last-child:nth-child(odd) { grid-column: auto; } }
ol.traits li { counter-increment: t; position: relative; padding: 11px 11px 12px; background: var(--paper-2); border-radius: 5px; font-size: 14.5px; line-height: 1.42; overflow-wrap: break-word; }
ol.traits li b.lead { padding-left: 28px; min-height: 21px; margin-bottom: 4px; }
ol.traits li::before { content: counter(t); position: absolute; left: 11px; top: 11px; width: 21px; height: 21px; border-radius: 50%; background: var(--c);
                       color: var(--paper); font: 700 12px/21px 'Bitter', serif; text-align: center; }
ol.traits li b.lead, ul.pd li b.lead { display: block; font-size: 15px; margin-bottom: 2px; }
ul.pd { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
ul.pd li { position: relative; padding: 12px 14px 12px 64px; border: 1px solid var(--line); border-radius: 5px; font-size: 14.5px; line-height: 1.42; min-height: 66px; }
.pd-ic { position: absolute; left: 12px; top: 12px; width: 40px; height: 40px; padding: 6px; border-radius: 50%; background: var(--t); color: var(--c);
         fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.sec-turtle { padding-block: 16px; }
.turtle-row { display: flex; align-items: center; gap: 16px; align-self: center; }
.turtle-thumb { flex: none; margin: 0; width: 76px; aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 6px; background: var(--t); display: grid; place-items: center; overflow: hidden; }
.turtle-thumb img { width: 100%; height: 100%; object-fit: cover; }
.turtle-thumb:has(img) { border-style: solid; }
.turtle-empty { font: 700 11.5px/1.2 'Bitter', serif; color: var(--muted); text-align: center; }
.turtle-line { margin: 0; font-size: 15.5px; color: var(--soft); }
.turtle-line b { color: var(--ink); }

/* The Dog: the character himself; heaviest section. His name rides above it so the long panel stays tied to the card header. */
.dog-name { margin: 0; padding: 14px 24px 10px; border-top: 1px solid var(--line); display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
            font: 400 clamp(24px, 2.8vw, 32px)/1 'Anton', Impact, sans-serif; text-transform: uppercase; color: var(--c); }
.dog-name span { font: 700 14px/1 'Bitter', serif; text-transform: none; color: var(--soft); }
.dog { background: var(--c); color: var(--paper); padding: clamp(22px, 3vw, 36px) 24px 26px; }
.dog-head { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 28px; align-items: end; padding-bottom: 18px; border-bottom: 1.5px solid color-mix(in srgb, var(--paper) 45%, transparent); }
.dog-title { font: 400 clamp(34px, 4vw, 46px)/.95 'Anton', Impact, sans-serif; text-transform: uppercase; }
.dog-hook { margin: 0; font: italic 400 clamp(20px, 2.3vw, 27px)/1.3 'Lora', Georgia, serif; text-wrap: balance; }
.dog-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; padding: 20px 0 22px; }
.dog-story p { margin: 0 0 12px; font-size: 17.5px; line-height: 1.6; }
.dog-story p:first-child::first-letter { font: 400 3.1em/.85 'Anton', Impact, sans-serif; float: left; margin: 6px 3px 0 0; }
.dog-bullets { margin: 0 0 16px; padding: 0; list-style: none; }
.dog-bullets li { position: relative; padding-left: 20px; margin-bottom: 8px; font-size: 15.5px; line-height: 1.45; }
.dog-bullets li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border: 2px solid var(--paper); transform: rotate(45deg); }
.keywords { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.keywords li { font: 700 13.5px/1 'Bitter', serif; padding: 7px 11px; border-radius: 20px; background: var(--paper); color: var(--c); }
.dog-ties { margin: 0; font-size: 14.5px; line-height: 1.5; opacity: .92; }
.dog-ties span { display: block; font: 700 13px/1.3 'Bitter', serif; opacity: .8; margin-bottom: 2px; }
.gear-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gs { display: flex; gap: 12px; align-items: stretch; background: var(--paper); color: var(--ink); border-radius: 6px; padding: 12px; }
.gs-art { flex: none; width: 74px; aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 5px; display: grid; place-items: center; background: var(--t); overflow: hidden; }
.gs-art img { width: 100%; height: 100%; object-fit: contain; }
.gs-art-empty { font: 400 30px/1 'Anton', Impact, sans-serif; color: var(--line); }
.gs-body { display: flex; flex-direction: column; gap: 3px; }
.gs-label { font: 700 13px/1.2 'Bitter', serif; color: var(--c); }
.gs-value { font: 400 22px/1 'Anton', Impact, sans-serif; text-transform: uppercase; }
.gs-tops { font-size: 13.5px; line-height: 1.4; color: var(--soft); }
.gs-tops a { color: var(--ink); text-decoration-color: var(--c); text-underline-offset: 2px; }
.gs-link { margin-top: auto; padding-top: 4px; font: 700 13px/1.2 'Bitter', serif; color: var(--c); text-decoration: none; }
.gs-link:hover { text-decoration: underline; }

/* Boards */
.board-head { padding-bottom: 12px; }
.filters { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.frow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.frow > span { font: 700 13px/1 'Bitter', serif; color: var(--muted); min-width: 64px; }
.fbtn { font: 600 14.5px/1 'Bitter', serif; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.fbtn[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fbtn.c[aria-pressed=true] { background: var(--c); border-color: var(--c); color: var(--paper); }
.count { font: 600 14px/1 'Bitter', serif; color: var(--soft); margin-top: 4px; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 22px; }
.item { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); }
.art { aspect-ratio: 4 / 3; background: var(--paper-2); border-bottom: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.art:has(img) { aspect-ratio: 1; } /* his board art is square (640x640); the 4:3 frame stays for empty slots */
.art img { width: 100%; height: 100%; object-fit: contain; }
.slot { width: 82%; height: 76%; border: 2px dashed var(--line); border-radius: 6px; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted); padding: 10px; }
.slot .num { font: 400 34px/1 'Anton', Impact, sans-serif; color: var(--line); }
.slot code { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.slot small { font: 600 13px/1.2 'Bitter', serif; }
.item-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.item h3 { font: 800 18px/1.25 'Bitter', serif; }
.item .meta { font: 600 13.5px/1 'Bitter', serif; color: var(--muted); }
.item p { margin: 0; font-size: 15px; line-height: 1.45; }
.item .legend { font-style: italic; color: var(--soft); }
.item .sci { font-style: italic; font-size: 14px; color: var(--soft); margin-top: -6px; }
.item.flash { outline: 3px solid var(--muted); outline-offset: 3px; }
.item details { font-size: 14.5px; color: var(--soft); }
.item summary { cursor: pointer; font: 700 13.5px/1.2 'Bitter', serif; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.picks { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.pick { font-size: 14px; line-height: 1.4; color: var(--soft); }
.tag { display: inline-block; font: 700 12.5px/1 'Bitter', serif; padding: 4px 8px; border-radius: 3px; margin-right: 6px; border: 1.5px solid var(--c); color: var(--c); white-space: nowrap; }
.tag.top { background: var(--c); color: var(--paper); }
.open { font-size: 14px; color: var(--muted); font-style: italic; }
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; border: 2px dashed var(--line); border-radius: 6px; color: var(--soft); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font: 600 13.5px/1.3 'Bitter', serif; color: var(--muted); border-top: 1.5px solid var(--line-strong); margin-top: 24px; }

@media (max-width: 900px) {
  .sec, .dog-head { grid-template-columns: 1fr; }
  .dog-body { grid-template-columns: 1fr; }
  .gear-slots { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .roster { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .badge { padding: 12px 4px; }
  .badge .bt { display: none; }
}
@media (max-width: 600px) {
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-meta { margin: 0; grid-template-columns: auto 1fr; }
  .card-meta dt { text-align: left; }
  .turtle-row { align-items: flex-start; }
  .turtle-thumb { width: 64px; }
  .tabs { margin-left: 0; width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 13px 6px; }
  table { font-size: 14px; }
  .stack thead { display: none; }
  .stack tr { display: grid; padding-block: 12px; border-bottom: 1px solid var(--line); }
  table.grid.stack td { display: flow-root; border: 0 !important; padding: 4px 0; padding-inline-start: 8em; text-align: start; }
  .stack td::before { content: attr(data-l); float: inline-start; width: 7.5em; margin-inline-start: -8em; white-space: normal; font: 700 12.5px/1.4 'Bitter', serif; color: var(--muted); }
  table.grid.stack td:first-child { padding-inline-start: 0; }
  .stack td:first-child::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .badge { transition: none; } .badge:hover { transform: none; } }
