/* ErogameScape v2 — design system
   Light/dark tokens, layout, components. No external fonts: Japanese system faces. */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-3: #e7eaf2;
  --text: #1a1e29;
  --muted: #5f6676;
  --faint: #9299a8;
  --line: #e2e5ed;
  --line-strong: #cfd4df;
  --accent: #d6336c;
  --accent-strong: #b8245a;
  --accent-soft: rgba(214, 51, 108, .09);
  --accent-2: #5b4bd6;
  --link: #2451c7;
  --ok: #2f9e44;
  --warn: #e8590c;
  --danger: #e03131;
  --s90: #c2255c;
  --s80: #e8590c;
  --s70: #2b8a3e;
  --s60: #1971c2;
  --s50: #6741d9;
  --s0: #868e96;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .14);
  --header-h: 60px;
  --maxw: 1320px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1d212c;
  --surface-3: #262b38;
  --text: #e6e8ef;
  --muted: #a2a9b8;
  --faint: #6f7686;
  --line: #2a2f3c;
  --line-strong: #394051;
  --accent: #f06595;
  --accent-strong: #f783ac;
  --accent-soft: rgba(240, 101, 149, .13);
  --accent-2: #9775fa;
  --link: #74a7ff;
  --s90: #f06595;
  --s80: #ff922b;
  --s70: #51cf66;
  --s60: #4dabf7;
  --s50: #9775fa;
  --s0: #868e96;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --surface: #171a23;
    --surface-2: #1d212c;
    --surface-3: #262b38;
    --text: #e6e8ef;
    --muted: #a2a9b8;
    --faint: #6f7686;
    --line: #2a2f3c;
    --line-strong: #394051;
    --accent: #f06595;
    --accent-strong: #f783ac;
    --accent-soft: rgba(240, 101, 149, .13);
    --accent-2: #9775fa;
    --link: #74a7ff;
    --s90: #f06595;
    --s80: #ff922b;
    --s70: #51cf66;
    --s60: #4dabf7;
    --s50: #9775fa;
    --s0: #868e96;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; letter-spacing: .01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ---------- boot / loading ---------- */
.boot { min-height: 60vh; display: grid; place-items: center; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s ease, opacity .4s;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  /* no backdrop-filter: it causes blank repaint bands in some Chromium builds */
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 12px rgba(0, 0, 0, .04);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px var(--accent-soft);
}
.logo small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .08em; line-height: 1; }
.logo span { line-height: 1.1; }
.main-nav { display: flex; gap: 2px; }
.main-nav a {
  color: var(--muted); padding: 7px 11px; border-radius: 9px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--accent); background: var(--accent-soft); }
.header-search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.classic-link { font-size: 12px; color: var(--muted); white-space: nowrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; }
.classic-link:hover { color: var(--text); text-decoration: none; border-color: var(--line-strong); }

.search-box { position: relative; }
.search-box input {
  width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 14px 0 38px; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-box input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.search-box kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 11px/1 var(--font); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px;
}
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 150;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  max-height: min(70vh, 560px); overflow: auto; padding: 6px;
}
.suggest[hidden] { display: none; }
.suggest h6 { margin: 8px 10px 4px; font-size: 11px; color: var(--faint); font-weight: 700; letter-spacing: .08em; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--text); }
.suggest a:hover, .suggest a.sel { background: var(--surface-2); text-decoration: none; }
.suggest img, .suggest .ph { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--surface-3); flex: none; }
.suggest .s-main { flex: 1; min-width: 0; }
.suggest .s-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.suggest .s-sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .s-all { justify-content: center; color: var(--link); font-size: 13px; }

