* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px;
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #1b1a21; color: #f1ecdf;
  max-width: 560px; margin-inline: auto;
}
h1 { font-size: 20px; margin: 8px 0 16px; }
label { display: block; font-size: 13px; opacity: .8; margin-top: 12px; }
input, button {
  width: 100%; font-size: 16px; padding: 12px; margin-top: 6px;
  border-radius: 10px; border: 1px solid #3a3844;
}
input { background: #26242d; color: #f1ecdf; }
button {
  background: #e0a44b; color: #1b1a21; font-weight: 700; border: none; cursor: pointer;
}
button.secondary { background: #3a3844; color: #f1ecdf; }
button:disabled { opacity: .4; cursor: default; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.status { margin: 12px 0; padding: 10px; border-radius: 10px; background: #26242d; font-size: 14px; }
.live { color: #ff6b6b; font-weight: 700; }
#comments {
  margin-top: 12px; height: 40vh; overflow-y: auto; padding: 10px;
  background: #26242d; border-radius: 10px; font-size: 14px;
}
#comments > div { padding: 4px 0; border-bottom: 1px solid #3a3844; }
#comments .name { opacity: .7; font-size: 12px; margin-right: 6px; }
.small { font-size: 12px; opacity: .7; }
/* ロビー上部の案内（箇条書き） */
.intro { margin: -4px 0 12px; padding-left: 18px; line-height: 1.6; }
.intro a { color: #e0a44b; white-space: nowrap; }
[hidden] { display: none !important; }
a.button {
  display: block; text-align: center; text-decoration: none; font-size: 16px; font-weight: 700;
  padding: 12px; margin-top: 12px; border-radius: 10px; background: #e0a44b; color: #1b1a21;
}
a.button.secondary { background: #3a3844; color: #f1ecdf; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; opacity: 1; margin-top: 16px; }
label.check input { width: auto; margin: 0; }
.room-list { display: flex; flex-direction: column; gap: 8px; }
.room {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #26242d;
  color: inherit; text-decoration: none; border: 1px solid #3a3844;
}
.room .title { font-weight: 700; overflow-wrap: anywhere; }
.room .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; opacity: .7; margin-top: 4px; }
.empty { text-align: center; opacity: .7; padding: 24px 0; }
.result { margin-top: 12px; padding: 12px; border-radius: 10px; background: #26242d; }
.result h2 { font-size: 18px; margin: 0 0 8px; overflow-wrap: anywhere; }
.result h3 { font-size: 14px; margin: 16px 0 6px; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 0; }
.result dt { opacity: .7; font-size: 13px; }
.result dd { margin: 0; font-weight: 700; }
.result ul { margin: 0; padding-left: 20px; font-size: 14px; overflow-wrap: anywhere; }
.room .info { flex: 1; min-width: 0; }
.room .user { font-size: 12px; opacity: .6; margin-top: 2px; }

/* アイコン（丸）。--size で大きさ、画像が無ければ既定の丸 */
.avatar {
  --size: 32px;
  flex: 0 0 auto; display: inline-block; width: var(--size); height: var(--size);
  border-radius: 50%; overflow: hidden; vertical-align: middle;
  background-color: #3a3844;
  background-image:
    radial-gradient(circle at 50% 38%, #6b6878 0 22%, transparent 23%),
    radial-gradient(circle at 50% 100%, #6b6878 0 42%, transparent 43%);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 音量連動の光る輪。--lvl（0〜1）で太さ・明るさ・拡大率が変わる */
.speaker {
  --lvl: 0;
  overflow: visible;
  box-shadow:
    0 0 0 calc(3px + var(--lvl) * 7px) rgba(224, 164, 75, calc(.35 + var(--lvl) * .65)),
    0 0 calc(4px + var(--lvl) * 36px) calc(var(--lvl) * 14px) rgba(255, 190, 90, calc(var(--lvl) * .85));
  transform: scale(calc(1 + var(--lvl) * .08));
  transition: box-shadow .1s linear, transform .1s linear, filter .3s;
}
.speaker img { border-radius: 50%; }
.speaker.off { filter: grayscale(1) brightness(.7); box-shadow: 0 0 0 3px #3a3844; transform: none; }

.stage { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 0 8px; }
.profile { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.profile .who { flex: 1; min-width: 0; }
.profile button { width: auto; flex: 0 0 auto; margin: 0; padding: 8px 12px; font-size: 14px; }
.pname { font-weight: 700; overflow-wrap: anywhere; }

/* ===== 配信/聴取画面（フルスクリーン） ===== */
/* ページ自体はスクロールさせない（スクロールは #comments の中だけ）。iOS のキーボードで画面がずれないように */
body.app {
  position: fixed; inset: 0; overflow: hidden; margin: 0; padding: 0; max-width: none;
  overscroll-behavior: none;
}
/* 上部バー〜入力行を包むコンテナ。高さと位置は visualViewport に合わせて JS で補正 */
.app-shell {
  height: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-direction: column; overflow: hidden;
  will-change: transform;
}
.topbar { flex: 0 0 48px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .speaker {
  box-shadow:
    0 0 0 calc(2px + var(--lvl) * 4px) rgba(224, 164, 75, calc(.35 + var(--lvl) * .65)),
    0 0 calc(2px + var(--lvl) * 16px) calc(var(--lvl) * 6px) rgba(255, 190, 90, calc(var(--lvl) * .85));
  transform: scale(calc(1 + var(--lvl) * .1));
}
.topbar .speaker.off { box-shadow: 0 0 0 2px #3a3844; transform: none; }
.bar-info { flex: 1; min-width: 0; line-height: 1.25; }
.bar-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-count { font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.pill {
  flex: 0 0 auto; width: auto; height: 32px; margin: 0; padding: 0 14px;
  border-radius: 16px; font-size: 14px; line-height: 32px;
}
button.icon-btn {
  flex: 0 0 32px; width: 32px; height: 32px; margin: 0; padding: 0; border-radius: 50%;
  background: #3a3844; color: #f1ecdf; display: grid; place-items: center;
}
button.icon-btn svg { width: 18px; height: 18px; }
.statusline {
  flex: 0 0 24px; height: 24px; line-height: 24px; font-size: 12px; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid #2e2c36;
}
.center { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.panel { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 12px; }
.app #comments {
  flex: 1; min-height: 0; height: auto; margin: 0; padding: 4px 0;
  background: none; border-radius: 0; overflow-y: auto;
  display: flex; flex-direction: column;
}
.app #comments > :first-child { margin-top: auto; } /* 下から積む */
#comments > .c { display: flex; gap: 8px; align-items: flex-start; border-bottom: none; padding: 5px 0; }
#comments .c .body { min-width: 0; overflow-wrap: anywhere; }
#comments .c .avatar { margin-top: 1px; }
#comments .c .name { display: block; }
.result-card {
  position: absolute; inset: 8px 0; z-index: 2; overflow-y: auto;
  padding: 16px; border-radius: 12px; background: #26242d; border: 1px solid #3a3844;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}
.result-card .result { margin: 0; padding: 0; background: none; }
.composer {
  flex: 0 0 auto; display: flex; gap: 8px;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.composer input { flex: 1; min-width: 0; margin: 0; padding: 10px 12px; font-size: 16px; } /* 16px 未満だと iOS が自動ズームする */
.composer button { flex: 0 0 64px; width: 64px; margin: 0; padding: 10px 0; font-size: 14px; }
.account { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0 8px; min-width: 0; }
.account .who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account a, a.link { color: #e0a44b; }
.account .logout { font-size: 12px; opacity: .8; color: #f1ecdf; }
#toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 5;
  padding: 6px 14px; border-radius: 16px; background: #3a3844; font-size: 12px;
  pointer-events: none; opacity: 1;
}
#toast:empty { display: none; }

/* ===== 第5弾: コラボ・配信者メニュー ===== */
.collab-icons { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; }
.collab-icons:empty { display: none; }
.collab-icons .speaker {
  box-shadow:
    0 0 0 calc(2px + var(--lvl) * 3px) rgba(120, 200, 255, calc(.35 + var(--lvl) * .65)),
    0 0 calc(2px + var(--lvl) * 14px) calc(var(--lvl) * 5px) rgba(140, 210, 255, calc(var(--lvl) * .85));
  transform: scale(calc(1 + var(--lvl) * .1));
}
.collab-icons .speaker.off { box-shadow: 0 0 0 2px #3a3844; transform: none; }

.collabbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.collabbar .badge {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
  background: rgba(120, 200, 255, .18); color: #9fd6ff; border: 1px solid rgba(120, 200, 255, .5);
}
.collabbar .spacer { flex: 1; }
button.pill.mic-on { background: #ff6b6b; color: #1b1a21; }

.invite-card { display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 4px; }
.invite-card h2 { font-size: 17px; margin: 0 0 8px; }

/* 下からスライドするシート */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  max-width: 560px; margin: 0 auto; max-height: 75dvh; overflow-y: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  background: #26242d; border-radius: 16px 16px 0 0; border: 1px solid #3a3844; border-bottom: none;
  transform: translateY(105%); transition: transform .25s ease; visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }
.sheet-head { display: flex; align-items: center; gap: 8px; height: 40px; }
.sheet-head .t { flex: 1; font-weight: 700; text-align: center; }
button.link-btn {
  width: auto; flex: 0 0 64px; margin: 0; padding: 6px 0; background: none; color: #e0a44b;
  font-size: 14px; font-weight: 400;
}
button.link-btn:last-child { text-align: right; }
.menu-item {
  display: block; width: 100%; margin: 6px 0 0; text-align: left; font-weight: 400;
  background: #3a3844; color: #f1ecdf;
}
.sheet .note { font-size: 13px; opacity: .8; margin: 4px 0 8px; }
.urow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #3a3844; }
.urow.dim { opacity: .45; }
.urow .who { flex: 1; min-width: 0; line-height: 1.3; }
.urow .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .sub { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #666; margin-right: 4px; vertical-align: 1px; }
.urow .dot.on { background: #5bd17a; }
.urow button { flex: 0 0 auto; width: auto; margin: 0; padding: 6px 12px; font-size: 13px; border-radius: 14px; }
.urow .tag { font-size: 12px; opacity: .8; }
.urow input[type=range] { width: 100%; margin: 4px 0 0; padding: 0; accent-color: #e0a44b; background: none; border: none; }
.urow .val { flex: 0 0 48px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.empty-note { text-align: center; opacity: .7; padding: 16px 0; font-size: 13px; }

/* ===== 第6弾: ミュート・エフェクト ===== */
.speaker { position: relative; }
/* ミュートバッジ（右下の斜線マイク） */
.avatar.muted::after {
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px;
  border-radius: 50%; background-color: #ff6b6b; border: 1.5px solid #1b1a21;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1a21' stroke-width='3' stroke-linecap='round'%3E%3Crect x='9' y='4' width='6' height='10' rx='3'/%3E%3Cpath d='M6 11a6 6 0 0 0 12 0M4 4l16 16'/%3E%3C/svg%3E");
  background-size: 9px 9px; background-position: center; background-repeat: no-repeat;
  box-sizing: content-box;
}
.speaker.muted, .topbar .speaker.muted, .collab-icons .speaker.muted { --lvl: 0 !important; }

/* 右端フローティング列（下から ミュート / エフェクト） */
.fx-col {
  position: fixed; z-index: 4;
  right: max(12px, calc((100vw - 560px) / 2 + 12px));
  bottom: calc(68px + var(--cf-help-h, 0px) + env(safe-area-inset-bottom)); /* 「?」パネルが開いている間はその上へ */
  display: flex; flex-direction: column; gap: 12px;
}
.fx-btn {
  position: relative; width: 48px; height: 48px; margin: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 19, 26, .78); color: #f1ecdf; border: 1px solid #3a3844;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.fx-btn svg { width: 22px; height: 22px; }
.fx-btn.muted { background: #ff6b6b; color: #1b1a21; border-color: #ff6b6b; }
.fx-btn.active::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px;
  border-radius: 50%; background: #e0a44b; border: 1.5px solid #1b1a21;
}
body.fx-on #comments { padding-right: 64px; }

/* エフェクトパネル */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 12px; }
.chip {
  flex: 0 0 auto; width: auto; margin: 0; padding: 7px 14px; border-radius: 16px;
  background: #3a3844; color: #f1ecdf; font-size: 14px; font-weight: 400; border: 1px solid transparent;
}
.chip.on { background: rgba(224, 164, 75, .18); color: #e0a44b; border-color: #e0a44b; font-weight: 700; }
.fx-row { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; padding: 6px 0; }
.fx-row .nm { font-size: 14px; }
.fx-row input[type=range] { width: 100%; margin: 0; padding: 0; accent-color: #e0a44b; background: none; border: none; }
.fx-row .val { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; opacity: .85; }
.fx-space .chips { grid-column: 2 / 4; padding: 0; gap: 6px; }
.fx-space .chip { padding: 5px 12px; font-size: 13px; }
.fx-reset { margin-top: 12px; }

/* ===== 第7弾: 規約・ポリシー ===== */
.legal { margin: 32px 0 8px; text-align: center; font-size: 12px; opacity: .7; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.legal a { white-space: nowrap; } /* 狭い画面でリンクの途中で折り返さない */
.legal a, .back-link, .doc a { color: #e0a44b; }
.back-link { display: inline-block; font-size: 14px; margin: 4px 0 8px; }
.doc { line-height: 1.75; font-size: 14px; }
.doc h1 { font-size: 20px; margin: 8px 0 12px; }
.doc h2 { font-size: 15px; margin: 24px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #3a3844; }
.doc p, .doc ul { margin: 6px 0; }
.doc ul, .doc ol { padding-left: 20px; }
.doc ol { margin: 6px 0; }
/* 通知の案内: iPhone のアプリ内ブラウザ向けの「Safariで開く」 */
.safari-box { margin: 8px 0; padding: 10px 12px; border: 1px solid #3a3844; border-radius: 10px; background: #26242d; }
.safari-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.doc button.safari-btn {
  width: auto; margin: 0; padding: 8px 16px; border-radius: 10px; background: #e0a44b; color: #1b1a21; font-weight: 700; font-size: 14px;
}
.copy-url { user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; }
.doc .date { margin-top: 24px; font-size: 13px; opacity: .75; }

/* ===== 第8弾: 初回案内 ===== */
.contact { margin: 4px 0 24px; text-align: center; font-size: 12px; opacity: .7; line-height: 1.8; }
.contact a { color: #e0a44b; }
body.modal-open { overflow: hidden; }
.notice-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.notice-card {
  width: 100%; max-width: 480px; max-height: 85vh; max-height: 85dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background: #f7f4ee; color: #1b1a21; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.notice-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px 20px 12px; font-size: 14px; line-height: 1.7;
}
.notice-body h1 { font-size: 18px; margin: 0 0 10px; line-height: 1.4; }
.notice-body h2 { font-size: 15px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #ddd6c8; }
.notice-body p, .notice-body ul { margin: 6px 0; }
.notice-body ul { padding-left: 20px; }
.notice-body li { margin: 3px 0; }
.notice-body .note { font-size: 12px; color: #6b6878; }
.notice-body a { color: #a86a10; }
.notice-foot {
  flex: 0 0 auto; padding: 12px 16px 16px; border-top: 1px solid #ddd6c8; background: #f7f4ee;
}
.notice-foot button { margin: 0; }

/* ===== 第9弾: 自分の音量・モニター ===== */
.fx-vol .fx-row { padding-top: 0; }
.fx-switch {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; padding: 8px 0 12px;
  font-size: 14px; opacity: 1; cursor: pointer; border-bottom: 1px solid #3a3844;
}
.fx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; }
.fx-switch .track {
  flex: 0 0 auto; position: relative; width: 42px; height: 24px; border-radius: 12px;
  background: #3a3844; transition: background .15s;
}
.fx-switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #f1ecdf; transition: transform .15s;
}
.fx-switch input:checked + .track { background: #e0a44b; }
.fx-switch input:checked + .track::after { transform: translateX(18px); }
.fx-switch input:focus-visible + .track { outline: 2px solid #e0a44b; outline-offset: 2px; }

/* ===== 第10弾: 開始画面・ルーム概要・上部バー ===== */
textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 12px; margin-top: 6px; resize: vertical;
  border-radius: 10px; border: 1px solid #3a3844; background: #26242d; color: #f1ecdf; line-height: 1.5;
}
.start-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.start-row label.check { margin: 0; flex: 0 0 auto; }
.start-row input#key { flex: 1 1 120px; min-width: 0; width: auto; margin: 0; padding: 10px 12px; }
.start-row button { flex: 0 0 auto; width: auto; margin: 0 0 0 auto; padding: 12px 18px; }
.topbar .icon-btn#btnStop, .topbar .icon-btn#btnClose, .topbar .icon-btn#btnBack { font-size: 16px; line-height: 1; }

.overview { flex: 0 0 auto; border-top: 1px solid #2e2c36; }
.overview-toggle {
  display: flex; align-items: center; gap: 4px; width: 100%; margin: 0; padding: 4px 0; height: 28px;
  background: none; color: #f1ecdf; font-size: 12px; font-weight: 700; text-align: left; border-radius: 0; opacity: .85;
}
.overview-toggle .caret { display: inline-block; transition: transform .15s; }
.overview.open .overview-toggle .caret { transform: rotate(180deg); }
.overview-body {
  max-height: 30dvh; overflow-y: auto; padding: 0 0 8px; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; opacity: .9;
}
.pre-info { margin: 4px 0 12px; }
.pre-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.pre-desc { margin-top: 6px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; opacity: .85; }
.room .desc { font-size: 12px; opacity: .55; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 第11弾: NG ワード伏せ字の通知 ===== */
.composer { flex-wrap: wrap; }
.mask-note { flex: 0 0 100%; font-size: 12px; color: #e0a44b; padding: 2px 2px 0; }

/* 経過時間（数字幅を固定して揺れないように） */
#barTime { font-variant-numeric: tabular-nums; }

/* ===== 機材モード ===== */
.fx-switch + .fx-switch { margin-top: 0; }
.fx-sub { display: block; font-size: 11px; opacity: .65; margin-top: 2px; }
.fx-banner {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 2px 0 4px;
  border-radius: 10px; background: rgba(120, 200, 255, .14); border: 1px solid rgba(120, 200, 255, .45);
  font-size: 12px; line-height: 1.4;
}
.fx-banner span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fx-banner button { flex: 0 0 auto; width: auto; margin: 0; padding: 6px 10px; font-size: 12px; border-radius: 14px; }

/* 診断ログ */
.fx-diag { margin-top: 16px; font-size: 13px; }
.fx-diag summary { cursor: pointer; opacity: .8; padding: 4px 0; }
.fx-log {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.4;
  white-space: pre; overflow: auto; resize: vertical; margin-top: 6px;
}
.fx-diag .fx-copy { margin-top: 6px; padding: 8px; font-size: 13px; }

/* ===== 第12弾: コメント機能拡張（装飾コマンド / ピン留め / 流れるコメント） ===== */
/* 装飾コマンド（comment-format.js が付けるクラス） */
.cf-b { font-weight: 700; }
.cf-i { font-style: italic; }
.cf-big { font-size: 1.4em; line-height: 1.3; }
.cf-big2 { font-size: 1.8em; line-height: 1.25; }
.cf-big3 { font-size: 2.4em; line-height: 1.2; }
.cf-small { font-size: .8em; }
.cf-small2 { font-size: .65em; }
.cf-small3 { font-size: .5em; }
.cf-red { color: #ff5b5b; }
.cf-blue { color: #5ba8ff; }
.cf-green { color: #5bdc8a; }
.cf-orange { color: #ffa43b; }
/* /dopa: 虹色の文字が流れて光る（text-shadow は background-clip: text と相性が悪いので filter で発光） */
.cf-dopa {
  display: inline-block; max-width: 100%;
  background: linear-gradient(90deg, #ff5b5b, #ffa43b, #ffe45b, #5bdc8a, #5be0ff, #5ba8ff, #c77dff, #ff5b5b);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .7)) drop-shadow(0 0 10px rgba(255, 180, 255, .5));
  animation: cf-rainbow 2s linear infinite;
}
/* 背景幅 300% なので、位置 150% で背景1枚分ずれて継ぎ目なくループする */
@keyframes cf-rainbow { from { background-position: 0% 50%; } to { background-position: 150% 50%; } }

/* 入力欄の「?」（コマンド一覧） */
.composer button.cmd-btn { flex: 0 0 40px; width: 40px; background: #3a3844; color: #f1ecdf; font-weight: 700; }
/* 「?」パネル: 入力欄の真上（画面の縦並びの一部なので入力欄と重ならない）。ミュートボタンと同じ 48px の正方形を1列に並べ、横スクロール */
.cf-help-panel { flex: 0 0 auto; padding: 6px 0 2px; border-top: 1px solid #2e2c36; }
.cf-help {
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); /* 右端を薄くして続きがあると分かるように */
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.cf-help::-webkit-scrollbar { display: none; }
.cf-help::after { content: ""; flex: 0 0 18px; } /* 最後のボタンが薄くなった右端に隠れないように */
button.cf-help-item {
  position: relative; flex: 0 0 48px; width: 48px; height: 48px; margin: 0; padding: 1px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: #26242d; color: #f1ecdf; border: 1px solid #3a3844; border-radius: 10px; font-weight: 400; overflow: hidden;
}
button.cf-help-item:active { background: #3a3844; }
.cf-help-item code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: -.3px; color: #e0a44b; white-space: nowrap; }
.cf-help-sample { font-size: 11px; line-height: 1.15; white-space: nowrap; max-width: 100%; }
.cf-help-sample.cf-help-wrap { white-space: normal; font-size: 10px; line-height: 1.1; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.cf-help-sample.cf-big, .cf-help-sample.cf-big2, .cf-help-sample.cf-big3 { font-size: 13px; }
.cf-help-sample.cf-small, .cf-help-sample.cf-small2, .cf-help-sample.cf-small3 { font-size: 9px; }
.cf-help-item .cf-help-n:not(:empty) {
  position: absolute; top: 1px; right: 1px; padding: 0 3px; border-radius: 5px; font-size: 9px; line-height: 12px;
  background: #e0a44b; color: #1b1a21; font-weight: 700; opacity: 1;
}
/* コマンドを入れた直後に入力欄の枠を一瞬光らせる */
@keyframes cf-input-flash { from { border-color: #e0a44b; box-shadow: 0 0 0 2px rgba(224, 164, 75, .5); } to { border-color: #3a3844; box-shadow: none; } }
.composer input.cf-input-flash { animation: cf-input-flash .6s ease-out; }

/* ピン留め（コメント一覧の上部に固定） */
.pinned {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 2px; padding: 6px 10px;
  border-radius: 10px; background: #26242d; border: 1px solid #3a3844; font-size: 14px;
  max-height: 30dvh; overflow-y: auto;
}
.pinned .pin-mark { flex: 0 0 auto; font-size: 13px; line-height: 20px; }
.pinned .avatar { margin-top: 1px; }
.pinned .body { min-width: 0; overflow-wrap: anywhere; }
.pinned .name { display: block; opacity: .7; font-size: 12px; }
.host-live #comments .c[data-cid], .host-live .pinned { cursor: pointer; }

/* 流れるコメント: 画面全体の高さ 20%〜80% に固定し、6レーンに分けて流す（body 直下）。タップは下に素通り */
.cf-flow { position: fixed; top: 20vh; height: 60vh; left: 0; right: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.cf-flow-item {
  position: absolute; left: 100%; display: flex; align-items: center; gap: 4px;
  white-space: nowrap; line-height: 24px; font-size: 16px; color: #fff;
  text-shadow: 0 0 2px #000, 0 0 4px #000, 1px 1px 0 #000;
  will-change: transform;
}
/* 末尾の投稿者アイコン（本文の装飾・サイズに関係なく16px、縦中央） */
.cf-flow-item .cf-flow-av { flex: 0 0 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.cf-flow-item .cf-dopa { max-width: none; text-shadow: none; }
/* 流れるコメントの大きい文字: 行の高さを詰めて 大1段=1レーン、2〜3段=2レーンに収める。3段は狭い画面で幅に合わせて縮める */
.cf-flow-item .cf-big, .cf-flow-item .cf-big2, .cf-flow-item .cf-big3 { line-height: 1.1; }
.cf-flow-item .cf-big3 { font-size: min(2.4em, 9vw); }

/* フォロー・配信開始の通知（listen.html の上部バーの下、host.html のプロフィール・メニュー、ロビーの印） */
.follow-bar { flex: 0 0 auto; padding: 4px 0 6px; border-top: 1px solid #2e2c36; }
.follow-row { display: flex; align-items: center; gap: 10px; }
button.pill.follow-btn { height: 28px; line-height: 28px; padding: 0 14px; font-size: 13px; }
button.pill.follow-btn.on { background: #3a3844; color: #e0a44b; border: 1px solid #e0a44b; }
.follow-count { font-size: 12px; opacity: .7; }
.notify-box { margin-top: 6px; }
button.pill.notify-btn { height: 28px; line-height: 28px; padding: 0 12px; font-size: 13px; }
button.pill.notify-btn.on { color: #e0a44b; }
.notify-note { margin: 0; font-size: 12px; line-height: 1.5; opacity: .85; }
.notify-steps { margin: 4px 0 0; padding-left: 1.4em; font-size: 12px; line-height: 1.6; opacity: .85; }
.room .follow-mark {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; line-height: 16px;
  color: #e0a44b; border: 1px solid #e0a44b;
}
.menu-note { padding: 8px 0 10px; font-size: 13px; opacity: .8; border-bottom: 1px solid #2e2c36; margin-bottom: 4px; }

/* ロビー: 左上のアカウントボタンとログイン状態の小さいウインドウ */
.lobby-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.lobby-head h1 { margin: 0; flex: 1; min-width: 0; }
button.account-btn {
  flex: 0 0 auto; width: auto; margin: 0; padding: 0; border: none; border-radius: 50%; background: none; line-height: 0;
  box-shadow: 0 0 0 2px #3a3844;
}
button.account-btn.in { box-shadow: 0 0 0 2px #e0a44b; }
.account-pop {
  position: absolute; top: 64px; left: 16px; z-index: 50; width: min(300px, calc(100vw - 32px));
  padding: 14px; border-radius: 12px; background: #26242d; border: 1px solid #3a3844; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.account-pop .acc-state { font-size: 12px; opacity: .7; }
.account-pop .acc-user { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.account-pop .acc-who { min-width: 0; }
.account-pop .acc-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-pop .acc-sub { font-size: 12px; opacity: .7; }
.account-pop .acc-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; opacity: .8; }
.account-pop .acc-error { margin: 0 0 8px; font-size: 13px; color: #ff6b6b; }
.account-pop .acc-env { margin: 10px 0 0; font-size: 11px; opacity: .55; }

/* ===== コメントUX追加（段階ボタン / fever / スクロール固定） ===== */
/* 遡って読んでいるときの「最新のコメント +N」（.center の中、一覧の下端に重ねる） */
.cf-newer {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2;
  width: auto; margin: 0; padding: 6px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  background: #e0a44b; color: #1d1b22; box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.cf-newer[hidden], #comments[hidden] + .cf-newer { display: none; }

/* /fever: 全画面のレイヤー（body 直下、流れるコメントとは別）。タップは下に素通り */
.cf-fever { position: fixed; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.cf-fever-ch {
  position: absolute; font-size: 19.2px; line-height: 1; white-space: pre; will-change: transform, opacity;
}
/* 虹色は文字ごとに違う位置で止める（90文字の背景アニメーションは重いので） */
.cf-fever-ch .cf-dopa { animation: none; max-width: none; }
/* 尾: 文字の中心から進む向きと反対（右上）へ伸びる光の筋 */
.cf-fever-ch::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 4em; height: 2px; margin-top: -1px;
  transform-origin: 0 50%; transform: rotate(var(--tail, -45deg)); border-radius: 1px; z-index: -1;
  background: linear-gradient(90deg, rgba(255, 230, 255, .9), rgba(255, 180, 255, .35) 40%, rgba(255, 180, 255, 0));
}
/* 周りの小さな光点（2つ目は box-shadow で） */
.cf-fever-ch::before {
  content: ""; position: absolute; left: -5px; top: -3px; width: 3px; height: 3px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 4px 1px rgba(255, 220, 255, .8), 14px 22px 0 -0.5px rgba(255, 240, 180, .9);
}

/* /bonusa /bonusb: 画面中央に本文を出す全画面のレイヤー（流れる・降るコメントより上、シートより下）。タップは下に素通り */
.bonus-layer { position: fixed; inset: 0; z-index: 8; overflow: hidden; pointer-events: none; }
.bonus-stage { position: absolute; inset: 0; }
.bonus-text {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: clamp(32px, 9vw, 72px); font-weight: 900; line-height: 1.1; letter-spacing: .02em; white-space: nowrap;
  color: #fff; text-shadow: 0 0 12px rgba(255, 255, 255, .5), 0 4px 0 rgba(0, 0, 0, .35);
}
/* 11〜20文字は文字数に合わせて1行に収まる大きさ（--n は文字数）、21文字以上は折り返して小さく */
.bonus-text.bonus-mid { font-size: clamp(18px, calc(86vw / var(--n, 20)), 72px); }
.bonus-text.bonus-long { font-size: clamp(16px, 4.5vw, 32px); white-space: normal; width: min(90vw, 520px); text-align: center; overflow-wrap: anywhere; }
.bonus-text .cf-big, .bonus-text .cf-big2, .bonus-text .cf-big3,
.bonus-text .cf-small, .bonus-text .cf-small2, .bonus-text .cf-small3 { font-size: 1em; line-height: inherit; }
.bonus-text .cf-dopa { max-width: none; text-shadow: none; }

/* 揺れ・着地・爆発の共通: 約1.6秒止まってから0.4秒で消える */
@keyframes bonus-hold { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* /bonusa: 叩きつけて -6度に傾いて着地 */
.bonus-a .bonus-text { animation: bonus-stamp .28s cubic-bezier(.2, 1.6, .4, 1) both, bonus-hold 2s .28s both; }
@keyframes bonus-stamp {
  0% { transform: translate(-50%, -50%) scale(3.2) rotate(-12deg); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(.92) rotate(-6deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(-6deg); opacity: 1; }
}
/* 画面ごと揺らす。#appShell の transform は iOS のキーボード対策で JS が使うので、translate / rotate プロパティで重ねる */
.bonus-shake { animation: bonus-shake .55s .2s cubic-bezier(.3, .1, .3, 1); }
@keyframes bonus-shake {
  0% { translate: 0 0; rotate: 0deg; }
  10% { translate: -10px 8px; rotate: -.6deg; }
  20% { translate: 9px -7px; rotate: .5deg; }
  30% { translate: -8px -6px; rotate: -.4deg; }
  40% { translate: 7px 6px; rotate: .3deg; }
  55% { translate: -5px 3px; rotate: 0deg; }
  70% { translate: 4px -3px; rotate: 0deg; }
  85% { translate: -2px 1px; rotate: 0deg; }
  100% { translate: 0 0; rotate: 0deg; }
}

/* /bonusb: 閃光・三重の光輪・火花。本文は弾けてから収まる */
.bonus-b .bonus-text { animation: bonus-burst .38s cubic-bezier(.2, 2, .4, 1) both, bonus-hold 2s .38s both; }
@keyframes bonus-burst {
  0% { transform: translate(-50%, -50%) scale(.1); opacity: 0; filter: brightness(3); }
  55% { transform: translate(-50%, -50%) scale(1.45); opacity: 1; filter: brightness(2); }
  75% { transform: translate(-50%, -50%) scale(.9); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: brightness(1); }
}
.bonus-flash {
  position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(255, 255, 255, .55), transparent 55%);
  animation: bonus-flash .4s ease-out both;
}
@keyframes bonus-flash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.bonus-ring {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; border-radius: 50%; border: 4px solid #ffb43b;
  transform: translate(-50%, -50%); box-shadow: 0 0 18px #ffb43b; animation: bonus-ring .8s ease-out both; will-change: transform, opacity;
}
.bonus-ring.bonus-r2 { border-color: #fff; box-shadow: none; animation-delay: .12s; animation-duration: .9s; }
.bonus-ring.bonus-r3 { border-color: #ff5b8a; box-shadow: none; animation-delay: .22s; animation-duration: 1s; }
@keyframes bonus-ring {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(22); opacity: 0; border-width: 1px; }
}
.bonus-spark {
  position: absolute; left: 50%; top: 50%; width: var(--s, 6px); height: var(--s, 6px); border-radius: 50%;
  box-shadow: 0 0 8px currentColor; will-change: transform, opacity;
  animation: bonus-spark var(--t, .9s) cubic-bezier(.1, .8, .3, 1) both;
}
.bonus-spark.bonus-line { border-radius: 2px; width: 3px; }
@keyframes bonus-spark {
  0% { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 40px)) rotate(var(--r, 0deg)) scale(.2); opacity: 0; }
}

/* ===== ゲームモード（射的） ===== */
/* 全画面のレイヤー。タップを受けるのは的エリアだけ（エリアの外はコメント一覧などがそのまま使える） */
.game-layer { position: fixed; inset: 0; z-index: 7; pointer-events: none; }
.game-layer[hidden], body.mini .game-layer { display: none; }
.game-area {
  position: fixed; pointer-events: auto; border: 1px solid rgba(255, 255, 255, .22); border-radius: 14px;
  background: rgba(0, 0, 0, .28); touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.game-count {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: calc(var(--side, 300px) * .32); font-weight: 900; line-height: 1; color: #fff;
  text-shadow: 0 0 18px rgba(255, 180, 60, .6), 0 4px 0 rgba(0, 0, 0, .35);
}
.game-count-pop { animation: game-pop 1s ease-out; }
@keyframes game-pop { 0% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { opacity: .85; } }
/* 的: 同心円（赤・白）＋番号。位置は中心、大きさはエリアの一辺に対する割合 */
button.game-target {
  position: absolute; transform: translate(-50%, -50%); margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle, #e8322f 0 16%, #fff 16% 33%, #e8322f 33% 50%, #fff 50% 67%, #e8322f 67% 100%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .45); cursor: pointer;
  animation: game-appear .12s ease-out;
}
button.game-target:disabled { opacity: .55; cursor: default; }
button.game-target.game-hit { opacity: 1; filter: grayscale(.2) brightness(.9); box-shadow: 0 0 0 4px #ffd34d, 0 0 18px rgba(255, 211, 77, .8); }
@keyframes game-appear { from { transform: translate(-50%, -50%) scale(.4); } to { transform: translate(-50%, -50%) scale(1); } }
.game-target-n {
  position: absolute; right: -2px; top: -2px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: #1b1a21; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.game-mine, .game-wait {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 4px 10px; border-radius: 8px;
  background: rgba(0, 0, 0, .55); color: #ffd34d; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.game-wait { top: 50%; bottom: auto; transform: translate(-50%, -50%); color: #f1ecdf; }
/* リザルトカード（エリアの中央。長いときはカードの中でスクロール） */
.game-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 88%; max-height: 92%; overflow-y: auto;
  padding: 14px; border-radius: 14px; background: #26242d; border: 1px solid #3a3844; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.game-result h3 { margin: 0 0 10px; font-size: 16px; text-align: center; }
.game-none { margin: 12px 0; text-align: center; opacity: .8; }
.game-winners { display: grid; gap: 6px; }
.game-sub { margin: 10px 0 4px; font-size: 12px; opacity: .7; }
.game-ranking { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.game-row { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.game-row-label { flex: 0 0 auto; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: #3a3844; }
.game-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-row-name.dim { opacity: .5; }
.game-row-ms { flex: 0 0 auto; font-weight: 700; color: #ffd34d; font-variant-numeric: tabular-nums; }
.game-actions { display: flex; gap: 8px; margin-top: 12px; }
.game-actions button { flex: 1; margin: 0; }
/* 設定シート */
.game-field { margin: 10px 0; }
.game-field-label { font-size: 13px; opacity: .75; margin-bottom: 6px; }
.game-seg { display: flex; gap: 6px; }
.game-seg button { flex: 1; margin: 0; background: #26242d; color: #f1ecdf; border: 1px solid #3a3844; }
.game-seg button[aria-checked="true"] { background: #e0a44b; color: #1b1a21; border-color: #e0a44b; font-weight: 700; }
button.game-start-btn { display: block; width: 100%; margin: 16px 0 4px; }
/* ミニプレイヤーの上の帯（リスナー）。タップで視聴画面に戻る */
button.game-band {
  position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 7; margin: 0; border-radius: 0;
  padding: 10px 16px; background: #e0a44b; color: #1b1a21; font-weight: 700; font-size: 14px; text-align: center;
}
button.game-band[hidden] { display: none; }
/* ===== ゲームモード（逃げろ）: 的エリアに Canvas、上に残り時間・HP、下にジョイスティックか爆弾の選択 ===== */
.game-area.dodge-area { background: #161923; overflow: hidden; touch-action: none; }
.dodge-area canvas { display: block; width: 100%; height: 100%; }
.dodge-area .game-count { pointer-events: none; }
.dodge-area.dodge-hit { animation: dodge-hit .4s ease-out; }
.dodge-area.dodge-hit2 { animation: dodge-hit2 .5s ease-out; }
@keyframes dodge-hit { 0%, 100% { transform: translate(0); } 20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(4px, 2px); } }
@keyframes dodge-hit2 { 0%, 100% { transform: translate(0); } 15% { transform: translate(-10px, 6px) rotate(-.5deg); } 30% { transform: translate(10px, -6px) rotate(.5deg); } 50% { transform: translate(-7px, -4px); } 70% { transform: translate(6px, 4px); } 85% { transform: translate(-3px, 2px); } }
@media (prefers-reduced-motion: reduce) { .dodge-area.dodge-hit, .dodge-area.dodge-hit2 { animation: none; } }
.dodge-hud {
  position: fixed; height: 28px; pointer-events: none; display: flex; flex-wrap: nowrap; gap: 12px; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 8px; background: #1d2130; border: 1px solid #2b3044; font-size: 13px; color: #b9bdcc; white-space: nowrap; overflow: hidden;
}
.dodge-hud b { color: #fff; font-variant-numeric: tabular-nums; }
.dodge-hp { display: inline-flex; gap: 3px; vertical-align: -1px; }
.dodge-hp i { width: 11px; height: 11px; border-radius: 3px; background: #ff5b5b; }
.dodge-hp i.off { background: #3a3844; }
.dodge-ctrl { position: fixed; pointer-events: none; display: grid; justify-items: center; gap: 6px; }
.dodge-ctrl > * { pointer-events: auto; }
.dodge-stickwrap { display: grid; justify-items: center; gap: 4px; -webkit-user-select: none; user-select: none; }
.dodge-stick { position: relative; width: 140px; height: 140px; border-radius: 50%; background: #1d2130; border: 1px solid #2b3044; touch-action: none; -webkit-touch-callout: none; }
.dodge-stickwrap[hidden] { display: none; }
.dodge-sectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dodge-sectors path { fill: rgba(43, 48, 68, .5); stroke: #161923; stroke-width: 1.2; transition: fill .08s; }
.dodge-sectors path.on { fill: #5ba8ff; filter: drop-shadow(0 0 6px rgba(91, 168, 255, .8)); }
.dodge-sectors path.weak { fill: rgba(91, 168, 255, .35); }
.dodge-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: #5ba8ff; box-shadow: 0 4px 14px rgba(91, 168, 255, .45); transition: transform .08s; pointer-events: none; }
.dodge-stick.active .dodge-knob { transition: none; }
.dodge-stickhint { font-size: 11px; color: #8e94a8; padding: 1px 8px; border-radius: 6px; background: rgba(27, 26, 33, .85); }
.dodge-stock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; padding: 6px; border-radius: 10px; background: rgba(29, 33, 48, .95); border: 1px solid #2b3044; }
button.dodge-opt {
  width: auto; margin: 0; padding: 7px 8px; display: grid; gap: 2px; text-align: left; border-radius: 8px;
  background: #161923; color: #e8e9ef; border: 1px solid #2b3044; font-weight: 400; font-size: 13px; touch-action: manipulation;
}
button.dodge-opt b { font-size: 13px; }
button.dodge-opt small { font-size: 11px; color: #8e94a8; line-height: 1.3; }
button.dodge-opt[aria-pressed="true"] { border-color: #ffb43b; box-shadow: inset 0 0 0 1px #ffb43b; }
.dodge-msg { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: max-content; max-width: 92%; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: rgba(27, 26, 33, .92); border: 1px solid #3a3844; font-size: 13px; text-align: center; }
.dodge-msg[hidden] { display: none; }
.dodge-head { margin: 4px 0 8px; font-weight: 700; text-align: center; color: #ffd34d; }
/* システムコメント（ゲームの結果など） */
#comments .c.c-sys { background: rgba(224, 164, 75, .1); border-radius: 8px; }
.cf-sys { color: #ffd34d; font-weight: 700; }

/* 視聴画面: 音声を再取得ボタン（押している間だけ回す） */
@keyframes icon-spin { to { transform: rotate(360deg); } }
button.icon-btn.spin svg { animation: icon-spin .6s linear infinite; }

/* ロビー: お知らせ（リリース履歴）。見出しをタップで開き、中は日付ごとの折りたたみ */
.news { margin: 24px 0 0; border: 1px solid #3a3844; border-radius: 12px; background: #26242d; }
.news > summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
.news-day { border-top: 1px solid #3a3844; }
.news-day > summary { padding: 10px 14px; font-size: 14px; cursor: pointer; opacity: .9; }
.news-day ul { margin: 0 0 12px; padding: 0 14px 0 32px; font-size: 13px; line-height: 1.7; }
.news-day p { margin: 0 14px 6px; font-size: 13px; line-height: 1.7; }
.news a, .notice-body a { color: #e0a44b; }
.news code, .doc code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; padding: 0 3px; border-radius: 4px; background: #1b1a21; white-space: nowrap; }

/* ===== ミニプレイヤー（視聴画面を画面下に縮め、上にロビーを出す。視聴画面の DOM は隠すだけ） ===== */
body.mini #appShell, body.mini .fx-col { display: none; }
.mini-lobby {
  position: fixed; left: 0; right: 0; top: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 6;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: #1b1a21;
}
.mini-lobby-inner { max-width: 560px; margin: 0 auto; padding: 16px; }
.mini-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  height: calc(56px + env(safe-area-inset-bottom)); padding: 0 12px env(safe-area-inset-bottom);
  display: flex; align-items: center; gap: 8px;
  background: #26242d; border-top: 1px solid #3a3844; box-shadow: 0 -4px 16px rgba(0, 0, 0, .35);
}
.mini-bar[hidden] { display: none; }
button.mini-main {
  flex: 1; min-width: 0; width: auto; height: 48px; margin: 0; padding: 0 4px;
  display: flex; align-items: center; gap: 10px; background: none; border: none; color: #f1ecdf; font-weight: 700; text-align: left;
}
.mini-title { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar.ended .mini-title { color: #e0a44b; }
/* ロビーの一覧: いま聴いている配信 */
.room.playing { border-color: #e0a44b; }
.room .playing-mark {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; line-height: 16px; vertical-align: 2px;
  background: #e0a44b; color: #1b1a21; font-weight: 700;
}

/* /fall: 雪のように上から真下へ降る文字（発光なし。色コマンドはその色、/dopa は虹色＋発光） */
.cf-fall-ch { position: absolute; font-size: 19.2px; line-height: 1; white-space: pre; color: #fff; will-change: transform, opacity; }
.cf-fall-ch .cf-dopa { animation: none; max-width: none; }

/* オープンチャット（ロビー） */
.lobby-chat { margin-top: 24px; padding: 12px; border: 1px solid #3a3844; border-radius: 12px; background: #26242d; }
.lc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lc-head h2 { font-size: 16px; margin: 0; }
.lc-list { height: 260px; overflow-y: auto; margin-top: 8px; padding: 4px 8px; border-radius: 10px; background: #1b1a21; font-size: 14px; overscroll-behavior: contain; }
.lc-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.lc-row.lc-mine { cursor: default; }
.lc-row .avatar { margin-top: 1px; }
.lc-row .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lc-row .name { display: block; opacity: .7; font-size: 12px; }
.lc-row.lc-mine .name { color: #e0a44b; opacity: .9; }
.lc-time { flex: none; font-size: 11px; opacity: .45; margin-top: 2px; }
.lc-empty, .lc-error { text-align: center; opacity: .6; font-size: 13px; padding: 24px 0; margin: 0; }
.lobby-chat .composer { display: flex; gap: 8px; margin-top: 8px; flex-wrap: nowrap; }
.lc-login { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lc-login .small { flex: 1; }
.lc-login button { flex: 0 0 auto; width: auto; margin: 0; padding: 8px 12px; font-size: 14px; }
.lc-msg { margin: 6px 0 0; color: #e0a44b; opacity: 1; }
.lc-msg:empty { display: none; }
.lc-hidden { margin: 6px 0 0; }
.lc-link { width: auto; margin: 0; padding: 0; background: none; color: #e0a44b; font-weight: 400; font-size: 12px; text-decoration: underline; }
.lc-note { margin: 8px 0 0; }

/* ===== 新しい版の通知（update-check.js）・更新後の復帰 ===== */
/* 上部バーの直下（top は JS が決める）。演出（bonus 8）より上、シート（10〜）より下 */
.update-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 9;
  max-width: 560px; margin: 0 auto; padding: 8px 8px 8px 14px;
  display: flex; align-items: center; gap: 8px;
  background: #2e2b38; border: 1px solid #e0a44b; border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4); font-size: 13px;
}
.update-bar[hidden] { display: none; }
.update-bar .update-text { flex: 1; min-width: 0; }
.update-bar button { width: auto; margin: 0; flex: 0 0 auto; }
.update-bar .update-go { padding: 6px 12px; font-size: 13px; border-radius: 14px; }
.update-bar .update-close { padding: 4px 8px; background: none; color: #f1ecdf; font-size: 18px; line-height: 1; opacity: .7; }
/* 更新後に自動で入り直したが、音を出すにはタップが要るとき（視聴画面） */
.update-bar.tap-audio { cursor: pointer; }
