/* ミームクロニクル — SetLi の DECK デザイン寄り（生成り＋墨、角丸、ずらした硬い影、押すと沈む） */
:root,
:root[data-theme="light"] {
  --bg: #f7fafb; --surface: #ffffff; --surface-alt: #f0f5f7;
  --ink: #23343c; --muted: #62767d; --dim: #93a6ae;
  --rule: #e1eaed; --rule-strong: #c9d8de;
  --primary: #4fa8d8; --primary-ink: #23343c;
  --hero: #302833; --hero-ink: #fbfaf5;
  --accent: #c94f36; --link: #2a77a6;
  --shadow-hard: #b9cbd2;
  --tier-4: #c94f36; --tier-3: #23343c; --tier-2: #62767d; --tier-1: #93a6ae;
  --band: #dcebf2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1e22; --surface: #23272c; --surface-alt: #2b3036;
    --ink: #e8eaed; --muted: #9aa3ac; --dim: #6b7580;
    --rule: #363c42; --rule-strong: #4a525a;
    --primary: #6fb8e0; --primary-ink: #1b1e22;
    --hero: #e9e4d4; --hero-ink: #22262b;
    --accent: #e08a78; --link: #8cc6e8;
    --shadow-hard: #3f464d;
    --tier-4: #e08a78; --tier-3: #e8eaed; --tier-2: #9aa3ac; --tier-1: #6b7580;
    --band: #2f3f4a;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1e22; --surface: #23272c; --surface-alt: #2b3036;
  --ink: #e8eaed; --muted: #9aa3ac; --dim: #6b7580;
  --rule: #363c42; --rule-strong: #4a525a;
  --primary: #6fb8e0; --primary-ink: #1b1e22;
  --hero: #e9e4d4; --hero-ink: #22262b;
  --accent: #e08a78; --link: #8cc6e8;
  --shadow-hard: #3f464d;
  --tier-4: #e08a78; --tier-3: #e8eaed; --tier-2: #9aa3ac; --tier-1: #6b7580;
  --band: #2f3f4a;
}
/* 形は色のテーマと関係なく固定 */
:root {
  --font-sans: "Zen Kaku Gothic New", -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-head: var(--font-sans);
  --font-num: "Montserrat", var(--font-sans);
  --r-lg: 16px; --r: 10px; --r-sm: 8px; --r-full: 9999px;
  --lift: 3px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.75; -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.meta-small { font-size: 12px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 押せるものの共通：ずらした硬い影と、押すと沈む動き */
.card, .year-card, .toc a, .seg, .search-form button, .search-big button, .dlg-close {
  box-shadow: var(--lift) var(--lift) 0 var(--shadow-hard);
  transition: transform .08s ease-out, box-shadow .08s ease-out, border-color .12s, background-color .12s;
}
.card:active, .year-card:active, .toc a:active, .seg:active,
.search-form button:active, .search-big button:active, .dlg-close:active {
  transform: translate(var(--lift), var(--lift)); box-shadow: 0 0 0 var(--shadow-hard);
}
@media (prefers-reduced-motion: reduce) {
  .card, .year-card, .toc a, .seg, .search-form button, .search-big button, .dlg-close { transition: none; }
  .card:active, .year-card:active, .toc a:active, .seg:active,
  .search-form button:active, .search-big button:active, .dlg-close:active { transform: none; }
}

/* ヘッダー */
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); }
.head-row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 10px; }
.logo {
  font-family: var(--font-head); font-weight: 900; font-size: 21px; letter-spacing: .04em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.search-form { display: flex; gap: 6px; margin-left: auto; flex: 0 1 340px; min-width: 0; }
.search-form input, .search-big input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm); padding: 4px 12px; height: 36px; font-size: 14px;
}
.search-form input:focus, .search-big input:focus { outline: none; border-color: var(--primary); }
.search-form button, .search-big button {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--primary-ink); background: var(--primary);
  border: 0; border-radius: var(--r-sm); padding: 0 14px; height: 36px; cursor: pointer; flex: none;
}
.year-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px; }
.year-tabs::-webkit-scrollbar { display: none; }
.year-tabs a {
  font-family: var(--font-num); font-weight: 700; font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 3px 11px; border-radius: var(--r-full); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.year-tabs a:hover { color: var(--ink); background: var(--surface-alt); }
.year-tabs a[aria-current="page"] { background: var(--hero); color: var(--hero-ink); }
@media (min-width: 720px) {
  .site-header { position: sticky; top: 0; z-index: 10; }
  html { scroll-padding-top: 116px; }
}

/* トップの題字 */
.masthead {
  margin: 26px 0 8px; padding: 26px 26px 24px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--lift) var(--lift) 0 var(--shadow-hard);
}
.masthead h1 { font-family: var(--font-head); font-weight: 900; font-size: 40px; line-height: 1.2; margin: 0; letter-spacing: .04em; }
.masthead .lead { margin: 8px 0 0; color: var(--muted); }
.masthead .stats { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.masthead .stats b { font-family: var(--font-num); font-size: 20px; color: var(--ink); margin: 0 3px; font-variant-numeric: tabular-nums; }
.search-big { display: flex; gap: 8px; margin-top: 18px; max-width: 580px; }
.search-big input { height: 46px; font-size: 16px; padding: 6px 14px; border-radius: var(--r); }
.search-big button { height: 46px; font-size: 15px; padding: 0 22px; border-radius: var(--r); }

/* 年のページの見出し */
.year-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 32px; align-items: end;
  padding: 28px 0 20px; border-bottom: 1px solid var(--rule);
}
.year-num { font-family: var(--font-num); font-weight: 800; font-size: 72px; line-height: .95; margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.year-sub { margin: 0; color: var(--muted); font-size: 13px; }
.faces {
  grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0; gap: 8px;
}
.faces div { padding: 7px 12px 8px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); min-width: 0; }
.faces dt { font-size: 11px; color: var(--muted); }
.faces dd { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.notice {
  margin: 16px 0 0; padding: 9px 14px; border-radius: var(--r);
  background: var(--surface-alt); font-size: 13px; color: var(--muted);
}

/* 目次 */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.toc a {
  font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; padding: 3px 14px;
  border: 1px solid var(--rule); border-radius: var(--r-full); background: var(--surface);
}
.toc a small { font-family: var(--font-num); font-weight: 600; color: var(--muted); margin-left: 5px; }
.toc a:hover { border-color: var(--primary); }

/* セクション */
.section { margin: 44px 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--font-head); font-weight: 900; font-size: 21px; margin: 0; letter-spacing: .02em;
  padding-left: 12px; border-left: 5px solid var(--primary); line-height: 1.3;
}
.section-head .note { font-size: 12px; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px 20px; }
.panel h3 {
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em;
  margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--rule);
}
.panel h3.sub { margin-top: 18px; }
.source-line { margin: 12px 0 0; font-size: 11px; color: var(--dim); word-break: break-all; }
.source-line a { color: var(--dim); }
ul.plain { margin: 0; padding-left: 18px; font-size: 14px; }

