/* 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, .suggest .noimg { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--surface-3); flex: none; }
.suggest .noimg { font-size: 0; }   /* a plain tile: "NO IMAGE" does not fit in 34px */
.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; }
/* long reviews: the text at least as wide as on the classic page (995px) */
.page-memo { max-width: 1080px; }
.page-memo .article { max-width: none; }
/* a part of a page that may use the whole window's width while the rest keeps --maxw
   (100vw counts the scrollbar: the 28px margin leaves room for it) */
@media (min-width: 1360px) { .bleed { margin-left: calc(50% - 50vw + 28px); margin-right: calc(50% - 50vw + 28px); } }
.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: minmax(0, 1fr) auto minmax(0, 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 th .th-sort { cursor: pointer; user-select: none; }
table.data th .th-sort:hover { color: var(--text); }
table.data th .th-sort.sorted { color: var(--accent); }
table.data th .th-sort.sorted::after { content: " ▼"; font-size: 9px; }
table.data th .th-sort.sorted.asc::after { content: " ▲"; }
table.data th .th-sort.minor { font-weight: 600; font-size: 11px; }
table.data th .th-sep { margin: 0 6px; color: var(--faint); }
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; }
/* 音楽 tab: links to a song's video / audio on Eroge Music Quiz, and the VN's songs EGS lacks */
.music-table .media { display: inline-flex; gap: 4px; white-space: nowrap; }
.music-table .media a { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); border: 1px solid var(--line); }
.music-table .media a:hover { color: var(--accent); border-color: var(--accent); }
.music-table .media svg { width: 16px; height: 16px; }
.music-table tr.sep td { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); padding: 7px 12px; }
.music-note svg { width: 13px; height: 13px; vertical-align: -2px; }
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); }
/* a user's 評価したゲーム: one row per game, the comment in the last, widest column */
/* the other columns keep to their content and the comment column takes all the width left over,
   however short the comments are */
.ugames table.data td.ugame { min-width: 260px; max-width: 320px; }
.ugames table.data .thumb-cell { width: 92px; padding: 6px 0 6px 8px; }
/* tall covers shrink instead of making the row taller */
.ugames table.data .thumb-cell img { width: auto; height: auto; max-width: 84px; max-height: 64px; margin: 0 auto; background: none; }
.ugames table.data .thumb-cell .noimg { width: 84px; height: 56px; }
.ugames.fit .table-wrap { width: fit-content; max-width: 100%; }
.ugames.fit table.data { width: auto; }
.udate { margin-left: 8px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.ubadge { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 10.5px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.ugames table.data td.ucomment-cell { width: 100%; min-width: 320px; font-size: 13px; line-height: 1.65; }
.ucomment .memo-link { font-size: 12px; font-weight: 700; }
.ugames .mlabel { display: none; }
/* phones and tablets (the table needs ~1,030px): each game a small card (cover, title and score; dates on one line; the comment below),
   the column headers a row of sort buttons */
@media (max-width: 1000px) {
  .ugames table.data, .ugames table.data thead, .ugames table.data tbody { display: block; }
  .ugames table.data thead tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
  .ugames table.data th { position: static; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
  .ugames table.data th:not(.sortable, .sub-sorts) { display: none; }
  .ugames table.data th.sub-sorts { display: contents; }
  .ugames table.data th.sub-sorts .th-sep { display: none; }
  .ugames table.data th.sub-sorts .th-sort { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 700; }
  .ugames table.data tbody tr { display: flow-root; position: relative; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .ugames table.data tbody tr:last-child { border-bottom: 0; }
  .ugames table.data td { display: block; padding: 0; border: 0; background: none !important; text-align: left; }
  .ugames table.data td.thumb-cell { float: left; width: 64px; height: 62px; padding: 0 10px 0 0; }   /* the height keeps the text beside a short cover */
  .ugames table.data .thumb-cell img { max-width: 54px; max-height: 60px; margin: 0; }
  .ugames table.data .thumb-cell .noimg { width: 54px; height: 40px; font-size: 8px; }
  .ugames table.data td.ugame { min-width: 0; max-width: none; padding-right: 44px; }
  .ugames table.data td.c-t { position: absolute; top: 10px; right: 12px; }
  .ugames table.data td.c-meta { display: inline-block; margin: 3px 10px 0 0; color: var(--muted); font-size: 12px; }
  .ugames table.data td.c-meta:has(> .faint:only-child) { display: none; }
  .ugames .mlabel { display: inline; margin-right: 4px; color: var(--faint); }
  .ugames table.data td.ucomment-cell { clear: both; width: auto; min-width: 0; padding-top: 6px; }
  .ugames table.data td.ucomment-cell:empty { display: none; }
}
.rank-cell { font-weight: 800; color: var(--faint); width: 44px; text-align: center; }
.rank-cell.top { color: var(--accent); }

.list { display: grid; grid-template-columns: minmax(0, 1fr); }   /* an auto column would grow to the longest (unwrapped) title */
.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); }
.rec-why { display: flex; margin-top: 5px; }
.gist-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 0; }
.rec-reason { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.packages figure { margin: 0; text-align: center; }
.packages img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 6px; background: var(--surface-2); cursor: zoom-in; }
.packages figcaption { font-size: 12px; margin-top: 4px; }
.packages figcaption svg { width: 11px; height: 11px; vertical-align: -1px; }
.rec-why .chip { font-size: 11px; padding: 1px 8px; }

.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; }
.pager .per-page { display: flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 12px; color: var(--muted); }
[data-cb="ptop"] .pager { margin: 0 0 14px; }

