/* Farms page: the overview (05-farms) and the reference (06-farm-reference), one shown at a time.
   Desktop sizes are tuned so a 1440 px window (a 1289 px column at zoom 1.1) reads as the mockup scaled
   to the window: the 05 mockup px x 1.28 and the 06 mockup px x 1.2. Layout is fluid from there down to
   the tablet column; headings shrink with --t below 1200 px. Phone sizes are half the 724 px mockups. */

.farm { --t: 1; margin-top: 2px; }
.farm-view { display: flex; flex-direction: column; gap: var(--gap); }
.farm-view[hidden] { display: none; }
.farm h2, .farm h3 { font-weight: 700; }

/* A picture in the bronze pixel frame (frame-sm drawn at 2x): the worker portraits and city cards. */
.fo-worker__art, .fo-city { position: relative; isolation: isolate; display: block; overflow: hidden; clip-path: var(--notch); background: radial-gradient(ellipse at 50% 60%, #2a3d63, #0b1530 75%); }
.fo-worker__art::after, .fo-city::after { content: ''; position: absolute; inset: 0; z-index: 2; border: 8px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 16px; pointer-events: none; }
.fo-worker__art img, .fo-city img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: cover; }

/* Section titles on parchment, with the ornament rule below. */
.fo-title { font: 700 calc(46px * var(--t))/1.15 var(--display); text-align: center; color: var(--ink); }
.fo-rule { width: 84%; margin: 2px auto 0; }

/* ---- Overview ---- */
/* The hero runs to the window edge at 1440 px: the band takes the column's gutters, and the scene fades
   into the navy behind the copy (and on its right, where wide windows leave navy beside the column). */
.fo-hero { --band-h: calc(410px * var(--t)); --art-w: 72%; --art-pos: 50% 34%; margin: 0 -10px calc(2px - var(--gap)); }
.fo-hero__art img { --fade-l: 22%; --fade-t: 3%; --fade-r: 0%; --fade-b: 0%; }
@media (min-width: 1452px) { .fo-hero__art img, .fr-hero__art img { --fade-r: 4%; } }
.fo-hero__text { max-width: none; padding: 20px 0 6px 42px; }
.fo-hero__title { font: 700 calc(52px * var(--t))/1.1 var(--display); color: var(--cream); }
.fo-hero__title span { display: block; }
.fo-hero__lede { max-width: 370px; margin-top: 14px; font-size: 28px; line-height: 32px; color: var(--cream); }
.fo-hero__btn { min-width: 348px; min-height: 60px; margin-top: 30px; padding: 0 24px; font-size: 28px; }
.fo-hero__art .caption { position: absolute; right: 14px; bottom: 14px; font-size: 16px; }

.fo-workers { padding: 28px 38px 37px 42px; }
.fo-workers__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.fo-worker { display: grid; grid-template-columns: minmax(0, 147fr) minmax(170px, 129fr); align-items: start; column-gap: 15px; padding-right: 16px; }
.fo-worker + .fo-worker { padding-left: 24px; border-left: 2px solid #9a6a3a; }
.fo-worker__art { aspect-ratio: 147 / 168; }
.fo-worker__art img { object-position: 50% 30%; transform: scale(1.16); }
.fo-worker__text { padding-top: 15px; }
.fo-worker__role { display: flex; align-items: center; justify-content: center; height: 64px; font: 700 calc(30px * var(--t))/1 var(--display); color: var(--ink); }
.fo-worker__role.plate::before { border-width: 8px; border-image: url(/assets/art/frame-sm.svg) 8 / 16px; clip-path: var(--notch); background: #f4dcae; }
.fo-worker__text p { margin: 16px 0 0 12px; font-size: 22px; line-height: 26.5px; color: var(--ink); }

.fo-cities { padding: 20px 37px 10px; }
.fo-cities__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin-top: 11px; }
.fo-city { aspect-ratio: 302 / 252; color: var(--cream); }
.fo-city img { transition: transform var(--hover); }
.fo-city:hover img { transform: scale(1.03); }
.fo-city__name { position: absolute; z-index: 3; left: 11px; right: 11px; bottom: 6px; display: flex; align-items: center; justify-content: center; height: 46px; font: 700 29px/1 var(--sans); text-shadow: 0 1px 0 rgb(60 8 18 / 0.6); }
.fo-city__name::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 6px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 12px; clip-path: var(--notch-sm); background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); background-origin: border-box; }
/* The two bronze diamonds either side of the city name. */
.fo-city__name::after { content: ''; position: absolute; left: 50%; top: 50%; width: 192px; height: 15px; transform: translate(-50%, -50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23f2b060' d='M4 0h1v1h1v1h1v1h1v1h1v1H8v1H7v1H6v1H5v1H4V8H3V7H2V6H1V5H0V4h1V3h1V2h1V1h1zM4 2v1H3v1H2v1h1v1h1v1h1V6h1V5h1V4H6V3H5V2z'/%3E%3C/svg%3E") left center / 15px no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23f2b060' d='M4 0h1v1h1v1h1v1h1v1h1v1H8v1H7v1H6v1H5v1H4V8H3V7H2V6H1V5H0V4h1V3h1V2h1V1h1zM4 2v1H3v1H2v1h1v1h1v1h1V6h1V5h1V4H6V3H5V2z'/%3E%3C/svg%3E") right center / 15px no-repeat; }
.fo-city:focus-visible { outline-offset: -4px; }

.fo-price { display: flex; align-items: center; justify-content: center; min-height: 121px; padding: 14px 40px; }
.fo-price__coins { flex: none; width: 86px; height: auto; margin-right: 32px; filter: drop-shadow(0 2px 0 rgb(60 30 10 / 0.35)); }
.fo-price__amount { flex: none; font: 700 calc(46px * var(--t))/1 var(--display); color: #5a1320; white-space: nowrap; }
.fo-price__text { max-width: 450px; margin-left: 44px; padding-left: 46px; border-left: 2px solid #9a6a3a; font-size: 26px; line-height: 29.5px; }

.fo-plan { padding: 24px 16px 29px; }
.fo-plan__links { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 12px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), #b28958 calc(100% / 6 - 1px) calc(100% / 6 + 1px)) 0 50% / 100% 40px no-repeat; }
.fo-plan__links a { justify-self: center; font-size: 26px; line-height: 40px; text-underline-offset: 7px; }

/* The closing band: the harbour runs edge to edge inside the navy frame and melts into it behind the title. */
.fo-close { display: flex; flex-direction: column; justify-content: center; min-height: calc(201px * var(--t)); padding: 22px 0 26px 46px; }
.fo-close .frame__art { left: 33%; }
.fo-close .frame__art img { --fade-l: 16%; object-position: 50% 34%; }
.fo-close__title { position: relative; max-width: calc(450px * var(--t)); font: 700 calc(58px * var(--t))/0.95 var(--display); color: var(--cream); }
.fo-close__link { position: relative; align-self: start; margin-top: 16px; font-size: 26px; }

/* ---- Reference ---- */
.fr-anchors { position: absolute; }
.fr-hero { --band-h: calc(455px * var(--t)); --art-w: 61%; --art-pos: 50% 18%; margin: 0 -10px calc(2px - var(--gap)); }
.fr-hero__art img { --fade-l: 12%; --fade-t: 3%; --fade-r: 0%; --fade-b: 0%; }
.fr-hero__text { max-width: none; padding: 26px 0 30px 46px; }
.fr-crumb { font-size: 25px; color: var(--cream); }
.fr-crumb a { text-decoration-thickness: 3px; text-underline-offset: 8px; }
.fr-hero__title { max-width: 500px; margin-top: 22px; font: 700 calc(64px * var(--t))/1.04 var(--display); color: var(--cream); }
.fr-hero__lede { max-width: 470px; margin-top: 18px; font-size: 25px; line-height: 30px; color: var(--cream); }
.fr-hero__btn { min-width: 366px; min-height: 63px; margin-top: 32px; padding: 0 24px; font-size: 31px; }

.fr-body { padding: 41px 37px 30px; }

/* Category tabs: framed plates, the chosen one burgundy. */
.fr-tabs { position: relative; }
.fr-tabs__list { display: flex; gap: 5px; }
.fr-tab { position: relative; isolation: isolate; flex: 1 1 0; display: flex; align-items: center; justify-content: center; height: 67px; padding: 0 10px; font: 700 calc(27.5px * var(--t))/1 var(--display); color: var(--ink); white-space: nowrap; }
.fr-tab::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 2px solid #5d3d22; clip-path: var(--notch-sm); background: linear-gradient(#fcebc8, #f1d5a3); box-shadow: inset 0 0 0 2px rgb(255 246 222 / 0.9), inset 0 -3px 0 2px rgb(150 100 50 / 0.25); }
.fr-tab:hover::before { background: linear-gradient(#fdf0d4, #f5dcb0); }
.fr-tab[aria-current="page"] { color: var(--cream); text-shadow: 0 1px 0 rgb(60 8 18 / 0.6); }
.fr-tab[aria-current="page"]::before { border: 7px solid transparent; border-image: url(/assets/art/frame-sm.svg) 8 / 14px; background: linear-gradient(var(--burgundy-top), var(--burgundy-bottom)); background-origin: border-box; box-shadow: none; }
.fr-tab:first-child { flex-grow: 1.1; }
.fr-tabs__arrow { display: none; }

.fr-tools { display: flex; align-items: center; gap: 27px; margin: 29px 0 0 4px; }
.fr-search { position: relative; flex: 1; }
.fr-search__icon { position: absolute; left: 20px; top: 50%; width: 31px; height: 31px; margin-top: -15.5px; color: var(--ink); pointer-events: none; }
.fr-search__input::placeholder { color: #7d7062; }
.fr-search__input.input { min-height: 59px; padding: 6px 16px 6px 71px; border: 2px solid #6d4c30; border-radius: 5px; background: #fef4e1; font-size: 24px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6); }
.fr-search__input::-webkit-search-cancel-button { cursor: pointer; }
.fr-filters { display: flex; gap: 27px; padding-left: 27px; border-left: 2px solid #b28958; }
.fr-select { display: block; }
.fr-select[hidden] { display: none; }
.fr-select .input { width: 238px; min-height: 59px; padding: 4px 50px 4px 20px; border: 2px solid #6d4c30; border-radius: 5px; font-size: 24px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6);
  background: #fdf3e0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1.5 1.5 8 8l6.5-6.5' fill='none' stroke='%2322180f' stroke-width='2.6'/%3E%3C/svg%3E") right 18px center / 20px 13px no-repeat; }
.fr-select:not(.fr-select--city) .input { width: 221px; }
.fr-filters-toggle { display: none; }

/* The record table, framed, with the two notes as its last row. Columns are shares of the table, so it
   fills any column width the way the mockup's does. */
.fr-panel { margin-top: 36px; }
.fr-frame { position: relative; margin: 0 -8px; padding: 2px; clip-path: var(--notch-sm); background: #fdecce; overflow-x: auto; }
.fr-frame::after { content: ''; position: absolute; inset: 0; z-index: 1; border: 6px solid transparent; border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' shape-rendering='crispEdges'%3E%3Cpath fill='%233a2116' fill-rule='evenodd' d='M3 0h8v1h1v1h1v1h1v8h-1v1h-1v1h-1v1H3v-1H2v-1H1v-1H0V3h1V2h1V1h1zM4 2v1H3v1H2v6h1v1h1v1h6v-1h1v-1h1V4h-1V3h-1V2z'/%3E%3Cpath fill='%23fffbe6' fill-opacity='.85' fill-rule='evenodd' d='M4 2h6v1h1v1h1v6h-1v1h-1v1H4v-1H3v-1H2V4h1V3h1zM5 3v1H4v1H3v4h1v1h1v1h4v-1h1V9h1V5h-1V4H9V3z'/%3E%3C/svg%3E") 6 / 6px; pointer-events: none; }
.fr-table { width: 100%; border-collapse: collapse; font-size: 25px; line-height: 1.25; }
.fr-table thead th { height: 60px; padding: 4px 10px; background: linear-gradient(#f4d9a7, #f1d29d); border-bottom: 2px solid #956936; font: 700 calc(27px * var(--t))/1.1 var(--display); color: var(--ink); text-align: center; white-space: nowrap; }
.fr-table thead th:first-child { padding-left: 4%; text-align: left; }
.fr-table--crops thead th:first-child { padding-left: 0; text-align: center; }
.fr-table tbody th, .fr-table td { height: 89px; padding: 4px 12px; text-align: center; vertical-align: middle; font-weight: 400; }
.fr-table .fr-col--wide { text-align: left; }
.fr-row { cursor: pointer; }
.fr-row:hover { background: rgb(255 248 228 / 0.6); }
.fr-row > * { background: linear-gradient(#af8956, #af8956) 0 100% / 100% 2px no-repeat; }
.fr-row > :first-child { background-position: 18px 100%; background-size: calc(100% - 18px) 2px; }
.fr-row > :last-child { background-size: calc(100% - 20px) 2px; }
.fr-row > td:not(:last-child) { background-image: linear-gradient(#b28958, #b28958), linear-gradient(#af8956, #af8956); background-size: 2px 48px, 100% 2px; background-position: 0 50%, 0 100%; background-repeat: no-repeat; }
.fr-item { display: flex; align-items: center; gap: 18px; padding-left: 12px; text-align: left; }
.fr-item__img { flex: none; width: 74px; height: 74px; object-fit: contain; image-rendering: auto; }
img.fr-item__img[src^="img/"] { image-rendering: pixelated; }
.fr-item__name { font: 700 calc(30px * var(--t))/1.1 var(--display); color: var(--ink); }
.fr-chev { position: relative; width: 52px; height: 52px; border: 0; background: none; cursor: pointer; }
.fr-chev::before { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; border: solid var(--burgundy); border-width: 0 4px 4px 0; transform: translate(-50%, -75%) rotate(45deg); transition: transform var(--hover); }
.fr-chev[aria-expanded="true"]::before { transform: translate(-50%, -25%) rotate(-135deg); }
.fr-detail > td { padding: 6px 30px 22px 36px; text-align: left; background: linear-gradient(#af8956, #af8956) 18px 100% / calc(100% - 38px) 2px no-repeat; }
.fr-detail__body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 40px; }
.fr-stages { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.fr-stages li { display: grid; justify-items: center; gap: 2px; font-size: 18px; color: var(--muted); }
.fr-stages img { width: 58px; height: 58px; image-rendering: pixelated; }
.fr-facts { flex: 1 1 440px; display: grid; gap: 5px; font-size: 20px; line-height: 1.35; }
.fr-facts > div { display: grid; grid-template-columns: 160px 1fr; gap: 14px; }
.fr-facts dt { font: 700 20px/1.35 var(--display); }
.fr-mats { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.fr-mat { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.fr-mat img { width: 36px; height: 36px; object-fit: contain; }
.fr-mat img[src^="img/"] { image-rendering: pixelated; }
/* Crop columns measured off the mockup's table; the other categories give their wide column the rest. */
.fr-table--crops { table-layout: fixed; }
.fr-table--crops th:nth-child(1) { width: 24.3%; }
.fr-table--crops th:nth-child(2) { width: 11.9%; }
.fr-table--crops th:nth-child(3) { width: 11.8%; }
.fr-table--crops th:nth-child(4) { width: 9%; }
.fr-table--crops th:nth-child(5) { width: 10.1%; }
.fr-table--crops th:nth-child(6) { width: 11.8%; }
.fr-table--crops th:nth-child(7) { width: 14.3%; }
.fr-table--crops th:nth-child(8) { width: 6.8%; }
.fr-table--crops tbody th { padding-right: 2px; }
.fr-table:not(.fr-table--crops) tbody td { font-size: 21px; }
.fr-table:not(.fr-table--crops, .fr-table--stock) thead th:first-child { width: 26%; }
:is(.fr-table--habitats, .fr-table--buildings, .fr-table--debris) th.fr-col--wide { width: 30%; }
:is(.fr-table--crafting, .fr-table--cooking) th:nth-child(2) { width: 17%; }
.fr-table:not(.fr-table--crops) .fr-item__name { font-size: calc(27px * var(--t)); }
.fr-table:not(.fr-table--stock) thead th:last-child { width: 6.8%; }

.fr-notes { display: grid; grid-template-columns: 47.6% 1fr; align-items: center; min-height: 90px; }
.fr-notes li { display: flex; align-items: center; justify-content: center; gap: 20px; padding-inline: 16px; font-size: 25px; line-height: 1.2; }
.fr-notes li + li { min-height: 48px; border-left: 2px solid #b28958; }
.fr-notes__icon { flex: none; width: 38px; height: 38px; color: var(--burgundy); }

/* The builder's stock: a short price list in two halves side by side, so it spans the panel. */
.fr-sub { margin: 32px 0 14px; font: 700 calc(30px * var(--t))/1.2 var(--display); color: var(--ink); }
.fr-stock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 30px; }
.fr-table--stock tbody th, .fr-table--stock td { height: 72px; border-bottom: 2px solid #af8956; }
.fr-table--stock tr:last-child > * { border-bottom: 0; }
.fr-table--stock td { width: 34%; }
.fr-table--stock .fr-item__img { width: 54px; height: 54px; }
.fr-table--stock .fr-item__name { font-size: calc(25px * var(--t)); }
.fr-table--stock thead th { padding-inline: 28px; }

.fr-loading { padding: 48px 0; text-align: center; color: var(--muted); }
.fr-empty { display: flex; align-items: center; justify-content: center; gap: 40px; padding: 36px 24px; text-align: left; }
.fr-empty .state__art { width: 260px; }
.fr-empty__text { display: grid; justify-items: start; gap: 8px; max-width: 430px; }
.fr-empty .state__title { font-size: calc(36px * var(--t)); }
.fr-empty .rule { width: 100%; margin: 0; }
.fr-empty .state__text { max-width: none; font-size: 22px; }

/* "Craft useful goods.": the cooking scene sits on the parchment and fades into it on its left and top. */
.fr-craft { display: grid; align-content: center; justify-items: start; min-height: calc(307px * var(--t)); padding: 30px 36px 34px 53px; }
.fr-craft__art { position: absolute; z-index: -1; top: 6px; right: 6px; bottom: 6px; width: 54%; overflow: hidden; }
.fr-craft__art img { --fade-l: 30%; --fade-t: 34%; width: 100%; height: 100%; object-fit: cover; object-position: 50% 64%; }
.fr-craft__title { font: 700 calc(60px * var(--t))/1 var(--display); color: var(--ink); }
.fr-craft__text { max-width: 460px; margin-top: 18px; font-size: 26.5px; line-height: 31px; color: var(--ink); }
.fr-craft__btn { min-width: 415px; min-height: 72px; margin-top: 30px; padding: 0 24px; font-size: 32px; }

/* ---- Below 1200 px the column is the window (no zoom): headings and art follow it down ---- */
@media (max-width: 1199px) and (min-width: 768px) {
  .farm { --t: 0.82; }
  .fo-hero__text, .fr-hero__text { padding-left: 34px; }
  .fo-hero__lede { max-width: 320px; font-size: 23px; line-height: 27px; }
  .fo-hero__btn, .fr-hero__btn, .fr-craft__btn { min-width: 0; min-height: 52px; font-size: 23px; }
  .fo-workers { padding-inline: 30px; }
  .fo-worker { column-gap: 10px; padding-right: 10px; }
  .fo-worker + .fo-worker { padding-left: 14px; }
  .fo-worker__role { height: 52px; }
  .fo-worker__text p { margin-left: 6px; font-size: 18px; line-height: 22px; }
  .fo-cities { padding-inline: 28px; }
  .fo-cities__list { gap: 18px; }
  .fo-city__name { height: 40px; font-size: 24px; }
  .fo-city__name::after { width: 160px; }
  .fo-price__coins { width: 70px; margin-right: 24px; }
  .fo-price__text { margin-left: 28px; padding-left: 28px; font-size: 20px; line-height: 24px; }
  .fo-plan__links a { font-size: 21px; }
  .fo-close__link { font-size: 21px; }
  .fr-crumb { font-size: 20px; }
  .fr-hero__lede { max-width: 400px; font-size: 21px; line-height: 26px; }
  .fr-body { padding: 32px 28px 26px; }
  .fr-tab { height: 56px; }
  .fr-tools { flex-wrap: wrap; gap: 14px 22px; }
  .fr-search__input.input, .fr-select .input { min-height: 50px; font-size: 21px; }
  .fr-table { font-size: 20px; }
  .fr-table:not(.fr-table--crops) tbody td { font-size: 18px; }
  .fr-table tbody th, .fr-table td { height: 74px; padding-inline: 8px; }
  .fr-item { gap: 14px; padding-left: 6px; }
  .fr-item__img { width: 60px; height: 60px; }
  .fr-notes li { font-size: 20px; }
  .fr-craft__text { max-width: 380px; font-size: 22px; line-height: 27px; }
}
@media (max-width: 1023px) and (min-width: 768px) {
  .farm { --t: 0.68; }
  .fo-hero { --art-w: 66%; }
  .fo-workers__list { margin-top: 16px; }
  .fo-worker { grid-template-columns: 1fr; row-gap: 10px; }
  .fo-worker__art { width: 78%; }
  .fo-worker__text { padding-top: 0; }
  .fo-worker__role { width: 78%; height: 46px; }
  .fo-worker__text p { margin: 10px 0 0 4px; font-size: 17px; }
  .fo-city__name { height: 34px; font-size: 20px; }
  .fo-city__name::after { width: 130px; height: 12px; background-size: 12px; }
  .fo-price { display: grid; grid-template-columns: auto auto; justify-content: center; padding-block: 16px; }
  .fo-price__coins { grid-row: span 2; }
  .fo-price__amount { padding: 2px 0 6px 28px; border-left: 2px solid #9a6a3a; }
  .fo-price__text { margin: 0; padding: 0 0 2px 28px; }
  .fo-plan__links a { font-size: 18px; }
  .fr-hero { --art-w: 58%; }
  .fr-hero__lede { max-width: 300px; }
  .fr-search { flex-basis: 100%; }
  .fr-filters { flex: 1; padding-left: 0; border-left: 0; }
  .fr-select { flex: 1; }
  .fr-select .input, .fr-select:not(.fr-select--city) .input { width: 100%; }
  .fr-table--crops { table-layout: auto; }
  .fr-table--crops th { width: auto !important; }
  .fr-table { font-size: 17px; }
  .fr-item__img { width: 44px; height: 44px; }
  .fr-notes li { font-size: 17px; }
  .fr-stock { gap: 18px; }
  .fr-craft__art { width: 50%; }
}

/* ---- Phones ---- */
@media (max-width: 767px) {
  .farm { margin-top: 4px; }

  .fo-title { font-size: 18px; line-height: 20px; }
  .fo-rule { width: 87%; margin-top: 2px; }
  .fo-rule.rule { height: 10px; gap: 6px; margin-bottom: 8px; }
  .fo-rule.rule > i { width: 10px; height: 10px; background-size: 10px; }

  /* The farm scene runs window-wide under the copy and rises beside the button. */
  .fo-hero { --band-art-h: auto; margin: 0 -5px calc(-2px - var(--gap)); }
  .fo-hero__text { padding: 6px 16px 0 25px; }
  .fo-hero__title { font-size: 21.5px; line-height: 19px; }
  .fo-hero__lede { max-width: 150px; margin-top: 7px; font-size: 11px; line-height: 12px; }
  .fo-hero__btn { min-width: 143px; min-height: 25px; margin-top: 11px; padding: 0 10px; font-size: 12.6px; }
  .fo-hero__art { min-height: 0; aspect-ratio: 724 / 334; margin-top: -56px; overflow: hidden; }
  .fo-hero__art img { --fade-l: 0%; --fade-r: 0%; --fade-t: 30%; --fade-b: 0%; object-position: 50% 40%; }
  .fo-hero__art .caption { right: 10px; bottom: 9px; font-size: 8px; }

  .fo-workers, .fo-cities, .fo-plan { padding: 6px 16px 10px; }
  .fo-workers { padding-bottom: 6px; }
  .fo-plan { padding-top: 2px; padding-bottom: 5px; }
  .fo-workers__list { grid-template-columns: 1fr; margin: 0 6px; }
  .fo-worker { grid-template-columns: 70px minmax(0, 1fr); column-gap: 18px; padding: 3px 0 3px 14px; }
  .fo-worker + .fo-worker { padding-left: 14px; border-left: 0; border-top: 1px solid #9a6a3a; }
  .fo-worker__art { aspect-ratio: 70 / 57; }
  .fo-worker__art::after { border-width: 4px; border-image-width: 8px; }
  .fo-worker__art, .fo-city { clip-path: var(--notch-sm); }
  .fo-worker__art img, .fo-city img { inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
  .fo-worker__text { padding-top: 4px; }
  .fo-worker__role { width: 75px; height: 23.5px; font-size: 13px; }
  .fo-worker__role.plate::before { border-width: 4px; border-image-width: 8px; clip-path: var(--notch-sm); }
  .fo-worker__text p { max-width: 145px; margin: 5px 0 0 6px; font-size: 11px; line-height: 12px; }

  .fo-cities__list { grid-template-columns: 1fr; gap: 6px; margin: 4px 6px 0; }
  .fo-city { aspect-ratio: 610 / 145; }
  .fo-city img { object-position: 50% 45%; }
  .fo-city::after { border-width: 4px; border-image-width: 8px; }
  .fo-city__name { left: 3px; right: 3px; bottom: 3px; height: 21px; font-size: 14px; }
  .fo-city__name::before { border-width: 2px; border-image-width: 4px; }
  .fo-city__name::after { width: 120px; height: 7px; background-size: 7px; }

  .fo-price { display: grid; grid-template-columns: auto 1fr; justify-content: start; min-height: 0; padding: 6px 14px 6px 26px; }
  .fo-price__coins { grid-row: span 2; width: 48px; margin-right: 18px; }
  .fo-price__amount { padding: 2px 0 2px 16px; border-left: 1px solid #9a6a3a; font-size: 16.7px; }
  .fo-price__text { max-width: 205px; margin: 0; padding: 0 0 2px 16px; border-left: 1px solid #9a6a3a; font-size: 10.3px; line-height: 12px; }

  .fo-plan__links { grid-template-columns: repeat(3, 1fr); margin: 0 -4px; background: none; }
  .fo-plan__links a { justify-self: stretch; padding: 3.5px 0; text-align: center; font-size: 13.7px; line-height: 18px; text-underline-offset: 3px; }
  .fo-plan__links a:nth-child(3n + 2) { border-inline: 1px solid #b28958; }
  .fo-plan__links a:nth-child(-n + 3) { box-shadow: 0 1px 0 #b28958; }

  .fo-close { min-height: 79px; padding: 10px 0 10px 13px; }
  .fo-close .frame__art { left: 40%; }
  .fo-close .frame__art img { --fade-l: 14%; }
  .fo-close__title { max-width: 150px; font-size: 18px; line-height: 17px; }
  .fo-close__link { margin-top: 5px; font-size: 9.6px; text-decoration-thickness: 2px; text-underline-offset: 3px; }

  /* The reference header keeps the workshop beside the copy, as the phone mockup draws it. */
  .fr-hero { flex-direction: row; align-items: center; --art-w: 58%; margin: 0 -5px calc(-2px - var(--gap)); }
  .fr-hero__art { position: absolute; inset: 0 0 0 auto; width: var(--art-w); height: auto; }
  .fr-hero__art img { --fade-l: 16%; --fade-t: 0%; --fade-r: 0%; --fade-b: 0%; }
  .fr-hero__text { padding: 8px 0 12px 15px; }
  .fr-crumb { gap: 5px; font-size: 12px; }
  .fr-crumb li + li::before { margin-right: 5px; }
  .fr-crumb a { text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .fr-hero__title { max-width: 180px; margin-top: 7px; font-size: 22px; line-height: 20px; }
  .fr-hero__lede { max-width: 150px; margin-top: 8px; font-size: 11px; line-height: 13px; }
  .fr-hero__btn { min-width: 146px; min-height: 31px; margin-top: 10px; padding: 0 8px; font-size: 13px; }

  .fr-body { padding: 11px 9px 14px; }
  .fr-tabs { display: flex; align-items: center; gap: 9px; }
  .fr-tabs__list { flex: 1; gap: 3px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .fr-tabs__list::-webkit-scrollbar { display: none; }
  .fr-tab { flex: 1 0 69px; height: 31px; padding: 0; font-size: 11px; scroll-snap-align: start; }
  .fr-tab:first-child { flex: 1 0 71px; }
  .fr-tab::before { border-width: 1px; box-shadow: inset 0 0 0 1px rgb(255 246 222 / 0.9), inset 0 -2px 0 1px rgb(150 100 50 / 0.2); }
  .fr-tab[aria-current="page"]::before { border-width: 4px; border-image-width: 8px; box-shadow: none; }
  .fr-tabs__arrow { display: block; flex: none; width: 14px; height: 31px; padding: 0; border: 0; background: none; cursor: pointer; }
  .fr-tabs__arrow::before { content: ''; display: block; width: 10px; height: 10px; margin: auto; border: solid var(--burgundy); border-width: 0 0 2.5px 2.5px; transform: translateX(2px) rotate(45deg); }
  .fr-tabs__arrow--next::before { transform: translateX(-2px) rotate(-135deg); }

  .fr-tools { display: grid; gap: 6px; margin: 12px 4px 0; }
  .fr-search__icon { left: 9px; width: 13px; height: 13px; margin-top: -6.5px; }
  /* 16 px keeps phones from zooming into the field on focus. */
  .fr-search__input.input { min-height: 27px; padding: 2px 8px 2px 35px; border-width: 1px; font-size: 16px; }
  .fr-filters-toggle { display: flex; align-items: center; gap: 12px; min-height: 30px; margin: 6px -1px 0; padding: 0 12px 0 20px; border: 1px solid #8f6534; border-radius: 3px; background: linear-gradient(#fbe6bf, #f3dbb0); font: 700 13.8px/1 var(--display); color: var(--ink); cursor: pointer; text-align: left; }
  .fr-filters-toggle svg { flex: none; width: 15px; height: 15px; }
  .fr-filters-toggle::after { content: ''; width: 7px; height: 7px; margin: -4px 4px 0 auto; border: solid var(--burgundy); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .fr-filters-toggle[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
  .fr-filters { display: none; gap: 8px; padding: 0; border: 0; }
  .fr-filters.is-open { display: grid; grid-template-columns: 1fr 1fr; }
  .fr-select .input, .fr-select:not(.fr-select--city) .input { width: 100%; min-height: 34px; padding: 2px 30px 2px 10px; border-width: 1px; font-size: 16px; background-position: right 10px center; background-size: 12px 8px; }

  /* Record sheets: one per row on phones, side by side once a phone or small tablet has the room. */
  .fr-panel { margin-top: 17px; }
  .fr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; gap: 11px; margin: 0 -1px; }
  .fr-card { position: relative; border: 1px solid #5b4636; border-radius: 3px; background: #fdecce; box-shadow: inset 0 0 0 1px rgb(255 252 232 / 0.8); overflow: hidden; }
  .fr-card__head { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 2px 16px; background: linear-gradient(#f7e2bb, #f2d6a5); list-style: none; cursor: pointer; }
  .fr-card__head::-webkit-details-marker { display: none; }
  details.fr-card > .fr-card__head::after { content: ''; width: 8px; height: 8px; margin: 3px 4px 0 auto; border: solid var(--burgundy); border-width: 0 2px 2px 0; transform: rotate(-135deg); }
  details.fr-card:not([open]) > .fr-card__head::after { margin-top: -4px; transform: rotate(45deg); }
  .fr-card__head img { flex: none; width: 39px; height: 39px; object-fit: contain; }
  .fr-card__head img[src^="img/"] { image-rendering: pixelated; }
  .fr-card__name { font: 700 18px/1.1 var(--display); color: var(--ink); }
  .fr-card__facts { margin: 0 8px 8px 9px; }
  .fr-card__facts > div { display: grid; grid-template-columns: minmax(96px, 36%) 1fr; border-bottom: 1px solid #c3a273; }
  .fr-card__facts dt { padding: 2px 6px 1px; background: #f3dcb0; font: 700 12.5px/15.5px var(--display); color: var(--ink); }
  .fr-card__facts dd { padding: 2px 11px 1px; font-size: 11px; line-height: 15.5px; overflow-wrap: anywhere; }
  .fr-card__facts .fr-mats { gap: 2px 10px; }
  .fr-card__facts .fr-mat img { width: 16px; height: 16px; }
  .fr-notes { display: grid; grid-template-columns: 1fr; min-height: 0; margin: 12px 0 0 15px; gap: 9px; }
  .fr-notes li { justify-content: flex-start; gap: 11px; padding-inline: 0; font-size: 11.8px; }
  .fr-notes li + li { min-height: 0; border: 0; }
  .fr-notes__icon { width: 17px; height: 17px; }
  .fr-sub { margin: 18px 0 8px; font-size: 15px; }

  .fr-empty { flex-direction: column; gap: 10px; padding: 18px 8px; text-align: center; }
  .fr-empty .state__art { width: 120px; }
  .fr-empty__text { justify-items: center; }
  .fr-empty .state__title { font-size: 20px; }
  .fr-empty .state__text { font-size: 14px; }

  /* Title across the top, the text and the cooking scene side by side under it. */
  .fr-craft { grid-template-columns: minmax(0, 37fr) minmax(0, 63fr); align-content: start; min-height: 0; padding: 16px 14px 14px; }
  .fr-craft__title { grid-column: 1 / -1; font-size: 24px; }
  .fr-craft__text { grid-area: 2 / 1; margin: 8px 0 0 3px; font-size: 11.2px; line-height: 14px; }
  .fr-craft__art { position: relative; inset: auto; grid-area: 2 / 2; justify-self: end; width: 100%; max-width: 340px; aspect-ratio: 226 / 110; margin-top: 2px; }
  .fr-craft__art img { --fade-l: 18%; --fade-t: 22%; object-position: 50% 62%; }
  .fr-more { grid-column: 1 / -1; width: 100%; margin-top: 10px; border-width: 1px; }
  .fr-more > summary { min-height: 30px; padding: 4px 12px; font: 700 13px/1.2 var(--display); justify-content: space-between; }
  .fr-more > summary::before { order: 2; width: 7px; height: 7px; border-width: 0 2px 2px 0; border-color: var(--burgundy); transform: rotate(45deg); }
  .fr-more[open] > summary { background: none; color: var(--ink); }
  .fr-more[open] > summary::before { transform: rotate(-135deg); }
  .fr-more .accordion__body { display: grid; gap: 8px; padding: 4px 12px 12px; font-size: 12px; }
  .fr-craft__btn { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 38px; margin-top: 11px; font-size: 16.2px; }
}

/* ---- Large phones and small tablets in portrait: the workers and cities sit side by side again ---- */
@media (min-width: 560px) and (max-width: 767px) {
  .fo-hero__art { max-height: 250px; }
  .fo-workers__list { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 6px 0 4px; }
  .fo-worker { grid-template-columns: 1fr; row-gap: 6px; padding: 0 10px; }
  .fo-worker + .fo-worker { padding-left: 10px; border-top: 0; border-left: 1px solid #9a6a3a; }
  .fo-worker__art { aspect-ratio: 147 / 120; }
  .fo-worker__text p { max-width: none; }
  .fo-cities__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fo-city { aspect-ratio: 302 / 252; }
  .fr-tabs__arrow { display: none; }
}
