/* ---------- filter bar: sticks under the site header while the list scrolls ---------- */
.wk-controls { position:sticky; top:var(--head-h); z-index:20; margin:8px 0 4px; padding:14px 0 12px;
  background:var(--bg); border-bottom:1px solid var(--line); box-shadow:0 0 0 100vmax var(--bg); clip-path:inset(0 -100vmax); }
.wk-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; }
.wk-query { flex:1 1 20rem; max-width:34rem; min-width:0; display:block; }
.wk-toolbar input[type=search], .wk-toolbar select { width:100%; min-width:0; height:44px; padding:0 14px; font:inherit; font-size:16px; color:var(--text);
  background:var(--card); border:2px solid var(--line); border-radius:8px; }
.wk-toolbar input[type=search] { padding-left:40px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23bdb6da' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m12.5 12.5 4 4'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:14px 50%; }
.wk-toolbar input[type=search]::placeholder { color:var(--muted); opacity:1; }
.wk-toolbar input[type=search]:hover, .wk-toolbar select:hover { border-color:var(--muted); }
.wk-toolbar input[type=search]:focus, .wk-toolbar select:focus { outline:none; border-color:var(--lime); }
.wk-sort { display:flex; align-items:center; gap:8px; font-size:15px; color:var(--muted); white-space:nowrap; }
.wk-sort select { width:auto; min-width:12.5rem; cursor:pointer; }
.wk-known { display:flex; align-items:center; min-height:44px; gap:8px; color:var(--text); font-size:15px; cursor:pointer; white-space:nowrap; }
.wk-known input { appearance:none; -webkit-appearance:none; display:inline-grid; place-items:center; width:20px; height:20px; margin:0; flex:none; border:2px solid var(--muted); border-radius:5px; background:var(--bg-deep); cursor:pointer; }
.wk-known input::after { content:""; width:6px; height:10px; margin-top:-3px; border-right:3px solid var(--on-primary); border-bottom:3px solid var(--on-primary); transform:rotate(45deg); opacity:0; }
.wk-known input:checked { background:var(--lime); border-color:var(--lime); }
.wk-known input:checked::after { opacity:1; }
.wk-known input:focus-visible { outline:3px solid var(--lime); outline-offset:2px; }
.wk-count { margin:0 0 0 auto; font-size:15px; font-weight:700; color:var(--muted); white-space:nowrap; font-variant-numeric:tabular-nums; }
.wk-count b { color:var(--cream); }

/* category choices: outlined until pressed, then a solid pink road sign; each shows how many entries it holds */
.wk-categories { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 0; }
.wk-categories button { display:inline-flex; align-items:center; gap:7px; font:inherit; font-size:15px; font-weight:700; cursor:pointer; white-space:nowrap;
  border:2px solid var(--line); border-radius:7px; background:var(--card); color:var(--text); padding:5px 11px 3px; min-height:38px; }
