/* Villager trades, on the shared look from ../game.css: deepslate panels, dark item slots and clean rows around the game's
   own art. The pixel font is for names, headings and buttons at 16, 24, 32 or 48 px; trade names, numbers and notes use
   the system sans. No style attributes anywhere: the site's CSP blocks them. */

/* Pixel font pieces that are not headings or buttons. */
.level__name, .level__title--card, .large-bar__pct, .slot__n, .large-head__title { font-family: MC, var(--sans); font-weight: 400; font-synthesis: none; font-kerning: none; font-variant-ligatures: none; -webkit-font-smoothing: none; font-smooth: never; }

/* Header: title and intro over the world, then the cast standing on the panel with the jump links and the finder. */
.trades-hero { padding-top: 40px; }
.hero__kicker { margin-bottom: 12px; }
.hero__lede { max-width: 68ch; margin-top: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.hero__actions { margin-top: 20px; }
.large-open { gap: 0; }
.large-open__more { display: none; }
@media (min-width: 480px) { .large-open__more { display: inline; } }
/* The scripts reveal these two. Hold their space from the first paint, so nothing below them jumps when they do. */
@media (scripting: enabled) {
  .large-open[hidden] { display: inline-flex !important; visibility: hidden; }
  .finder[hidden] { display: grid !important; visibility: hidden; }
}
.cast { display: flex; align-items: flex-end; gap: 2px; margin-top: 28px; padding: 0 16px; overflow: hidden; }
.cast__mob { flex: none; width: auto; height: 76px; }
.cast__mob--llama { height: 78px; }
.cast__mob:nth-child(n+8) { display: none; }
.hero__panel { padding: 16px; }
.hero__label { margin-bottom: 8px; font-size: 14px; font-weight: 600; line-height: 20px; color: #B1B2B5; }
.trades__toc .btn { min-height: 40px; padding: 6px 12px 10px; }
.chip__head { flex: none; width: 24px; height: 24px; }

/* Finder: hidden until trades.js is running. The count sits beside its label, so filling it moves nothing. */
.finder { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label count" "field field" "toggle toggle"; gap: 8px 16px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.finder__label { grid-area: label; font-size: 14px; font-weight: 600; line-height: 20px; color: #B1B2B5; }
.finder__count { grid-area: count; min-height: 20px; font-size: 14px; font-weight: 600; line-height: 20px; color: #FFE45C; text-align: right; font-variant-numeric: tabular-nums; }
.finder__input { grid-area: field; }
.finder__toggle { grid-area: toggle; display: inline-flex; gap: 10px; align-items: center; cursor: pointer; }
.trades-hero__meta { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: #8C8D90; }
.trades-hero__meta code { color: #B1B2B5; }

/* Sections. */
.section { margin-top: 56px; }
.section__title { margin-bottom: 12px; font-size: 32px; line-height: 40px; }
.section__lede { max-width: 72ch; margin-bottom: 24px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

/* An item slot's stack count, where the game draws it. A price range is too wide for that and gets a small badge. */
.slot__n { position: absolute; right: 0; top: 20px; font-size: 16px; line-height: 16px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; white-space: nowrap; pointer-events: none; }
.slot__n--range { top: auto; right: -4px; bottom: -4px; padding: 0 4px; font-family: var(--sans); font-size: 12px; font-weight: 600; line-height: 16px; background: #0E0E0F; border-radius: 3px; text-shadow: none; -webkit-font-smoothing: antialiased; }
.slot--big { width: 72px; height: 72px; border-radius: 4px; }
.slot--big img { width: 64px; height: 64px; }

/* Cards. */
.ledgers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.ledger { min-width: 0; padding: 16px; }
.ledger--wide { width: 100%; }

/* Card header: the villager, its block, and how to craft the block. */
.ledger__head { display: flex; gap: 16px; align-items: flex-end; padding-bottom: 4px; }
.ledger__figure { flex: none; display: flex; align-items: flex-end; }
.ledger__villager { width: auto; height: 170px; }
.ledger__intro { flex: 1 1 auto; min-width: 0; }
.ledger__title { font-size: 24px; line-height: 32px; }
.ledger__tag { margin: 2px 0 12px; font-size: 14px; line-height: 20px; color: #B1B2B5; }
.ledger__site { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px; }
.ledger__block { flex: none; width: auto; height: 84px; }
.ledger__station { margin: 0 0 8px; font-weight: 600; line-height: 20px; }
.ledger__station-label { display: block; font-size: 14px; font-weight: 400; color: #8C8D90; }

/* Crafting grid: dark slots, three by three. */
.craft__row { display: flex; align-items: center; gap: 8px; }
.craft__grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 2px; }
.craft__note { max-width: 14rem; margin-top: 6px; font-size: 14px; line-height: 20px; color: #8C8D90; }

/* Levels inside a card: a raised row with the badge color, then clean rows. */
.level { margin-top: 12px; }
.level__title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 6px 10px; font-family: var(--sans); font-size: 14px; line-height: 20px; text-shadow: none; -webkit-font-smoothing: antialiased; background: #313233; border-radius: 4px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06); }
.level__name { position: relative; padding-left: 18px; font-size: 16px; line-height: 20px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.level__name::before { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; background: var(--badge, #8C8D90); border-radius: 2px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
[data-level="1"] { --badge: #9a8f83; }
[data-level="2"] { --badge: #e8e8e8; }
[data-level="3"] { --badge: #f2c744; }
[data-level="4"] { --badge: #2fbf55; }
[data-level="5"] { --badge: #4fe0e6; }
.level__pick { color: #B1B2B5; }
.level__xp { margin-left: auto; color: #8C8D90; font-variant-numeric: tabular-nums; }
.level__blurb { margin: 10px 0 8px; font-size: 14px; line-height: 20px; color: #B1B2B5; }
.level__title--card { gap: 12px; padding: 0; font-size: 16px; line-height: 20px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); background: none; box-shadow: none; }
.level--wt { margin-top: 24px; }
.level--wt:first-child { margin-top: 0; }

/* A trade row: slots, the arrow, then what it is. */
.trade-list { margin-top: 2px; }
.trade { display: grid; grid-template-columns: 86px 20px 36px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.trade:first-child { border-top: 0; }
.trade__wants { display: flex; align-items: center; justify-content: flex-end; }
.plus { width: 14px; font-size: 14px; text-align: center; color: #8C8D90; }
.trade__info { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.trade__name { line-height: 22px; }
.trade__meta { display: flex; gap: 12px; margin-left: auto; font-size: 14px; line-height: 20px; color: #8C8D90; font-variant-numeric: tabular-nums; }
.meta { white-space: nowrap; }
.trade__more { grid-column: 1 / -1; margin: 2px 0 2px 166px; font-size: 14px; line-height: 20px; color: #B1B2B5; }
.trade__more summary { display: inline-block; cursor: pointer; color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.trade__more summary::before { content: "+ "; }
.trade__more[open] summary::before { content: "- "; }
.trade__more ul { display: grid; gap: 4px; margin: 6px 0 2px; }
.trade__more b { margin-right: 6px; color: #fff; }

/* The wandering trader's long pools, packed tighter. */
.trade-list--dense .trade { grid-template-columns: 36px 20px 36px minmax(0, 1fr); break-inside: avoid; }
.trade-list--dense .trade:first-child { border-top: 1px solid var(--line); }

/* Primer above the villagers: how to read a row, and biome outfits. */
.primer { display: grid; gap: 16px; margin-bottom: 32px; }
.key { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.key__row { display: flex; align-items: center; gap: 8px; }
.key__row .trade__meta { margin-left: 8px; color: #fff; }
.key__list { display: grid; gap: 10px; }
.key__list dt { font-weight: 600; }
.key__list dd { font-size: 14px; line-height: 20px; color: #B1B2B5; }
.primer__outfits { padding: 16px; }
.primer__title { margin-bottom: 12px; }
.outfits { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 4px; align-items: end; }
.outfit { text-align: center; }
.outfit img { width: auto; height: 96px; margin: 0 auto 4px; }
.outfit__name { font-size: 14px; line-height: 20px; color: #B1B2B5; }

/* A section's mascot beside its intro. */
.feature { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; margin-bottom: 24px; }
.feature .section__lede { flex: 1 1 280px; margin: 0; }
.feature__art { flex: none; display: flex; gap: 12px; align-items: flex-end; }
.feature__mob { width: auto; height: 150px; }
.feature__mob--llama { height: 140px; }

/* Bartering and other tables. */
.bart, .book-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bart th, .book-table th { padding: 8px 12px 8px 0; font-size: 14px; font-weight: 600; line-height: 20px; color: #B1B2B5; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.bart td, .book-table td { padding: 6px 12px 6px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.bart tr:last-child td, .book-table tr:last-child td { border-bottom: 0; }
.bart__icon { width: 48px; }
.bart__qty, .book-table td:nth-child(n+2) { white-space: nowrap; }
.bart__pct { width: 40%; white-space: nowrap; }
.bar { display: inline-block; vertical-align: middle; width: calc(100% - 64px); height: 10px; margin-right: 10px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.bar rect { fill: #FFE45C; }
.bar__n { font-size: 14px; }
.trades .aside { margin-top: 12px; padding-left: 12px; border-left: 2px solid #48494A; font-size: 14px; line-height: 20px; color: #B1B2B5; }

/* What changed since the old chart. */
.changes li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.changes li:first-child { border-top: 0; padding-top: 0; }
.changes li:last-child { padding-bottom: 0; }
.changes p { max-width: 72ch; color: #B1B2B5; }
.changes b { display: block; color: #fff; }
.changes__when { margin-left: 6px; vertical-align: 1px; }

@media (min-width: 560px) {
  .cast__mob, .cast__mob--llama { height: 100px; }
  .cast__mob:nth-child(n+8) { display: block; }
  .cast__mob:nth-child(n+11) { display: none; }
}
@media (min-width: 700px) {
  .finder { grid-template-areas: "label count" "field toggle"; }
  .ledgers--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-list--dense { columns: 2; column-gap: 24px; }
}
@media (min-width: 900px) {
  .cast__mob { height: 128px; }
  .cast__mob--llama { height: 124px; }
  .cast__mob:nth-child(n+11) { display: block; }
}
/* Two columns that pack by height, so a short card never leaves a hole beside a long one. */
@media (min-width: 1000px) {
  .ledgers:not(.ledgers--two) { display: block; columns: 2; column-gap: 24px; }
  .ledgers:not(.ledgers--two) > .ledger { break-inside: avoid; margin-bottom: 24px; }
}
@media (min-width: 1100px) { .trade-list--dense { columns: 3; } }
/* Phone rules leave the large view alone: the poster looks the same on every screen. */
@media (max-width: 599px) {
  :root:not(.large-on) .section__title { font-size: 24px; line-height: 32px; }
  .trades__toc .menu li { flex: 1 1 auto; }
  .trades__toc .btn { width: 100%; }
}
@media (max-width: 479px) {
  :root:not(.large-on) .ledger { padding: 12px; }
  :root:not(.large-on) .ledger__villager { height: 128px; }
  :root:not(.large-on) .ledger__head { gap: 8px; align-items: flex-start; }
  :root:not(.large-on) .ledger__block { height: 60px; }
  :root:not(.large-on) .trade { column-gap: 4px; }
  :root:not(.large-on) .trade__more { margin-left: 0; }
  :root:not(.large-on) .trade__meta { margin-left: 0; width: 100%; }
  :root:not(.large-on) .bart th:nth-child(2), :root:not(.large-on) .bart__qty { display: none; }
  :root:not(.large-on) .bar { width: calc(100% - 56px); margin-right: 6px; }
  :root:not(.large-on) .bart__pct { width: 38%; }
}

/* ---------- Large view: the whole page as one poster to zoom and move around ---------- */

.large-head { display: none; }

.large-on, .large-on body { overflow: hidden; overscroll-behavior: none; }
.large-on .topbar, .large-on .trades-hero, .large-on .footer, .large-on .skip-link { display: none; }

/* The poster's own size never changes; only its transform does. */
.large-on #main { position: fixed; left: 0; top: 0; width: 6600px; display: grid; grid-template-columns: 3060px 1500px 2040px; grid-template-areas: "head head head" "villagers villagers villagers" "wandering bartering books" "wandering bartering changed"; grid-template-rows: auto auto auto 1fr; padding-bottom: 60px; transform-origin: 0 0; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; outline: none; }
.large-on #main.is-grabbing { cursor: grabbing; }
.large-on #main.is-flying { transition: transform .32s cubic-bezier(.2, .7, .2, 1); }
/* Far out, nothing can stay on a pixel grid, so let the browser smooth text and pictures. */
.large-on #main:not(.is-near), .large-on #main:not(.is-near) * { -webkit-font-smoothing: antialiased; }
.large-on #main:not(.is-near) * { image-rendering: auto; }
.large-on .large-head { grid-area: head; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 40px 44px 0; overflow: hidden; }
.large-on .large-head__text { padding-bottom: 28px; }
.large-on .large-head__kicker { font-size: 24px; line-height: 32px; color: #B1B2B5; }
.large-on .large-head__title { font-size: 96px; line-height: 112px; text-shadow: 0 12px 0 rgba(0, 0, 0, .4); }
.large-on .large-head__cast { display: flex; align-items: flex-end; gap: 6px; }
.large-on .large-head__cast .cast__mob { display: block; height: 200px; }
.large-on #villagers { grid-area: villagers; }
.large-on #wandering { grid-area: wandering; }
.large-on #bartering { grid-area: bartering; }
.large-on #books { grid-area: books; }
.large-on #changed { grid-area: changed; }
.large-on .section { margin: 0; padding-top: 48px; }
.large-on .wrap { width: auto; max-width: none; padding: 0 44px; }
.large-on .section__title { margin-bottom: 20px; font-size: 48px; line-height: 56px; }
.large-on .section__lede { max-width: none; font-size: 24px; line-height: 36px; }
.large-on #villagers .wrap { display: grid; grid-template-columns: 2300px minmax(0, 1fr); column-gap: 60px; align-items: start; }
.large-on #villagers .section__title { grid-column: 1; grid-row: 1; }
.large-on #villagers .section__lede { grid-column: 1; grid-row: 2; margin: 0 0 24px; }
.large-on #villagers .primer { grid-column: 2; grid-row: 1 / 3; grid-template-columns: 1000px minmax(0, 1fr); margin-bottom: 24px; }
.large-on #villagers .ledgers { grid-column: 1 / -1; grid-row: 3; }
.large-on .ledgers:not(.ledgers--two) { display: block; columns: 10; column-gap: 30px; }
.large-on .ledgers:not(.ledgers--two) > .ledger { break-inside: avoid; margin-bottom: 30px; }
.large-on .ledgers--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.large-on .trade-list--dense { columns: 5; column-gap: 24px; }

/* The toolbar sits above the poster and stays the same size at any zoom. */
.large-bar { position: fixed; z-index: 20; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px 12px; padding: 8px 12px; background: rgba(30, 30, 31, .96); border-bottom: 2px solid #0E0E0F; }
.large-bar .btn { min-height: 40px; padding: 6px 12px 10px; }
.large-bar__zoom { flex: none; display: flex; align-items: center; gap: 6px; }
.large-bar__zoom [data-zoom="out"], .large-bar__zoom [data-zoom="in"] { width: 40px; padding-left: 0; padding-right: 0; }
.large-bar__pct { min-width: 56px; font-size: 16px; line-height: 20px; text-align: center; }
.large-bar__jump { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.large-bar__jump::-webkit-scrollbar { display: none; }
.large-bar__jump .btn { flex: none; width: 40px; padding: 0 0 4px; font-size: 0; gap: 0; }
.large-bar__hint { flex: none; width: 15rem; font-size: 14px; line-height: 18px; color: #B1B2B5; }
.large-bar.is-hinted .large-bar__hint { display: none; }
.large-bar__close { flex: none; }
@media (max-width: 1240px) { .large-bar__hint { display: none; } }
@media (max-width: 699px) {
  .large-bar { flex-wrap: wrap; }
  .large-bar__jump { order: 3; flex: 1 0 100%; }
  .large-bar__close { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .large-on #main.is-flying { transition: none; } }