/* 絞り込み */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-full); padding: 3px 14px; cursor: pointer;
}
.seg small { font-family: var(--font-num); font-weight: 600; color: var(--muted); margin-left: 5px; }
.seg[aria-pressed="true"] { background: var(--hero); color: var(--hero-ink); border-color: var(--hero); }
.seg[aria-pressed="true"] small { color: var(--hero-ink); opacity: .75; }

/* 流行度 */
.tier { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--tier-color); white-space: nowrap; }
.tier .sq { font-size: 9px; letter-spacing: 1px; }
.tier[data-tier="4"] { --tier-color: var(--tier-4); }
.tier[data-tier="3"] { --tier-color: var(--tier-3); }
.tier[data-tier="2"] { --tier-color: var(--tier-2); }
.tier[data-tier="1"] { --tier-color: var(--tier-1); }

/* ミームのカード */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 11px 13px 13px;
}
.card:hover { border-color: var(--primary); }
.card[hidden] { display: none; }
.card-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 1.45; color: var(--ink); }
.card-meta { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; font-size: 11px; color: var(--muted); }
.tag-tiktok { font-size: 10px; font-weight: 700; color: var(--hero-ink); background: var(--hero); padding: 0 6px; line-height: 1.7; border-radius: 4px; }
.card-sum {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.carry { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.carry .linkish { margin-right: 12px; }
.linkish {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--link);
  text-decoration: underline; text-underline-offset: 3px; text-align: left;
}

/* 流行語大賞 */
.grand { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-bottom: 14px; }
.grand .label { font-size: 12px; font-weight: 700; color: var(--surface); background: var(--accent); padding: 1px 9px; border-radius: var(--r-full); }
.grand .word { font-family: var(--font-head); font-weight: 900; font-size: 23px; line-height: 1.35; }
.word-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.word-list li { font-size: 13.5px; padding: 1px 11px; border: 1px solid var(--rule); background: var(--surface-alt); border-radius: var(--r-full); }
.word-list.small li { font-size: 12.5px; padding: 0 9px; }
details.more { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 700; }
details.more[open] summary { margin-bottom: 10px; }

/* 順位表 */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }
.rank-list li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.rank-list .r { font-family: var(--font-num); font-weight: 700; width: 24px; text-align: right; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-list li:first-child .r { color: var(--accent); }
.rank-list .t { font-weight: 700; }
.rank-list .a { font-size: 12px; color: var(--muted); margin-left: 8px; }
.award-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 28px; }
.award-list li { padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.award-list .k { display: block; font-size: 11px; color: var(--muted); }
.award-list .v { font-weight: 700; }
.jcjk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 28px; }
.jcjk-grid h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 3px; }
.jcjk-grid ol { margin: 0; padding-left: 22px; font-size: 13.5px; }
.jcjk-grid ol li::marker { font-family: var(--font-num); font-weight: 700; color: var(--muted); }

