/* ============================================================
   Xで話題のアニメ・動画ランキング — トレンド/ランキング系デザイン
   制約: 絵文字なし。星はインラインSVG、装飾は原則CSS/SVG。
   主色: パープル #7c3aed 〜 ピンク #db2777 のグラデ。背景: 薄グレー。
   ============================================================ */

:root {
  --brand: #7c3aed;
  --brand-dark: #6d28d9;
  --brand-2: #db2777;
  --brand-tint: #f5edff;
  --brand-tint-line: #e4d4fb;

  --accent: #f59e0b;
  --star: #f59e0b;
  --star-empty: #d9d9e0;

  --bg: #f6f5fa;
  --bg-2: #edecf3;
  --surface: #ffffff;
  --surface-2: #fbfaff;
  --ink: #1c1a24;
  --ink-2: #33313d;
  --muted: #6b6875;
  --muted-2: #8b8895;
  --line: #e7e5ee;
  --line-strong: #d6d3e0;

  --gold: #f6b93b;
  --silver: #b8bcc6;
  --bronze: #cd8b52;

  --warn-bg: #fff8ec;
  --warn-line: #f3e0b6;
  --warn-ink: #7a5b10;

  --shadow-sm: 0 1px 2px rgba(24, 16, 48, 0.06);
  --shadow: 0 2px 10px rgba(24, 16, 48, 0.09);
  --shadow-lg: 0 8px 26px rgba(24, 16, 48, 0.15);

  --maxw: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-sm);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 58px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; color: #fff; }
