/* VOICE   a tavern's trade catalogue: warm, dark, gilded, a little playful
   IDEA    each shop is a page of the Mug & Market catalogue, held up over the tavern
   PICTURE partner cut-outs on their shop colours; damage tiles; the tavern stays put behind
   COLOUR  near-black panel, cream text, gold accents; rarity and damage colours carry meaning
   TYPE    Young Serif titles, Sorts Mill Goudy labels, Jost body
   LAYOUT  phone first: shop list -> item page; groups get their own designed blocks */

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; margin: 0; font: var(--t-body)/1.55 var(--f-body); color: var(--cream); background: #141210; overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

/* Fixed tavern backdrop (a fixed layer, since iPhones ignore background-attachment: fixed) */
/* Sized to the phone's largest viewport (address bar hidden), so it doesn't stretch or jump
   when the browser bar slides in and out while scrolling. */
.backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none;
  background: #141210 url("../assets/img/bg-tavern.jpg") center top / cover no-repeat; transform: translateZ(0); }
@media (max-width: 700px) { .backdrop { background-image: url("../assets/img/bg-tavern-sm.jpg"); } }
.backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(12, 10, 8, 0.4); }

/* Site bar */
.bar { position: sticky; top: 0; z-index: 10; background: rgba(20, 18, 16, 0.97); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); transition: transform .25s ease; }
.bar-hidden .bar { transform: translateY(-100%); }
.bar-in { max-width: 1400px; margin: 0 auto; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 10px; }
.brand { flex: none; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); min-height: 44px; }
.brand img { width: 40px; height: 40px; }
.brand span { display: none; font: 24px/1 var(--f-title); }
.brand b { font-weight: 400; color: var(--gold); }
.tabs { overscroll-behavior-x: contain; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; margin-left: auto; padding: 2px; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--rule); color: var(--cream); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; scroll-snap-align: start; }
.tabs a + a { margin-left: -1px; }
.tabs a:hover { position: relative; z-index: 1; border-color: var(--gold-dark); }
.tabs a[aria-current] { position: relative; z-index: 2; }
.tabs a[aria-current] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
@media (min-width: 900px) { .brand span { display: inline; } }

