/* Monster cards: the atlas (02-card-atlas), a card's detail (03-card-detail) and the guide (04-card-guide).
   Desktop lengths are px at the 1086 px wide mockups (the guide's 1024 px mockup x 1.06); phone lengths
   are half the 724 px phone mockups. The column is fluid (1066 to 1300 px on desktop), so columns, tile
   rows and art heights follow the view's width (cqw); type and controls stay in px. */

.cards .view { display: flex; flex-direction: column; gap: var(--gap); container-type: inline-size; }
.cards .view[hidden] { display: none; }

/* ---- Navy hero bands (.band from site.css): copy at the left, the scene melting into the navy ---- */
.hero__title { font: 700 56px/0.93 var(--display); color: var(--cream); }
.hero__lede { margin: 12px 0 0 5px; font-size: 23px; line-height: 1.22; color: var(--cream); }
.hero__link { display: inline-block; margin: 10px 0 0 5px; font-size: 23px; line-height: 1.2; }

.atlas-hero { --band-h: clamp(240px, 24.4cqw, 320px); --art-w: 58%; --art-pos: 50% 62%; }
.atlas-hero .band__art { right: 2.4%; --fade-l: 14%; --fade-r: 3%; --fade-t: 0%; --fade-b: 0%; }
.atlas-hero .band__body { max-width: 430px; padding: 10px 0 18px 38px; }
.atlas-hero .hero__lede { max-width: 340px; }

/* A parchment slab with a thin bronze line and notched corners (section titles, stats, words). */
.slab { position: relative; isolation: isolate; }
.slab::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 2px solid transparent; border-image: url(img/plate.svg) 6 / 6px; clip-path: var(--notch-sm); background: #f9e9c8; background-origin: border-box; pointer-events: none; }


