/* Pokemon Card Finder
   Layout: a yellow-on-blue hero band, a retailer coverage strip, then a filterable grid of product cards. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #16203a;
  --muted: #5a6582;
  --line: #dde2ee;
  --yellow: #ffcb05;
  --yellow-ink: #2a1f00;
  --blue: #2a4fa8;
  --blue-deep: #1b2f6b;
  --red: #e3350d;
  --ok: #138a4b;
  --ok-bg: #e2f5ea;
  --warn: #9a5b00;
  --warn-bg: #fff1d6;
  --chip: #eef1f8;
  --font-display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1426; --surface: #172040; --ink: #eef1fa; --muted: #a3acc7; --line: #2a3560;
    --yellow: #ffd23a; --yellow-ink: #221a00; --blue: #6f93f0; --blue-deep: #101a3c; --red: #ff6a45;
    --ok: #5fd796; --ok-bg: #12382a; --warn: #ffc266; --warn-bg: #3a2b0e; --chip: #212c55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1426; --surface: #172040; --ink: #eef1fa; --muted: #a3acc7; --line: #2a3560;
  --yellow: #ffd23a; --yellow-ink: #221a00; --blue: #6f93f0; --blue-deep: #101a3c; --red: #ff6a45;
  --ok: #5fd796; --ok-bg: #12382a; --warn: #ffc266; --warn-bg: #3a2b0e; --chip: #212c55;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Hero */
.hero { background: var(--blue-deep); color: #fff; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -60px; top: -40px; width: 320px; height: 320px;
  background: repeating-linear-gradient(135deg, rgba(255, 203, 5, .16) 0 14px, transparent 14px 28px);
  transform: rotate(8deg); pointer-events: none;
}
.hero .wrap { padding-block: calc(40px + env(safe-area-inset-top, 0px)) 32px; position: relative; z-index: 1; display: grid; gap: 14px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #ffcb05; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 7vw, 64px); line-height: .95; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 span { color: #ffcb05; }
.lede { max-width: 62ch; margin: 0; color: #d3dcf5; font-size: 16px; }
.stamp { display: inline-flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: #c3cdea; }
.stamp b { color: #fff; font-weight: 800; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; display: inline-block; margin-right: 6px; }

/* Coverage strip */
.coverage { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: -18px; position: relative; z-index: 2; }
.cov { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 2px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.cov:hover { border-color: var(--blue); }
.cov:focus-visible, .btn:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.cov[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cov .name { font-weight: 800; font-size: 13px; }
.cov .count { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.cov .count.zero { color: var(--muted); }
.cov .sub { font-size: 11.5px; color: var(--muted); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding-block: 22px 14px; }
.controls h2 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.controls h2 small { font-family: var(--font-body); font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.ctl-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label.tog { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); cursor: pointer; }
select { font: inherit; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* Grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding-bottom: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.tile { background: var(--chip); padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--line); }
.rbadge { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; color: #fff; white-space: nowrap; }
.r-walmart { background: #0b5ed7; }
.r-target { background: #cc0000; }
.r-ace { background: #b8001f; }
.r-sams { background: #0060a9; }
.r-costco { background: #005daa; }
.r-bam { background: #6b2c91; }
.packs { text-align: right; }
.packs .n { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--blue); }
.packs .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ptitle { font-weight: 800; font-size: 16px; line-height: 1.3; margin: 0; text-wrap: balance; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-family: var(--font-mono); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.msrp { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.markup { font-family: var(--font-mono); font-size: 11.5px; padding: 2px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); }
.markup.good { background: var(--ok-bg); color: var(--ok); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; width: fit-content; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-in { background: var(--ok-bg); color: var(--ok); }
.s-low { background: var(--warn-bg); color: var(--warn); }
.detail { font-size: 13px; color: var(--muted); margin: 0; }
.detail strong { color: var(--ink); font-weight: 700; }
.btn { margin-top: auto; display: inline-flex; justify-content: center; align-items: center; gap: 6px; background: var(--yellow); color: var(--yellow-ink); font-weight: 800; text-decoration: none; padding: 10px 14px; border-radius: 8px; border: 2px solid var(--yellow); }
.btn:hover { background: transparent; color: var(--ink); }
.empty { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); }

/* Notes */
.notes { border-top: 1px solid var(--line); padding-block: 22px 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; }
.notes h3 { font-family: var(--font-display); font-size: 17px; margin: 0 0 6px; }
.notes p, .notes li { font-size: 13.5px; color: var(--muted); margin: 0; }
.notes ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.notes b { color: var(--ink); }

@media (max-width: 860px) { .coverage { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 460px) { .coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .15s ease; }
  .card:hover { transform: translateY(-2px); }
}
