/* Neutral mobile-first theme. The accent colour comes from assets/theme.css (--accent, written by build.mjs); the page loads theme.css AFTER this file, so its :root values override the defaults below. */
:root {
  --bg: #0f1115; --fg: #e8eaee; --muted: #8b93a1; --card: #171a21; --line: #272c36;
  --good: #3ecf8e; --warn: #f2b34a; --bad: #ef6a6a; --accent: #77ccff;
  color-scheme: dark light;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f7f9; --fg: #14171c; --muted: #5d6675; --card: #fff; --line: #dde1e8; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.top nav a { color: var(--muted); text-decoration: none; padding: .2rem 0; }
.top nav a[aria-current="page"] { color: var(--fg); border-bottom: 2px solid var(--accent); }

main, footer { max-width: 760px; margin: 0 auto; padding: 1rem; }
footer { padding-bottom: 3rem; font-size: .85rem; }
#banner { max-width: 760px; margin: 0 auto; padding: 0 1rem; }
.stack > * + * { margin-top: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.card.small { font-size: .9rem; }
.hero { padding: 1.25rem 0 .25rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.badge { display: inline-block; padding: .15rem .7rem; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; }
.badge.open { color: var(--good); border-color: var(--good); }
.badge.soon { color: var(--warn); border-color: var(--warn); }
.badge.soldout, .badge.closed { color: var(--bad); border-color: var(--bad); }

.counter { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.counter small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin: .6rem 0 .8rem; }
.bar .fill { height: 100%; width: 0; background: var(--accent); }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; overflow-wrap: anywhere; }
.amount { font-size: 1.3rem; }

.btn { display: inline-block; font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #05121c; font-weight: 600; }
.btn:hover { border-color: var(--accent); }
.chip { display: inline-block; font: inherit; font-size: .85rem; color: var(--fg); border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .2rem .7rem; margin: 0 .2rem .3rem 0; cursor: pointer; text-decoration: none; }
.chip.on { border-color: var(--accent); color: var(--accent); }

input[type="number"], input[type="text"] { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; min-height: 40px; width: 100%; }
.stepper { display: flex; gap: .5rem; align-items: stretch; }
.stepper input { text-align: center; max-width: 7rem; }
.stepper.wide input { max-width: none; text-align: left; }
.label { display: block; margin-bottom: .4rem; color: var(--muted); }
.addr { word-break: break-all; font-size: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; }
.note-text { white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; }

.note { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .5rem 0; }
.note.warn { border-color: var(--warn); }
.note.info { border-color: var(--accent); }

.steps { padding-left: 1.3rem; }
.steps li { margin: .5rem 0; }
.shots { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shots img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.shots figcaption { color: var(--muted); font-size: .85rem; }

.grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tile { margin: 0; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: center; }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.tile .ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; color: var(--muted); font-size: 1.2rem; }
.tile figcaption { padding: .25rem; font-size: .8rem; color: var(--muted); }

.rows .row { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .6rem; overflow-wrap: anywhere; }
.row.good { border-left-color: var(--good); }
.row.warn { border-left-color: var(--warn); }
.row.bad { border-left-color: var(--bad); }
.row .top { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .4rem .3rem; border-bottom: 1px solid var(--line); }
.tbl .num { text-align: right; }

@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---- market (MARKET-SPEC M9). Mobile first: a 360 px screen must never scroll sideways. ---- */
.top nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.top nav a { white-space: nowrap; }
@media (min-width: 640px) { .top nav { flex-wrap: wrap; overflow-x: visible; } }
img { max-width: 100%; height: auto; }
.banner-img { display: block; width: 100%; border-radius: 12px; }
.logo-img { display: block; width: 72px; height: 72px; margin-bottom: .5rem; }
.concept-img { display: block; width: 100%; border-radius: 10px; }
.item-img { image-rendering: auto; }

.note.good { border-color: var(--good); }
.note.bad { border-color: var(--bad); }
.note.banner { margin: .5rem 0; font-weight: 600; }
.row.neutral { border-left-color: var(--line); }
.badge.soon { white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .6rem; }
.stat { display: flex; flex-direction: column; text-align: center; }
.stat .v { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.stat .k { color: var(--muted); font-size: .8rem; }

.filters .filter-row, .trait-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; min-height: 40px; max-width: 100%; }
.filter-row input[type="text"] { width: auto; flex: 1 1 8rem; }
.check { display: flex; align-items: flex-start; gap: .5rem; margin: .5rem 0; }
.check input { margin-top: .3rem; flex: none; }

.lgrid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.lcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; text-align: center; color: var(--fg); text-decoration: none; }
.lcard:hover { border-color: var(--accent); }
.lc-img { position: relative; background: var(--bg); border-radius: 8px; overflow: hidden; }
.lc-img img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.lc-img .ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; color: var(--muted); font-size: 1.2rem; }
.lc-img.big { max-width: 320px; width: 100%; }
.lc-id { font-weight: 600; margin-top: .3rem; }
.lc-price { color: var(--accent); }
.tile .badge { display: block; margin: 0 .3rem .4rem; font-size: .75rem; }
.tile a { display: block; color: inherit; }
.item-hero { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .item-hero { grid-template-columns: 320px 1fr; } }

.amount-big { font-size: 1.6rem; font-weight: 700; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; }
.card.pay h2 { margin-bottom: .25rem; }
.countdown { font-weight: 600; }
.forms .form { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }
.forms .form:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.forms h3 { font-size: 1rem; margin: 0 0 .3rem; }
.forms input[type="text"] { margin-bottom: .5rem; }
.mono { overflow-wrap: anywhere; }
.shot-missing { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 140px; padding: .8rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

/* ---- visual QA fixes (2026-10-16) ---- */
/* the picture frame of an item must be visible even while the piece is still hidden: framed box, centred "?" and a hint */
.lc-img { background: var(--card); border: 1px solid var(--line); }
.lc-img .ph { flex-direction: column; gap: .3rem; font-size: 2rem; background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(128, 128, 128, .08) 10px 20px); }
.lc-img.big { margin: 0; }
.lc-img.big .ph { font-size: 4rem; }
.ph small { font-size: .85rem; color: var(--muted); text-align: center; padding: 0 .5rem; }
.item-hero { align-items: start; }
.kv .k { flex: none; }
.row .top { flex-wrap: wrap; align-items: baseline; gap: .1rem 1rem; }
.row .top > .muted { white-space: nowrap; }
.row .mono { word-break: break-all; }
.lc-img.big { justify-self: center; }
@media (min-width: 640px) { .lc-img.big { justify-self: start; } }
