:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --text: #2b2b2b;
  --muted: #6e6e6e;
  --border: #dcdcdc;
  --accent: #b00808;
  --on-accent: #ffffff;
  --error-bg: #fbeaea;
  --error-text: #7a0a0a;
  --hero-bg: #ffffff;
  --live-bg: #3d3d3d;
  --on-live-bg: #ffffff;
  --live-sub: #d9d9d9;
  --live-accent: #ff6b6e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141414;
    --surface: #1e1e1e;
    --text: #f2f2f2;
    --muted: #9a9a9a;
    --border: #2e2e2e;
    --accent: #f55a5d;
    --on-accent: #141414;
    --error-bg: #351818;
    --error-text: #ffb4b4;
    --hero-bg: #1e1e1e;
    --live-bg: #2a2a2a;
    --on-live-bg: #f2f2f2;
    --live-sub: #b5b5b5;
    --live-accent: #f55a5d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --surface: #1e1e1e;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --border: #2e2e2e;
  --accent: #f55a5d;
  --on-accent: #141414;
  --error-bg: #351818;
  --error-text: #ffb4b4;
  --hero-bg: #1e1e1e;
  --live-bg: #2a2a2a;
  --on-live-bg: #f2f2f2;
  --live-sub: #b5b5b5;
  --live-accent: #f55a5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; }
[hidden] { display: none !important; }