main:focus { outline: none; }
main { max-width: 1100px; margin: 0 auto; padding: 14px max(12px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.panel { background: var(--panel); padding: 20px 16px 24px; }
@media (min-width: 700px) { main { padding: 32px 24px 56px; } .panel { padding: 32px; } }
.two { margin: 0; font: 400 clamp(34px, 9vw, 60px)/1.05 var(--f-title); text-wrap: balance; }
.two span { display: block; }
.two span + span { color: var(--gold); }
.h2 { margin: 28px 0 12px; font: 400 26px/1.15 var(--f-title); }
.nb { margin: 28px 0 0; font: var(--t-small)/1.4 var(--f-title); color: var(--muted); }
.bold { font-weight: 700; }

/* Gold corner brackets, the deck's side-panel frame */
.bracket { position: relative; background: var(--side); padding: 18px 18px 20px; margin: 16px 0; }
.bracket::before, .bracket::after { content: ""; position: absolute; width: 26px; height: 26px; border: 2px solid var(--gold-dark); pointer-events: none; }
.bracket::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.bracket::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.bracket h3 { margin: 0 0 8px; font: 400 22px/1.2 var(--f-title); }
.quote { margin-top: 14px; }
.quote b { display: block; font: 400 17px/1.3 var(--f-title); }
.disclaimer { margin-top: 12px; font-size: 13px; line-height: 1.45; color: #d4d4d4; }

/* Home */
.hero { display: grid; gap: 16px; margin-bottom: 8px; }
.hero-title { display: flex; align-items: center; gap: 14px; }
.hero-title img { width: 84px; flex: none; }
.hero .art { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 2px solid var(--gold-dark); transition: border-color .2s; }
.art-link { position: relative; display: block; text-decoration: none; }
.art-link span { position: absolute; right: 2px; bottom: 2px; padding: 8px 14px; background: rgba(32, 32, 32, .88); color: var(--cream); font: 400 18px/1.2 var(--f-title); }
.art-link:hover .art, .art-link:focus-visible .art { border-color: var(--gold); }
.art-link:hover span, .art-link:focus-visible span { color: var(--gold); }
@media (min-width: 800px) { .hero-title img { width: 110px; } }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; background: var(--cream); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card { display: flex; justify-content: space-between; flex-direction: column; text-decoration: none; color: var(--cream); background: var(--shop); position: relative; overflow: hidden; transition: transform .2s ease; }
.card:hover, .card:focus-visible { transform: translateY(-3px); }
.card-name { padding: 10px 12px 6px; font: 400 clamp(18px, 4.8vw, 24px)/1.12 var(--f-title); }
.card-name span { display: block; }
.card-name span + span { color: var(--gold); }
.card-pic { position: relative; aspect-ratio: 480 / 544; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.card-pic::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: var(--gold-dark); clip-path: polygon(0 100%, 100% 22%, 100% 100%); }
/* Portraits are pre-cropped by scripts/make_portraits.py so every head is the same size and height */
.card-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-pic.logo-only { align-items: center; justify-content: center; padding: 16px; }
.card-pic.logo-only::before { display: none; }
.card-pic.logo-only img { position: static; width: 72%; height: auto; }
/* The shop logo straddles the line between portrait and nameplate, as in the deck.
   Sizes use the card's own width (cqw) so it scales the same at every column count. */
.card { container-type: inline-size; }
.card-foot { position: relative; background: #202020; padding: 10px 12px 12px; display: grid; gap: 6px; }
.card-foot:has(.card-logo) { padding-top: calc(26cqw + 4px); }
.card-logo { position: absolute; left: 4cqw; top: 0; width: 66cqw; height: 46cqw; transform: translateY(-44%); object-fit: contain; object-position: left center; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)); z-index: 1; }
.card-foot .cat { font: 400 clamp(15px, 9cqw, 22px)/1.12 var(--f-title); text-align: right; }
.card-foot .cat span { display: block; }
.card-foot .cat span + span { color: var(--gold); }
.card-count { position: absolute; top: 8px; right: 8px; font-size: 12px; background: rgba(20, 18, 16, .78); padding: 1px 7px; }

/* Shop header */
.shop-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 14px; margin-bottom: 18px; }
.shop-head .logo { width: clamp(150px, 46vw, 300px); height: clamp(110px, 32vw, 210px); object-fit: contain; object-position: right center; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.shop-head .cat { grid-column: 1 / -1; margin: 0; font: 400 26px/1.1 var(--f-title); }
.shop-head .cat span + span { color: var(--gold); }
.shop-head.no-partner .two { grid-column: 1; }

/* Item list */
.list { display: grid; gap: 8px; }
.li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border: 1px solid #5b5650; background: rgba(20, 18, 16, .55); text-decoration: none; color: var(--cream); }
.li:hover { border-color: var(--gold-dark); }
.li .n { font: 400 20px/1.2 var(--f-title); color: var(--rc); }
.li .meta { margin-top: 2px; }
/* Row sub-lines, shared by shop lists, stat rows and the Index */
.li .att, .ix .att { display: block; margin-top: 2px; font: 400 15px/1.2 var(--f-label); color: var(--cream); }
.li .perk, .ix .perk { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.item-head .lede { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.li::after { content: "›"; font: 400 28px/1 var(--f-title); color: var(--gold); }
.meta { font: var(--t-label)/1.35 var(--f-label); color: var(--cream); }
.meta .rar { color: var(--rc); }

/* Group blocks */
.group { margin: 22px 0; }
.group-title { margin: 0; font: 400 26px/1.15 var(--f-title); }
.group-title small { display: block; font: var(--t-label)/1.3 var(--f-label); }
.tiles { display: grid; gap: 6px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: grid; grid-template-columns: 112px 1fr; min-height: 84px; text-decoration: none; color: var(--cream); background: #25221d; border: 1px solid #4a4540; }
.tile .dt { background: var(--tile); color: var(--tile-ink, #fff6e2); padding: 10px; font: 400 20px/1.15 var(--f-title); display: flex; align-items: flex-start; }
.tile .tm { padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-content: center; font-size: 14px; font-weight: 700; line-height: 1.45; }
.tile .tm span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.tile:hover { border-color: var(--gold-dark); }
/* Stat rows: a list row with the group's stat (e.g. Armour Class) in a small badge on the right */
.stat-row { grid-template-columns: 1fr auto auto; padding-top: 8px; padding-bottom: 8px; }
.stat-row .stat, .ix .stat { min-width: 40px; text-align: right; font: 400 22px/1 var(--f-title); color: var(--cream); white-space: nowrap; }
.stat-row .stat .plus, .ix .stat .plus { display: block; margin-top: 3px; font: 700 12px/1 var(--f-body); }
.stat-row .stat.dice, .ix .stat.dice { font-size: 21px; }
.stat-row .stat.dice .plus, .ix .stat.dice .plus { margin-top: 2px; font: inherit; }
.stat-row .stat small, .ix .stat small { display: block; margin-bottom: 3px; font: 600 10px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.group-note { margin: 2px 0 10px; padding-left: 10px; border-left: 2px solid var(--gold-dark); font-size: 14px; line-height: 1.45; color: var(--muted); }
.group-note p { margin: 0; }
.group-note b, .group-note strong { color: var(--cream); font-weight: 600; }
/* "New" tag after an item's name */
.new-tag { display: inline-block; vertical-align: 0.2em; margin-left: 6px; padding: 2px 6px 1px; background: var(--gold); color: var(--ink); font: 700 10px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; }
.item-head h1 .new-tag { font-size: 12px; vertical-align: 0.5em; }
/* Featured items on the home page */
/* Showcase: the café painting with the featured items laid over its lower half */
.showcase { position: relative; margin: 4px 0 26px; border: 2px solid var(--gold-dark); background: #141210; }
.showcase .art-link .art { display: block; border: 0; aspect-ratio: 3 / 2; }
.showcase .art-link span { top: auto; right: auto; bottom: 10px; left: 10px; }  /* bottom left, clear of the café sign */
/* The band under the painting: the same painting, blurred and dimmed, so it reads as part of the picture */
.feat-wrap { position: relative; overflow: hidden; padding: 12px 0 12px; border-top: 1px solid var(--gold-dark); }
.feat-wrap::before { content: ""; position: absolute; inset: -30px; background: url("../assets/img/cafe-painting.webp") center 85% / cover no-repeat; filter: blur(16px) brightness(.42) saturate(1.3); }
.feat-wrap > * { position: relative; }
.feat-label { display: inline-block; margin: 0 0 0 14px; padding: 5px 10px 4px; background: var(--gold); color: var(--ink); font: 400 15px/1 var(--f-title); letter-spacing: .12em; text-transform: uppercase; }
.featured { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 14px; margin: 0; padding: 10px 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 14px; scrollbar-width: none; }
.featured > .feat { scroll-snap-align: start; }
.feat-dots { display: flex; justify-content: center; gap: 8px; margin: 2px 0 0; }
.feat-dots span { width: 7px; height: 7px; border: 1px solid var(--gold-dark); transform: rotate(45deg); }
.feat-dots span.on { background: var(--gold); border-color: var(--gold); }
@media (min-width: 760px) {
  .showcase .art-link .art { aspect-ratio: 21 / 7; }
  .feat-wrap { padding: 14px 18px 18px; }
  .feat-label { margin: 0 0 4px; }
  .featured { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); grid-auto-columns: auto; padding: 4px 0 0; overflow: visible; }
  .feat-dots { display: none; }
}
.feat { position: relative; display: block; margin: 0; padding: 12px 14px 13px 18px; background: rgba(32, 30, 27, .92); border: 1px solid var(--gold-dark); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); text-decoration: none; color: var(--cream); }
.feat-strip { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.feat-shop { display: block; margin-bottom: 4px; font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.feat .n { display: block; font: 400 21px/1.15 var(--f-title); color: var(--rc); }
.feat .att { display: block; margin-top: 3px; font: 400 15px/1.2 var(--f-label); }
.feat .perk { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.feat:hover .n { text-decoration: underline; text-underline-offset: 3px; }
/* Quad: four tiles in a 2×2, each in its element's colours, split by a thin gold cross */
.quad { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 3px; background: var(--gold-dark); border: 1px solid var(--gold-dark); }
.quad:not(.full) { background: none; border: 0; gap: 8px; }
.quad-tile { display: grid; align-content: start; gap: 8px; padding: 14px 14px 16px; min-height: 140px; text-decoration: none; background: var(--qb); color: var(--qt); }
.quad-tile .glyph { width: 26px; height: 26px; opacity: .85; }
.quad-tile .dt { font: 400 24px/1.1 var(--f-title); }
.quad-tile .tm { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.quad-tile .tm span { color: inherit !important; }
.quad-tile .tm span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.quad-tile:hover { filter: brightness(1.08); }
.quad.full .quad-tile:nth-child(even) { padding-left: 28px; }  /* keep text clear of the centre ring */
.quad.full .quad-tile:nth-child(odd) { padding-right: 24px; }
/* A diamond "porthole" where the lines cross: the panel shows through, edged in the same gold line as the cross */
.quad-ring { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; background: #1c1a18; border: 3px solid var(--gold-dark); transform: rotate(45deg); pointer-events: none; }
.q-air { --qb: #dfe9ea; --qt: #24323a; }
.q-fire { --qb: #eb6b34; --qt: #fff6e2; }
.q-water { --qb: #2f6f9f; --qt: #fff6e2; }
.q-earth { --qb: #6e5a3a; --qt: #fff6e2; }
/* Yin-yang pair: a black tile and a white tile side by side */
.yy { position: relative; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #4a4540; }
.yy-half { display: grid; align-content: start; gap: 8px; padding: 14px 14px 16px; min-height: 120px; text-decoration: none; }
.yy-half .dt { font: 400 22px/1.15 var(--f-title); }
.yy-half .tm { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; font-size: 14px; font-weight: 700; line-height: 1.45; }
.yy-half .tm span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.yy-half.dark { background: #141210; color: var(--cream); }
.yy-half.light { background: var(--cream); color: #202020; --r-common: #202020; }
.yy-half.light .tm span { filter: brightness(.62) saturate(1.4); } /* rarity colours, darkened to read on cream */
/* S-shaped seam between the halves, echoing the yin-yang curve, with a gold line along it */
.yy::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; z-index: 1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 100' preserveAspectRatio='none'%3E%3Crect width='44' height='100' fill='%23fff6e2'/%3E%3Cpath d='M0 0H22C44 25 0 75 22 100H0Z' fill='%23141210'/%3E%3Cpath d='M22 0C44 25 0 75 22 100' fill='none' stroke='%23e1b05c' stroke-width='1.6' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.yy-half.dark { padding-right: 26px; }
.yy-half.light { padding-left: 26px; }
.yy-half:hover { box-shadow: inset 0 0 0 2px var(--gold-dark); }
.menu-sec { margin-top: 6px; }
.menu-sec ~ .menu-sec { margin-top: 22px; }
.tier { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px; margin-bottom: 8px; border: 1px solid #5b5650; background: rgba(20, 18, 16, .55); text-decoration: none; color: var(--cream); }
.tier .n { font: 400 22px/1.2 var(--f-title); color: var(--rc); }
.tier .ac { font-size: 18px; font-weight: 700; grid-column: 1; }
.tier .ac small { display: block; font: 13px/1.3 var(--f-body); font-weight: 400; color: var(--muted); }
.tier .tm { grid-column: 1 / -1; font-size: 14px; font-weight: 700; line-height: 1.5; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
.tier .tm span:nth-child(even) { text-align: right; }
.tier::after { content: "›"; grid-row: 1 / 3; grid-column: 2; align-self: center; font: 400 28px/1 var(--f-title); color: var(--gold); }

/* Item page */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 500; text-decoration: none; }
.item-head { margin: 6px 0 14px; }
.item-head h1 { margin: 0; font: 400 clamp(30px, 8vw, 44px)/1.1 var(--f-title); color: var(--rc); text-wrap: balance; }
.item-head .meta { font-size: 19px; margin-top: 4px; }
.note { margin-top: 6px; font: 16px/1.4 var(--f-label); color: var(--muted); }
.says { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.says img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--shop); border: 2px solid var(--gold-dark); }
.says img.logo { object-fit: contain; background: #141210; padding: 4px; }  /* shops without a partner (Cogsta) use their logo */
.desc p { max-width: 70ch; }
.desc .stat { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.kw { font-weight: 700; color: var(--k); }
.mats { margin-top: 18px; border: 1px solid #7e7d7c; }
.mats h2 { margin: 0; padding: 6px 14px; background: var(--gold); color: var(--ink); font: 400 22px/1.3 var(--f-title); }
.mats .rows { display: grid; grid-template-columns: 1fr 64px; }
.mats .m { padding: 7px 14px 0; font-weight: 700; color: var(--mc); }
.mats .q { padding: 7px 14px 0 0; font-weight: 700; color: var(--mc); text-align: right; background: var(--shade); font-variant-numeric: tabular-nums; }
.mats a { color: inherit; text-decoration: none; }
.mats a::after { content: " ›"; color: var(--gold); text-decoration: none; display: inline-block; margin-left: 2px; }
.mats a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mats .m small { font: 400 12px/1 var(--f-body); color: var(--muted); margin-left: 4px; }
.mats.used { margin-top: 14px; }
.mats.used h2 { background: transparent; color: var(--gold); border-bottom: 1px solid #7e7d7c; }
.mats .rows > :nth-child(1), .mats .rows > :nth-child(2) { padding-top: 12px; }
.mats .rows > :nth-last-child(1), .mats .rows > :nth-last-child(2) { padding-bottom: 12px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule); text-decoration: none; color: var(--cream); max-width: 48%; }
.pager a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager a:hover { border-color: var(--gold); }
.enter { animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Drinks menu */
.drink { margin-bottom: 14px; }
.drink a { color: var(--cream); text-decoration: none; }
.drink h3 { margin: 0; font: 400 21px/1.25 var(--f-title); }
.drink .contains { margin: 8px 0 0; font: 400 16px/1.5 var(--f-title); }
.drink ul { margin: 4px 0 0; padding-left: 20px; font: 400 16px/1.5 var(--f-title); }
.plush { margin-top: 24px; background: var(--cream); color: var(--ink); padding: 16px; }
.plush h2 { margin: 0; font: 400 32px/1.1 var(--f-title); color: #b8862e; }
.plush .lead { margin: 6px 0 12px; font: 400 18px/1.25 var(--f-title); }
.plush .pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plush figure { margin: 0; position: relative; }
.plush figure img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.plush figcaption { position: absolute; top: 8px; left: 10px; font: 400 26px/1 var(--f-title); color: var(--cream); text-shadow: 0 2px 0 #202020, 0 0 6px #202020; }
.plush .pnote { margin: 10px 0 0; font: 400 15px/1.35 var(--f-title); }
.plush .foot { margin-top: 12px; font: italic 400 16px/1.3 var(--f-title); }

/* Shop sections (subtabs) */
.subtabs { position: sticky; top: calc(61px + env(safe-area-inset-top)); transition: top .25s ease; z-index: 6; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 16px; padding: 10px 16px; background: rgba(32, 32, 32, 0.97); border-bottom: 1px solid var(--rule); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-bottom: 3px solid transparent; color: var(--cream); text-decoration: none; font: 400 19px/1 var(--f-title); white-space: nowrap; }
.subtabs a small { font: 500 12px/1 var(--f-body); color: var(--muted); }
.subtabs a[aria-current] { color: var(--gold); border-bottom-color: var(--gold); }
@media (min-width: 700px) { .subtabs { margin: 0 -32px 20px; padding: 10px 32px; } }

/* Index */
.find { display: grid; gap: 6px; margin: 16px 0 10px; font-size: 14px; color: var(--muted); }
.find input { width: 100%; min-height: 48px; padding: 0 14px; background: #141210; border: 1px solid var(--rule); color: var(--cream); font: 16px var(--f-body); }
.find input:focus { border-color: var(--gold); outline: none; }
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; margin-bottom: 8px; }
.letters button { min-width: 36px; min-height: 40px; background: none; border: 1px solid var(--rule); color: var(--gold); font: 400 17px/1 var(--f-title); cursor: pointer; }
.letters button:hover { border-color: var(--gold); }
.letters button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.letters button:disabled { color: #5b5650; border-color: #3a3632; cursor: default; }
.letter { margin: 20px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--gold-dark); font: 400 26px/1 var(--f-title); color: var(--gold); }
.ix { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 10px 2px; border-bottom: 1px solid #3a3632; text-decoration: none; color: var(--cream); }
.ix:hover .n { text-decoration: underline; text-underline-offset: 3px; }
.ix .n { font: 400 19px/1.25 var(--f-title); color: var(--rc); }
.ix .shop { font-size: 13px; color: var(--muted); text-align: right; }
.ix .meta { grid-column: 1 / -1; font-size: 15px; }
.ix .sub { grid-column: 1 / -1; }
.ix .sub:empty { display: none; }
.ix.has-stat .sub { grid-column: 1; }
.ix .stat { grid-column: 2; grid-row: 2 / span 2; justify-self: end; align-self: start; padding-top: 4px; }
.empty { color: var(--muted); padding: 16px 0; }

/* Image loading: a spinning Cogsta cog until each picture arrives, then a short fade */
img.pending { background: url("../assets/img/cog-spinner.svg") center / min(56px, 50%) no-repeat; min-height: 56px; min-width: 56px; }
img.shown { animation: fade .35s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.filters { margin: 4px 0 10px; border: 1px solid var(--rule); background: rgba(20, 18, 16, .55); }
.filters summary { min-height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 14px; cursor: pointer; font: 400 19px/1 var(--f-title); list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "›"; margin-left: auto; color: var(--gold); font-size: 26px; transition: transform .2s; }
.filters[open] summary::after { transform: rotate(90deg); }
.filters summary span { color: var(--gold); font: 500 15px var(--f-body); }
.filters fieldset { border: 0; margin: 0; padding: 4px 14px 10px; }
.filters legend { padding: 0; margin-bottom: 6px; font: var(--t-label)/1.2 var(--f-label); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 12px; background: none; border: 1px solid var(--rule); color: var(--cream); font: 500 15px var(--f-body); cursor: pointer; }
.chip.rar { color: var(--rc); }
.chip:hover { border-color: var(--gold-dark); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.clear { margin: 2px 14px 14px; min-height: 40px; padding: 0 12px; background: none; border: 0; color: var(--gold); font: 500 15px var(--f-body); text-decoration: underline; cursor: pointer; }
.count { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.ix .type { color: var(--muted); font-family: var(--f-label); }

/* Phone touches */
.bar-hidden .subtabs { top: env(safe-area-inset-top); }
.subtabs { overscroll-behavior-x: contain; }
/* Element edge: a strip down the left of a row, split into equal bands when an item has several elements */
.li[data-el], .tier[data-el], .ix[data-el] { position: relative; }
.li[data-el]::before, .tier[data-el]::before, .ix[data-el]::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 5px; background: var(--strip); }
.li[data-el], .tier[data-el] { padding-left: 18px; }
.ix[data-el] { padding-left: 14px; }
.ix[data-el]::before { left: 0; top: 6px; bottom: 6px; width: 4px; }
.tier[data-el]::after { grid-row: 1 / 3; }
.el-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.el-chip { padding: 4px 10px; font: 400 16px/1.2 var(--f-title); color: #fff6e2; text-decoration: none; }
.el-chip.lt { color: #202020; }
.el-chip:hover { filter: brightness(1.12); }
.el-rule { height: 4px; margin-top: 14px; }
.chip.el { border-left: 5px solid var(--tab); }
.li:active, .tile:active, .tier:active, .ix:active, .card:active, .pager a:active, .chip:active { filter: brightness(1.25); }
.ix { content-visibility: auto; contain-intrinsic-size: auto 64px; }
@media (hover: none) { .card:hover { transform: none; } }

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  /* Top bar: plain text links with a gold underline, matching the shop section tabs */
  .tabs { padding: 0; gap: 4px; align-self: stretch; }
  .tabs a { border: 0; border-bottom: 3px solid transparent; margin: 0; min-height: 0; height: 100%; padding: 3px 12px 0; font: 400 18px/1 var(--f-title); }
  .tabs a + a { margin-left: 0; }
  .tabs a:hover { border-bottom-color: rgba(195, 156, 79, .5); }
  .tabs a[aria-current] { background: none; color: var(--gold); border-bottom-color: var(--gold); }
  .tabs a:nth-child(2) { margin-right: 14px; position: relative; }
  .tabs a:nth-child(2)::after { content: ""; position: absolute; right: -9px; top: 50%; height: 22px; margin-top: -11px; border-right: 1px solid var(--rule); }
  .bar-in { padding-top: 0; padding-bottom: 0; }
  .brand { min-height: 60px; }
}
@media (min-width: 1024px) and (max-width: 1239px) {
  .brand span { display: none; }
  .tabs a { padding-left: 10px; padding-right: 10px; }
}
@media (min-width: 1024px) {
  main { max-width: 1320px; padding-top: 36px; }
  .panel { padding: 36px 44px 40px; }

  /* Shop header laid out like the deck: partner left, logo centre, category right */
  .shop-head { grid-template-columns: 1fr auto 1fr; gap: 24px; margin-bottom: 24px; }
  .shop-head .two { font-size: 64px; }
  .shop-head .logo { width: 400px; height: 250px; object-position: center; grid-column: 2; grid-row: 1; margin: -28px 0 -16px; }
  .shop-head .cat { grid-column: 3; grid-row: 1; text-align: right; font-size: 40px; line-height: 1.1; }
  .shop-head .cat span { display: block; }
  .shop-head.no-partner { grid-template-columns: 1fr auto; }

  .subtabs { margin: 0 -44px 24px; padding: 10px 44px; top: 61px; }

  /* List on the left, details on the right */
  .split { display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; gap: 32px; align-items: start; }
  .split-list .group { margin-top: 0; }
  .split-list .li[aria-current], .split-list .tile[aria-current], .split-list .tier[aria-current] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
  .split-pane { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--gold-dark) transparent; }
  .pane-in { background: rgba(20, 18, 16, .6); border: 1px solid #5b5650; padding: 24px 28px; }
  .pane-in .item-head h1 { font-size: 38px; }
  .split-pane .nb { margin-top: 14px; padding: 0 4px; }
  .pane-empty { display: grid; justify-items: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); font: 400 19px/1.3 var(--f-title); }
  .pane-empty img { width: 70%; max-width: 340px; aspect-ratio: 480 / 544; object-fit: cover; object-position: top; background: var(--shop); border-bottom: 3px solid var(--gold-dark); }
  .pane-empty img.logo-only { aspect-ratio: auto; object-fit: contain; background: none; border: 0; width: 50%; }
  .tiles { grid-template-columns: 1fr; }

  /* Item page (when opened from the Index) gets a readable column */
  .panel > div > .item-head, .panel > div > .desc, .panel > div > .mats, .panel > div > .pager, .panel > div > .says { max-width: 860px; }

  /* Index: filters as a sidebar */
  .ix-layout { display: grid; grid-template-columns: 300px 1fr; gap: 36px; align-items: start; }
  .ix-side { position: sticky; top: 90px; }
  .ix-side .filters summary { pointer-events: none; }
  .ix-side .filters summary::after { display: none; }
  .ix { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; align-items: center; padding: 10px 6px; }
  .ix .meta { grid-column: 2; grid-row: 1; }
  .ix .sub { grid-column: 2; grid-row: 1; justify-self: start; text-align: left; }
  .ix .sub .att, .ix .sub .perk { margin-top: 0; }
  .ix .shop { grid-column: 3; font-size: 14px; }
  .ix { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto 64px; }
  .ix.has-stat .sub { grid-column: 2; }
  .ix .stat { grid-column: 4; grid-row: 1; align-self: center; padding-top: 0; }

  /* Drinks page: menu and plushies side by side */
  .menu-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
  .menu-layout .plush { margin-top: 16px; }
}
