:root {
  --bg: #f5f5f2;
  --paper: #ffffff;
  --ink: #151515;
  --ink-2: #3a3a37;
  --muted: #62625d;
  --rule: #d8d8d2;
  --rule-2: #b8b8b1;
  --code-bg: #ebebe6;
  --link: #0a4fbf;
  --mast: #151515;
  --mast-ink: #f5f5f2;
  --mast-muted: #b4b4ad;
  --mast-rule: #45453f;
  --row-hover: #f0f0ea;

  --ok-bg: #17703a;    --ok-fg: #ffffff;
  --warn-bg: #f0b400;  --warn-fg: #151515;
  --bad-bg: #b42318;   --bad-fg: #ffffff;
  --dash: #85857e;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --max: 1200px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --paper: #1a1a18;
    --ink: #ecece6;
    --ink-2: #cfcfc8;
    --muted: #a2a29b;
    --rule: #32322e;
    --rule-2: #4a4a44;
    --code-bg: #262623;
    --link: #8db6ff;
    --mast: #000000;
    --mast-ink: #ecece6;
    --mast-muted: #a2a29b;
    --mast-rule: #3a3a35;
    --row-hover: #222220;
    --ok-bg: #3bb26a;    --ok-fg: #08170d;
    --warn-bg: #f5c02e;  --warn-fg: #1a1400;
    --bad-bg: #f0705f;   --bad-fg: #1f0603;
    --dash: #77776f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211;
  --paper: #1a1a18;
  --ink: #ecece6;
  --ink-2: #cfcfc8;
  --muted: #a2a29b;
  --rule: #32322e;
  --rule-2: #4a4a44;
  --code-bg: #262623;
  --link: #8db6ff;
  --mast: #000000;
  --mast-ink: #ecece6;
  --mast-muted: #a2a29b;
  --mast-rule: #3a3a35;
  --row-hover: #222220;
  --ok-bg: #3bb26a;    --ok-fg: #08170d;
  --warn-bg: #f5c02e;  --warn-fg: #1a1400;
  --bad-bg: #f0705f;   --bad-fg: #1f0603;
  --dash: #77776f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Rows get display:grid on small screens, which would beat the UA rule for [hidden]. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
}
a { color: var(--link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--code-bg); padding: 1px 4px; border-radius: 2px; overflow-wrap: anywhere; }
q { font-style: normal; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; margin: 0.5em 0 0.35em; max-width: 24ch; }
h2 { font-size: 1.02rem; font-weight: 750; letter-spacing: -0.005em; margin: 2em 0 0.6em; padding-top: 0.45em; border-top: 2px solid var(--ink); }
h3 { font: 700 0.7rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 1.6em 0 0.3em; }
p { margin: 0.6em 0; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lead { font-size: 1.04rem; color: var(--ink-2); max-width: 70ch; }

/* Masthead */
.site-header { background: var(--mast); color: var(--mast-ink); border-bottom: 1px solid var(--mast-rule); }
.site-header .wrap { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
.brand { color: var(--mast-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.32rem; letter-spacing: -0.02em; }
.brand-mark { width: 24px; height: 15px; border: 3px solid currentColor; border-radius: 5px; display: inline-block; flex: none; }
.nav { display: flex; gap: 2px 18px; flex-wrap: wrap; align-items: center; font-size: 0.9rem; }
.nav a { color: var(--mast-muted); text-decoration: none; padding: 6px 0 4px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--mast-ink); }
.nav a[aria-current="page"] { color: var(--mast-ink); border-bottom-color: var(--mast-ink); }
.nav :focus-visible { outline-color: var(--mast-ink); }
.theme-toggle { background: transparent; border: 1px solid var(--mast-rule); color: var(--mast-muted); border-radius: 2px; padding: 3px 8px; cursor: pointer; font: 600 0.68rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.theme-toggle:hover { color: var(--mast-ink); border-color: var(--mast-muted); }

/* Home intro and counts */
.hero { padding: 18px 0 0; }
.stats { display: flex; flex-wrap: wrap; margin: 18px 0 10px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.stat { padding: 10px 26px 10px 0; margin-right: 26px; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat b { display: block; font-size: 1.85rem; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font: 600 0.66rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

/* Filter bar sits on top of the table as one panel */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 26px 0 0; padding: 12px; background: var(--paper); border: 1px solid var(--rule); border-bottom: 0; }
.filters label { display: flex; flex-direction: column; gap: 3px; font: 600 0.64rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.filters .search { flex: 1 1 240px; }
.filters input, .filters select { font: 0.9rem/1.3 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--bg); border: 1px solid var(--rule-2); border-radius: 2px; padding: 6px 8px; min-width: 112px; }
.filters input { width: 100%; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.filters .count { margin-left: auto; font: 600 0.78rem/1.3 var(--mono); color: var(--ink-2); padding-bottom: 7px; white-space: nowrap; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--paper); }
.table-wrap-games { overflow: visible; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
th { font: 700 0.64rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); background: var(--paper); border-bottom: 2px solid var(--ink); padding-top: 9px; padding-bottom: 7px; }
th.num { font-family: var(--mono); }
.games thead th { position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
.games td:first-child a { color: var(--ink); font-weight: 650; text-decoration: none; }
.games td:first-child a:hover { text-decoration: underline; }
.games td:first-child .muted { font-size: 0.8rem; }
.games .ext { font-size: 0.84rem; }
.reports .notes { min-width: 16em; }
.plain-table { background: var(--paper); border: 1px solid var(--rule); }
.plain-table th { font: 650 0.9rem/1.4 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); border-bottom: 1px solid var(--rule); width: 12em; }

/* Status badges: solid fills where there is a verdict, outlines where there isn't */
.badge { display: inline-block; padding: 2px 7px 1px; border-radius: 2px; font: 700 0.68rem/1.45 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; border: 1px solid transparent; }
.badge-verified { background: var(--ok-bg); color: var(--ok-fg); }
.badge-playable { background: var(--warn-bg); color: var(--warn-fg); }
.badge-unsupported { background: var(--bad-bg); color: var(--bad-fg); }
.badge-unknown { border: 1px dashed var(--dash); color: var(--ink-2); }
.badge-untested { border-color: var(--rule-2); color: var(--muted); }
.badge-mixed { border: 2px solid var(--ink); color: var(--ink); padding: 1px 6px 0; }
.badge-neutral { border-color: var(--rule-2); color: var(--ink-2); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }

.btn { display: inline-block; padding: 7px 14px; border-radius: 2px; border: 2px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; font: 650 0.9rem/1.3 var(--sans); cursor: pointer; }
.btn:hover { background: var(--row-hover); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }

.legend dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.legend dt { font: 700 0.7rem/1.9 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; }
.legend dd { margin: 0; color: var(--ink-2); max-width: 80ch; }
.callout { border-left: 4px solid var(--ink); background: var(--paper); padding: 8px 16px; margin: 16px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.crumbs { color: var(--muted); font-size: 0.85rem; margin: 16px 0 0; }
.crumbs a { color: var(--muted); }
.game-head h1 { margin-top: 0.3em; max-width: none; }
.game-head .meta { color: var(--muted); font-size: 0.9rem; }
.sources, .plain { padding-left: 1.2em; }
.sources li { margin: 8px 0; overflow-wrap: anywhere; }
.sources q { display: block; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--rule-2); color: var(--ink-2); font-size: 0.9rem; }

.checklist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.checklist li { margin: 0; padding: 9px 2px; border-bottom: 1px solid var(--rule); }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
/* min-width:0 lets long identifiers like XR_META_foveation_eye_tracked wrap instead of pushing the tag off a phone screen. */
.checklist label > span:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.checklist input { margin-top: 4px; width: 16px; height: 16px; flex: none; accent-color: var(--ink); }
.checklist li:has(input:checked) > label > span:first-of-type { color: var(--muted); }
.origin { font: 700 0.6rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; padding: 1px 5px; border-radius: 2px; margin-left: auto; white-space: nowrap; flex: none; }
.origin-valve { background: var(--ink); color: var(--bg); }
.origin-advice { border: 1px dashed var(--dash); color: var(--ink-2); }
.lead .origin { margin-left: 0; vertical-align: 1px; }

.site-footer { border-top: 2px solid var(--ink); margin-top: 52px; padding: 14px 0 32px; color: var(--muted); font-size: 0.8rem; }
.site-footer p { max-width: 95ch; }
.site-footer a { color: var(--ink-2); }

/* Kit sales page, purchase pages and the report form */
.panel { background: var(--paper); border: 1px solid var(--rule); padding: 14px 16px; margin: 16px 0; max-width: 760px; }
.buybox { border: 2px solid var(--ink); background: var(--paper); padding: 14px 16px; margin: 20px 0 8px; max-width: 760px; }
.price { margin: 0; display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.price b { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price span { color: var(--ink-2); }
.btn-buy { min-width: 11em; text-align: center; }
.btn[disabled] { cursor: not-allowed; border-style: dashed; border-color: var(--rule-2); color: var(--muted); background: transparent; }
.spaced li { margin: 0.55em 0; max-width: 80ch; }
.store-state { font-size: 1.02rem; margin: 0.2em 0 0.6em; }
.store-state.good { color: var(--ok-bg); font-weight: 700; }
.store-state.bad { color: var(--bad-bg); }
.store-state:empty { display: none; }
.download code { font-size: 0.8rem; }
.licence-text { font-size: 0.84rem; color: var(--ink-2); max-width: 80ch; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field legend, .report-out > label { font-weight: 650; font-size: 0.9rem; }
.req { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.hint { color: var(--muted); font-size: 0.82rem; }
.panel input[type=text], .panel input[type=email], .panel input[type=url], .panel select, .panel textarea {
  font: 0.95rem/1.35 var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--rule-2); border-radius: 2px; padding: 7px 9px; width: 100%; min-height: 40px;
}
.panel textarea { resize: vertical; }
.panel input:focus, .panel select:focus, .panel textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
fieldset.field { border: 0; padding: 0; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; font-weight: 400; margin: 6px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--ink); }
.report-out { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 10px; }
.report-out textarea { font: 0.8rem/1.45 var(--mono); margin-top: 4px; }
.restore-form .field { margin-bottom: 12px; max-width: 28rem; }

@media (max-width: 720px) {
  h2 { margin-top: 1.6em; }
  .cols { grid-template-columns: 1fr; }
  .legend dl { grid-template-columns: 1fr; gap: 2px; }
  .legend dd { margin-bottom: 10px; }

  .filters { display: grid; grid-template-columns: 1fr 1fr; padding: 10px; }
  .filters .search, .filters .count { grid-column: 1 / -1; }
  .filters .count { margin-left: 0; padding-bottom: 0; }
  .filters select { min-width: 0; width: 100%; }

  /* Name across the top, the other fields in two columns underneath. */
  .games thead { display: none; }
  .games, .games tbody { display: block; width: 100%; }
  .games tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
  .games tbody tr:last-child { border-bottom: 0; }
  .games td { display: block; padding: 0; border: 0; }
  .games td::before { content: attr(data-label); display: block; font: 600 0.6rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
  .games td:first-child { grid-column: 1 / -1; }
  .games td:first-child::before { content: none; }
  .games td:first-child .muted { display: block; }
  .games td.num { text-align: left; }

  .reports thead { display: none; }
  .reports, .reports tbody { display: block; width: 100%; }
  .reports tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
  .reports td { display: block; padding: 0; border: 0; text-align: left; }
  .reports td::before { content: attr(data-label); display: block; font: 600 0.6rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
  .reports .notes { grid-column: 1 / -1; min-width: 0; }
  .table-wrap { overflow-x: visible; }

  .plain-table, .plain-table tbody, .plain-table tr, .plain-table th, .plain-table td { display: block; width: auto; }
  .fields { grid-template-columns: 1fr; }
  .btn-buy { width: 100%; }
  .plain-table th { border-bottom: 0; padding-bottom: 0; }

  /* Touch targets at least 40px tall. The negative margins grow the hit area without moving the text. */
  .brand { min-height: 40px; }
  .nav a { padding: 9px 0 7px; }
  .theme-toggle { min-height: 40px; padding: 0 12px; }
  .filters input, .filters select { min-height: 40px; }
  .btn { padding-top: 9px; padding-bottom: 9px; }
  .games td:first-child a { display: inline-block; padding: 9px 0; margin: -9px 0; }
  .games .ext, .crumbs a { display: inline-block; padding: 11px 0; margin: -11px 0; }
}
@media (max-width: 480px) {
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 8px 8px 8px 0; margin-right: 0; border-right: 0; }
  .stat b { font-size: 1.5rem; }
}
