:root {
  --bg: #171a21;
  --panel: #1e232c;
  --panel2: #252b36;
  --border: #2e3541;
  --text: #dfe4ec;
  --muted: #8b95a7;
  --link: #66c0f4;
  --link-hover: #9fd8ff;
  --accent: #1b9de2;
  --green: #a4d007;
  --green-bg: #4c6b22;
  --red: #e0575b;
  --yellow: #e5b23a;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1 { font-size: 26px; margin: 18px 0 8px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 10px; font-weight: 600; }
h2 a { color: var(--text); }
h3 { font-size: 15px; margin: 22px 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
small { font-size: 12px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--green); }
.mixed { color: var(--yellow); }
.neg { color: var(--red); }
.lead { font-size: 15px; color: #c9d1dd; }

/* header */
.top { background: #0f1218; border-bottom: 1px solid #262c37; position: sticky; top: 0; z-index: 20; }
.top-inner { display: flex; align-items: center; gap: 22px; height: 54px; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #fff; white-space: nowrap; }
.logo span { color: #c7d5e0; font-weight: 500; }
.logo b { color: var(--link); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: #b8c2d0; padding: 8px 10px; border-radius: 4px; white-space: nowrap; font-weight: 500; }
.nav a:hover, .nav a.on { background: #1c2230; color: #fff; text-decoration: none; }
.search { position: relative; width: 340px; max-width: 45vw; }
.search input { width: 100%; background: #1c2230; border: 1px solid #2e3541; color: var(--text); padding: 7px 11px; border-radius: 4px; font: inherit; }
.search input:focus { outline: none; border-color: var(--accent); }
.suggest { position: absolute; top: 100%; left: 0; right: 0; background: #1c2230; border: 1px solid #2e3541; border-top: none; border-radius: 0 0 4px 4px; z-index: 30; max-height: 420px; overflow: auto; }
.suggest a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 11px; color: var(--text); border-top: 1px solid #262c37; }
.suggest a:hover, .suggest a.sel { background: #252b36; text-decoration: none; }
.suggest a .muted { font-size: 12px; }

/* home */
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: 30px; margin: 0 0 6px; }
.hero p { color: var(--muted); font-size: 15px; max-width: 720px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.stat-v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; min-width: 0; }
.panel .table { margin: 0; }

/* tables */
.table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; }
.table th, .table td { padding: 7px 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; background: #1a1f28; position: sticky; top: 54px; }
.table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.table tbody tr:hover { background: rgba(102, 192, 244, 0.07); }
.table.compact th, .table.compact td { padding: 5px 8px; }
.table.kvt th { width: 200px; color: var(--muted); font-weight: 500; }
.table.sortable thead th { cursor: pointer; user-select: none; }
.table.sortable thead th.asc::after { content: " ▲"; }
.table.sortable thead th.desc::after { content: " ▼"; }
.table-scroll { overflow-x: auto; }
.app-link { display: inline-flex; align-items: center; gap: 8px; }
.cap { width: 60px; height: 22px; object-fit: cover; border-radius: 2px; background: #10131a; flex: none; }
.cell-app { min-width: 240px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #2b3240; color: #b8c2d0; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }
.badge.t-game { background: #23405a; color: #9fd8ff; }
.badge.t-dlc { background: #3f3660; color: #cfc2ff; }
.badge.t-demo { background: #3a4a2a; color: #c9e59a; }
.badge.t-tool, .badge.t-application { background: #4a3d2a; color: #f0cf9a; }
.disc { background: var(--green-bg); color: var(--green); font-weight: 700; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.price s { margin-right: 3px; }
.cl-apps a { margin-right: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-block; background: #2b3240; color: #c7d5e0; padding: 2px 8px; border-radius: 3px; font-size: 12px; }
a.chip:hover { background: #34405a; color: #fff; text-decoration: none; }
.chip.plain { background: #232936; color: var(--muted); }
.pager { display: flex; gap: 16px; align-items: center; margin: 10px 0 30px; }
.filters { display: flex; gap: 14px; align-items: end; margin: 8px 0 12px; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
select, button, .btn { background: #2b3240; color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 6px 12px; font: inherit; cursor: pointer; display: inline-block; }
.btn:hover, button:hover { background: #34405a; color: #fff; text-decoration: none; }
.bigsearch { display: flex; gap: 8px; margin: 10px 0 16px; }
.bigsearch input { flex: 1; background: #1c2230; border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 4px; font: inherit; font-size: 16px; }
.empty { text-align: center; padding: 80px 0; }

/* charts */
.chart-box { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px; height: 340px; margin: 8px 0 16px; position: relative; }
.chart-box.small { height: 180px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }
.range-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.ranges a { display: inline-block; padding: 3px 9px; border-radius: 3px; margin-left: 4px; color: var(--muted); }
.ranges a.on, .ranges a:hover { background: #2b3240; color: #fff; text-decoration: none; }

/* app page */
.app-head { display: flex; gap: 20px; align-items: flex-start; margin: 20px 0 16px; }
.app-header-img { width: 320px; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 6px; background: #10131a; flex: none; }
.app-title { min-width: 0; flex: 1; }
.app-title h1 { margin: 4px 0 6px; font-size: 28px; }
.crumbs { color: var(--muted); }
.app-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.app-meta b { color: var(--text); font-weight: 600; }
.app-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.app-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-box { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.side-h { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a small { color: #667084; margin-left: 3px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: #fff; border-bottom-color: var(--link); }
.history .key { max-width: 260px; word-break: break-all; }
.history .old { color: var(--red); max-width: 320px; word-break: break-all; }
.history .new { color: var(--green); max-width: 320px; word-break: break-all; }
.raw { background: #10131a; border: 1px solid var(--border); border-radius: 6px; padding: 12px; font-family: var(--mono); font-size: 12px; overflow: auto; max-height: 800px; white-space: pre; }
.news { padding: 12px 0; border-bottom: 1px solid var(--border); }
.news h3 { margin: 0 0 4px; }
.news p { margin: 6px 0 0; color: #c9d1dd; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-head h1 { margin: 10px 0; }

/* footer */
.foot { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0 30px; color: var(--muted); font-size: 13px; }
.foot-cols { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.foot-note { margin-top: 10px; font-size: 12px; }

@media (max-width: 960px) {
  .grid-2, .stat-row { grid-template-columns: 1fr 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .app-head { flex-direction: column; }
  .app-header-img { width: 100%; max-width: 460px; }
  .top-inner { gap: 10px; }
}
@media (max-width: 640px) {
  .grid-2, .stat-row { grid-template-columns: 1fr; }
  .top-inner { flex-wrap: wrap; height: auto; padding: 8px 0; }
  .search { width: 100%; max-width: none; order: 3; }
  .nav { order: 2; width: 100%; }
  .table thead th { position: static; }
  .wrap { padding: 0 12px; }
  .cap { display: none; }
}
