:root {
  --bg: #0e0f1a;
  --bg-soft: #171a2b;
  --card: #1d2136;
  --card-hover: #262b45;
  --text: #eef0f8;
  --muted: #9aa0bd;
  --accent: #7c8bff;
  --accent-rgb: 124, 139, 255;
  --line: #2c3150;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #23264a 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.7;
}

.wrap { width: min(1080px, 92vw); margin-inline: auto; }
a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(14, 15, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; }
.logo span { color: var(--accent); font-weight: 600; font-size: 0.8rem; }
.nav { display: flex; gap: 22px; font-size: 0.92rem; }
.nav a { color: var(--muted); transition: color 0.2s; }
.nav a:hover { color: var(--text); }
.nav a.is-current { color: var(--accent); font-weight: 700; }

/* Hero */
.hero { padding: 64px 0 30px; }
.hero.hero-sub { padding: 48px 0 20px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: 0 0 12px; line-height: 1.25; }
.hero-sub h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 60ch; margin: 0; }
.updated { color: var(--muted); font-size: 0.82rem; margin-top: 14px; }
.freshness-warn { color: #ffb020; font-size: 0.82rem; margin-top: 6px; }
.freshness-warn[hidden] { display: none; }

/* Sections */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.section-head h2 { font-size: 1.5rem; margin: 0; }

/* 今月の記念日ウィジェット */
.anniv-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.anniv-item {
  flex: 0 0 auto; min-width: 110px; display: flex; flex-direction: column; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--m-color, var(--accent));
  border-radius: var(--radius); padding: 10px 14px; text-decoration: none; color: inherit;
  transition: background 0.18s, transform 0.18s;
}
.anniv-item:hover { background: var(--card-hover); transform: translateY(-2px); }
.anniv-item.is-past { opacity: 0.55; }
.anniv-item.is-today { border-left-color: #ffcc4d; background: rgba(255, 204, 77, 0.08); }
.anniv-day { font-size: 1.1rem; font-weight: 800; color: var(--m-color, var(--accent)); }
.anniv-name { font-size: 0.88rem; font-weight: 700; }
.anniv-label { font-size: 0.75rem; color: var(--muted); }

.member-controls { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.member-controls[hidden] { display: none; }
.member-controls input[type="search"] {
  flex: 1; min-width: 180px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-size: 0.85rem;
}
.member-controls input[type="search"]::placeholder { color: var(--muted); }
.member-controls select {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text); font-size: 0.85rem;
}
@media (max-width: 560px) { .member-controls { flex-direction: column; } }

.live-hero-bar {
  display: block; text-align: center; padding: 10px 16px; font-weight: 700;
  background: linear-gradient(90deg, #ff4757, #ff6b81); color: #fff;
}
.live-hero-bar:hover { filter: brightness(1.08); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters[hidden] { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  padding: 5px 14px; border-radius: 999px; font-size: 0.83rem; cursor: pointer;
  transition: all 0.18s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #0e0f1a; font-weight: 700; }

.share-url-fallback {
  display: block; width: 100%; max-width: 480px; margin-top: 8px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  padding: 6px 10px; border-radius: 8px; font-size: 0.82rem; font-family: monospace;
}

/* Schedule */
.schedule-group { margin-bottom: 32px; }
.schedule-group:last-child { margin-bottom: 0; }
.schedule-group h3 {
  font-size: 1.02rem; color: var(--muted); font-weight: 700;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.show-more-btn {
  justify-self: center; margin-top: 4px; padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.18s;
}
.show-more-btn:hover { background: var(--card-hover); color: var(--text); }
.schedule-grid { display: grid; gap: 14px; }
.stream {
  position: relative;
  display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; transition: background 0.18s, transform 0.18s;
  border-left: 4px solid var(--m-color, var(--accent));
}
.watchlater-toggle {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: rgba(10, 12, 20, 0.65); border: none; border-radius: 50%;
  font-size: 1rem; line-height: 1; cursor: pointer; color: #fff;
}
.watchlater-toggle.active { color: #ffcc4d; }
.cal-add-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; display: grid; place-items: center;
  background: rgba(10, 12, 20, 0.65); border: none; border-radius: 50%;
  font-size: 0.9rem; line-height: 1; cursor: pointer;
}
.cal-add-btn:hover { background: var(--accent); }
.stream:hover { background: var(--card-hover); transform: translateY(-2px); }
.stream.is-watched { opacity: 0.6; }
.watched-badge {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  background: rgba(10, 12, 20, 0.75); color: var(--muted); font-size: 0.7rem;
  padding: 2px 8px; border-radius: 999px;
}
.stream .thumb {
  width: 150px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover;
  background: var(--bg-soft); display: block;
}
.stream .thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 0.75rem; }
.stream .body { min-width: 0; }
.stream .who { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.stream .who b { font-size: 0.95rem; }
.stream .title { color: var(--text); font-size: 0.98rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stream .when { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.badge { font-size: 0.72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.live { background: #ff4757; color: #fff; animation: pulse 1.6s infinite; }
.badge.upcoming { background: #2c3150; color: #b9c0ea; }
.badge.archive { background: #23283f; color: var(--muted); }
.badge.type-stream { background: #23283f; color: var(--muted); }
.badge.type-short { background: #2c3150; color: #b9c0ea; }
.badge.type-video { background: #1f3d33; color: #7be0b4; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.gen-tag { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; }

.empty { color: var(--muted); text-align: center; padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty.empty-sub { padding: 20px; font-size: 0.88rem; }

/* Members */
.member-group { margin-bottom: 32px; }
.member-group:last-child { margin-bottom: 0; }
.member-group h3 {
  font-size: 1.02rem; color: var(--muted); font-weight: 700;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.member-group.graduated h3::after { content: ' ・ 卒業'; color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.member-group.graduated summary {
  font-size: 1.02rem; color: var(--muted); font-weight: 700; cursor: pointer;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.member-group.graduated summary::after { content: ' ・ 卒業'; color: var(--muted); font-weight: 400; font-size: 0.85rem; }

.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .member-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .member-grid { grid-template-columns: 1fr; } }

.member-card {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: transform 0.18s, background 0.18s;
  border-left: 4px solid var(--m-color, var(--accent));
  display: flex; flex-direction: column; gap: 10px;
}
.member-card:hover { transform: translateY(-3px); background: var(--card-hover); }
.member-group.graduated .member-card { opacity: 0.82; }
.mc-link { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; cursor: pointer; }

.fav-toggle {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: none; border: none; font-size: 1.15rem; line-height: 1; cursor: pointer;
  color: var(--muted); padding: 2px;
}
.fav-toggle:hover { color: #ffcc4d; }
.fav-toggle.active { color: #ffcc4d; }
/* メンバー個別ページでは右上に卒業生バッジがあるため、お気に入りボタンは左上に出す */
#memberFavToggle .fav-toggle { left: 10px; right: auto; top: 10px; }
.fav-indicator { color: #ffcc4d; font-size: 0.8rem; }

.mc-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-soft); display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 800; color: var(--m-color, var(--accent));
  border: 2px solid var(--m-color, var(--accent)); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-card .mfurigana { color: var(--muted); font-size: 0.7rem; }
.member-card .mname { font-weight: 700; font-size: 1rem; }
.member-card .mgen { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

.mc-meta { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.mc-block-label {
  font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em;
  margin: 6px 0 -2px; font-weight: 600;
}
.mc-genre { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-tag {
  font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px; background: var(--bg-soft);
}

.mc-trend-summary { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin: 2px 0 0; }

.mc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }

/* 推しダッシュボード */
.dashboard-next {
  display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 18px; margin-bottom: 24px; text-decoration: none;
}
.dashboard-next:hover { border-color: var(--accent); }
.dashboard-next-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.dashboard-next-who { font-weight: 700; font-size: 1.15rem; margin-top: 4px; }
.dashboard-next-title { color: var(--text); margin-top: 2px; font-size: 0.95rem; }
.dashboard-next-countdown { font-size: 1.5rem; font-weight: 800; color: var(--accent); margin-top: 10px; }
.dashboard-card-body { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; color: var(--muted); }
.dashboard-row { line-height: 1.4; }
.dashboard-row.muted { opacity: 0.75; }
.dashboard-row-link { color: var(--muted); text-decoration: none; }
.dashboard-row-link:hover { color: var(--text); text-decoration: underline; }
.oshi-card-btn {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 0; font: inherit; cursor: pointer;
}

/* スターターパック */
.starter-pack-grid { display: flex; flex-direction: column; gap: 16px; }
.starter-pack-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.starter-pack-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.starter-pack-members { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.starter-pack-member {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-left: 3px solid var(--m-color, var(--accent));
  border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 0.85rem; font-weight: 600;
}
.starter-pack-member:hover { background: var(--card-hover); }
.starter-pack-member .avatar { width: 28px; height: 28px; font-size: 0.85rem; }

.timestamp-highlight-card {
  display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--m-color, var(--accent));
  transition: background 0.18s, transform 0.18s;
}
.timestamp-highlight-card:hover { background: var(--card-hover); transform: translateY(-2px); }

/* 年間まとめ（Recap） */
.recap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.recap-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.recap-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.recap-value { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.dashboard-row-label { font-weight: 600; color: var(--text); }
.dashboard-countdown { font-weight: 700; color: var(--accent); }

/* 今日の一本／ランダム発掘 */
.todays-pick-label { font-weight: 700; margin-bottom: 10px; }
.todays-pick-card .stream { max-width: 480px; }

/* 配信時間帯ヒートマップ */
.heatmap { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heatmap-row { display: grid; grid-template-columns: 28px repeat(24, minmax(16px, 1fr)); gap: 3px; align-items: center; }
.heatmap-corner { }
.heatmap-day-label, .heatmap-hour-label { font-size: 0.68rem; color: var(--muted); text-align: center; }
.heatmap-cell {
  aspect-ratio: 1; border-radius: 4px;
  background-color: rgba(var(--accent-rgb), calc(0.08 + var(--ratio, 0) * 0.85));
}

/* メンバー比較ページ */
.compare-picker { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.compare-picker-item { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; cursor: pointer; }
.compare-picker-item input:disabled + span { opacity: 0.5; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 16px; }
.compare-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--m-color, var(--accent)); border-radius: var(--radius); padding: 14px; }
.compare-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.compare-avatar { width: 36px; height: 36px; }
.link-tag {
  font-size: 0.74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  transition: background 0.18s, color 0.18s;
}
.link-tag:hover { background: var(--card-hover); color: var(--text); }
.link-tag.yt { background: #ff0033; border-color: #ff0033; color: #fff; }
.link-tag.yt:hover { background: #d40029; }

/* About */
.about p { color: var(--muted); max-width: 70ch; }
.fineprint { font-size: 0.85rem; }
.fineprint a { text-decoration: underline; text-underline-offset: 2px; }
.fineprint a:hover { color: var(--accent); }

.calendar-help { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin: 10px 0; }
.calendar-help p { margin: 4px 0; }
.calendar-help b { color: var(--text); }


/* Ranking */
.rank-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.rank-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; border-left: 4px solid var(--m-color, var(--accent));
  transition: background 0.18s, transform 0.18s;
}
a.rank-row:hover { background: var(--card-hover); transform: translateY(-2px); }
.rank-num { width: 2.4em; text-align: center; font-weight: 800; font-size: 1.1rem; color: var(--muted); flex-shrink: 0; }
.rank-avatar { width: 44px; height: 44px; font-size: 1rem; }
.rank-info { flex: 1; min-width: 0; }
.rank-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rank-name-row b { font-size: 0.98rem; }
.rank-value { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }

/* News */
.news-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.news-row {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: inherit; text-decoration: none; transition: background 0.18s, transform 0.18s;
}
a.news-row:hover { background: var(--card-hover); transform: translateY(-2px); }
.news-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.news-cat {
  font-size: 0.72rem; font-weight: 700; color: var(--accent); border: 1px solid var(--accent);
  padding: 2px 9px; border-radius: 999px;
}
.news-date { font-size: 0.78rem; color: var(--muted); }
.news-text { font-size: 0.92rem; }
.news-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 推しの新着受信箱（未読ハイライト） */
#oshiInboxSection { margin-bottom: 28px; }
.oshi-inbox-row.is-unread { border-left: 3px solid var(--accent); position: relative; }
.oshi-inbox-row.is-unread::before {
  content: ''; position: absolute; top: 14px; right: 14px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}
.oshi-inbox-row:not(.is-unread) { opacity: 0.65; }

/* History chart */
.history-chart-svg { width: 100%; height: auto; margin-top: 18px; }
.history-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.history-point { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; }
.history-marker { stroke: #ffb020; stroke-width: 1; stroke-dasharray: 4 3; }
.history-marker-label { fill: #ffb020; font-size: 11px; }
.history-grad-start { stop-color: var(--accent); stop-opacity: 0.35; }
.history-grad-end { stop-color: var(--accent); stop-opacity: 0; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis-label { fill: var(--muted); font-size: 11px; }
.history-chart-svg-compact .chart-axis-label { font-size: 13px; }
.history-chart-svg-compact .history-marker-label { font-size: 13px; }

/* Timeline (メンバー年表・期生デビュー一覧で共用) */
.timeline-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.timeline-list li { display: flex; gap: 12px; align-items: baseline; font-size: 0.88rem; }
.timeline-date { color: var(--muted); white-space: nowrap; min-width: 9em; }
.timeline-label { font-weight: 600; }

.trend-controls { margin-bottom: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 40px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 620px) {
  .stream { grid-template-columns: 110px 1fr; }
  .stream .badge { grid-column: 2; justify-self: start; }
  .stream .thumb { width: 110px; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 8px; }
  .nav { flex-wrap: wrap; gap: 8px 14px; font-size: 0.8rem; }
  .rank-row { flex-wrap: wrap; }
}