/* ---------- layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 64px; }
.page-narrow { max-width: 900px; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; font-weight: 800; }
.section-head .sub { color: var(--muted); font-size: 13px; }
.section-head .more { margin-left: auto; font-size: 13px; font-weight: 600; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: .01em; }
.page-sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs span::before { content: "›"; margin-right: 6px; color: var(--faint); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sidebar-col { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .sub { font-weight: 500; font-size: 12px; color: var(--muted); }
.card h3 svg, .section-head svg, .btn svg { width: 17px; height: 17px; flex: none; }
.card h3 { white-space: nowrap; }
.chart-card .card-head h3, .card-pad h3 { white-space: normal; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-body { padding: 16px 20px 20px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px;
  font-weight: 600; color: var(--text); white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.input, .select {
  height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 11px;
  outline: none; min-width: 0; font-size: 14px;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm, .select-sm { height: 30px; font-size: 13px; border-radius: 8px; padding: 0 8px; }
.select { padding-right: 28px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.field { display: grid; gap: 5px; }
.field > label, .field-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.range-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 13px;
  font-weight: 600; color: var(--muted); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; line-height: 1.6;
}
a.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip .n { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-x { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .03em; background: var(--surface-3); color: var(--muted); white-space: nowrap; line-height: 1.7;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.badge-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge-blue { background: color-mix(in srgb, var(--s60) 14%, transparent); color: var(--s60); }
.badge-purple { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }

.score {
  display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 7px; border-radius: 8px;
  font-weight: 800; font-size: 14px; color: #fff; background: var(--s0); font-variant-numeric: tabular-nums; line-height: 1;
}
.score.s90 { background: var(--s90); } .score.s80 { background: var(--s80); } .score.s70 { background: var(--s70); }
.score.s60 { background: var(--s60); } .score.s50 { background: var(--s50); } .score.sx { background: var(--surface-3); color: var(--faint); }
.score-lg { min-width: 64px; height: 44px; font-size: 24px; border-radius: 12px; }
.tx90 { color: var(--s90); } .tx80 { color: var(--s80); } .tx70 { color: var(--s70); } .tx60 { color: var(--s60); } .tx50 { color: var(--s50); } .tx0 { color: var(--s0); }

/* ---------- game cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.cards-sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gcard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); transition: transform .15s ease, box-shadow .15s ease, border-color .15s; position: relative;
}
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); text-decoration: none; }
.gcard .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.gcard .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gcard .thumb .noimg, .noimg {
  width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 12px; letter-spacing: .1em;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px);
}
.gcard .score { position: absolute; left: 10px; top: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.gcard .rank-no {
  position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, .65); color: #fff; font-weight: 800; font-size: 12px;
  padding: 2px 8px; border-radius: 999px;
}
.gcard .body { padding: 10px 12px 12px; display: grid; gap: 3px; flex: 1; align-content: start; }
.gcard .title { font-weight: 700; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gcard .brand { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .meta { font-size: 12px; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.gcard .extra { font-size: 12px; color: var(--accent); font-weight: 700; }
.medal-1 .rank-no { background: linear-gradient(135deg, #f7c948, #d99a07); color: #3b2a00; }
.medal-2 .rank-no { background: linear-gradient(135deg, #e3e7ee, #9aa4b5); color: #1e2433; }
.medal-3 .rank-no { background: linear-gradient(135deg, #f1b58a, #b86b3c); color: #2e1405; }

.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.hscroll > * { scroll-snap-align: start; }
.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

/* ---------- lists / tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th.sorted { color: var(--accent); }
table.data th.sorted::after { content: " ▼"; font-size: 9px; }
table.data th.sorted.asc::after { content: " ▲"; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
table.data td.num, table.data th.num { text-align: right; }
table.data .thumb-cell { width: 64px; padding-right: 0; }
table.data .thumb-cell img, table.data .thumb-cell .noimg { width: 56px; height: 42px; object-fit: contain; border-radius: 6px; background: var(--surface-2); display: block; }
table.data .title-cell a { font-weight: 700; color: var(--text); }
table.data .title-cell a:hover { color: var(--accent); }
table.data .sub { display: block; font-size: 12px; color: var(--muted); }
.rank-cell { font-weight: 800; color: var(--faint); width: 44px; text-align: center; }
.rank-cell.top { color: var(--accent); }

.list { display: grid; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item img, .list-item .noimg { width: 56px; height: 42px; object-fit: contain; border-radius: 6px; background: var(--surface-2); flex: none; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .t { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.list-item .s { font-size: 12px; color: var(--muted); }

.pager { display: flex; justify-content: center; gap: 4px; margin-top: 22px; flex-wrap: wrap; }
.pager button {
  min-width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.pager button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { align-self: center; color: var(--faint); padding: 0 4px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.kpi .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .d { font-size: 12px; color: var(--faint); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  padding: 11px 14px; font-weight: 700; font-size: 14px; color: var(--muted); border: 0; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-size: 12px; color: var(--faint); font-weight: 600; margin-left: 4px; }
.tabs-sticky { position: sticky; top: var(--header-h); z-index: 20; background: var(--bg); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 44px 40px; margin-bottom: 8px;
  background:
    radial-gradient(1200px 400px at 110% -10%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 120%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; letter-spacing: .02em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 8px 0 22px; max-width: 640px; }
.hero .search-box input { height: 52px; font-size: 16px; border-radius: 14px; padding-left: 46px; background: var(--surface); }
.hero .search-box .search-icon { left: 16px; width: 20px; height: 20px; }
.hero .search-box { max-width: 640px; }
.hero .chips { margin-top: 16px; }

/* ---------- entity header (game / brand / creator / user) ---------- */
.ent-head { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.ent-head.no-media { grid-template-columns: minmax(0, 1fr); }
.cover {
  border-radius: 16px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  aspect-ratio: 4 / 3; display: grid; place-items: center; cursor: zoom-in; position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cover .count { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.ent-title { font-size: clamp(22px, 3vw, 32px); font-weight: 900; line-height: 1.3; }
.ent-kana { color: var(--faint); font-size: 13px; margin-top: 2px; }
.ent-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.ent-meta b { color: var(--text); font-weight: 700; }
.ent-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.scorebox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 20px; padding: 18px 20px; }
.ring { --p: 0; --c: var(--s0); width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring .rv { position: relative; text-align: center; line-height: 1.1; }
.ring .rv b { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; display: block; }
.ring .rv span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 18px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.avatar {
  width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center; font-size: 38px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow);
}
.avatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; box-shadow: none; flex: none; }

/* ---------- comments ---------- */
.comments { display: grid; gap: 12px; }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-head .who { font-weight: 700; color: var(--text); }
.comment-head .when { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.comment-head .votes { margin-left: auto; font-size: 12px; color: var(--muted); }
.comment-game { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-game img, .comment-game .noimg { width: 48px; height: 36px; object-fit: contain; border-radius: 6px; background: var(--surface-2); }
.comment-game a { font-weight: 700; color: var(--text); }
.comment-body { margin-top: 8px; word-break: break-word; overflow-wrap: anywhere; }
.comment-foot { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.memo-link { font-weight: 700; }
.pov-comment { padding: 10px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.pov-comment:last-child { border-bottom: 0; }
.rank-tag { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-weight: 900; font-size: 12px; color: #fff; }
.rank-A { background: var(--s90); } .rank-B { background: var(--s60); } .rank-C { background: var(--s0); }
.spoiler { position: relative; }
.spoiler.locked .spoiler-body { filter: blur(7px); user-select: none; pointer-events: none; max-height: 160px; overflow: hidden; }
.spoiler-gate {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2;
}
.spoiler:not(.locked) .spoiler-gate { display: none; }
.spoiler-gate .box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow-lg); }

/* ---------- article (long review) ---------- */
.article { font-size: 16.5px; line-height: 2; letter-spacing: .02em; max-width: 44em; word-break: break-word; overflow-wrap: anywhere; }
.article p { margin: 0 0 1em; }
.quote { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; font-weight: 600; font-size: 16px; }

/* ---------- bars ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .a { background: var(--s90); } .bar .b { background: var(--s60); } .bar .c { background: var(--s0); }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.hbar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hbar { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); min-width: 2px; }

/* ---------- POV block ---------- */
.pov-groups { display: grid; gap: 14px; }
.pov-group h4 { font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .06em; margin-bottom: 6px; }
.pov-chip.nb { border-style: dashed; }
.pov-chip.nb.masked { color: transparent; text-shadow: 0 0 7px var(--muted); }
.pov-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pov-item:last-child { border-bottom: 0; }
.pov-item .bar { margin: 6px 0 2px; height: 7px; max-width: 360px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: 300px; }
.chart-tall { height: 420px; }
.chart-short { height: 220px; }
.chart-card .card-head .row { margin-left: auto; }
.chart-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chart-controls .field { grid-auto-flow: column; align-items: center; gap: 6px; }
.chart-note { font-size: 12px; color: var(--faint); margin-top: 6px; }

/* ---------- search page ---------- */
.search-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; }
.filters .card-body { display: grid; gap: 16px; }
.filters-toggle { display: none; }
.results-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.results-bar .count { font-weight: 800; font-size: 15px; }
.results-bar .count b { color: var(--accent); font-size: 20px; margin: 0 2px; font-variant-numeric: tabular-nums; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ac { position: relative; }
.ac .suggest { top: calc(100% + 4px); }

/* ---------- year calendar ---------- */
.year-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.year-strip a { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; }
.year-strip a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.year-strip a:hover { text-decoration: none; border-color: var(--line-strong); color: var(--text); }
.day-block { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.day-block .day { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.day-block .day small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.year-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.year-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--text); display: grid; gap: 2px; }
.year-tile:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.year-tile .y { font-size: 22px; font-weight: 900; }
.year-tile .s { font-size: 12px; color: var(--muted); }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .big { font-size: 40px; margin-bottom: 6px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--surface-2); border: 1px solid var(--line); }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(8, 10, 16, .88); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%;
  font-size: 22px; cursor: pointer;
}
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; }
.lightbox .lb-next { right: 18px; top: 50%; }
.lightbox .lb-count { position: absolute; bottom: 16px; color: #ddd; font-size: 13px; }
.tile-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile-link { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.tile-link:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.tile-link .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tile-link .ic svg { width: 22px; height: 22px; }
.tile-link b { display: block; }
.tile-link span { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.link-list a, .link-list span { font-size: 13px; padding: 5px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); }
.link-list span { color: var(--faint); }
.link-list a:hover { border-color: var(--accent); text-decoration: none; }
.profile-text { font-size: 14px; line-height: 1.85; max-height: 240px; overflow: auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { flex: 1; min-width: 180px; max-width: 320px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px; display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 400; box-shadow: var(--shadow-lg);
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .main-nav a { padding: 7px 8px; }
  .classic-link { display: none; }
}
@media (max-width: 1024px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .sidebar-col { position: static; }
  .ent-head { grid-template-columns: 260px minmax(0, 1fr); }
  .main-nav { display: none; }
  .menu-btn { display: grid; }
  .main-nav.open {
    display: grid; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--surface); padding: 10px 16px 16px;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  .main-nav.open a { padding: 11px 12px; }
}
@media (max-width: 860px) {
  .search-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: fixed; inset: var(--header-h) 0 0 0; z-index: 90; max-height: none; border-radius: 0; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .page { padding: 16px 14px 48px; }
  .header-inner { padding: 0 12px; gap: 10px; }
  .logo small { display: none; }
  .ent-head { grid-template-columns: minmax(0, 1fr); }
  .cover { max-width: 420px; }
  .hero { padding: 28px 20px; border-radius: 18px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .scorebox { grid-template-columns: minmax(0, 1fr); }
  .scorebox .ring { justify-self: start; }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-block { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hbar-row { grid-template-columns: 110px 1fr 48px; }
  .search-box kbd { display: none; }
  .chart { height: 260px; }
  .chart-tall { height: 340px; }
}
@media (max-width: 520px) {
  .header-search { position: static; }
  .logo > span:last-child { display: none; }
  .header-tools .icon-btn { width: 34px; height: 34px; }
  .page-title { font-size: 22px; }
}
@media print {
  .site-header, .site-footer, .filters, .pager { display: none !important; }
}