/* 詳細（ダイアログとミームのページで共通） */
dialog.meme {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0;
  border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-hard);
}
dialog.meme::backdrop { background: rgba(20, 30, 36, .45); }
.dlg-head {
  position: sticky; top: 0; background: var(--surface); display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 20px 10px; border-bottom: 1px solid var(--rule); z-index: 1;
}
.dlg-head h2 { flex: 1; margin: 0; font-family: var(--font-head); font-weight: 900; font-size: 21px; line-height: 1.4; }
.dlg-close {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm); padding: 2px 12px; cursor: pointer; flex: none;
}
.dlg-body { padding: 10px 20px 22px; }
.dlg-more { margin: 18px 0 0; font-size: 13px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 4px 0 6px; }
.facts div { padding: 5px 10px 6px; background: var(--surface-alt); border-radius: var(--r-sm); }
.facts dt { font-size: 11px; color: var(--muted); }
.facts dd { margin: 0; font-size: 13.5px; font-weight: 700; }
.detail h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 18px 0 4px; }
.detail p { margin: 0; }
.detail .summary { font-family: var(--font-head); font-weight: 700; font-size: 16.5px; margin: 12px 0 0; line-height: 1.6; }
.detail ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.detail .awards { list-style: none; padding: 0; }
.detail .awards li { padding: 3px 0; border-bottom: 1px dotted var(--rule-strong); }
.detail .awards .y { font-family: var(--font-num); font-weight: 700; margin-right: 10px; }
.detail .notes {
  list-style: none; padding: 9px 14px; background: var(--surface-alt); border-radius: var(--r);
  font-size: 12.5px; color: var(--muted); margin-top: 16px;
}
.spark { width: 100%; height: auto; display: block; margin-top: 4px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .band { fill: var(--band); }
.spark .tick { stroke: var(--dim); vector-effect: non-scaling-stroke; }
.spark .tick-label { font-family: var(--font-num); font-size: 13px; fill: var(--dim); text-anchor: middle; }

/* ミームのページ */
.crumbs { font-size: 12px; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }
.meme-page { max-width: 760px; }
.meme-page h1 {
  font-family: var(--font-head); font-weight: 900; font-size: 32px; line-height: 1.35;
  margin: 8px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}

/* 検索 */
.search-page h1 { font-family: var(--font-head); font-weight: 900; font-size: 28px; margin: 28px 0 0; }
.search-hint { font-size: 13px; color: var(--muted); max-width: 640px; }
.year-jump { margin: 20px 0 0; font-weight: 700; }
.results-head {
  font-family: var(--font-head); font-weight: 900; font-size: 17px;
  margin: 28px 0 8px; padding-left: 10px; border-left: 4px solid var(--primary); line-height: 1.35;
}
.results-head small { font-family: var(--font-sans); font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 8px; }
.results { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.results:empty { display: none; }
.results li + li { border-top: 1px solid var(--rule); }
.results a { display: block; padding: 10px 14px; text-decoration: none; color: inherit; }
.results a:hover { background: var(--surface-alt); }
.r-name { display: block; font-family: var(--font-head); font-weight: 700; font-size: 16.5px; color: var(--link); }
.r-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; color: var(--muted); align-items: center; }
.r-sum { display: block; font-size: 13px; color: var(--muted); }
.results.small a { padding: 7px 14px; }
.results.small .r-name { font-size: 15px; }

/* トップ：年の一覧 */
.years { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.year-card {
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  padding: 12px 15px 14px; border: 1px solid var(--rule); border-radius: var(--r); min-width: 0;
}
.year-card:hover { border-color: var(--primary); }
.year-card .yn { font-family: var(--font-num); font-weight: 800; font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.year-card .yn small {
  font-family: var(--font-sans); font-size: 11px; font-weight: 700; color: var(--surface);
  background: var(--accent); padding: 1px 7px; border-radius: var(--r-full); margin-left: 8px; vertical-align: middle;
}
.year-card dl { margin: 8px 0 0; font-size: 13px; }
.year-card dl div { display: flex; gap: 8px; align-items: baseline; border-top: 1px solid var(--rule); padding: 3px 0; }
.year-card dt { flex: none; width: 4.4em; font-size: 11px; color: var(--muted); }
.year-card dd { margin: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 主な舞台の移り変わり */
.platform-chart { display: grid; gap: 6px; }
.pc-row { display: grid; grid-template-columns: 44px 1fr 28px; gap: 10px; align-items: center; font-size: 12px; }
.pc-row .y { font-family: var(--font-num); font-weight: 700; color: var(--muted); }
.pc-row .n { font-family: var(--font-num); color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.pc-bar { display: flex; height: 16px; background: var(--surface-alt); border-radius: var(--r-full); overflow: hidden; }
.pc-bar span { display: block; height: 100%; border-right: 2px solid var(--surface); }
.pc-bar span:last-child { border-right: 0; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pc-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 3px; }

/* 説明 */
.explain { margin: 0; }
.explain div { display: grid; grid-template-columns: 9em 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.explain div:last-child { border-bottom: 0; }
.explain dd { margin: 0; color: var(--muted); }

.site-footer { margin-top: 56px; padding: 18px 0 40px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
.review { border-style: dashed; }
.review ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.review .status { font-weight: 700; color: var(--accent); }

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .head-row { gap: 10px; }
  .logo { font-size: 17px; letter-spacing: .02em; }
  .search-form { flex-basis: auto; }
  .masthead { margin-top: 18px; padding: 20px 18px; }
  .masthead h1 { font-size: 30px; }
  .year-hero { grid-template-columns: 1fr; padding-top: 20px; }
  .year-num { font-size: 54px; }
  .faces { grid-column: 1; grid-row: auto; margin-top: 10px; gap: 6px; }
  .faces dd { font-size: 13.5px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 9px 10px 11px; }
  .card-name { font-size: 15px; }
  .card-sum { font-size: 12px; }
  .panel { padding: 14px 15px; }
  .meme-page h1 { font-size: 26px; }
  .explain div { grid-template-columns: 1fr; gap: 0; }
}