/* ---- Atlas: search, rail, results ---- */
.catalog { padding: 22px 34px 10px 44px; }
.search { display: flex; gap: 18px; }
.search__box { position: relative; flex: 1; display: flex; }
.search__icon { position: absolute; left: 14px; top: 50%; width: 26px; height: 26px; margin-top: -13px; color: #4a1a17; pointer-events: none; }
.search__input { min-height: 46px; padding-left: 60px; font-size: 20px; border-radius: 4px; }
.search__input::-webkit-search-cancel-button { cursor: pointer; }
.search__go { width: 162px; min-height: 46px; font-size: 22px; }
.filters-open { display: none; }

.catalog__body { display: grid; grid-template-columns: clamp(200px, 26%, 320px) minmax(0, 1fr); margin-top: 20px; border-top: 2px solid rgb(201 151 88 / 0.75); }
.rail { padding: 18px 16px 0 0; border-right: 2px solid rgb(201 151 88 / 0.75); }
.rail__fields { display: grid; }
.rail .field { gap: 8px; padding-bottom: 12px; margin-bottom: 11px; border-bottom: 2px solid rgb(201 151 88 / 0.6); }
.rail .field__label, .rail__label { font: 700 22px/1.1 var(--display); color: var(--ink); }
.rail select.input { min-height: 38px; font-size: 17px; }
.rail__foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-top: 18px; }
.rail__foot .more-filters { flex: 1 1 auto; }
.rail__foot .more-filters[open] { flex-basis: 100%; order: 1; }
.rail .more-filters > summary { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 30px; list-style: none; color: var(--link); font: 700 18px/1.2 var(--sans); cursor: pointer; }
.more-filters > summary::-webkit-details-marker { display: none; }
.rail .more-filters > summary::after { content: ''; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-3px); transition: transform var(--hover); }
.rail .more-filters[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.more-filters__body { display: grid; gap: 12px; padding-top: 8px; }
.more-filters__body .field { padding: 0; margin: 0; border: 0; }
.rail .more-filters__body .field__label { font: 700 17px/1.2 var(--sans); }
.check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-weight: 600; font-size: 17px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--burgundy); }
.rail__group { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 2px solid rgb(201 151 88 / 0.6); }
.rail__stats { justify-content: center; gap: 10px; width: 100%; min-height: 42px; font-size: 20px; }
.rail__stats img { width: 20px; height: auto; }
.rail__stats[aria-expanded="true"] { background: #f7e7c6; }
.rail__clear { font-size: 20px; }

.results { min-width: 0; padding: 4px 0 0 28px; }
.results__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.results__title { font: 700 46px/1 var(--display); color: var(--ink); }
.results__title:focus { outline: none; }
.results__sort { display: flex; align-items: center; gap: 12px; font: 700 18px/1 var(--sans); }
.results__sort select.input { width: 220px; min-height: 34px; font-size: 18px; }
.results__rule { margin: 4px 0 12px; }
.results__more { display: flex; margin: 22px auto 0; width: min(292px, 100%); min-height: 50px; font-size: 22px; }
.results__count { margin-top: 4px; text-align: center; font-size: 14px; line-height: 18px; color: var(--muted); }

/* Tiles stay 180 to about 260 px wide: the rail takes a share of the panel, and a wider results area
   gets another column rather than bigger tiles. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px clamp(24px, 5.8%, 44px); padding: 0 2.2%; }
.tile__link { display: grid; justify-items: center; gap: 4px; color: inherit; }
.tile__art { display: block; width: 100%; max-width: 262px; }
.tile__art .mcard { width: 100%; }
.tile__link:hover .mcard { transform: translateY(-3px); filter: brightness(1.07); }
.tile__cta { color: var(--link); font: 700 19px/1.2 var(--sans); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.tile__link:hover .tile__cta { color: var(--burgundy-hover); }

.chips[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.chips__chip { cursor: pointer; }
.chips__x { position: relative; width: 10px; height: 10px; }
.chips__x::before, .chips__x::after { content: ''; position: absolute; left: 4px; top: -1px; width: 2px; height: 12px; background: var(--burgundy); transform: rotate(45deg); }
.chips__x::after { transform: rotate(-45deg); }
.chips__clear { font-size: 15px; }

/* Damage preview: opens above the results. */
.preview { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(110px, 18%, 160px); gap: 10px; margin-bottom: 22px; padding: 18px 20px 18px 24px; }
.preview::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 4px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); background: #fbecd0; background-origin: border-box; }
.preview[hidden] { display: none; }
.preview__title { font: 700 30px/1.1 var(--display); color: var(--ink); }
.preview .rule { margin: 4px 0 10px; }
.preview__help { font-size: 17px; line-height: 1.45; }
.preview__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.preview .field__label { font-size: 17px; }
.preview .input { min-height: 40px; font-size: 17px; }
.preview__go { margin-top: 14px; min-width: min(250px, 100%); min-height: 48px; font-size: 21px; }
.preview__out { min-height: 1.5em; margin-top: 10px; font-weight: 700; font-size: 17px; }
.preview__formula { font-size: 15px; line-height: 1.45; color: var(--muted); }
.preview__link { display: inline-block; margin-top: 8px; font-size: 16px; }
.preview__art { align-self: end; width: 100%; height: auto; }
.pw { white-space: nowrap; }
.pw--on { color: var(--burgundy); font-weight: 700; }

/* Feedback panels (no matches, could not connect, missing card): art left, words right (board 17). */
.state { display: grid; grid-template-columns: auto minmax(0, 300px); align-items: center; justify-content: center; justify-items: start; gap: 24px; padding: 26px 10px 18px; text-align: left; }
.state__art { width: clamp(150px, 26cqw, 230px); height: auto; }
.state__body { display: grid; justify-items: start; }
.state__title { font: 700 34px/1.12 var(--display); color: var(--ink); }
.state .rule { width: 100%; margin: 8px 0 12px; }
.state__text { font-size: 20px; line-height: 1.35; color: var(--ink); }
.state .btn { margin-top: 20px; min-width: 222px; }

/* ---- Farm helpers callout: a navy frame, the farm melting into it from the right ---- */
.helpers { --band-h: clamp(200px, 20.2cqw, 270px); --art-w: 61%; --art-pos: 50% 48%; }
.helpers .band__art { inset: 6px 6px 6px auto; clip-path: var(--notch); --fade-l: 16%; --fade-t: 0%; --fade-b: 0%; }
.helpers .band__body { max-width: 440px; padding: 14px 0 20px 50px; }
.helpers__title { font: 700 47px/1.04 var(--display); color: var(--cream); }
.helpers__line { display: block; }
.helpers__cta { margin-top: 20px; min-width: 330px; min-height: 52px; font-size: 24px; }