h1 { font-size: 26px; margin: 0; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.01em; }
h2::before {
  content: ""; display: inline-block; width: 9px; height: 18px; margin-right: 9px; vertical-align: -2px;
  background: var(--accent); clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%);
}
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
p { margin: 0; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
section { margin: 36px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-top: 8px; }

/* ---------- ヘッダー（ロゴを大きく） ---------- */
.hero { position: relative; background: var(--hero-bg); border-bottom: 1px solid var(--border); padding: 40px 16px 20px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: 0; right: 0; width: 100px; height: 100%;
  background: var(--accent); clip-path: polygon(70% 0, 100% 0, 100% 100%, 30% 100%);
}
.hero::after {
  content: ""; position: absolute; top: 0; right: 82px; width: 20px; height: 100%;
  background: var(--text); opacity: .85; clip-path: polygon(70% 0, 100% 0, 30% 100%, 0 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-logo { display: block; width: min(520px, calc(100vw - 96px)); height: auto; margin: 0 0 10px; }
.hero-tagline { margin-top: 4px; font-size: 14px; color: var(--muted); }
.live-subs { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.live-subs-label { font-size: 12px; color: var(--muted); }
.live-subs-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.live-subs-note { font-size: 10px; color: var(--muted); }

.error { background: var(--error-bg); color: var(--error-text); padding: 12px 14px; border-radius: 2px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 14px; }
.text-button, .button-small, .month-step {
  font: inherit; cursor: pointer; border-radius: 2px;
}
.text-button { background: none; border: 0; padding: 4px 0; color: var(--accent); text-decoration: underline; }
.button-small { background: var(--accent); color: var(--on-accent); border: 0; padding: 10px 16px; font-weight: 700; white-space: nowrap; }

/* ---------- 次の生配信（一番目立たせる） ---------- */
.next-live {
  position: relative; margin: 20px 0 36px; padding: 22px 20px 22px 24px;
  background: var(--live-bg); color: var(--on-live-bg); border-radius: 0; overflow: hidden;
  border-left: 8px solid var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
}
.next-live-heading { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.2em; color: var(--live-accent); }
.next-live-heading::before { display: none; }
.next-live-when { font-size: 30px; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.next-live-media { margin: 4px 0 12px; max-width: 480px; }
.next-live-thumb-link { display: block; }
.next-live-thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); border-radius: 2px; }
.next-live.is-featured .next-live-when { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; color: var(--live-sub); }
.next-live-title-row { margin-top: 8px; }
.next-live-title { font-size: 18px; font-weight: 700; color: var(--on-live-bg); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.next-live-status { margin-top: 8px; font-size: 14px; color: var(--live-sub); }
.next-live-link { display: inline-block; padding: 12px 18px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; border-radius: 2px; }
.next-live-note { display: block; font-size: 12px; margin-top: 4px; }
.next-live.is-live .next-live-when::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: 2px;
  background: var(--live-accent); border-radius: 0; clip-path: polygon(0 0, 100% 0, 100% 60%, 60% 100%, 0 100%);
}

/* ---------- リンク集 ---------- */
.links-main { display: grid; grid-template-columns: 1fr; gap: 10px; }
.links-sub { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.link-button {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 68px; padding: 12px 44px 12px 18px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 2px;
}
.link-button::after {
  content: ""; position: absolute; top: 50%; right: 16px; width: 12px; height: 12px; margin-top: -6px;
  background: var(--accent); clip-path: polygon(0 0, 100% 50%, 0 100%, 25% 50%);
}
.link-button:hover, .link-button:focus-visible { border-color: var(--accent); outline: none; }
.link-button:active { background: var(--bg); }
.link-label { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.link-note { font-size: 12px; color: var(--muted); }
.link-sub { min-height: 56px; border-left-color: var(--muted); }
.noscript { margin-top: 12px; }

/* ---------- 切り替えボタン ---------- */
.toggle { display: inline-flex; max-width: 100%; border: 1px solid var(--border); border-radius: 2px; overflow: hidden; background: var(--surface); }
.toggle button { background: transparent; color: var(--text); border: 0; padding: 11px 18px; cursor: pointer; font: inherit; font-size: 14px; white-space: nowrap; }
.toggle button + button { border-left: 1px solid var(--border); }
.toggle button.active { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* ---------- 予定 ---------- */
.schedule-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.schedule-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 2px; padding: 12px 14px; }
.schedule-item.type-live { border-left-color: var(--accent); }
.schedule-item.is-live { border-color: var(--accent); }
.schedule-when { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.schedule-head { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.schedule-title { font-weight: 700; overflow-wrap: anywhere; }
a.schedule-title { text-decoration: underline; text-underline-offset: 3px; }
.schedule-location { margin-top: 2px; font-size: 12px; color: var(--muted); }
.schedule-filter { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-weight: 700; }
#schedule-empty { margin-top: 14px; }
#schedule-note { margin-top: 10px; }
.badge {
  display: inline-block; padding: 1px 12px 1px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.6;
  color: #ffffff; background: #3d3d3d; clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.type-live .badge { background: #b00808; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge { background: #cfcfcf; color: #141414; }
  :root:not([data-theme="light"]) .type-live .badge { background: #f55a5d; color: #141414; }
}
:root[data-theme="dark"] .badge { background: #cfcfcf; color: #141414; }
:root[data-theme="dark"] .type-live .badge { background: #f55a5d; color: #141414; }

/* 月カレンダー */
#schedule-month { margin-top: 14px; padding: 12px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.month-label { font-weight: 800; font-size: 17px; }
.month-step { width: 44px; height: 44px; font-size: 22px; line-height: 1; color: var(--text); background: var(--bg); border: 1px solid var(--border); }
.month-week, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.month-week span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.month-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 46px; padding: 4px 0; font: inherit; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 2px;
}
.month-cell.other { color: var(--muted); opacity: .55; }
.month-cell.today { border-color: var(--text); }
button.month-cell { cursor: pointer; background: var(--bg); }
button.month-cell:hover, button.month-cell:focus-visible { border-color: var(--accent); outline: none; }
.month-day { font-size: 14px; font-variant-numeric: tabular-nums; }
.month-mark { display: block; width: 12px; height: 6px; margin-top: 4px; background: var(--accent); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }

/* カレンダー購読 */
.subscribe { margin-top: 18px; }
.subscribe-row { display: flex; gap: 8px; }
.ics-url { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 13px; padding: 10px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 2px; }
.subscribe-links { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.subscribe-links a { color: var(--accent); }

/* ---------- お知らせ・note ---------- */
.news-list, .notes-list, .disco-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.news-item, .disco-item { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 12px 14px; }
.news-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.news-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
a.news-title { text-decoration: underline; text-underline-offset: 3px; }
.news-body { margin-top: 4px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; }
.note-link { display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 10px 12px; text-decoration: none; }
.note-link:hover .note-title, .note-link:focus-visible .note-title { text-decoration: underline; }
.note-thumb { flex: 0 0 auto; width: 88px; height: 56px; object-fit: cover; background: var(--border); border-radius: 0; }
.note-body { display: flex; flex-direction: column; min-width: 0; }
.note-title { font-weight: 700; overflow-wrap: anywhere; }
.note-date { font-size: 12px; color: var(--muted); }

/* ---------- プロフィール・楽曲 ---------- */
.profile-bio p + p { margin-top: 10px; }
.profile-facts { margin: 16px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.profile-facts dt { color: var(--muted); }
.profile-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tag-label, .credit-role { margin-left: 6px; font-size: 12px; color: var(--muted); }
.credit-role { margin: 0 6px 0 0; }
.tag-link, .credit-name { overflow-wrap: anywhere; }
a.tag-link, a.credit-name { color: var(--accent); }
.disco-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.disco-title { font-weight: 700; overflow-wrap: anywhere; }
.disco-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.disco-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
a.disco-link { color: var(--accent); }

.footer { text-align: center; padding: 8px 16px 40px; }
.footer-credits { margin-bottom: 6px; }

/* ---------- 広い画面 ---------- */
@media (min-width: 601px) {
  .links-main { grid-template-columns: 1fr 1fr; }
  .links-sub { grid-template-columns: 1fr 1fr; }
  .next-live { padding: 28px 28px 28px 32px; }
  .next-live-when { font-size: 40px; }
  .next-live.is-featured .next-live-when { font-size: 15px; }
  .next-live-media { max-width: 560px; }
  .next-live-title { font-size: 20px; }
  .subscribe-links { flex-direction: row; gap: 20px; }
  h1 { font-size: 30px; }
}

@media (max-width: 600px) {
  .hero { padding-top: 44px; }
  .hero::before { width: 44px; }
  .hero::after { right: 36px; width: 10px; }
  .hero-inner { padding-right: 48px; }
  .hero-logo { width: min(520px, calc(100vw - 100px)); }
  .month-cell { min-height: 44px; }
  .profile-facts { grid-template-columns: 1fr; gap: 2px; }
  .profile-facts dd { margin-bottom: 8px; }
}

/* ---------- ロゴの出し分け（自動=OS、手動=data-theme） ---------- */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* ---------- テーマ切替ボタン（自動 / ライト / ダーク） ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px; padding: 0;
  font: inherit; font-size: 14px; line-height: 1; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 2px; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero .theme-toggle { position: absolute; top: 8px; left: 16px; z-index: 2; }
