:root {
  color-scheme: dark;
  --bg: #121418;
  --panel: #1c1f25;
  --field: #171a1f;
  --line: #353940;
  --text: #f5f4f0;
  --muted: #a7adb6;
  --gold: #ffd072;
  --mint: #90ddc5;
  --review-bar: #b9a8ec;
  --online-bar: #81c1e3;
  --track: #3b4049;
  font: 15px/1.55 Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
h1,h2,h3,p { margin: 0; }
a { color: inherit; text-decoration: none; }
button,select,input { font: inherit; color: inherit; }
button,select { cursor: pointer; }
button { border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}
a:hover, button:hover { color: var(--gold); }
.wrap { width: min(1424px,calc(100% - clamp(32px,8vw,136px))); margin-inline: auto; }
header { border-bottom: 1px solid var(--line); background: #15171c; }
.top, nav, .brand, .mast, .section-head, .section-head>div, .filter-row, .search-row, .selects, #tabs,
.card-title, .tag-line, .card-foot, .tags, footer, .exports, .actions {
  display: flex; align-items: center;
}
.top { height: 66px; justify-content: space-between; }
.brand { font-weight: 850; font-size: 22px; letter-spacing: -.05em; gap: 10px; }
nav { gap: 24px; font-size: 13px; }
nav a { font-weight: 650; }
nav button { padding: 0; color: var(--muted); }
.mast { justify-content: space-between; gap: 24px; padding: 38px 0 24px; }
h1 { font-size: clamp(32px,3.65vw,54px); letter-spacing: -.065em; line-height: 1.12; }
.datebox { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
input, select { border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 8px 11px; min-width: 0; }
.datebox input { color: var(--text); font-variant-numeric: tabular-nums; }
.periods { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.periods button {
  text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
  padding: 15px 18px; font-weight: 720; font-size: 17px;
}
.periods time { font: 12px/1.4 ui-monospace,monospace; color: var(--muted); }
.periods button[aria-pressed=true] { background: var(--gold); border-color: var(--gold); color: #2e2414; }
.periods button[aria-pressed=true] time { color: #5e4725; }
#releases { margin: 28px 0 40px; scroll-margin-top: 16px; }
.section-head { justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head>div { align-items: baseline; gap: 10px; }
h2 { font-size: 23px; letter-spacing: -.04em; }
#count,#sync,.subtle { color: var(--muted); font-size: 12px; }
.filters { display: grid; gap: 12px; margin-bottom: 20px; }
.search-row, .filter-row { justify-content: space-between; gap: 12px; }
.search-row input { flex: 1; }
select, .search-row input { min-height: 38px; font-size: 13px; }
::placeholder { color: #9b9fa8; }
#tabs, .selects { flex-wrap: wrap; gap: 6px; }
#tabs button { padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
#tabs button[aria-pressed=true] { color: var(--text); border-color: #787d87; background: #353a43; }
#tabs i { font: 11px ui-monospace,monospace; color: #b8bdc7; margin-left: 5px; }
.selects select { max-width: 190px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,258px),1fr)); gap: 18px; align-items: stretch; }
.game-card { min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.game-card:focus-within, .game-card:hover { border-color: #72747a; }
.art { aspect-ratio: 460/215; width: 100%; position: relative; display: grid; place-items: center; padding: 0; background: #252a32; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art::after { content:""; position:absolute; inset:48% 0 0; background:linear-gradient(transparent,#10121680); }
.art .kind { z-index:1; position:absolute; left:11px; bottom:9px; background:#121418de; color:white; font-size:11px; font-weight:650; border-radius:4px; padding:2px 7px; }
.kind::before { content:""; display:inline-block; width:6px; height:6px; margin:0 5px 1px 0; border-radius:50%; background:var(--mint); }
.kind[data-kind="ea"]::before { background:var(--gold); }
.kind[data-kind="demo"]::before { background:var(--review-bar); }
.no-cover { font-size:13px; color:var(--muted); }
.card-body { padding: 13px 14px 10px; flex:1; min-width:0; display:flex; flex-direction:column; }
.card-title { align-items:baseline; justify-content:space-between; gap:8px; }
.card-title h3 { min-width:0; font-size:17px; line-height:1.35; }
.card-title button { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-align:left; padding:0; font-weight:750; overflow-wrap:anywhere; }
.price { flex-shrink:0; color:var(--gold); font-size:12px; font-weight:650; }
.tag-line,.tags { flex-wrap:wrap; gap:5px; }
.tag-line { margin:9px 0 15px; }
[data-tone="coral"] { --chip-ink:#ffb69e; --chip-bg:#422d29; }
[data-tone="lime"]  { --chip-ink:#cbe099; --chip-bg:#303924; }
[data-tone="sky"]   { --chip-ink:#acd6ff; --chip-bg:#24374c; }
[data-tone="mint"]  { --chip-ink:#a1dfc3; --chip-bg:#223b34; }
[data-tone="amber"] { --chip-ink:#f8d28c; --chip-bg:#3b3322; }
[data-tone="lilac"] { --chip-ink:#d5bcff; --chip-bg:#382d49; }
[data-tone="rose"]  { --chip-ink:#f2b6cf; --chip-bg:#422c39; }
.tag-chip, #tag[data-tone] { color:var(--chip-ink); background-color:var(--chip-bg); }
.tag-chip {
  max-width:100%; padding:3px 8px; border-radius:5px; font-size:12px; line-height:1.5;
  font-weight:550; overflow-wrap:anywhere; text-align:left;
}
.tag-chip:hover { color:var(--chip-ink); box-shadow:inset 0 0 0 1px currentColor; }
.metrics {
  display:grid; grid-template-columns:60px minmax(0,1fr); align-items:center; gap:16px;
  font-variant-numeric:tabular-nums; background:var(--field); border-radius:8px; padding:10px 12px;
}
.game-card .metrics { margin-top:auto; }
.rating {
  position:relative; width:60px; height:60px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; line-height:1.1;
}
.ring {
  position:absolute; inset:0; border-radius:50%;
  background:conic-gradient(var(--mint) var(--rate),var(--track) 0);
  mask:radial-gradient(closest-side,transparent calc(100% - 4px),black calc(100% - 3px));
}
.missing .ring { background:none; border:2px dashed var(--track); mask:none; }
.rating strong { font-size:18px; letter-spacing:-.03em; }
.rating small { font-size:10px; margin-left:1px; }
.rating-label { color:var(--muted); font-size:10px; margin-top:3px; }
.counts { display:grid; gap:8px; }
.count-meter>div { display:flex; align-items:baseline; justify-content:space-between; gap:5px; line-height:1.2; }
.count-meter strong { font-size:14px; }
.count-meter div span,.card-foot a { color:var(--muted); font-size:11px; }
.track { height:4px; margin-top:4px; background:var(--track); border-radius:3px; display:block; overflow:hidden; }
.track i { display:block; height:100%; border-radius:inherit; background:var(--review-bar); }
.online .track i { background:var(--online-bar); }
.track[data-missing] { height:4px; background:none; border-bottom:1px dashed var(--track); border-radius:0; }
.card-foot a:hover { color:var(--gold); }
.card-foot { justify-content:space-between; gap:8px; margin-top:9px; }
.ai { color:#bec3cd; font-size:11px; }
.ai.disclosed { color:var(--mint); font-weight:650; }
.ai.unknown { color:#a5aab3; }
#message { color:var(--muted); padding:24px 0; }
.more,.primary { display:block; margin:24px auto 0; padding:8px 18px; border:1px solid var(--line); border-radius:7px; }
footer { padding:20px 0 30px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; justify-content:space-between; gap:12px; }
.exports,.actions { flex-wrap:wrap; gap:14px; }
dialog { width:min(640px,calc(100% - 24px)); max-height:86vh; background:var(--panel); color:var(--text); border:1px solid #545964; border-radius:14px; padding:24px; }
dialog::backdrop { background:#08090cd4; }
.close { float:right; width:34px; height:34px; position:sticky; top:0; background:var(--panel); border:1px solid var(--line); border-radius:50%; font-size:20px; line-height:1; }
dialog h2 { margin-right:42px; line-height:1.3; }
dialog p,dialog .tags { margin:12px 0; }
dialog p { color:#c7ccd4; }
.detail-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; color:var(--muted); margin-top:6px; font-size:12px; }
dialog .metrics { grid-template-columns:66px minmax(0,1fr); gap:20px; padding:14px 16px; }
dialog .actions { margin:16px 0; font-size:13px; }
dialog details { border-top:1px solid var(--line); }
dialog summary { padding:10px 0; font-size:14px; font-weight:600; }
dialog details small { color:var(--muted); }
dialog dl { display:grid; grid-template-columns:minmax(70px,32%) 1fr; gap:7px 14px; font-size:13px; }
dialog dt { color:var(--muted); }
dialog dd { margin:0; overflow-wrap:anywhere; }
dialog a { color:var(--gold); }
summary { cursor:pointer; }
.est button { color:var(--gold); padding:0; }
.primary { margin:0; color:#242016; background:var(--gold); }
a.primary:hover { color:#242016; }
@media(max-width:720px) {
  .wrap { width:calc(100% - 28px); }
  .top { height:54px; }
  .mast { padding-top:24px; gap:10px; flex-wrap:wrap; }
  .datebox { display:flex; align-items:center; gap:8px; }
  .periods button { padding:10px; font-size:14px; }
  .periods time { width:100%; font-size:10px; }
  .section-head { align-items:flex-start; }
  #sync { text-align:right; max-width:52%; }
  .filter-row,footer { flex-wrap:wrap; }
  .selects select { flex:1; }
  .game-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .card-body { padding:10px; }
  .card-title h3 { font-size:15px; }
}
@media(max-width:490px) {
  .game-grid { grid-template-columns:1fr; }
  #tabs { width:100%; }
  .filter-row { gap:8px; }
  .selects { width:100%; }
  .periods { gap:5px; }
  .periods button { padding:9px; }
}