/* ---- Card detail ---- */
.detail-hero { --band-h: clamp(250px, 25.5cqw, 330px); --art-w: 63%; --art-pos: 78% 30%; }
.detail-hero .band__art { --fade-l: 22%; --fade-t: 0%; --fade-b: 0%; }
.detail-hero .band__art .detail-hero__dragon { position: absolute; right: 9%; bottom: 0; width: auto; height: 92%; object-fit: contain; }
.detail-hero .band__body { max-width: 400px; padding: 14px 0 22px 42px; }
.detail-hero .hero__title { font-size: 80px; }
.detail-hero .hero__lede { max-width: 336px; margin-top: 12px; font-size: 21px; line-height: 1.27; }

.card { padding: 26px 46px 44px 40px; }
.card:focus { outline: none; }
.crumbs { padding-left: 12px; font: 600 23px/1.3 var(--sans); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 10px; }
.crumbs li + li::before { content: '/'; margin-right: 10px; }
.card > .rule { margin: 10px 0 25px 12px; }
.card__grid { display: grid; grid-template-columns: clamp(250px, 34%, 400px) minmax(0, 1fr); gap: clamp(26px, 3.6%, 48px); align-items: start; }
.card__art .mcard { aspect-ratio: 338 / 482; }
.card__info { min-width: 0; padding-top: 2px; }
.card__title { font: 700 52px/1 var(--display); color: var(--ink); }
.card__facts { margin-top: 10px; font: 600 26px/1.25 var(--sans); }
.dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.card__chance { margin-top: 4px; font: 700 26px/1.25 var(--sans); }
.card__info > .rule { margin: 8px 0 14px; }
.card__section { display: grid; gap: 14px; }
.card__plate { display: block; padding: 6px 22px 5px; font: 700 32px/1.1 var(--display); color: var(--ink); }
.card__grant { margin-top: -4px; font-size: 21px; line-height: 1.3; }
.words-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.words-row__label { font-weight: 700; font-size: 20px; }
.words-row__words { flex: 1; min-width: 200px; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 6px 18px; font: 600 24px/1.2 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; user-select: all; }
.words-row__copy { min-width: 162px; min-height: 46px; font-size: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; }
.stat { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 6px 16px; font: 700 23px/1.2 var(--sans); }
.stat__icon { flex: none; width: 26px; height: 30px; object-fit: contain; }
.effect { font-size: 21px; line-height: 1.4; }
.effect--list { display: grid; gap: 4px; padding-left: 22px; }
.effect--plain { padding-left: 0; list-style: none; }
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; }
.work { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 60px; padding: 6px 16px; font: 700 23px/1.2 var(--sans); }
.work__icon { flex: none; width: 52px; height: 40px; object-fit: contain; }

.card > .rule:nth-of-type(2) { margin: 36px 0 26px; }
.kinds-nav ul { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0 0 0 2px; }
.kinds-nav li { margin-left: -2px; }
.kinds-nav__item { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 4px 8px; font: 700 23px/1.15 var(--sans); color: var(--ink); }
.kinds-nav__item::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 2px solid transparent; border-image: url(img/plate.svg) 6 / 6px; clip-path: var(--notch-sm); background: linear-gradient(#fbe9bd, #f1d496); background-origin: border-box; }
.kinds-nav__item:hover { color: var(--burgundy); }
.kinds-nav__item[aria-current="page"] { position: relative; z-index: 1; margin: -6px 0; color: var(--cream); text-shadow: 0 1px 0 rgb(60 8 18 / 0.6); }
.kinds-nav__item[aria-current="page"]::before { border-image: url(/assets/art/frame-btn.svg) 20 / 20px; border-width: 7px; clip-path: var(--notch); background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); }
.card__links { display: flex; justify-content: center; align-items: center; gap: 44px; margin-top: 36px; font-size: 24px; }
.card__links-sep { width: 2px; height: 32px; background: var(--line); }

.card--missing { padding-block: 30px; }

