:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #14171f;
  --muted: #5d6573;
  --line: #e3e6ec;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e8efff;
  --good: #0f7a4f;
  --good-soft: #e3f5ec;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --card: #7a3fd1;
  --card-soft: #f1e9fd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --surface: #171a21; --ink: #e8eaef; --muted: #9aa3b2; --line: #2a2f3a;
    --accent: #6b9bff; --accent-ink: #0b1020; --accent-soft: #1b2540;
    --good: #4fd19a; --good-soft: #12291f; --warn: #f1b45a; --warn-soft: #2d2412;
    --bad: #ff8a80; --bad-soft: #321a19; --card: #c3a2ff; --card-soft: #261c38;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
img { display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand svg { width: 26px; height: 26px; }
.brand rect { fill: var(--accent); }
.brand circle { fill: var(--accent-ink); }
.top-note { color: var(--muted); font-size: 13px; text-align: right; }

.search { display: flex; gap: 8px; margin: 28px 0 12px; }
.search input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search button, .btn {
  height: 48px; padding: 0 20px; font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: var(--radius); cursor: pointer;
}
.search button:disabled { opacity: .6; cursor: progress; }

.status { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; font-size: 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.chip.loading::before { background: var(--accent); animation: pulse 1s infinite; }
.chip.ok::before { background: var(--good); }
.chip.empty::before { background: var(--muted); }
.chip.err::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }

.section-title { font-size: 17px; margin: 28px 0 6px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.sugg-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sugg {
  display: flex; gap: 12px; width: 100%; padding: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.sugg:hover, .sugg:focus-visible { border-color: var(--accent); outline: none; }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 6px; background: var(--bg); object-fit: contain; }
.sugg-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sugg-title { font-weight: 600; line-height: 1.25; }
.sugg-meta { font-size: 13px; color: var(--muted); }
.sugg-price { font-size: 13px; color: var(--ink); margin-top: auto; }

.link-btn { margin-top: 20px; padding: 0; font: inherit; color: var(--accent); background: none; border: 0; cursor: pointer; }
.game {
  display: flex; gap: 20px; align-items: center; margin: 12px 0 8px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.game .thumb { width: 132px; height: 132px; border-radius: 8px; background: #fff; }
.game-body { min-width: 0; }
.game h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.game p { margin: 6px 0 0; font-size: 14px; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.ean { font-variant-numeric: tabular-nums; }
.game-best strong { font-size: 18px; color: var(--good); }
@media (max-width: 520px) {
  .game { flex-direction: column; align-items: flex-start; }
  .game .thumb { width: 100%; height: 200px; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 10px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.seg button { padding: 6px 12px; font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; border-radius: 7px; cursor: pointer; }
.seg button[aria-checked="true"] { color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.price.card-used { display: block; color: var(--card); }
.old-plain { display: block; font-size: 12px; color: var(--muted); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.offers { width: 100%; border-collapse: collapse; }
.offers th { padding: 10px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.offers th .th-sort {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; font: inherit; letter-spacing: inherit;
  text-transform: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.offers th.num .th-sort { flex-direction: row-reverse; }
.offers th .th-sort::after { content: "↕"; font-size: 11px; opacity: .35; }
.offers th .th-sort:hover { color: var(--ink); }
.offers th .th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.offers th[aria-sort="ascending"], .offers th[aria-sort="descending"] { color: var(--accent); }
.offers th[aria-sort="ascending"] .th-sort::after { content: "▲"; opacity: 1; }
.offers th[aria-sort="descending"] .th-sort::after { content: "▼"; opacity: 1; }
.offers td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.offers tr:last-child td { border-bottom: 0; }
.offers .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.offers tr.best td { background: var(--good-soft); }
.shop-name { font-weight: 600; }
.shop-title { display: block; font-size: 12px; color: var(--muted); max-width: 260px; }
.price { font-weight: 600; }
.old { display: block; font-size: 12px; color: var(--muted); text-decoration: line-through; }
.cardprice { display: inline-block; margin-top: 4px; padding: 1px 6px; font-size: 12px; font-weight: 600; color: var(--card); background: var(--card-soft); border-radius: 6px; white-space: nowrap; }
.ship-label { display: block; font-size: 12px; color: var(--muted); white-space: normal; }
.total { font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { padding: 1px 7px; font-size: 12px; border-radius: 6px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.go { display: inline-block; padding: 6px 12px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; white-space: nowrap; }
.go:hover { background: var(--accent-soft); }
.empty-row td { text-align: center; color: var(--muted); padding: 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
.card strong { font-size: 15px; }
.card span { font-size: 13px; color: var(--muted); }

.shipping { margin: 28px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shipping summary { padding: 12px 14px; font-weight: 600; cursor: pointer; }
.shipping dl { margin: 0; padding: 0 14px 10px; }
.shipping dt { font-weight: 600; margin-top: 10px; }
.shipping dd { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

.foot { padding-top: 24px; padding-bottom: 32px; font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .top-note { display: none; }
  .offers thead { display: none; }
  .offers, .offers tbody, .offers tr, .offers td { display: block; width: 100%; }
  .offers tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .offers td { padding: 0; border: 0; }
  .offers td.num { text-align: left; }
  .offers td[data-l]::before { content: attr(data-l) " "; color: var(--muted); font-size: 12px; }
  .offers td.c-shop { grid-column: 1 / -1; }
  .offers td.c-info { grid-column: 1 / -1; }
  .offers td.c-go { grid-column: 1 / -1; }
  .go { display: block; text-align: center; }
  .shop-title { max-width: none; }
}