/* ---------- 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); }

/* ---------- 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; }

/* ---------- characters (game page) ---------- */
.char-controls { gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.char-legend { margin: 0 0 12px; }
.char-role { margin: 22px 0 10px; font-size: 16px; }
.char-role .sub { color: var(--faint); font-weight: 600; font-size: 13px; margin-left: 4px; }
.char-list { display: grid; gap: 12px; }
.char-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; padding: 14px; }
.char-card.spoil1, .char-card.spoil2 { border-style: dashed; }
.char-img { position: relative; width: 128px; min-height: 96px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); align-self: start; }
.char-img img { display: block; width: 100%; height: auto; }
.char-img.noimg { height: 150px; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.char-img.hidden-img img { filter: blur(14px); transform: scale(1.1); }
.char-img .reveal { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, .35); color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.char-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.char-name b { font-size: 16px; }
.char-info { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.char-info th { text-align: left; font-weight: 600; color: var(--muted); white-space: nowrap; padding: 3px 12px 3px 0; vertical-align: top; width: 1%; }
.char-info td { padding: 3px 0; line-height: 1.6; }
.trait.spoil1, .char-info .spoil1 { color: var(--accent-2); }
.trait.spoil2, .char-info .spoil2 { color: var(--accent); }
.trait.lie { text-decoration: line-through; }
@media (max-width: 560px) {
  .char-card { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .char-img { width: 88px; }
}

/* ---------- 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; }
/* compact enough to fit a 1440p screen without scrolling; smaller screens scroll the panel */
.filters .card-body { display: grid; gap: 14px; }
/* minmax(0, ...) and width: 100%: Firefox otherwise keeps inputs at their natural ~144px and the
   panel scrolls sideways */
.filters .card-body { grid-template-columns: minmax(0, 1fr); }
.filters .field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filters .field, .filters .ac { min-width: 0; }
.filters .field-row .input, .filters .field-row .select, .filters .ac .input { width: 100%; }
.filters .field-row .select { padding-left: 10px; }
.filters .checks { display: grid; gap: 8px; }
.filters .seg button { padding: 5px 8px; }
.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); }

/* ---------- DLsite search ---------- */
.dl-card:hover { transform: none; }
.dl-card .thumb { display: block; }
.dl-card a.title { color: var(--text); }
.dl-card a.title:hover, .dl-card a.brand:hover { color: var(--accent); }
.dl-card .meta { color: var(--muted); }
.dl-off {
  position: absolute; right: 8px; top: 8px; background: var(--warn); color: #fff; font-weight: 800; font-size: 11px;
  padding: 2px 7px; border-radius: 999px;
}
.dl-egs { font-size: 12px; font-weight: 700; margin-top: 2px; }
.dl-price { color: var(--text); font-weight: 700; white-space: nowrap; }
.dl-price s { color: var(--faint); font-weight: 400; }
.dl-price.sale { color: var(--warn); }
.dl-stars { color: #d99a07; white-space: nowrap; }
.dl-stars small { color: var(--faint); margin-left: 1px; }
.dl-table .thumb-cell img, .dl-table .thumb-cell .noimg { width: 64px; height: 64px; }
.dl-table .thumb-cell { width: 72px; min-width: 72px; }
.dl-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 60em; }
.dl-tags { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; font-size: 11px; }
.dl-tags a { color: var(--faint); }
.dl-tags a:hover { color: var(--accent); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--accent); }
.dl-dialog {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg);
}
.dl-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dl-dialog[open] { display: flex; flex-direction: column; }
.dl-dialog-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dl-dialog-head h3 { font-size: 16px; font-weight: 800; }
.dl-dialog-head .input { width: 200px; }
.dl-dialog-body { overflow: auto; padding: 4px 16px 16px; }
.dl-genre-group h4 { font-size: 13px; font-weight: 800; color: var(--muted); margin: 14px 0 8px; }
.dl-genre-group .chip { cursor: pointer; font: inherit; font-size: 13px; }
.dl-cover { cursor: pointer; }
.dl-crumbs { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.dl-crumbs .crumbs { margin-bottom: 0; flex: 1; min-width: 0; padding-top: 4px; }
.dl-back { flex: none; white-space: nowrap; }
.dl-title { color: var(--text); }
.dl-title:hover { color: var(--accent); }
.dl-facts { margin-top: 16px; padding: 14px 18px; }
.dl-text { white-space: pre-wrap; line-height: 1.8; max-width: 60em; }
.dl-egs-list { display: grid; gap: 10px; max-width: 640px; }
.dl-egs-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: var(--text); }
.dl-egs-row > span:last-child { display: grid; gap: 2px; }
.dl-egs-row:hover { border-color: var(--accent); text-decoration: none; }
.dl-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dl-shot { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; padding: 0; background: var(--surface-2); cursor: zoom-in; aspect-ratio: 16 / 10; }
.dl-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dl-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.dl-info-grid h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.dl-hist-row { display: grid; grid-template-columns: 2.5em minmax(0, 1fr) 5em 3em; gap: 8px; align-items: center; font-size: 13px; margin-top: 4px; }
.dl-hist-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.dl-hist-bar i { display: block; height: 100%; background: #d99a07; border-radius: 5px; }
.dl-ranks { border-collapse: collapse; font-size: 13px; }
.dl-ranks th { text-align: left; color: var(--muted); font-weight: 700; padding: 4px 12px 4px 0; vertical-align: top; white-space: nowrap; }
.dl-ranks td { padding: 4px 14px 4px 0; vertical-align: top; }
.dl-ranks td b, .dl-ranks td span { display: block; white-space: nowrap; }
.dl-bonuses { display: grid; gap: 12px; }
.dl-bonuses p { margin-top: 4px; white-space: pre-wrap; }
.dl-wl { color: #e2557b; font-weight: 700; }
.dl-links { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.dl-vndb-cell { display: block; font-size: 12px; margin-top: 2px; }
.dl-vndb-score { min-width: 3.4em; font-size: 13px; }
@media (max-width: 640px) { .dl-ranks tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .dl-ranks th { grid-column: 1 / -1; } }

/* ---------- 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); }
.notice-warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice-warn b { color: var(--warn); }
.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; }
}

/* "me" mode (me.js): the viewer's own score / list status next to every game link */
.mine { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.6;
  color: var(--accent); border: 1px solid var(--accent); background: var(--accent-soft); white-space: nowrap; vertical-align: 1px; }
.mine::before { content: "★ "; }
.gcard .thumb .mine { position: absolute; right: 8px; bottom: 8px; margin: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); background: var(--surface); }
.mine-badge { text-decoration: none; }
.mine-badge::before { content: "★ "; }
.icon-btn.on { color: var(--accent); border-color: var(--accent); }
.user-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn.on { color: var(--accent); border-color: var(--accent); }
.vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
.vs .who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.vs .who:last-child { flex-direction: row-reverse; text-align: right; }
.vs .who .name { font-size: 20px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.vs .mid { font-weight: 800; color: var(--faint); }
.vs .who-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.vs .who:last-child .who-name { justify-content: flex-end; }
.who-change { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 7px;
  width: 26px; height: 26px; padding: 0; font-size: 13px; line-height: 1; cursor: pointer; }
.who-change:hover { color: var(--accent); border-color: var(--accent); }
.who-pick { margin-top: 8px; text-align: left; }
.who-pick[hidden] { display: none; }
.who-pick input { width: 100%; min-width: 200px; }
.who-pick .suggest { min-width: 280px; }
.vs .who:last-child .who-pick .suggest { left: auto; }
.pick { position: relative; }
.feed-item .comment-head .who { font-weight: 700; }

/* 攻略 tab: a walkthrough of seiya-saiga.com (pages/game_kouryaku.js).  Its own colours come as
   --kr-fg / --kr-bg (as on the page) and --kr-fg-d / --kr-bg-d (same hue, for the dark theme). */
.kr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
/* チェックを外す keeps its place when there is nothing to clear, so the walkthrough doesn't jump */
.kr-head [hidden] { display: inline-flex; visibility: hidden; }
.kr-doc { --kr-paper: #fff; --kr-text: #111; --kr-line: #b9c3ea; --kr-link: #2451c7; --kr-bar: #dfe2ea; --kr-sel: #b9d2ff;
  background: var(--kr-paper); color: var(--kr-text); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  overflow-x: auto; font-size: 14px; line-height: 1.7; }
.kr-doc .kr-fg { color: var(--kr-fg); }
.kr-doc .kr-bg { background-color: var(--kr-bg); }
.kr-doc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.kr-doc table table { margin: 0; }
.kr-doc td, .kr-doc th { border: 1px solid var(--kr-line); padding: 6px 8px; vertical-align: top; font-size: 14px; }
.kr-doc a { color: var(--kr-link); }
.kr-doc img { max-width: 100%; height: auto; vertical-align: middle; }
.kr-doc input[type=checkbox] { margin: 0 6px 0 0; vertical-align: -2px; accent-color: var(--accent); }
.kr-doc label, .kr-doc input[type=checkbox], .kr-doc .kr-sp[data-part=choice] { cursor: pointer; }
.kr-doc hr { border: 0; border-top: 1px solid var(--kr-line); margin: 8px 0; }
/* a row taken out (shop links) where a cell above spans into it: kept for the table's shape, unseen */
.kr-doc tr.kr-gone > td, .kr-doc tr.kr-gone > th { padding: 0; border: 0; }
/* spoilers: hidden text is a bar in place; selecting it shows it */
.kr-doc .kr-hid { color: transparent !important; background: var(--kr-bar); border-radius: 3px; cursor: text;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.kr-doc .kr-hid::selection { color: var(--kr-text); background: var(--kr-sel); }
.kr-doc input.kr-hid { visibility: hidden; }
.kr-doc img.kr-hid { filter: blur(16px) grayscale(1); opacity: .5; }
:root[data-theme="dark"] .kr-doc { --kr-paper: var(--surface); --kr-text: var(--text); --kr-line: var(--line-strong);
  --kr-link: var(--link); --kr-bar: #2c3140; --kr-sel: #3d5591; }
:root[data-theme="dark"] .kr-doc .kr-fg { color: var(--kr-fg-d); }
:root[data-theme="dark"] .kr-doc .kr-bg { background-color: var(--kr-bg-d); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kr-doc { --kr-paper: var(--surface); --kr-text: var(--text); --kr-line: var(--line-strong);
    --kr-link: var(--link); --kr-bar: #2c3140; --kr-sel: #3d5591; }
  :root:not([data-theme="light"]) .kr-doc .kr-fg { color: var(--kr-fg-d); }
  :root:not([data-theme="light"]) .kr-doc .kr-bg { background-color: var(--kr-bg-d); }
}
@media (max-width: 640px) { .kr-doc { padding: 8px; } .kr-doc td, .kr-doc th { padding: 4px 5px; font-size: 13px; } }