/* ---- Guide ---- */
.guide-hero { --band-h: clamp(270px, 29cqw, 370px); --art-w: 60%; --art-pos: 50% 48%; }
.guide-hero .band__art { right: 1.4%; --fade-l: 14%; --fade-r: 3%; --fade-t: 0%; --fade-b: 0%; }
.guide-hero .band__body { max-width: 480px; padding: 18px 0 24px 34px; }
.guide-hero .hero__title { font-size: 52px; white-space: nowrap; }
.guide-hero .hero__lede { max-width: 390px; margin-top: 12px; font-size: 25px; line-height: 1.17; }
.guide-hero__cta { margin-top: 30px; min-width: 368px; min-height: 58px; font-size: 26px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 22px 22px 20px; }
.step { display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.step + .step { border-left: 2px solid rgb(201 151 88 / 0.75); }
.step__art { flex: none; position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; width: clamp(120px, 15cqw, 180px); aspect-ratio: 16 / 15; }
.step__art > img { height: auto; }
.step__art > img:only-child { width: 100%; height: 100%; object-fit: contain; }
.step__art .step__shield { position: relative; z-index: 1; width: 58%; }
.step__art .step__sword { position: absolute; left: 50%; top: 50%; width: 94%; max-width: none; max-height: none; transform: translate(-50%, -50%) rotate(90deg); }
.step__art .step__sword--b { transform: translate(-50%, -50%) rotate(180deg); }
.step__title { font: 700 31px/1.1 var(--display); color: var(--ink); white-space: nowrap; }
.step__text { margin-top: 8px; font-size: 18px; line-height: 1.2; }

.section-title { text-align: center; font: 700 44px/1.05 var(--display); color: var(--ink); }
.kinds .rule, .boxes .rule { width: min(890px, 100%); margin: 2px auto 12px; }
.kinds { padding: 18px clamp(24px, 6cqw, 80px) 16px; }
.kinds__table { width: 100%; border-collapse: collapse; font-size: 21px; line-height: 1.2; }
.kinds__table th, .kinds__table td { padding: 3px 36px; border: 2px solid #b89466; text-align: left; }
.kinds__table thead th:first-child { width: 32%; }
.kinds__table thead th:nth-child(2) { width: 42%; }
.kinds__table thead th { border-color: var(--burgundy); background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); color: var(--cream); font-weight: 700; font-size: 21px; }
.kinds__table tbody th { font-weight: 800; font-size: 22px; }
.kinds__table th:last-child, .kinds__table td:last-child { text-align: center; }
.kinds__table tbody tr { background: rgb(255 248 230 / 0.5); }
.kinds__note { margin-top: 8px; text-align: center; font-size: 18px; }

.boxes { padding: 14px clamp(24px, 5cqw, 70px) 14px; }
.boxes .rule { margin-bottom: 6px; }
.boxes__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.box { display: grid; justify-items: center; gap: 5px; padding: 0 14px; }
.box + .box { border-left: 2px solid rgb(201 151 88 / 0.75); }
.box__art { width: clamp(120px, 15cqw, 180px); aspect-ratio: 160 / 127; object-fit: contain; }
.box__label { display: inline-block; min-height: 34px; padding: 4px 22px; font-size: 18px; line-height: 26px; white-space: nowrap; }
.box__label b { font-weight: 700; }
.box__label .dot { width: 5px; height: 5px; margin: 0 3px; }
.boxes__note { margin-top: 8px; text-align: center; font-size: 18px; }
.boxes__more { margin-left: 6px; font-size: 16px; }
.boxes__shop[hidden] { display: none; }
.boxes__shop { display: grid; gap: 10px; max-width: 760px; margin: 12px auto 4px; font-size: 17px; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.35; }
.table th, .table td { padding: 6px 12px; border: 2px solid #b89466; text-align: left; vertical-align: top; }
.table thead th { background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); border-color: var(--burgundy); color: var(--cream); }

.faq { display: grid; gap: 12px; padding: 4px 26px 0; }
.faq__item.accordion { position: relative; isolation: isolate; margin: 0; border: 0; background: none; }
.faq__item::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 4px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); background: var(--parchment-bg); background-origin: border-box; }
.faq__item > summary { min-height: 46px; padding: 4px 38px 4px 34px; font: 700 24px/1.15 var(--display); }
.faq__item > summary::before { display: none; }
.faq__item > summary::after { content: ''; width: 22px; height: 22px; margin-left: auto; background: linear-gradient(var(--burgundy), var(--burgundy)) center / 22px 4px no-repeat, linear-gradient(var(--burgundy), var(--burgundy)) center / 4px 22px no-repeat; }
.faq__item[open] > summary { background: none; color: var(--ink); border-bottom: 2px solid rgb(201 151 88 / 0.6); }
.faq__item[open] > summary::after { background: linear-gradient(var(--burgundy), var(--burgundy)) center / 22px 4px no-repeat; }
.faq .accordion__body { display: grid; gap: 12px; padding: 16px 32px 24px; font-size: 18px; line-height: 1.55; }
.faq .accordion__body > p { max-width: 68ch; }
.faq h3 { margin-top: 6px; font: 700 22px/1.2 var(--display); }
.faq__links { display: flex; flex-wrap: wrap; gap: 28px; }
.words { font: 600 0.95em/1.2 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; white-space: nowrap; }