.logo:hover { text-decoration: none; color: #fff; }
.logo .mark {
  background: #fff; color: var(--brand);
  padding: 3px 9px; border-radius: var(--radius-sm);
  font-size: 15px; letter-spacing: 0.04em;
}
.logo .logo-txt { font-size: 16px; letter-spacing: -0.01em; }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  padding: 6px 13px; border-radius: 999px; color: #fff;
  font-size: 13.5px; font-weight: 700; transition: background 0.15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.2); color: #fff; text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 16px; margin: 18px 0 8px;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand) 45%, var(--brand-2));
  color: #fff; box-shadow: var(--shadow);
}
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; padding: 34px 26px 30px; }
.hero-kicker {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.18em;
  background: rgba(255, 255, 255, 0.18); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.page-title { margin: 0 0 8px; font-size: 30px; font-weight: 900; line-height: 1.3; }
.hero .lead { color: #f3e8ff; margin: 0 0 20px; max-width: 720px; font-size: 14.5px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats .stat {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px; padding: 10px 18px; min-width: 96px; text-align: center;
}
.hero-stats .num { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.hero-stats .lbl { font-size: 11.5px; color: #f0e3ff; }

/* ---------- Category bar ---------- */
.cat-bar {
  display: flex; gap: 6px; flex-wrap: wrap; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin: 16px 0; box-shadow: var(--shadow-sm);
}
.cat-bar a {
  padding: 6px 13px; border-radius: 999px; background: var(--bg-2);
  color: var(--ink-2); font-size: 13px; font-weight: 700; border: 1px solid var(--line);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cat-bar a:hover {
  text-decoration: none; background: var(--brand-tint);
  color: var(--brand-dark); border-color: var(--brand-tint-line);
}

/* ---------- Notice / disclosure ---------- */
.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink);
  padding: 11px 14px; border-radius: var(--radius); font-size: 12.5px;
  margin: 16px 0; line-height: 1.7;
}
.disclosure {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  padding: 12px 14px; border-radius: var(--radius); font-size: 11.5px;
  line-height: 1.7; margin-top: 14px;
}

/* ---------- Section title ---------- */
.section-title {
  font-size: 20px; font-weight: 900; margin: 30px 0 14px;
  padding-left: 12px; border-left: 5px solid var(--brand); line-height: 1.4;
}

/* ---------- Grid / cards ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-tint-line); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  display: flex; align-items: flex-end;
}
.thumb-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb-title {
  position: relative; z-index: 2; color: #fff; font-weight: 900;
  font-size: 17px; line-height: 1.35; padding: 12px 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.thumb-format {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(0, 0, 0, 0.42); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.rank {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  min-width: 38px; height: 38px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px; color: #fff;
  background: rgba(28, 20, 40, 0.72); border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.rank.gold { background: linear-gradient(135deg, #ffe08a, var(--gold)); color: #6a4a00; }
.rank.silver { background: linear-gradient(135deg, #e6e8ee, var(--silver)); color: #43474f; }
.rank.bronze { background: linear-gradient(135deg, #e8b98d, var(--bronze)); color: #4d2f13; }
.card .body { padding: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.badge {
  font-size: 11px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px;
}
.badge.genreref { color: var(--brand-dark); background: var(--brand-tint); border-color: var(--brand-tint-line); }
a.badge:hover { text-decoration: none; background: var(--brand-tint); }
.card h3 { margin: 4px 0 8px; font-size: 17px; font-weight: 800; line-height: 1.4; }
.meta { color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.meta .dot { margin: 0 2px; color: var(--muted-2); }
.excerpt {
  color: var(--ink-2); font-size: 13px; margin: 8px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Rating / stars ---------- */
.rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.stars { display: inline-flex; gap: 1px; }
.star { width: 16px; height: 16px; }
.star.full { fill: var(--star); }
.star.empty { fill: var(--star-empty); }
.rating-num { font-weight: 900; color: var(--accent); font-size: 15px; }
.rating-count { font-size: 11.5px; color: var(--muted); }
.rating.signal-only .rating-count {
  color: var(--brand-dark); font-weight: 700; background: var(--brand-tint);
  border: 1px solid var(--brand-tint-line); padding: 3px 10px; border-radius: 999px;
}

/* ---------- Streaming badges ---------- */
.sv-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge.sv { color: #fff; background: #555; border-color: transparent; }
.badge.sv.netflix { background: #e50914; }
.badge.sv.crunchyroll { background: #f47521; }
.badge.sv.prime { background: #00a8e1; }
.badge.sv.abema { background: #111; }
.badge.sv.unext { background: #000; }
.badge.sv.theater { background: var(--brand-2); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 12.5px; color: var(--muted); margin: 16px 0 10px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; color: var(--muted-2); }

/* ---------- Work head (article) ---------- */
.work-head {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 8px;
}
.wh-thumb {
  position: relative; width: 240px; max-width: 100%; aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden; flex-shrink: 0;
}
.wh-thumb .thumb-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.wh-inner { flex: 1; min-width: 240px; }
.wh-inner h1 { margin: 8px 0 2px; font-size: 25px; font-weight: 900; line-height: 1.35; }
.wh-inner .sub { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.facts {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0;
  font-size: 13px; color: var(--ink-2);
}
.facts span { display: inline-flex; gap: 5px; }
.facts b { color: var(--muted); font-weight: 700; }
.facts .wide { flex-basis: 100%; }

/* ---------- Prose ---------- */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 22px 20px; box-shadow: var(--shadow-sm); }
.prose h2 { font-size: 19px; }
.prose p { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.where-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.where-list li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px;
}
.where-name { font-weight: 800; color: var(--ink); }
.where-note { font-size: 12px; color: var(--muted); }
.contact-mail { font-size: 17px; }

/* ---------- Affiliate ---------- */
.aff { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 22px 20px; box-shadow: var(--shadow-sm); margin-top: 20px; }
.aff-lead { color: var(--ink-2); font-size: 13.5px; }
.aff-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.aff-btn {
  display: block; text-align: center; font-weight: 800; font-size: 13.5px;
  padding: 12px 14px; border-radius: 10px; color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow-sm);
}
.aff-btn:hover { text-decoration: none; filter: brightness(1.06); }
.aff-btn.alt { background: linear-gradient(90deg, #f59e0b, #f97316); }

/* ---------- Related / nav ---------- */
.related { margin-top: 26px; }
.ep-nav { margin: 26px 0; display: flex; justify-content: center; }
.tolist, .backhome {
  display: inline-block; font-weight: 800; color: var(--brand-dark);
  background: var(--brand-tint); border: 1px solid var(--brand-tint-line);
  padding: 10px 20px; border-radius: 999px;
}
.tolist:hover, .backhome:hover { text-decoration: none; background: #ecdcff; }

/* ---------- Tag cloud ---------- */
.tagcloud { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.tagchip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; font-weight: 800; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.tagchip:hover { text-decoration: none; background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand-tint-line); }
.tagchip .c {
  font-size: 11px; color: #fff; background: var(--brand);
  border-radius: 999px; padding: 1px 8px; font-weight: 800;
}

/* ---------- Plain list ---------- */
.list-plain { list-style: none; padding: 0; margin: 12px 0; }
.list-plain li { margin: 8px 0; }
.list-plain a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; color: var(--ink); box-shadow: var(--shadow-sm);
}
.list-plain a:hover { text-decoration: none; border-color: var(--brand-tint-line); background: var(--surface-2); }
.list-plain .count { font-size: 12px; color: var(--muted); font-weight: 700; }

.lead { color: var(--ink-2); font-size: 14.5px; }
.notfound { text-align: center; padding: 20px 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; background: #201a2c; color: #d7d2e2; }
.site-footer .wrap { padding: 26px 16px 34px; }
.fnav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.fnav a { color: #e5def5; font-weight: 700; font-size: 13.5px; }
.fnav.secondary a { color: #b3adc4; font-weight: 600; font-size: 12.5px; }
.site-footer .disclosure { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); color: #c3bdd4; }
.fine { font-size: 11.5px; color: #9d97ad; margin-top: 12px; line-height: 1.7; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .page-title { font-size: 24px; }
  .hero-inner { padding: 26px 18px 22px; }
  .grid { grid-template-columns: 1fr; }
  .wh-thumb { width: 100%; }
  .logo .logo-txt { font-size: 14px; }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14121b; --bg-2: #1f1c29; --surface: #1c1926; --surface-2: #201d2b;
    --ink: #f0edf7; --ink-2: #d6d2e2; --muted: #a29eb2; --muted-2: #837f93;
    --line: #2e2a3a; --line-strong: #3a3549; --star-empty: #403c50;
    --brand-tint: #2a1f45; --brand-tint-line: #3d2d63;
    --warn-bg: #2c2415; --warn-line: #4a3c1c; --warn-ink: #e6cf95;
  }
  .thumb-title { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
}
