:root {
  color-scheme: dark;
  --bg: #17181b;
  --panel: #202226;
  --panel2: #2a2d32;
  --line: #3a3e45;
  --text: #ece9e3;
  --muted: #a4a39e;
  --accent: #e8b04a;
  --tier-s: #f0c14d;
  --tier-a: #7fd1a8;
  --tier-b: #8fb8e8;
  --tier-c: #b9b4ac;
  --tier-d: #8b8780;
  --warn: #e98570;
  --radius: 10px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; font-size: 15px; }
button, select, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }

.top { background: #111214; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1480px; margin: 0 auto; padding: 22px 24px 10px; display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.brand h1 { font-size: 26px; letter-spacing: .04em; font-weight: 700; }
.brand p { color: var(--muted); font-size: 13.5px; }
.stats { display: flex; gap: 22px; margin: 0; flex-wrap: wrap; }
.stats div { min-width: 64px; }
.stats dt { font-size: 11.5px; color: var(--muted); }
.stats dd { margin: 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd small { font-size: 12px; color: var(--muted); font-weight: 400; }

.tabs { max-width: 1480px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

.filters { max-width: 1480px; margin: 0 auto; padding: 14px 24px; display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center; font-size: 13.5px; }
.filters[hidden] { display: none; }
.fgroup { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #1a1508; font-weight: 700; }
.fcheck, .frange, .fsort { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.frange output { color: var(--text); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.frange input { width: 120px; accent-color: var(--accent); }
.fcheck input { accent-color: var(--accent); }
.fsort select { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.fcount { margin-left: auto; color: var(--muted); }

main { max-width: 1480px; margin: 0 auto; padding: 4px 24px 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; text-align: left; padding: 0; }
.card:hover, .card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.card .pics { display: grid; grid-template-columns: 2fr 3fr; background: #0f1012; aspect-ratio: 13 / 6; }
.card .pics img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.card .pics img.stand { object-fit: contain; object-position: center; background: #e6e4e0; }
.card .body { padding: 10px 12px 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.score { grid-row: span 2; width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 21px; font-variant-numeric: tabular-nums; color: #15161a; }
.score.s { background: var(--tier-s); } .score.a { background: var(--tier-a); } .score.b { background: var(--tier-b); }
.score.c { background: var(--tier-c); } .score.d { background: var(--tier-d); }
.score.none { background: var(--panel2); color: var(--muted); font-size: 12px; font-weight: 400; }
.card h3 { font-size: 15px; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }
.card .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 11.5px; color: var(--muted); }
.tag.ng { border-color: var(--warn); color: var(--warn); }
.tag.use-daily { border-color: var(--tier-a); color: var(--tier-a); }
.tag.use-stock { border-color: var(--tier-d); color: var(--tier-c); }
.tag.more { border-color: var(--accent); color: var(--accent); }
.card .why { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty { color: var(--muted); padding: 60px 0; text-align: center; }

/* ランキング */
.rank { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rank th { text-align: left; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line); padding: 6px 8px; position: sticky; top: 0; background: var(--bg); white-space: nowrap; }
.rank td { border-bottom: 1px solid #2c2f34; padding: 6px 8px; vertical-align: middle; }
.rank tr { cursor: pointer; }
.rank tbody tr:hover td { background: var(--panel); }
.rank .thumbs { display: flex; gap: 4px; }
.rank .thumbs img { height: 62px; width: auto; border-radius: 3px; }
.rank .num { font-variant-numeric: tabular-nums; text-align: right; }
.rank .wide { min-width: 200px; }
.table-wrap { overflow-x: auto; }

/* 読み物 */
.prose { max-width: 900px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose h3 { font-size: 15.5px; margin: 18px 0 4px; color: var(--accent); }
.prose p { margin: 6px 0; }
.finding { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; }
.finding h3 { color: var(--text); margin: 0 0 4px; font-size: 16px; }
.finding .ev { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.finding .ev button { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 0; cursor: pointer; overflow: hidden; }
.finding .ev img { height: 96px; width: auto; }
.theme { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.theme h2 { margin: 0 0 4px; }
.theme .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid #0005; }

/* 詳細 */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(5, 6, 8, .78); }
.detail { width: min(1280px, 96vw); max-height: 94vh; padding: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.detail-head { position: sticky; top: 0; z-index: 2; background: #111214; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.detail-head h2 { font-size: 17px; line-height: 1.35; }
.detail-head p { color: var(--muted); font-size: 13px; }
.detail-head .close { margin-left: auto; }
.close { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.members { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: #141518; border-bottom: 1px solid var(--line); }
.member { background: none; border: 2px solid transparent; border-radius: 6px; padding: 2px; cursor: pointer; flex: none; color: var(--muted); font-size: 11.5px; text-align: center; }
.member img { height: 84px; width: auto; border-radius: 3px; }
.member.on { border-color: var(--accent); color: var(--text); }
.detail-body { padding: 14px 16px 20px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }
.shots { display: grid; grid-template-columns: 2fr 3fr; gap: 8px; align-items: start; }
.shots button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.shots img { width: 100%; border-radius: 6px; }
.side h3 { font-size: 13.5px; color: var(--muted); font-weight: 400; margin: 12px 0 4px; }
.side h3:first-child { margin-top: 0; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px; align-items: center; font-size: 13px; }
.bar { height: 7px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bars .v { font-variant-numeric: tabular-nums; }
.list { margin: 0; padding-left: 18px; font-size: 13.5px; }
.prompts { grid-column: 1 / -1; }
.prompt { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.prompt header { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 13px; color: var(--muted); gap: 8px; }
.prompt pre { margin: 0; padding: 0 10px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); font-size: 13px; max-height: 260px; overflow-y: auto; }
.copy { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 10px; cursor: pointer; font-size: 12.5px; }
.lightbox { max-width: 98vw; max-height: 98vh; padding: 0; background: transparent; border: 0; overflow: visible; }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 6px; }
.lightbox .close { position: fixed; top: 10px; right: 10px; }
.foot { max-width: 1480px; margin: 0 auto; padding: 12px 24px 40px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 860px) {
  .detail-body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top-inner, .filters { padding-left: 16px; padding-right: 16px; }
  main { padding-left: 16px; padding-right: 16px; }
  .foot { padding-left: 16px; padding-right: 16px; }
  .stats { gap: 14px; }
  .stats dd { font-size: 18px; }
  .fcount { margin-left: 0; width: 100%; }
  .card .pics { aspect-ratio: 13 / 7; }
  .detail { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; border: 0; margin: 0; }
  .shots { grid-template-columns: 1fr; }
}
