/* 一緒に観る◯◯ — 2a ポップ×テキストランキング×2カラムフィード */
:root {
  --bg: #131017;
  --panel: #191521;
  --panel2: #1f1a29;
  --line: #262033;
  --text: #f2eef7;
  --muted: #b9b3c6;
  --dim: #847c96;
  --faint: #57506a;
  --yellow: #ffd400;
  --yellow2: #f2d200;
  --teal: #5fd4c0;
  --ink: #131017;
  --danger: #ff7a6e;
  --radius: 20px;
  --disp: "Mochiy Pop One", sans-serif;
  --round: "M PLUS Rounded 1c", sans-serif;
  --body: "Zen Kaku Gothic New", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* スクロールバーの有無で中央寄せがズレないよう、左右両側にガター確保 */
html { scrollbar-gutter: stable both-edges; }
body {
  font-family: var(--body); color: var(--text); min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 24px 24px;
}
main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 80px; }
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 500; transform: translateY(-160%);
  padding: 10px 16px; border-radius: 10px; background: var(--yellow); color: var(--ink);
  font-family: var(--round); font-weight: 800; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--yellow2); outline-offset: 3px;
}

/* ---------- スクロールバー(サイト全体) ---------- */
* { scrollbar-width: thin; scrollbar-color: #3d3752 transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #3d3752; border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #574f74; background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--yellow); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- ヘッダー ---------- */
.topbar {
  max-width: 1240px; margin: 0 auto; padding: 18px 20px 6px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo {
  width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--yellow); color: var(--ink); border-radius: 13px;
  font-family: var(--disp); font-size: 22px; transform: rotate(-6deg);
  box-shadow: 0 4px 16px rgba(255, 212, 0, .3);
}
.brand:hover .logo { transform: rotate(2deg) scale(1.05); transition: transform .2s; }
.wordmark { font-family: var(--disp); font-size: 21px; letter-spacing: .03em; color: var(--yellow); }
.wordmark small { display: block; font-family: var(--round); font-weight: 700; font-size: 9px; color: var(--dim); letter-spacing: .28em; }
nav { margin-left: auto; display: flex; gap: 8px; }
nav a {
  font-family: var(--round); font-weight: 800; font-size: 13px; color: var(--muted);
  text-decoration: none; padding: 9px 20px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap;
}
.wordmark { white-space: nowrap; }
nav a:hover { color: var(--text); background: var(--panel2); }
nav a.active { color: var(--ink); background: var(--yellow); }
.dbchip {
  font-family: var(--round); font-weight: 700; font-size: 10px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); white-space: nowrap;
}
.dbchip.supa { color: #5fd4c0; border-color: rgba(95, 212, 192, .5); }

/* 認証UI */
.auth-area { display: inline-flex; align-items: center; gap: 8px; }
.authname {
  font-family: var(--round); font-weight: 700; font-size: 12px; color: var(--muted);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modchip {
  font-family: var(--round); font-weight: 800; font-size: 9px; color: var(--muted);
  background: var(--panel2); border: 1px solid rgba(95, 212, 192, .5);
  border-radius: 5px; padding: 2px 6px; letter-spacing: .06em;
}
.authbtn {
  font-family: var(--round); font-weight: 800; font-size: 12px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--muted);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; white-space: nowrap;
}
.authbtn:hover { background: #2a2438; color: var(--text); }
.authbtn.login { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.authbtn.login:hover { background: #ffdf47; }
.dbchip.err { color: #ff8a80; border-color: #5c2b2e; }

/* DB接続エラーバナー */
.dberr {
  max-width: 1240px; margin: 10px auto 0; padding: 13px 18px;
  background: #2a1215; border: 1px solid #5c2b2e; border-radius: 14px;
  color: #ffb4ab; font-size: 12.5px; line-height: 1.8;
}
.dberr b { color: #ff8a80; }
.dberr .mono {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #d8a99a;
  margin: 8px 0; word-break: break-all; opacity: .85;
}
.dberr button {
  font-family: var(--round); font-weight: 800; font-size: 12px;
  border: 1px solid #5c2b2e; background: #3a1a1e; color: #ffd9d4;
  border-radius: 999px; padding: 7px 16px; cursor: pointer;
}
.dberr button:hover { background: #4a2226; }

/* ---------- 汎用 ---------- */
/* 視聴サービスのバッジ */
.pf-badge {
  display: inline-block; font-family: var(--round); font-weight: 800; font-size: 10px;
  color: #fff; background: var(--pf, #666); border-radius: 6px; padding: 2px 7px;
  white-space: nowrap; line-height: 1.5; letter-spacing: .02em;
}
/* サムネイル上に重ねるバッジ */
.fthumb-wrap, .ac-thumb-wrap { position: relative; }
.fthumb-wrap .pf-badge, .ac-thumb-wrap .pf-badge, .sc-thumb-wrap .pf-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.sc-thumb-wrap .pf-badge { left: auto; right: 8px; bottom: 8px; }

section.view { animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 14px; }
h2, .badge-h {
  display: inline-block; font-family: var(--disp); font-weight: 400; font-size: 15px;
  margin: 0 0 14px; color: var(--ink); background: var(--yellow);
  padding: 8px 18px; border-radius: 12px; transform: rotate(-1deg);
  box-shadow: 0 3px 14px rgba(255, 212, 0, .22);
}
h3 { font-family: var(--round); font-weight: 800; font-size: 14px; margin: 20px 0 8px; color: var(--text); }
.lead { font-size: 12.5px; color: var(--muted); margin: 4px 0 14px; line-height: 1.9; }
.muted { color: var(--dim); font-size: 12px; }
select, input[type=text], input[type=number], input[type=password], input[type=email], textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; font-family: var(--body); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--yellow); }
button {
  font-family: var(--round); font-weight: 800; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  border-radius: 999px; padding: 10px 18px; cursor: pointer;
  transition: transform .12s, background .12s;
}
button:hover { background: #2a2438; transform: translateY(-1px); }
button:disabled { opacity: .4; pointer-events: none; }
.primary {
  background: var(--yellow); border-color: var(--yellow); color: var(--ink);
  box-shadow: 0 4px 18px rgba(255, 212, 0, .3);
}
.primary:hover { background: #ffdf47; }
.ghost { background: transparent; }
.danger-btn { color: var(--danger); }
.frow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.frow label { font-size: 12px; color: var(--dim); min-width: 88px; }
.grow { flex: 1; min-width: 180px; }
.err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin-top: 8px; }
.config-note {
  margin: 8px 0 14px; padding: 10px 12px; border: 1px solid rgba(95, 212, 192, .35);
  border-radius: 10px; background: rgba(95, 212, 192, .07); color: #9de4d7; font-size: 12px;
}
.config-note code { color: var(--text); }

/* ---------- ホーム: ヒーロー ---------- */
.hero { text-align: center; padding: 44px 16px 30px; }
.hero h1 {
  font-family: var(--disp); font-weight: 400; font-size: 38px; margin: 0 0 10px;
  color: var(--text); letter-spacing: .02em;
}
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero p { font-size: 13.5px; color: var(--muted); margin: 0 0 24px; }
.herosearch {
  display: flex; gap: 10px; max-width: 640px; margin: 0 auto;
  background: var(--panel); border: 2px solid var(--yellow); border-radius: 999px; padding: 6px;
  box-shadow: 0 6px 28px rgba(255, 212, 0, .14);
}
.herosearch input {
  flex: 1; border: none; background: transparent; font-size: 14px; padding: 10px 16px;
}
.herosearch button { flex: none; }

/* ---------- ホーム: テキストランキング ---------- */
.homesec { margin-top: 34px; }
.rank-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .rank-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .rank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rank-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; cursor: pointer; transition: border-color .15s, transform .15s;
}
.rank-card:hover { border-color: var(--yellow); transform: translateY(-2px); }
.rank-card.top { border-color: rgba(255, 212, 0, .45); background: linear-gradient(160deg, rgba(255, 212, 0, .07), transparent 55%), var(--panel); }
.rk-num { font-family: var(--disp); font-size: 32px; color: var(--yellow); line-height: 1; }
.rank-card.top .rk-num { font-size: 42px; }
.rk-t {
  font-family: var(--round); font-weight: 800; font-size: 14px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
}
.rk-n { font-size: 11.5px; color: var(--dim); }

/* ---------- ホーム: 2カラムフィード ---------- */
.feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .feed { grid-template-columns: minmax(0, 1fr); } }
.fcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 11px;
  cursor: pointer; transition: border-color .15s, transform .15s;
}
.fcard:hover { border-color: var(--yellow); transform: translateY(-2px); }
.fthumb {
  aspect-ratio: 16 / 9; border-radius: 14px; width: 100%; object-fit: cover;
  background: repeating-linear-gradient(45deg, #1a1620 0 14px, #1f1a28 14px 28px);
}
.ftitle { font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.5; }
.fmeta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-size: 12px; color: var(--ink); background: var(--yellow);
}
.fname { font-family: var(--round); font-weight: 800; font-size: 12.5px; color: var(--text); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fep {
  font-family: var(--round); font-weight: 800; font-size: 11px; color: var(--ink);
  background: var(--yellow); border-radius: 999px; padding: 4px 12px; white-space: nowrap;
  min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--round); font-weight: 700; font-size: 12px; padding: 7px 16px; border-radius: 999px;
  cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
}
.chip:hover { border-color: var(--yellow); color: var(--yellow); }
.empty { text-align: center; color: var(--dim); font-size: 13px; padding: 40px 0; line-height: 2.2; }

/* ---------- 配信者ページ ---------- */
.channel-head {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(120deg, rgba(255,212,0,.10), transparent 60%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
}
.ch-avatar {
  width: 60px; height: 60px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-size: 28px; color: var(--ink); background: var(--yellow);
  box-shadow: 0 4px 16px rgba(255,212,0,.3);
  overflow: hidden;
}
.ch-avatar.has-img {
  background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.ch-info { flex: 1; min-width: 0; }
.ch-label { font-family: var(--round); font-weight: 800; font-size: 10.5px; color: var(--dim); letter-spacing: .12em; }
.ch-name { font-family: var(--disp); font-size: 22px; color: var(--text); margin: 1px 0 3px; word-break: break-word; }
.ch-meta { font-size: 12px; color: var(--dim); }
.ch-link {
  flex: none; text-decoration: none;
  font-family: var(--round); font-weight: 800; font-size: 12.5px; color: var(--ink);
  background: var(--yellow); border-radius: 999px; padding: 9px 18px; white-space: nowrap;
}
.ch-link:hover { background: #ffdf47; }

/* アニメカード(配信者ページ) */
.anime-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.anime-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s;
}
.anime-card:hover { border-color: var(--yellow); transform: translateY(-2px); }
.ac-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.ac-body { padding: 12px 14px; }
.ac-title {
  font-family: var(--round); font-weight: 800; font-size: 14px; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ac-count { font-size: 11px; color: var(--yellow2); margin-top: 4px; }

/* モーダル */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(10, 8, 14, .72); backdrop-filter: blur(4px); animation: fade .18s ease both;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative; width: 100%; max-width: 620px; max-height: 84vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; animation: rise .22s ease both;
}
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--muted);
}
.modal-x:hover { background: #322c47; color: var(--text); }
.modal-title { font-family: var(--disp); font-size: 20px; color: var(--yellow); margin: 0 40px 2px 0; }
.modal-sub { font-size: 12px; color: var(--dim); margin-bottom: 14px; }

/* 認証 */
.auth-modal { max-width: 430px; margin: 0 auto; }
.auth-modal .modal-title { margin-bottom: 22px; }
.google-auth-btn { width: 100%; padding: 12px 18px; background: #fff; border-color: #ddd; color: #242124; }
.google-auth-btn:hover { background: #f4f4f4; }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--dim); font-size: 11px; }
.auth-separator::before, .auth-separator::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-form { display: grid; gap: 9px; }
.auth-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.auth-form input:not([type=checkbox]) { width: 100%; }
.auth-form .auth-consent { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; line-height: 1.6; }
.auth-consent input { margin-top: 4px; accent-color: var(--yellow); }
.auth-consent a { color: var(--yellow); }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-feedback { margin: 5px 0; padding: 9px 11px; border: 1px solid rgba(255, 122, 110, .35); border-radius: 10px; background: rgba(255, 122, 110, .08); color: #ffaaa2; font-size: 12px; line-height: 1.6; }
.auth-feedback.success { border-color: rgba(95, 212, 192, .35); background: rgba(95, 212, 192, .08); color: #9de4d7; }
.auth-privacy { margin: 15px 0 0; color: var(--dim); font-size: 11px; line-height: 1.7; }
.auth-trial-note { margin: 8px 0 0; padding: 8px 10px; border-radius: 9px; background: rgba(255, 212, 0, .06); color: #c8b75e; font-size: 10.5px; line-height: 1.6; }
.auth-switches { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px; }
.auth-switches button { border: 0; padding: 6px; background: transparent; color: var(--muted); font-family: var(--body); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* お問い合わせ */
.narrow-view { max-width: 900px; margin: 0 auto; }
.contact-intro .primary { margin-top: 4px; }
.support-form { margin-top: 16px; }
.support-message-row { display: grid; gap: 7px; margin: 14px 0; }
.support-message-row label { color: var(--dim); font-size: 12px; }
.support-message-row textarea { width: 100%; min-height: 170px; resize: vertical; line-height: 1.7; }
.support-hint { color: var(--danger); font-size: 11px; }
.support-list { display: grid; gap: 12px; }
.support-item { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); }
.support-head, .support-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.support-category { color: var(--text); font-family: var(--round); font-weight: 800; font-size: 13px; }
.support-status { padding: 4px 9px; border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 10px; font-weight: 700; }
.support-status.status-in_progress { color: var(--yellow); }
.support-status.status-resolved { color: var(--teal); }
.support-item p { margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.support-reporter { margin-top: 7px; color: var(--dim); font-size: 10px; overflow-wrap: anywhere; }
.support-foot { color: var(--dim); font-size: 10px; }
.support-foot label { display: flex; align-items: center; gap: 8px; }
.support-foot select { padding: 6px 10px; font-size: 11px; }
.support-setup-error { padding: 16px; border: 1px solid rgba(255, 122, 110, .35); border-radius: 12px; color: var(--danger); font-size: 12px; line-height: 1.8; }

/* ---------- 作品ページ ---------- */
.eps { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.ep-btn { padding: 8px 18px; }
.ep-btn.sel { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
  cursor: pointer; transition: border-color .15s;
}
.item-row:hover { border-color: var(--yellow); }
.item-row.sel { border-color: var(--yellow); background: rgba(255, 212, 0, .08); }
.item-row .ck { font-size: 15px; width: 20px; text-align: center; color: var(--yellow); }
.item-row .thumb {
  width: 84px; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 8px; background: #000; flex: none;
}
.item-row .sname { font-family: var(--round); font-weight: 800; font-size: 13px; }
.item-row .ainfo { flex: 1; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .off { font-size: 11px; color: var(--yellow2); font-variant-numeric: tabular-nums; }
.item-row .del { border: none; background: transparent; color: var(--dim); cursor: pointer; padding: 2px 6px; }
.item-row .del:hover { color: var(--danger); }
.gobar { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* 配信者選択(作品ページ・3カラムカード) */
.work-search { margin: 4px 0 16px; }
.work-search input { width: 100%; max-width: 380px; }
.streamer-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 1000px) { .streamer-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .streamer-cards { grid-template-columns: minmax(0, 1fr); } }
.streamer-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s;
}
.streamer-card:hover { border-color: var(--yellow); transform: translateY(-2px); }
.streamer-card:focus-visible { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 212, 0, .28); }
.streamer-card.sel { border-color: var(--yellow); background: rgba(255, 212, 0, .07); }
.sc-thumb-wrap { position: relative; }
.sc-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.sc-check {
  position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.65); background: rgba(0,0,0,.4);
}
.sc-check.on { background: var(--yellow); border-color: var(--yellow); }
.sc-check.on::after {
  content: '✓'; display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink); font-weight: 800; font-size: 14px;
}
.sc-edit, .sc-del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0;
  border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
  opacity: 0; transition: opacity .15s, background .15s;
}
.sc-edit { right: 38px; }
.streamer-card:hover .sc-edit, .streamer-card:hover .sc-del { opacity: 1; }
.sc-edit:hover { background: var(--yellow); color: var(--ink); }
.sc-del:hover { background: var(--danger); }
@media (hover: none) { .sc-edit, .sc-del { opacity: 1; } }
.sc-body { padding: 10px 12px; }
.sc-name {
  font-family: var(--round); font-weight: 800; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-off { font-size: 11px; color: var(--yellow2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.sc-select {
  width: 100%; margin-top: 9px; padding: 7px 10px; font-size: 11px;
  border-color: var(--line); background: rgba(255,255,255,.025);
}
.streamer-card.sel .sc-select { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }

/* ---------- 登録ウィザード ---------- */
.wiz-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.wstep {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--round); font-weight: 800; font-size: 12.5px; color: var(--dim);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
}
.wstep b {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 12px;
  background: var(--line); color: var(--dim);
}
.wstep.active { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.wstep.active b { background: var(--ink); color: var(--yellow); }
.wstep.done { color: var(--text); border-color: rgba(255, 212, 0, .5); }
.wstep.done b { background: var(--yellow); color: var(--ink); }
.wpanel { animation: rise .3s ease both; }

.confirm-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.crow {
  display: flex; gap: 14px; align-items: baseline;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px;
}
.clabel { font-family: var(--round); font-weight: 800; font-size: 12px; color: var(--dim); min-width: 64px; }
.crow > span:last-child { font-size: 14px; color: var(--text); }
.crow .cmono { font-size: 12px; color: var(--muted); }
.cnew { font-size: 10px; color: var(--ink); background: var(--teal); border-radius: 999px; padding: 2px 8px; margin-left: 4px; }

/* 検索式コンボボックス */
.combo { position: relative; }
.combo > input { width: 100%; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-height: 280px; overflow-y: auto;
}
.combo-opt {
  padding: 9px 14px; font-size: 13px; color: var(--text); cursor: pointer;
  display: flex; align-items: baseline; gap: 8px;
}
.combo-opt:hover { background: var(--panel2); color: var(--yellow); }
.combo-sub { font-size: 11px; color: var(--dim); }

/* 話数・開始タイミング・保存 一列 */
.offrow { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.offcol { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--dim); }
.offcol input { width: 110px; }
.offcol.grow2 { flex: 1; min-width: 160px; }
.offcol.grow2 input { width: 100%; }
.offrow button { align-self: stretch; }

/* タイムスタンプ抽出(折りたたみ) */
.ts-helper { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
.ts-helper summary { cursor: pointer; font-family: var(--round); font-weight: 700; font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.ts-helper summary:hover { color: var(--text); }
.ts-help-body { padding: 4px 0 10px; }

/* ---------- 登録 ---------- */
.regplayer { aspect-ratio: 16/9; max-width: 640px; background: #000; border-radius: 14px; overflow: hidden; margin: 10px 0; }
.regplayer > div, .regplayer iframe { width: 100%; height: 100%; }
.offbox {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0;
}
.offval { font-family: var(--disp); font-size: 22px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.pending { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pending .item-row { cursor: default; }
.annict-res { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* タイムスタンプ抽出リスト */
.ts-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 320px; overflow-y: auto; }
.ts-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
}
.ts-row.kw { border-color: rgba(255, 212, 0, .55); background: linear-gradient(90deg, rgba(255, 212, 0, .08), transparent 40%), var(--panel2); }
.ts-jump {
  font-family: var(--disp); font-size: 13px; padding: 5px 12px; flex: none;
  color: var(--yellow); background: transparent; border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.ts-jump:hover { border-color: var(--yellow); }
.ts-label { flex: 1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-row.kw .ts-label { color: var(--text); }
.ts-src { font-size: 10px; color: var(--dim); flex: none; }
.ts-set { font-size: 11px; padding: 5px 12px; flex: none; background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.ts-set:hover { background: #ffdf47; }

/* ---------- 視聴 ---------- */
.adnote {
  display: flex; gap: 8px; align-items: center;
  background: rgba(255, 212, 0, .1); border: 1px dashed rgba(255, 212, 0, .5);
  border-radius: 12px; padding: 10px 14px; font-size: 12px; color: #ffe37a; margin-bottom: 14px;
}
.master {
  position: sticky; top: 10px; z-index: 50;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: rgba(25, 21, 33, .94); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 16px;
}
.mtime-box { display: flex; align-items: baseline; gap: 8px; }
.mtime-box .lbl { font-family: var(--round); font-weight: 700; font-size: 11px; color: var(--dim); letter-spacing: .08em; }
#mtime {
  font-family: var(--disp); font-size: 30px; color: var(--yellow);
  font-variant-numeric: tabular-nums; letter-spacing: .04em; line-height: 1;
}
.mgroup { display: flex; align-items: center; gap: 6px; }
.mgroup .cap { font-size: 10.5px; color: var(--dim); margin-right: 2px; }
.mgroup button { padding: 7px 12px; font-size: 12px; }
#seekIn { width: 90px; text-align: center; }
.spacer { flex: 1; }
#grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
#grid.single { grid-template-columns: minmax(340px, 900px); justify-content: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; animation: rise .5s ease both; }
.card .head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.card .name { font-family: var(--round); font-weight: 800; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .ptime { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.aud { border-radius: 999px; padding: 4px 12px; font-size: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); }
.aud.on { background: rgba(255, 212, 0, .12); border-color: var(--yellow); color: var(--yellow); }
.card input[type=range] { width: 80px; accent-color: var(--yellow); }
.card .vid { aspect-ratio: 16/9; background: #000; }
.card .vid > div, .card .vid iframe { width: 100%; height: 100%; }

/* ---------- カウントダウン・トースト ---------- */
#cd {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 18px;
  background: rgba(15, 12, 20, .86); backdrop-filter: blur(6px);
}
#cdnum {
  font-family: var(--disp); font-size: 180px; line-height: 1;
  color: var(--yellow); text-shadow: 0 0 70px rgba(255, 212, 0, .5);
  animation: pop 1s ease both;
}
@keyframes pop { 0% { transform: scale(1.6) rotate(-6deg); opacity: 0; } 25% { transform: scale(1) rotate(0deg); opacity: 1; } }
#cdmsg { font-family: var(--disp); font-size: 22px; color: var(--text); }
#cdsub { font-size: 13px; color: var(--dim); }
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #0e0b14; border: 1px solid var(--line); color: var(--text);
  font-family: var(--round); font-weight: 700;
  font-size: 13px; padding: 11px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 110;
}
footer { margin-top: 48px; font-size: 11px; color: var(--faint); text-align: center; line-height: 1.9; }
.footer-links {
  margin: 12px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px;
}
.footer-links a { padding: 2px; color: var(--dim); font-family: var(--body); font-size: 11px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--text); background: transparent; }

/* ---------- サイト情報ページ ---------- */
.legal-page main { max-width: 920px; padding-top: 36px; }
.legal-topbar nav a { border-color: var(--line); }
.legal-card {
  padding: clamp(22px, 5vw, 52px); border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(25, 21, 33, .96); box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
.legal-card h1 { margin: 0 0 8px; color: var(--yellow); font-family: var(--round); font-size: clamp(26px, 5vw, 40px); }
.legal-card h2 {
  display: block; width: auto; margin: 38px 0 12px; padding: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--text); font-family: var(--round); font-size: 20px;
}
.legal-card h3 { margin: 24px 0 8px; color: var(--text); font-family: var(--round); font-size: 16px; }
.legal-card p, .legal-card li { color: var(--muted); line-height: 1.9; }
.legal-card li + li { margin-top: 7px; }
.legal-card a { color: var(--yellow); text-underline-offset: 3px; }
.legal-card .effective-date { margin: 0 0 28px; color: var(--dim); font-size: 13px; }
.legal-note { padding: 14px 16px; border: 1px solid rgba(255, 212, 0, .35); border-radius: 12px; background: rgba(255, 212, 0, .06); color: var(--muted); }
.legal-table-wrap { overflow-x: auto; margin: 14px 0; }
.legal-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; }
.legal-table th, .legal-table td { padding: 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.7; }
.legal-table th { color: var(--text); background: var(--panel2); font-family: var(--round); }
.legal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.legal-actions a { display: inline-flex; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-family: var(--round); font-weight: 800; text-decoration: none; }
.legal-actions a.primary-link { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }

@media (max-width: 700px) {
  html { scrollbar-gutter: auto; }
  main { padding: 12px 12px 64px; }
  .topbar { padding: 12px 12px 4px; gap: 10px; }
  .brand { flex: 1; min-width: 0; }
  .logo { width: 42px; height: 42px; font-size: 20px; border-radius: 13px; }
  .wordmark { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .wordmark small { display: none; }
  .dbchip { order: 3; }
  nav {
    order: 4; width: 100%; margin-left: 0; padding: 4px 0 8px;
    overflow-x: auto; overscroll-behavior-inline: contain;
  }
  nav a { padding: 8px 14px; }
  .authname { max-width: 90px; }
  .panel { padding: 16px; border-radius: 14px; }
  .hero { padding: 28px 4px 20px; }
  .hero h1 { font-size: clamp(27px, 9vw, 36px); }
  .herosearch { flex-direction: column; border-radius: 18px; }
  .herosearch input { width: 100%; }
  .herosearch button { width: 100%; min-height: 44px; }
  .gobar { flex-wrap: wrap; align-items: stretch; }
  .gobar button { min-height: 44px; }
  .frow { align-items: stretch; }
  .frow > label { min-width: 100%; }
  .frow > input.grow, .frow > select { width: 100%; }
  .offrow { align-items: stretch; }
  .offcol, .offcol.grow2 { width: 100%; }
  .offcol input, .offcol.grow2 input { width: 100%; }
  .offrow button { min-height: 44px; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-card { max-height: 92vh; padding: 20px 16px; border-radius: 18px 18px 10px 10px; }
  .master { top: 0; padding: 10px; gap: 10px; border-radius: 0 0 14px 14px; }
  .mgroup { flex-wrap: wrap; }
  .spacer { display: none; }
  #grid, #grid.single { grid-template-columns: minmax(0, 1fr); }
  #cdnum { font-size: 100px; }
  #cdmsg { padding: 0 18px; text-align: center; font-size: 18px; }
  #cdsub { padding: 0 18px; text-align: center; }
  #toast { bottom: 18px; width: calc(100% - 24px); text-align: center; }
  footer { padding: 0 16px 24px; }
}

@media (max-width: 420px) {
  .rank-grid { grid-template-columns: minmax(0, 1fr); }
  .dbchip { max-width: 54vw; overflow: hidden; text-overflow: ellipsis; }
  .authname { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* 旧クラス互換 */
.searchbar { display: flex; gap: 10px; margin-bottom: 18px; }
.searchbar input { flex: 1; font-size: 15px; padding: 12px 16px; border-radius: 999px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.wcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .15s, transform .15s;
}
.wcard:hover { border-color: var(--yellow); transform: translateY(-2px); }
.wcard .t { font-family: var(--round); font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.wcard .meta { font-size: 11px; color: var(--dim); }
