:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-2: #f3f2ef;
  --line: #e4e2dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7873;
  --accent: #2a78d6;          /* categorical slot 1: covered */
  --accent-2: #eb6834;        /* categorical slot 2: remaining */
  --accent-3: #1baf7a;        /* slot 3: partial */
  --ok: #008300;
  --warn: #c98500;
  --bad: #d33b3a;
  --grid: #ecebe6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1a1a19; --surface-2: #232322; --line: #363633; --text: #fff; --text-2: #c3c2b7;
    --muted: #8f8e86; --accent: #3987e5; --accent-2: #d95926; --accent-3: #199e70; --grid: #2a2a28;
    --warn: #eda100; --bad: #e66767; --ok: #3cb043;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a19; --surface-2: #232322; --line: #363633; --text: #fff; --text-2: #c3c2b7;
  --muted: #8f8e86; --accent: #3987e5; --accent-2: #d95926; --accent-3: #199e70; --grid: #2a2a28;
  --warn: #eda100; --bad: #e66767; --ok: #3cb043;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--text); }
body { font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.top { background: linear-gradient(to bottom, #0077B2 0%, #14A4EC 100%); border-bottom: 0; padding: 20px 0 16px; box-shadow: 0 3px 10px rgba(0, 40, 70, .35); color: #fff; }
.top h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; color: #fff; text-shadow: 0 2px 3px rgba(0, 30, 60, .45); }
.top .tagline { margin: 4px 0 2px; font-size: 15px; font-weight: 450; line-height: 1.35; color: #fff; text-shadow: 0 1px 2px rgba(0, 30, 60, .45); }
.top .vs { color: rgba(255, 255, 255, .8); font-weight: 400; }
.sub { margin: 4px 0 0; color: var(--text-2); }
.muted { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--surface-2); padding: 0 4px; border-radius: 3px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.tile { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; }
.tile .v { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.tile .l { color: var(--text-2); margin-top: 4px; font-size: 13px; }
.tile .s { color: var(--muted); font-size: 12px; }
.meter { height: 6px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 10px 0 16px; }
.charts-box { margin: 4px 0 12px; }
.charts-box > summary { cursor: pointer; font-weight: 600; list-style: none; padding: 6px 0; user-select: none; }
.charts-box > summary::-webkit-details-marker { display: none; }
.charts-box > summary .twisty::before { content: "▸"; display: inline-block; width: 16px; color: var(--muted); }
.charts-box[open] > summary .twisty::before { content: "▾"; }
.charts-box > summary .muted { font-weight: 400; font-size: 12px; margin-left: 6px; }
.charts-box.disabled > summary { cursor: default; color: var(--muted); }
#chart-genre svg, #chart-genre-pct svg { max-width: 640px; margin: 0 auto; }
#chart-genre, #chart-genre-pct { min-height: 0; }
svg .ref-line { stroke: var(--text-2); stroke-width: 1; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.chart { margin: 0; background: var(--surface-2); border-radius: 8px; padding: 12px 14px 8px; }
.chart figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.chart figcaption .muted { font-size: 12px; }
.linkbtn { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
svg .ref { stroke: var(--text-2); stroke-width: 2; fill: none; }
.chart-body { width: 100%; min-height: 240px; position: relative; }
.chart-body svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.legend i.line { height: 2px; border-radius: 1px; vertical-align: 3px; }
svg text { font-size: 11px; fill: var(--text-2); font-family: inherit; }
svg .grid line { stroke: var(--grid); stroke-width: 1; }
svg .axis line, svg .axis path { stroke: var(--line); }
svg .hover-line { stroke: var(--text-2); stroke-width: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 14px; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--text-2); font: inherit; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; margin-bottom: 10px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); }
.filters input, .filters select, .filters button { font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.filters input[type=search] { min-width: 220px; }
.filters input.yr { width: 68px; }
.filters .row { display: flex; align-items: center; gap: 4px; }
.filters select { max-width: 240px; }
.filters select.yr { width: 72px; } .filters select.mo { width: 52px; }
svg .brush { fill: var(--accent); fill-opacity: 0.12; stroke: var(--accent); stroke-width: 1; }
svg .band { fill: var(--text-2); fill-opacity: 0.08; }
#time-hit { cursor: crosshair; }
.filters button { cursor: pointer; }
.count { color: var(--text-2); margin: 4px 0 8px; font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th, .grid td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.grid th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.grid tr:last-child td { border-bottom: none; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid tr.covered td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.grid tr.partial td:first-child { box-shadow: inset 3px 0 0 var(--accent-3); }
.grid tr.uncovered td:first-child { box-shadow: inset 3px 0 0 var(--accent-2); }
.grid tr.nw td { color: var(--muted); }
.grid .exp { cursor: pointer; color: var(--muted); user-select: none; width: 18px; }
.grid tr.detail td { background: var(--surface-2); padding: 8px 12px 10px 34px; }
.grid tr.detail table { font-size: 12px; width: auto; }
.grid tr.detail td td { padding: 2px 10px 2px 0; border: none; }
.set { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); margin: 1px 3px 1px 0; white-space: nowrap; }
.badge.src-dist { border-color: var(--accent); }
.badge.src-jt { border-color: var(--accent-3); }
.badge.src-coinop { border-color: var(--warn); }
.badge.src-ongo { border-color: var(--accent-2); }
.badge.wip { border-style: dashed; }
.pct { display: inline-block; width: 90px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.pct > i { display: block; height: 100%; background: var(--accent); }
.more { text-align: center; }
.more button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.tooltip { position: fixed; z-index: 10; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 6px; font-size: 12px; line-height: 1.35; max-width: 280px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tooltip b { font-weight: 600; }
.status-good { color: var(--ok); } .status-imperfect { color: var(--warn); } .status-preliminary { color: var(--bad); }
#about-meta { font-size: 13px; color: var(--text-2); }
#about-meta table { border-collapse: collapse; }
#about-meta td { padding: 2px 10px 2px 0; }
.flag { color: var(--muted); font-size: 11px; }

/* filter bar, quick filters, active-filter chips, collapsible panel */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; width: 100%; }
.presets, .chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; align-items: center; }
.presets:empty, .chips:empty { display: none; }
.presets .lbl, .chips .lbl { font-size: 12px; color: var(--muted); }
.filters .presets button { padding: 3px 10px; border-radius: 14px; font-size: 12px; background: var(--surface-2); }
.filters .presets button:hover { border-color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--accent); color: var(--text); }
.chip b { font-weight: 600; color: var(--text-2); }
.filters .chip button { border: none; background: none; padding: 0 6px; font-size: 14px; line-height: 1; color: var(--muted); border-radius: 10px; }
.filters .chip button:hover { color: var(--text); background: var(--line); }
.chips .clear { font-size: 12px; color: var(--accent); cursor: pointer; background: none; border: none; padding: 2px 4px; }
.nbadge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--surface); font-size: 11px; text-align: center; }
.panel { display: flex; flex-wrap: wrap; gap: 12px 24px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.panel[hidden] { display: none; }
.panel fieldset { border: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; min-width: 0; }
.panel legend { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; float: left; }
.panel legend + * { clear: both; }

/* wishlist: +1 buttons, vote dialog, wishlist tables */
button.plus1 { font: inherit; font-size: 12px; font-weight: 600; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); color: var(--accent); cursor: pointer; white-space: nowrap; }
button.plus1:hover { background: var(--accent); color: var(--surface); }
button.plus1.voted { background: var(--accent); color: var(--surface); }
button.plus1 .n { font-weight: 400; opacity: .85; }
button.plus1 .n::before { content: "\00b7"; margin: 0 4px; }
.grid td.act { text-align: right; white-space: nowrap; }
.wl-h { font-size: 15px; margin: 18px 0 6px; }
#vote-dialog, #zap-dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 16px 20px; max-width: 420px; width: calc(100% - 32px); }
#vote-dialog::backdrop, #zap-dialog::backdrop { background: rgba(0,0,0,.35); }
#vote-dialog h3, #zap-dialog h3 { margin: 0 0 4px; }
#vote-dialog label, #zap-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
#vote-dialog input, #zap-dialog input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
#vote-dialog .small, #zap-dialog .small { font-size: 11px; }
#vote-dialog .vote-err, #zap-dialog .vote-err { color: var(--accent-2); font-size: 12px; margin: 6px 0 0; }
.vote-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.vote-actions .spacer { flex: 1; }
.vote-actions button { font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.vote-actions button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
button.plus1:disabled { opacity: .45; cursor: not-allowed; border-color: var(--muted); color: var(--muted); }
button.plus1:disabled:hover { background: var(--surface); color: var(--muted); }

/* screenshot preview on hover: the title screen and an in-game shot side by side */
.shot { position: fixed; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 6px; pointer-events: none; }
.shot .pair { display: flex; gap: 6px; }
.shot figure { margin: 0; max-width: 46vw; }
.shot figure[hidden] { display: none; }
.shot img { display: block; width: auto; height: auto; max-width: 100%; max-height: 70vh; border-radius: 4px; background: var(--surface-2); }  /* native size, only shrunk to fit the window */
.shot figcaption { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.shot .cap { font-size: 12px; color: var(--text-2); margin-top: 4px; }

button.launch { font: inherit; font-size: 11px; padding: 0 6px; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); color: var(--accent); cursor: pointer; }
button.launch:hover { background: var(--accent); color: var(--surface); }
button.zapset { font: inherit; font-size: 12px; padding: 2px 10px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); color: var(--accent); cursor: pointer; }
pre.zapcfg { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg, #0001); border: 1px solid var(--border, #8884); border-radius: 6px; padding: 6px 10px; font-size: 12px; overflow-x: auto; user-select: all; }
#zap-dialog { width: min(630px, calc(100vw - 32px)); max-width: 630px; box-sizing: border-box; }
#zap-dialog input { width: 100%; box-sizing: border-box; }
p.zapcopy { margin: 4px 0 8px; }
a.zapset { display: inline-block; text-decoration: none; margin-left: 0; }
.top .sub { display: inline; margin-right: 8px; }
.top .zapset { margin-top: 4px; vertical-align: baseline; }
.top .issue { margin-top: 6px; }
.top .issue a { color: var(--accent); text-decoration: underline; }
/* external links get a small "opens elsewhere" icon */
a[href^="http"]:not(.no-ext)::after { content: ""; display: inline-block; width: .7em; height: .7em; margin-left: .25em; vertical-align: baseline; background: currentColor; opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2h5v5M14 2 7 9M12 10v4H2V4h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2h5v5M14 2 7 9M12 10v4H2V4h4'/%3E%3C/svg%3E") center / contain no-repeat; }
#titles-table th.launchcol, #titles-table td.act:nth-child(2) { width: 1%; padding-left: 2px; padding-right: 2px; text-align: center; white-space: nowrap; }
#titles-table button.launch { margin: 0; }
/* header on the blue gradient: white text, soft shadows */
.top .sub { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 2px rgba(0, 30, 60, .45); }
.top .issue a { color: #fff; text-shadow: 0 1px 2px rgba(0, 30, 60, .45); }
.top button.zapset { color: #fff; border-color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .16); text-shadow: 0 1px 2px rgba(0, 30, 60, .4); box-shadow: 0 1px 3px rgba(0, 30, 60, .35); cursor: pointer; }
.top button.zapset:hover { background: rgba(255, 255, 255, .28); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 8px 0 0; }
.seg button { font: inherit; padding: 5px 14px; border: 0; background: var(--surface); color: var(--text-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.seg .n { opacity: .8; font-weight: 400; }