.wk-categories button:hover { border-color:var(--primary); }
.wk-categories .wk-n { font-size:13px; font-weight:700; color:var(--muted); font-variant-numeric:tabular-nums; }
.wk-categories button[aria-pressed=true] { color:var(--on-primary); background:var(--primary); border-color:var(--primary); box-shadow:inset 0 0 0 2px var(--on-primary); }
.wk-categories button[aria-pressed=true] .wk-n { color:var(--on-primary); }
/* once the bar is stuck under the header, the categories shrink to one row that scrolls sideways */
.wk-controls.is-stuck .wk-categories { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin-top:10px;
  -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image:linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.wk-controls.is-stuck .wk-categories::-webkit-scrollbar { display:none; }
.wk-controls.is-stuck .wk-categories button { flex:none; }

.wk-reveal { font:inherit; font-size:14px; font-weight:700; cursor:pointer; border:2px dashed var(--primary); border-radius:7px; background:transparent; color:var(--primary); padding:3px 9px 1px; vertical-align:middle; }
.wk-reveal:hover { background:var(--primary); color:var(--on-primary); border-style:solid; }
.wk-empty { color:var(--muted); font-size:17px; padding:48px 0; text-align:center; }

/* group heading */
.wk-section h2 { margin:32px 0 16px; font-size:22px; }
.wk-section + .wk-section h2 { margin-top:56px; }

/* ---------- cards: each card stacks its own content top to bottom; cards in a row share one height and the map links sit on the bottom edge ---------- */
.wk-grid { list-style:none; display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap:20px 16px; margin:0; padding:0; }
.wk-grid > li { display:flex; flex-direction:column; min-width:0; overflow:hidden; overflow-wrap:anywhere;
  padding-bottom:16px; background:var(--card); border:1px solid var(--line); border-radius:12px; }

.wk-photo { flex:none; overflow:hidden; margin:0; aspect-ratio:16 / 9; background:var(--bg-deep); border-bottom:1px solid var(--line); }
.wk-photo img { display:block; width:100%; height:100%; object-fit:contain; }
/* no photo: a faint 16:9 slot drawn by the stylesheet, so names in a row still start at the same height */
.wk-grid > li:not(:has(> .wk-photo))::before { content:"No photo yet"; flex:none; display:grid; place-items:center; aspect-ratio:16 / 9;
  background:var(--bg-deep); border-bottom:1px solid var(--line); color:var(--muted); opacity:.6; font-size:13px; font-weight:600; }
/* name only: one quiet line instead of an empty card */
.wk-grid > li:not(:has(.wk-ratings, .wk-facts, .wk-summary, .wk-how, .wk-map))::after { content:"Details not confirmed yet"; padding:10px 16px 0; color:var(--muted); font-size:13px; }

/* title block: category and price on the first line, then the name, then maker · variant and the edition tag */
.wk-title { display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 8px; padding:14px 16px 0; }
.wk-title small { flex:1 1 auto; font-size:13px; font-weight:800; color:var(--primary); letter-spacing:.01em; }
.wk-title h3 { flex:1 0 100%; margin:0; font-size:20px; line-height:1.2; color:var(--cream); }
.wk-maker, .wk-variant { color:var(--muted); font-size:14px; }
.wk-maker + .wk-variant::before { content:"· "; }
.wk-edition { align-self:center; padding:2px 7px 0; border-radius:5px; background:var(--lime); color:var(--on-primary); font-size:12px; font-weight:800; line-height:1.5; }
.wk-price { margin:0; font-size:18px; font-weight:800; line-height:1.2; color:var(--cream); font-variant-numeric:tabular-nums; }
.wk-price span { margin-right:5px; font-size:12px; font-weight:700; color:var(--muted); }

/* 0–10 ratings drawn as the in-game style bars */
.wk-ratings { list-style:none; margin:0; padding:14px 16px 0; display:grid; gap:5px; }
.wk-ratings li { display:grid; grid-template-columns:minmax(0, 8.6em) 1fr 2em; align-items:center; gap:10px; font-size:14px; line-height:1.3; }
.wk-ratings li::before { content:""; grid-column:2; grid-row:1; height:6px; border-radius:3px;
  background:linear-gradient(to right, var(--primary) calc(var(--v) * 10%), var(--line) 0); }
.wk-ratings span { grid-column:1; grid-row:1; color:var(--muted); }
.wk-ratings b { grid-column:3; grid-row:1; text-align:right; color:var(--text); font-variant-numeric:tabular-nums; }

/* other stats: small tiles two to a row; an odd last one runs the full width with label left, value right */
.wk-facts { margin:12px 16px 0; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:6px; }
.wk-facts div { display:grid; align-content:start; gap:1px; padding:6px 10px 4px; border-radius:6px; background:var(--bg-deep); line-height:1.35; }
.wk-facts div:last-child:nth-child(odd) { grid-column:1 / -1; display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.wk-facts dt { color:var(--muted); font-size:12px; }
.wk-facts dd { margin:0; font-size:14px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }

.wk-summary { margin:0; padding:12px 16px 0; color:var(--muted); font-size:14px; line-height:1.5; }
.wk-how { padding:14px 16px 0; font-size:15px; line-height:1.5; }
.wk-how > span { display:block; font-size:12px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text); }
.wk-how p { margin:3px 0 0; }
.wk-how small { display:block; margin-top:4px; color:var(--muted); font-size:14px; }

/* Show on map: said once, then one outlined row per place; pinned to the bottom so a row's links line up */
.wk-grid p.wk-map { margin:auto 0 0; padding:16px 16px 0; display:grid; gap:6px; }
.wk-map > span { font-size:12px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--primary); }
.wk-map a { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:40px; padding:7px 12px 5px; border:2px solid var(--primary); border-radius:8px;
  color:var(--text); font-size:14px; font-weight:700; line-height:1.3; text-decoration:none; }