.guide__cta { align-self: center; min-width: min(394px, 100%); min-height: 56px; margin: 6px 0 0; font-size: 27px; }

/* ---- Filter sheet (phones) ---- */
.filter-sheet .sheet__body { gap: 8px; }
.filter-sheet .field { gap: 2px; }
.filter-sheet .field__label { font-size: 15px; }
.filter-sheet .more-filters, .sheet-preview { margin: 6px 0 0; padding: 0; border: 0; }
.filter-sheet .more-filters > summary, .sheet-preview > summary { position: relative; isolation: isolate; display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 6px 14px; list-style: none; font: 700 16px/1.2 var(--sans); color: var(--ink); cursor: pointer; }
.filter-sheet .more-filters > summary::before, .sheet-preview > summary::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 4px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 8px; clip-path: var(--notch-sm); background: var(--surface); background-origin: border-box; }
.sheet-preview > summary::-webkit-details-marker, .filter-sheet .more-filters > summary::-webkit-details-marker { display: none; }
.filter-sheet .more-filters > summary::after, .sheet-preview > summary::after { content: ''; order: -1; width: 0; height: 0; margin: 0; border: solid transparent; border-width: 6px 0 6px 9px; border-left-color: var(--burgundy); transform: none; transition: transform var(--hover); }
.filter-sheet .more-filters[open] > summary::after, .sheet-preview[open] > summary::after { transform: rotate(90deg); }
.filter-sheet .more-filters__body { padding: 10px 2px 0; }
.filter-sheet .check { font-size: 15px; }
.sheet-preview .preview__text { padding: 10px 2px 0; }
.sheet-preview .preview__help { font-size: 14px; }
.sheet-preview .preview__fields { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.sheet-preview .field__label { font-size: 15px; }
.sheet-preview .preview__out { font-size: 14px; }
.sheet-preview .preview__formula { font-size: 13px; }
.sheet-preview .preview__link { font-size: 14px; }
.filter-sheet .sheet__actions .btn { min-height: 40px; font-size: 16px; }
/* Board 16: three card backs on a red cloth in front of the castle wall, fading up into the parchment. */
.filter-sheet__art { position: relative; display: flex; justify-content: center; align-items: flex-end; flex: none; height: 130px; margin-top: 18px; padding-bottom: 12px; background: url(/assets/art/scenes/game-gateway.webp) 50% 92% / cover; -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
.filter-sheet__art::after { content: ''; position: absolute; inset: auto 18% 0; height: 34px; background: linear-gradient(#8b2232, #5a1320); clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%); }
.filter-sheet__art .filter-sheet__card { position: relative; z-index: 1; width: 64px; height: auto; margin: 0 -6px; object-fit: contain; transform: rotate(-9deg) translateY(4px); filter: drop-shadow(0 3px 2px rgb(0 0 0 / 0.45)); }
.filter-sheet__art .filter-sheet__card:nth-child(2) { z-index: 2; width: 70px; transform: translateY(-6px); }
.filter-sheet__art .filter-sheet__card:nth-child(3) { transform: rotate(9deg) translateY(4px); }

/* ---- Tablet: the rail narrows so three tiles still fit; heroes and the detail give their copy more of
   the band ---- */
@media (max-width: 1024px) {
  .catalog { padding: 20px 24px 10px 28px; }
  .catalog__body { grid-template-columns: 200px minmax(0, 1fr); }
  .results { padding-left: 22px; }
}
@media (max-width: 1000px) {
  .results__title { font-size: 36px; }
  .hero__title { font-size: 44px; }
  .hero__lede { font-size: 20px; }
  .atlas-hero { --art-w: 52%; }
  .atlas-hero .band__body { max-width: 360px; }
  .atlas-hero .hero__lede { max-width: 300px; }
  .detail-hero .hero__title { font-size: 60px; }
  .detail-hero .band__body { max-width: 330px; }
  .detail-hero .hero__lede { font-size: 19px; }
  .guide-hero { --art-w: 52%; }
  .guide-hero .hero__title { font-size: 40px; }
  .guide-hero .hero__lede { font-size: 22px; }
  .guide-hero__cta { min-width: 0; font-size: 22px; }
  .guide-hero .band__body { max-width: 400px; }
  .helpers__title { font-size: 40px; }
  .helpers__cta { min-width: 0; font-size: 21px; }
  .helpers .band__body { padding-left: 34px; }
  .card { padding: 22px 28px 36px; }
  .card__title { font-size: 38px; }
  .card__facts, .card__chance { font-size: 21px; }
  .kinds-nav__item { font-size: 19px; }
  .step { flex-direction: column; align-items: center; gap: 6px; text-align: center; }
  .step__art { width: 120px; }
  .boxes__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
  .box:nth-child(3) { border-left: 0; }
  .preview { grid-template-columns: 1fr; }
  .preview__art { display: none; }
  .kinds__table th, .kinds__table td { padding-inline: 18px; }
}

/* ---- Phones: the compact banners keep their art at the right (mockups 02, 03); the guide stacks ---- */
@media (max-width: 767px) {
  .hero__title { font-size: 25px; line-height: 0.96; }
  .hero__lede { margin-top: 7px; font-size: 13.5px; line-height: 1.2; }
  .hero__link { margin-top: 8px; font-size: 13.5px; text-decoration-thickness: 2px; text-underline-offset: 4px; }

  .atlas-hero, .detail-hero, .helpers { flex-direction: row; align-items: center; }
  :is(.atlas-hero, .detail-hero, .helpers) .band__art { position: absolute; order: 0; width: var(--art-w); height: auto; }
  .atlas-hero { min-height: 133px; --art-w: 50%; --art-pos: 50% 55%; }
  .atlas-hero .band__art { inset: 0 0 0 auto; --fade-l: 16%; --fade-r: 0%; --fade-t: 0%; --fade-b: 0%; }
  .atlas-hero .band__body { max-width: 190px; padding: 6px 0 10px 9px; }
  .atlas-hero .hero__lede { max-width: 172px; }

  .catalog { padding: 12px 12px 10px; }
  .search { flex-direction: column; gap: 9px; }
  .search__icon { width: 15px; height: 15px; margin-top: -7.5px; left: 9px; }
  .search__input { min-height: 29px; padding: 2px 8px 2px 36px; font-size: 14px; border-radius: 3px; }
  .search__go { width: 100%; min-height: 29px; font-size: 15px; }
  .filters-open { display: flex; justify-content: center; width: 100%; gap: 8px; margin-top: 11px; min-height: 31px; padding: 2px 12px; border: 1.5px solid var(--field-line); border-radius: 4px; background: var(--surface); font-size: 15px; color: var(--burgundy); font-weight: 700; }
  .filters-open::before { display: none; }
  .filters-open__icon { width: 18px; height: auto; }
  .filters-open__chev { position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin: -6px 0 0; border: solid var(--burgundy); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }

  .catalog__body { display: block; margin-top: 14px; border-top: 1px solid rgb(201 151 88 / 0.75); }
  .rail { display: none; }
  .results { padding: 8px 0 0; }
  .results__head { display: grid; justify-content: stretch; gap: 8px; }
  .results__title { font-size: 26px; }
  .results__sort { gap: 8px; font-size: 13px; }
  .results__sort select.input { flex: 1; width: auto; min-height: 22px; padding: 0 30px 0 9px; font-size: 13px; background-size: 11px 7px; background-position: right 10px center; }
  .results__rule { height: 2px; gap: 0; margin: 6px 0 10px; }
  .results__rule > i { display: none; }
  .results__more { width: 100%; min-height: 32px; margin-top: 10px; font-size: 16px; }
  .results__count { margin-top: 2px; font-size: 11px; line-height: 14px; }
  .chips__chip { min-height: 26px; font-size: 13px; }

  /* Two landscape tiles across on a phone (mockup 02 mobile), more on a wide phone, one at 320 px. */
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 9px 24px; padding: 0 10px; }
  .tile__link { gap: 4px; }
  .tile__art { max-width: 210px; }
  .grid .mcard { aspect-ratio: 134 / 114; }
  .grid .mcard__name { height: 16cqw; margin-top: 6cqw; }
  .grid .mcard__foot { height: 9cqw; }
  .grid .mcard__kind { font-size: max(8.5px, 5cqw); letter-spacing: 0.05em; }
  /* The landscape window shows about half of each square illustration, so no extra zoom, and the focus
     sits high enough that a standing monster keeps its head. */
  .grid .mcard__art img { --art-zoom: 1; --art-pos: 50% 30%; }
  .grid .mcard__art img[src$="/portraits/elf-arcanist.webp"] { --art-pos: 50% 12%; }
  .tile__cta { font-size: 12.5px; text-underline-offset: 3px; }

  .preview { margin-bottom: 14px; padding: 12px; }

  .state { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; padding: 14px 0 6px; }
  .state__art { width: 140px; }
  .state__body { justify-items: center; }
  .state__title { font-size: 22px; }
  .state__text { font-size: 15px; }
  .state .btn { min-width: 0; margin-top: 12px; }

  .helpers { min-height: 122px; --art-w: 66%; --art-pos: 50% 42%; }
  .helpers .band__art { inset: 4px 4px 4px auto; clip-path: var(--notch-sm); --fade-l: 22%; }
  .helpers .band__body { max-width: 150px; padding: 9px 0 9px 11px; }
  .helpers__title { font-size: 21px; line-height: 1.02; }
  .helpers__line { display: inline; }
  .helpers__cta { min-width: 0; min-height: 25px; margin-top: 8px; padding: 2px 10px; font-size: 12px; }

  .detail-hero { min-height: 116px; --art-w: 66%; --art-pos: 72% 30%; }
  .detail-hero .band__art { inset: 0 0 0 auto; --fade-l: 24%; --fade-r: 0%; }
  .detail-hero .band__body { max-width: 160px; padding: 6px 0 9px 9px; }
  .detail-hero .hero__title { font-size: 37px; }
  .detail-hero .hero__lede { max-width: 150px; margin-top: 6px; font-size: 11px; line-height: 1.24; }

  .card { padding: 16px 18px 18px; }
  .crumbs { padding-left: 2px; font-size: 13.5px; }
  .card > .rule { margin: 6px 0; }
  .card > .rule:nth-of-type(2) { margin: 6px 0 10px; }
  .card__grid { grid-template-columns: 1fr; gap: 10px; justify-items: center; }
  .card__art { width: 180px; }
  .card__art .mcard { aspect-ratio: 180 / 225; }
  .card__info { width: 100%; padding: 0; text-align: center; }
  .card__title { font-size: 26.5px; }
  .card__facts { margin-top: 6px; font-size: 14px; font-weight: 500; }
  .dot { width: 4px; height: 4px; margin: 0 3px; }
  .card__chance { margin-top: 2px; font-size: 14px; }
  .card__info > .rule { margin: 6px 0 10px; }
  .card__section { gap: 8px; text-align: left; }
  .card__plate { padding: 4px 14px 3px; font-size: 18px; }
  .card__grant { margin-top: -2px; font-size: 13px; line-height: 1.3; }
  .effect { font-size: 14px; line-height: 1.2; }
  .effect--list { gap: 3px; padding-left: 16px; }
  .words-row { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; }
  .words-row__label { font-size: 14px; }
  .words-row__words { min-width: 0; min-height: 28px; padding: 2px 8px; font-size: 15px; }
  .words-row__copy { grid-column: 1 / -1; min-height: 32px; font-size: 15px; }
  .stats, .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .stat, .work { min-height: 31px; gap: 10px; padding: 3px 8px; font-size: 15px; }
  .work { min-height: 32px; }
  .stat__icon { width: 16px; height: 19px; }
  .work__icon { width: 28px; height: 22px; }
  .kinds-nav ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 4px; padding: 0; }
  .kinds-nav li { margin: 0; }
  .kinds-nav__item { min-height: 29px; font-size: 14px; }
  .kinds-nav__item[aria-current="page"] { margin: -2px 0; }
  .kinds-nav__item[aria-current="page"]::before { border-image: url(/assets/art/frame-sm.svg) 8 / 8px; border-width: 4px; clip-path: var(--notch-sm); }
  .card__links { gap: 24px; margin-top: 14px; font-size: 14px; }
  .card__links .link { text-underline-offset: 3px; }
  .card__links-sep { height: 16px; }

  /* The guide stacks title, words, the scene and its button (mockup 04 mobile). */
  .guide-hero { --band-art-h: clamp(140px, 44cqw, 280px); }
  .guide-hero .band__body { display: contents; }
  .guide-hero .hero__title { order: 1; margin: 6px 0 0 17px; font-size: 28px; line-height: 1; white-space: normal; }
  .guide-hero .hero__lede { order: 2; max-width: 240px; margin: 5px 0 0 18px; font-size: 14px; line-height: 1.12; }
  .guide-hero .band__art { order: 3; margin: 8px 6px calc(-1 * var(--gap)); --fade-l: 4%; --fade-r: 4%; --fade-t: 12%; --fade-b: 0%; }
  .guide-hero__cta { order: 4; align-self: center; width: 254px; min-width: 0; min-height: 27px; margin: -14px 0 0; padding: 2px 10px; font-size: 15.5px; }

  .steps { gap: 0; padding: 6px 12px; }
  .step { gap: 0; padding: 3px 0; }
  .step + .step { padding-top: 3px; border-left: 0; border-top: 1px solid rgb(201 151 88 / 0.75); }
  .step__art { width: 106px; aspect-ratio: auto; height: 52px; padding-right: 7px; border-right: 1px solid rgb(201 151 88 / 0.75); box-sizing: content-box; }
  .step__art .step__shield { width: 40px; }
  .step__art .step__sword { width: 54px; }
  .step__body { padding-left: 17px; }
  .step__title { font-size: 17px; }
  .step__text { margin-top: 2px; font-size: 12.5px; line-height: 1.2; }

  .section-title { font-size: 21px; }
  .kinds .rule, .boxes .rule { height: 12px; margin: 2px auto 6px; }
  .kinds .rule > i, .boxes .rule > i { width: 12px; height: 12px; background-size: 12px; }
  .kinds { padding: 6px 12px 8px; }
  .kinds__table { font-size: 11px; line-height: 1.2; }
  .kinds__table th, .kinds__table td { padding: 0 10px; border-width: 1px; }
  .kinds__table thead th:first-child { width: 33%; }
  .kinds__table thead th:nth-child(2) { width: 39%; }
  .kinds__table thead th { font-size: 11px; }
  .kinds__table tbody th { font-size: 12px; }
  .kinds__note { margin-top: 4px; font-size: 11px; }

  .boxes { padding: 6px 12px 8px; }
  .boxes .rule { margin-bottom: 4px; }
  .boxes__list { gap: 0; }
  .box { gap: 1px; padding: 6px 8px 8px; }
  .box:nth-child(n + 3) { border-top: 1px solid rgb(201 151 88 / 0.75); padding-top: 10px; }
  .box + .box { border-left-width: 1px; }
  .box__art { width: 74px; }
  .box__label.slab::before, .faq__item::before { border: 1.5px solid #a8743a; border-image: none; border-radius: 3px; clip-path: none; }
  .box__label.slab::before { background: linear-gradient(#fbe7b5, #f1d293); }
  .box__label { min-height: 15px; padding: 0 12px; font-size: 10.5px; line-height: 15px; }
  .box__label .dot { width: 3px; height: 3px; margin: 0 1px; }
  .boxes__note { margin-top: 4px; font-size: 11.5px; line-height: 1.2; }
  .boxes__more { font-size: 11px; }
  .boxes__shop { font-size: 13px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 4px 6px; }

  .faq { gap: 7px; padding: 0 5px; }
  .faq__item > summary { min-height: 20px; padding: 1px 12px 1px 14px; font-size: 13px; }
  .faq__item > summary::after { width: 11px; height: 11px; background-size: 11px 2px, 2px 11px; }
  .faq__item[open] > summary::after { background-size: 11px 2px; }
  .faq .accordion__body { gap: 8px; padding: 10px 14px 14px; font-size: 14px; }
  .faq h3 { font-size: 15px; }

  .guide__cta { width: 254px; min-width: 0; min-height: 27px; margin: 5px 0 0; padding: 2px 10px; font-size: 15.5px; }
}

@media (max-width: 359px) {
  .grid { grid-template-columns: minmax(0, 190px); justify-content: center; }
  .atlas-hero { --art-w: 46%; }
  .stat, .work { gap: 6px; padding-inline: 6px; font-size: 14px; }
}