.wk-map a::after { content:"→"; flex:none; color:var(--primary); font-size:16px; }
.wk-map a:hover { background:var(--primary); color:var(--on-primary); }
.wk-map a:hover::after { color:var(--on-primary); }
.wk-map a:focus-visible { outline:3px solid var(--lime); outline-offset:3px; }

/* top progress bar after clicking Show on map (class set in tool.js) */
html.wk-leaving body::before { content:""; position:fixed; z-index:3000; left:0; top:0; height:3px; width:0; background:var(--primary);
  box-shadow:0 0 8px var(--primary); animation:wk-progress 10s cubic-bezier(.08,.8,.2,1) forwards; }
@keyframes wk-progress { from { width:0; } to { width:94%; } }
@media (prefers-reduced-motion: reduce) { html.wk-leaving body::before { animation:none; width:60%; } }

/* ---------- phone: filter bar scrolls away (it would cover a fifth of the screen), photo beside the title, categories scroll sideways ---------- */
@media (max-width:640px) {
  .tool-top { padding-top:24px; }
  .wk-controls { position:static; padding:4px 0 12px; }
  .wk-toolbar { gap:8px 12px; }
  .wk-query { flex:1 1 200px; max-width:none; }
  .wk-sort, .wk-known { order:2; }
  .wk-sort { flex:1 1 150px; min-width:0; }  /* too wide to squeeze next to the search box: always starts the second row */
  .wk-sort > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .wk-sort select { flex:1; min-width:0; }
  .wk-count { font-size:14px; }
  .wk-categories { flex-wrap:nowrap; overflow-x:auto; margin:10px -16px 0; padding:0 16px 2px; scrollbar-width:none; }
  .wk-categories::-webkit-scrollbar { display:none; }
  .wk-categories button { flex:none; min-height:36px; font-size:14px; }
  .wk-section h2 { margin-top:20px; }
  .wk-grid { gap:12px; }
  .wk-grid > li { display:grid; grid-template-columns:120px minmax(0, 1fr); align-content:start; padding-bottom:14px; }
  .wk-grid > li > * { grid-column:1 / -1; }
  .wk-grid > li > .wk-photo { grid-column:1; grid-row:1; margin:14px 0 0 14px; border:0; border-radius:8px; align-self:start; }
  .wk-grid > li > .wk-title { grid-column:2; grid-row:1; padding:14px 14px 0 12px; }
  .wk-grid > li:not(:has(> .wk-photo))::before { display:none; }
  .wk-grid > li:not(:has(> .wk-photo)) > .wk-title { grid-column:1 / -1; padding-left:14px; }
  .wk-grid > li::after { grid-column:1 / -1; }
  .wk-title h3 { font-size:18px; }
  .wk-ratings, .wk-summary, .wk-how, .wk-grid p.wk-map { padding-left:14px; padding-right:14px; }
  .wk-grid p.wk-map { margin-top:0; }
  .wk-map a { min-height:44px; }
  .wk-facts { margin-left:14px; margin-right:14px; }
}
