/* ことば人狼 Lite — ロビー基盤スタイル
   デザイン基準：ロビーモックv1（おぎ承認済み）
   明るいミント×水色パレット。「初心者でも気軽に始めやすい、見やすい配色」。
   本家（人狼NIGHT）のダークファンタジーには寄せない。 */
:root {
  --ink: #17324a;
  --ink-soft: #4a6a84;
  --mint: #35cf8b;
  --mint-bg: #dcfaea;
  --sky: #2b9df4;
  --sky-deep: #1f8bf0;
  --card: #ffffff;
  --line: #d9ecf7;
  --gold: #f5a623;
  --danger: #e5534b;
  --radius: 20px;
  --shadow: 0 4px 14px rgba(31, 90, 140, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* 入力欄は文字選択・編集を今まで通り使えるようにする */
input, textarea { -webkit-user-select: text; user-select: text; }
/* 引っ張って更新（プルトゥリフレッシュ）で画面がリロードされ、いる場所が
   リセットされるのを防ぐ（2026-11-26 おぎ要望：そもそも対戦中は更新
   できないように。アプリ全体で無効化する） */
* { overscroll-behavior: none; }
body {
  /* 丸ゴシック M PLUS Rounded 1c（Google Fonts CDN / OFL）を第一に。
     見出し・ボタン・名前などは各所の font-weight: 800 で ExtraBold に寄る。
     長文の本文（ルール文・システムDM）は読みやすさ優先で従来フォント */
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-weight: 700;
  color: var(--ink);
  /* 長押しでブラウザの文字選択（コピー／すべて選択の帯）が出ないように。
     アプリ内の長押しメニューと競合するため全体で無効化し、入力欄だけ戻す */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  background: #cfeefc;
}
/* 全画面（PWA）時のステータスバー裏・ジェスチャーバー裏は白で塗る。
   上下バー（半透明白）と同色にして、帯がはみ出して見えないようにする（2026-11-25 おぎ） */
html { background: #ffffff; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
/* タップ時にブラウザが勝手に出す青い四角（タップハイライト）を消す */
* { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* スマホ枠。position: fixed で画面に固定する：height: 100dvh だと
   引っ張って更新の後にブラウザの高さ計算がずれて、下部メニューが
   画面外に落ちる端末があるため（2026-11-25 おぎ実機で発生） */
.phone {
  position: fixed;
  top: 0;
  bottom: 0;
  /* 中央寄せは margin: 0 auto + max-width の組み合わせにしないこと。
     その形だと Chrome が内側スクロールのタッチ判定を取りこぼし、
     画面が指でスクロールできなくなる（2026-11-27 おぎ実機＋検証で確認）。
     左右オフセットの計算で 430px 中央列にする */
  left: max(0px, calc((100% - 430px) / 2));
  right: max(0px, calc((100% - 430px) / 2));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #e4fbf0 0%, #e0f3ff 55%, #d8efff 100%);
  box-shadow: 0 0 24px rgba(31, 90, 140, 0.15);
}

/* 上部固定バー（スクロールしても残る細いバー＋⚙️） */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.topbar-title { font-size: 20px; font-weight: 800; color: #14549e; letter-spacing: 0.04em; display: flex; align-items: center; }
.topbar-logo { height: 34px; width: auto; display: block; }

/* ログイン画面（2026-11-26）：ロビーと同じグラデーションの上に
   ロゴ＋SNSログインボタン。モーダル（z 60）より下、画面（z 40）より上 */
.login-screen {
  position: absolute; inset: 0; z-index: 55;
  background: linear-gradient(180deg, #e4fbf0 0%, #e0f3ff 55%, #d8efff 100%);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.35s ease;
}
.login-screen.login-bye { opacity: 0; pointer-events: none; }
.login-inner {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 24px 28px calc(24px + env(safe-area-inset-bottom));
}
.login-logo { width: min(86%, 350px); height: auto; display: block; }
.login-tagline {
  margin: 14px 0 0; font-size: 15px; font-weight: 700; color: #14549e;
  letter-spacing: 0.06em;
}
.login-buttons {
  display: flex; flex-direction: column; gap: 12px;
  width: min(100%, 320px); margin-top: 44px;
}
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; border-radius: 14px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.login-btn:disabled { opacity: 0.55; cursor: default; }
.login-mark { width: 21px; height: 21px; display: block; flex: 0 0 auto; }
.login-btn-google {
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; box-shadow: 0 1px 3px rgba(23, 50, 74, 0.14);
}
.login-btn-apple { background: #000; color: #fff; border: 1px solid #000; }
.login-terms {
  margin: 26px 0 0; font-size: 11px; line-height: 1.7;
  color: #5b7a8c; text-align: center;
}
.login-terms a { color: #1f8bf0; }

/* ID のワンタップコピー（2026-11-26 おぎ）：自分のプロフカードと
   相手のプロフィールモーダルの ID 行が対象 */
.id-copy { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.id-copy:active { opacity: 0.6; }
.id-copy-ic { width: 12px; height: 12px; vertical-align: -1px; margin-left: 4px; opacity: 0.55; }
.gear-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.gear-img { width: 26px; height: 26px; display: block; }

/* スクロール領域 */
.scroll { flex: 1 1 auto; overflow-y: auto; padding: 14px 14px 0; }
.tab-panel { padding-bottom: 8px; }

/* プロフィールカード */
/* ライブティッカー：ロビーに動きを出す細い帯。実イベント＋お知らせを流す */
.ticker {
  overflow: hidden; overflow: clip;
  background: linear-gradient(90deg, #e6f7ff, #d9fbe8);
  border-radius: 999px;
  padding: 5px 0;
  margin-top: -6px;
  margin-bottom: 8px;
  box-shadow: inset 0 0 0 1px rgba(43, 157, 244, 0.15);
}
.ticker-track {
  display: inline-flex;
  gap: 0;
  white-space: nowrap;
  will-change: transform;
}
.ticker-item {
  font-size: 12.5px; font-weight: 700; color: #33536d;
  padding: 0 22px;
}
.profile-card {
  display: flex;
  gap: 14px;
  background: linear-gradient(135deg, #d9fbe8, #e6f7ff);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.avatar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; /* 本家標準：アイコンは四角（角丸） */
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.9), var(--shadow);
}
.avatar-lg { width: 88px; height: 88px; font-size: 52px; }
.avatar-md { width: 56px; height: 56px; font-size: 34px; border-radius: 14px; }
.avatar-sm { width: 52px; height: 52px; font-size: 32px; border-radius: 14px; position: relative; }
.avatar-xs { width: 28px; height: 28px; font-size: 17px; border-radius: 8px; position: relative; }
/* DMの相手メッセージ横の小アイコン（タップでプロフィール） */
.dm-msg-icon-btn {
  flex: 0 0 auto; align-self: flex-start;
  padding: 0; margin: 0; background: none; border: none; cursor: pointer;
}
.avatar-xl { width: 128px; height: 128px; font-size: 76px; margin: 10px auto; }
.profile-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.profile-main { min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* 名前もオンライン表示も改行させない。狭い画面では文字サイズを下げて収める */
.profile-name-btn {
  min-width: 0;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
  white-space: nowrap;
}
.profile-name { font-size: clamp(17px, 5.8vw, 26px); font-weight: 800; white-space: nowrap; }
.profile-name.long { font-size: clamp(14px, 4.6vw, 20px); }
/* 鉛筆は名前の流れの中に置き、名前の長さに必ず追随させる（絶対配置だと
   名前が長いときにボタン枠だけ縮んで文字に被るため） */
.name-pencil {
  font-size: 11px; color: var(--ink-soft);
  vertical-align: super; margin-left: 3px;
}
.online-label {
  color: #159a5f; font-weight: 700;
  font-size: clamp(10px, 3.4vw, 13px);
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.name-input {
  width: 100%; font: inherit; font-size: 16px; font-weight: 700;
  border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 12px; box-sizing: border-box; background: #f9fdff; color: var(--ink);
}
.birth-selects { display: flex; gap: 8px; }
.birth-sel { width: auto; flex: 1; }
.birth-sel-y { flex: 1.4; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-on { background: #2ecc71; }
.profile-id { color: var(--ink-soft); font-size: 14px; margin: 2px 0 6px; }
.profile-bio {
  font-size: 13.5px; line-height: 1.55; color: #33536d;
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit;
}
.profile-bio::after {
  content: '';
  display: inline-block;
  width: 13px; height: 13px;
  margin-left: 5px;
  vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a7a94' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 19.5l.8-3.9L16.6 4.3a2.05 2.05 0 0 1 2.9 0l.2.2a2.05 2.05 0 0 1 0 2.9L8.4 18.7l-3.9.8z'/%3E%3Cpath d='M14.8 6.1l2.9 2.9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.profile-bio.empty { color: var(--ink-soft); }
.bio-input {
  width: 100%; font: inherit; font-size: 14.5px; line-height: 1.6;
  border: 2px solid var(--border, #cfe3ee); border-radius: 12px;
  padding: 10px 12px; resize: none; box-sizing: border-box;
}

/* ピル（コイン／人気度） */
.pill-row { display: flex; gap: 10px; margin-top: 12px; }
.pill {
  flex: 1 1 0;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 8px 12px;
  font-weight: 800; font-size: 16px;
  white-space: nowrap;
}
.charge-chip {
  background: #bfe3ff; color: #1473c9;
  border-radius: 999px; padding: 3px 10px; font-size: 13px;
}
.pill-coin, .pill-sparkle { font-size: 18px; }
/* ピル内はアイコン＋数字のみで1行固定（2026-11-25 おぎ）。桁が増えても
   子要素を縮めたり改行させたりしない */
.pill > span { white-space: nowrap; flex: 0 0 auto; }

/* プリセットアイコン画像（.avatar の中身として全面に敷く） */
.avatar-img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; border-radius: inherit;
}
/* DM画面ヘッダーのオンラインバッジ（出す場所はロビーの友達帯と
   DM画面だけ：2026-11-25 おぎ） */
.dm-header .avatar .dot {
  position: absolute; right: -1px; bottom: -1px;
  border: 2px solid #eafaf1; width: 13px; height: 13px;
}

/* アイコン選択グリッド */
.icon-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin: 10px 0; padding: 9px 9px 2px 2px;
  overflow-y: auto; min-height: 0;
  align-content: start; align-items: start;
}
/* セルは常に正方形。中身は絶対配置のインナーに閉じ込め、寸法に影響させない。
   ✓バッジだけはセルの直の子として上に重ねる */
.icon-choice {
  position: relative; min-width: 0; min-height: 0;
  aspect-ratio: 1 / 1;
  display: block;
  background: #f4fbff; border: 2px solid var(--line); border-radius: 14px;
  padding: 0;
}
.icon-choice-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; overflow: clip; border-radius: 12px;
}
.icon-choice-lock {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  font-size: 8.5px; font-weight: 800; color: var(--ink-soft);
  text-align: center; white-space: nowrap; overflow: hidden; overflow: clip; padding: 2px 0;
}
.icon-choice .avatar-img { width: 44px; height: 44px; border-radius: 10px; }
.icon-choice-check {
  position: absolute; top: -7px; right: -7px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--mint); color: #fff;
  font-size: 12px; font-weight: 800; line-height: 20px; text-align: center;
  box-shadow: 0 2px 6px rgba(23, 50, 74, 0.25);
}
.icon-choice.selected { border-color: var(--mint); background: var(--mint-bg); }
.icon-choice:disabled { opacity: 0.55; cursor: default; }
.icon-choice.locked { opacity: 0.55; cursor: default; }


/* ログインボーナス */
.starter-card {
  margin-top: 10px; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 12px;
}
.starter-title { margin: 0 0 8px; font-weight: 800; font-size: 13.5px; color: var(--ink); }
.starter-progress { color: var(--sky); font-size: 12px; margin-left: 4px; }
.starter-stamps { display: flex; gap: 6px; }
.starter-stamps .stamp {
  flex: 1; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #eef4f9; color: #7d99b0; font-size: 11.5px; font-weight: 800;
  border: 2px dashed #c3d8e8;
}
.starter-stamps .stamp.next { border: 2px solid var(--sky); color: var(--sky); background: #eaf6ff; }
.starter-stamps .stamp.got {
  background: linear-gradient(180deg, #ffd964, #ffc93c); border: 2px solid #f0b429;
  color: #9a6a00; font-size: 15px;
}
.starter-note { margin: 8px 0 0; font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.bonus-banner {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(90deg, #ffedb3, #ffd964);
  color: #9a6a00;
  font-weight: 800; font-size: 14.5px;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.bonus-banner .bonus-label { white-space: nowrap; overflow: hidden; overflow: clip; }
.bonus-banner #bonus-state {
  background: #fff; color: #d18d00;
  border-radius: 999px; padding: 2px 10px; font-size: 12.5px;
  white-space: nowrap; flex-shrink: 0;
}
.bonus-banner.claimed { background: linear-gradient(90deg, #fff3c4, #ffe98f); }
.bonus-banner.claimed #bonus-state { background: #ffe9a8; color: #a87b12; }

/* セクション見出し */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 2px 10px;
}
.section-head h2 { font-size: 19px; font-weight: 800; }
.link-btn { color: var(--sky); font-weight: 700; font-size: 14.5px; }
.refresh-btn { display: inline-flex; align-items: center; gap: 5px; }
.refresh-icon { width: 17px; height: 17px; display: block; }
.see-all-btn { display: inline-flex; align-items: center; gap: 4px; }
.see-all-icon { width: 17px; height: 17px; display: block; flex: 0 0 auto; }

/* オンラインの友達 */
/* 横スクロール帯は touch-action: pan-x にする。auto のままだと
   帯の上で始めた縦スワイプ（少し斜めになるだけで）が横スクロール側に
   奪われ、ページ全体がスクロールしなくなる（2026-11-27 おぎ実機：
   もらったギフト／オンラインの友達のあたりから滑らない）。
   pan-x なら横は帯、縦は外側のスクロールに渡る */
.friends-strip { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 6px; touch-action: pan-x; }
.friends-strip-empty { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; padding: 4px 2px; }
.friend-item { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; }
.friend-item .friend-name { font-size: 13px; font-weight: 700; }
.friend-item .dot { position: absolute; right: -1px; bottom: -1px; border: 2px solid #eafaf1; width: 13px; height: 13px; }

/* ランダム入室 */
.random-btn {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(180deg, #3db2ff, var(--sky-deep));
  color: #fff;
  border-radius: 18px;
  padding: 15px 12px 13px;
  box-shadow: 0 6px 16px rgba(31, 139, 240, 0.35);
  display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.random-title { font-size: 22px; font-weight: 800; display: inline-flex; align-items: center; gap: 9px; }
.random-icon { width: 27px; height: 27px; display: block; }
.random-sub { font-size: 13.5px; opacity: 0.95; }

/* ルーム一覧 */
.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-card {
  display: flex; gap: 12px; align-items: center;
  width: 100%; text-align: left;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.gift-frame {
  background: #ffffff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 10px 14px 9px; margin-top: 12px;
}
.gift-strip-label {
  font-size: 13px; font-weight: 800; color: var(--ink);
}
.gift-strip {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 7px 0 0;
  white-space: nowrap; overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x;
  scrollbar-width: none;
  font-size: 14.5px; font-weight: 700; color: var(--ink);
  /* 右端を少し透かして「横に続きがある」ことを匂わせる */
  -webkit-mask-image: linear-gradient(to right, #000 93%, transparent);
  mask-image: linear-gradient(to right, #000 93%, transparent);
}
.gift-strip::-webkit-scrollbar { display: none; }
.gift-strip-item {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 1px; flex: 0 0 auto;
}
.gift-icon-img { width: 46px; height: 46px; border-radius: 12px; display: block; }
.gift-icon-lot { width: 46px; height: 46px; display: block; }
/* ドラゴンは背景から切り離した頭だけ絵で、ふわふわ浮かせる（おぎ指定） */
.gift-icon-fx { width: 46px; height: 46px; object-fit: contain; display: block; animation: gift-bob 1.5s ease-in-out infinite alternate; }
.gift-cell-fx { width: 100%; height: 100%; object-fit: contain; display: block; animation: gift-bob 1.5s ease-in-out infinite alternate; }
@keyframes gift-bob { from { transform: translateY(-2.5px); } to { transform: translateY(2.5px); } }
.gift-icon-lot svg, .gift-cell-lot svg { width: 100%; height: 100%; display: block; }
/* Lottieのダイヤは画布の中で小さめ＆下寄り（実測で中心が約14.6%下）。
   svg 側はプレイヤーが inline style で transform を上書きするため、
   拡大＋上寄せはコンテナ側に掛ける（ずらし量は拡大後の実寸換算） */
.gift-icon-lot, .gift-cell-lot { transform: translate(-3%, -20%) scale(1.38); }
.gift-cell-lot { width: 100%; height: 100%; display: block; }
.gift-icon-emoji {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.gift-count { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); line-height: 1.15; }
.gift-strip-empty { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.tappable { cursor: pointer; }
/* 枠の右上角に被せてはみ出させる（おぎ指定）。色はリンク系の青 */
.modal-x {
  position: absolute; top: -13px; right: -13px;
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--sky); color: #fff;
  border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 2px 7px rgba(23, 50, 74, 0.3);
}
.modal-x:active { background: var(--sky-deep); }
.fm-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fm-name { font-weight: 800; font-size: 18px; margin-top: 8px; }
.fm-status {
  margin-top: 3px; font-weight: 700; color: var(--ink-soft);
  font-size: clamp(11px, 3.4vw, 13px); white-space: nowrap;
}
/* ボタン3個は必ず1行。狭い画面ではフォントを下げて収める（おぎ指定） */
.fm-actions { display: flex; gap: 8px; margin-top: 16px; }
.fm-actions .primary-btn, .fm-actions .sub-btn {
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding: 10px 4px; font-size: clamp(11.5px, 3.6vw, 14px);
}
.sub-btn:disabled { opacity: 0.45; cursor: default; }
.up-name { text-align: center; margin-top: 2px; }
.up-center { text-align: center; }
.up-bio {
  margin-top: 10px; font-size: 14px; line-height: 1.55;
  background: #f4faff; border-radius: 12px; padding: 10px 12px;
  white-space: pre-wrap; word-break: break-word;
}
/* 人気度・勝利数は2つの小箱に分ける（数字が何桁でも崩れない形） */
.up-stats { display: flex; gap: 10px; margin-top: 12px; }
.up-stat {
  flex: 1 1 0; min-width: 0;
  background: #f4faff; border-radius: 12px;
  padding: 8px 6px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.up-stat-label {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.up-stat-value { font-size: 19px; font-weight: 800; white-space: nowrap; }
.up-gift-frame { box-shadow: none; border: 1px solid var(--line); }
/* プロフは紹介文やギフトで背が高くなるので、枠は伸ばさず中をスクロール */
#modal-user-profile { overflow-y: auto; }
.room-main { flex: 1 1 auto; min-width: 0; }
.room-title-row { display: flex; align-items: center; gap: 6px; }
.room-title {
  font-weight: 800; font-size: 15.5px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; overflow: clip; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 auto;
}
.room-lock { flex: 0 0 auto; font-size: 13px; line-height: 1; }
.room-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 5px; }
.meta-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.room-players { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.tag {
  border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 800;
}
.tag-public { background: var(--mint-bg); color: #128a54; }
.tag-private { background: #e8edf2; color: #5a6b7a; }
/* 対戦中はアバター下端に重ねる LIVE バッジで示す（タグ行の横幅対策。2026-11-25 おぎ） */
.room-avatar-wrap { position: relative; flex: none; }
.live-badge {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px;
  background: #ff5a3c; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.25;
  padding: 2px 7px; border-radius: 999px; border: 2px solid #fff;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(216, 74, 47, .35);
}
.live-badge .pulse-dot { background: #fff; width: 6px; height: 6px; }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff5a3c;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.78); }
}
.room-card.enter { animation: room-in 0.45s ease both; }
@keyframes room-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tag-beginner { background: var(--mint-bg); color: #128a54; }
.list-end-spacer { height: 18px; }

/* ルームを作る（スティッキー帯：下部メニューの上） */
/* ボタンだけが浮いて見えるよう、帯の背景は置かず画面に重ねる（2026-11-25 おぎ）。
   帯の領域はタップを透過し、ボタンだけが操作を受ける。 */
.create-bar {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(58px + env(safe-area-inset-bottom) + 10px);
  padding: 0 18px;
  background: none;
  pointer-events: none;
  z-index: 30;
}
.create-btn {
  pointer-events: auto;
  width: 100%;
  background: #eaf6ff;
  border: 2.5px solid var(--sky);
  color: #1473c9;
  border-radius: 16px;
  padding: 10px 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  box-shadow: 0 12px 26px rgba(20, 90, 160, 0.30);
}
/* 浮いたボタンの下に最後のルームカードが隠れないよう、ロビー末尾に余白 */
#tab-lobby { padding-bottom: 96px; }
.create-title { font-size: 20px; font-weight: 800; }
.create-sub { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }

/* 下部メニュー（2タブ） */
.tabbar {
  flex: 0 0 auto;
  height: calc(58px + env(safe-area-inset-bottom));
  display: flex; gap: 10px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--line);
}
.tabbtn {
  position: relative;
  flex: 1 1 0;
  border-radius: 999px;
  padding: 11px 0;
  font-size: 17px; font-weight: 800;
  color: var(--ink-soft);
  background: transparent;
  /* 文字が若干下に寄って見える対策：flexで縦中央に固定する */
  display: flex; align-items: center; justify-content: center; gap: 7px;
  line-height: 1;
}
.tabbtn.active { background: #bfe3ff; color: #1473c9; }

/* フレンドタブ */
/* トーク／フレンドどちらの一覧でもサブタブを上に固定（おぎ決定
   2026-11-25）。固定は外側のラッパーが担い、ピル自体の見た目
   （白背景＋影）は一切変えない。ラッパーの背景は画面上部の
   グラデーション開始色に合わせ、下端はフェードで消す */
.subtab-sticky {
  position: sticky; top: -14px; z-index: 30;
  margin: -14px -14px 0; padding: 14px 14px 12px;
  background: linear-gradient(180deg, #e4fbf0 0%, rgba(228, 251, 240, .97) 72%, rgba(228, 251, 240, 0) 100%);
  display: flex; align-items: center; gap: 8px;
}
.subtab-sticky .subtab-bar { flex: 1 1 auto; min-width: 0; }
/* グループ作成ボタン（バーの右端の丸ボタン。おぎ決定 2026-11-25） */
.group-plus-btn {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
/* グループ作成・追加のフレンド選択リスト */
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 38dvh; overflow-y: auto; }
.pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; background: #f4faff; border-radius: 12px;
  border: 2px solid transparent; text-align: left; font-weight: 700;
}
.pick-row.selected { border-color: #35b558; background: #eefbf3; }
.pick-row .pick-check {
  margin-left: auto; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: #35b558; color: #fff; display: none;
  align-items: center; justify-content: center;
}
.pick-row.selected .pick-check { display: flex; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: #f4faff; border-radius: 12px; font-weight: 700;
}
/* グループのアバター（メンバーの顔を2×2に敷く） */
.group-avatar { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; overflow: hidden; overflow: clip; }
.group-avatar .ga-cell { overflow: hidden; overflow: clip; }
.group-avatar .ga-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.group-avatar .ga-cell.emoji-cell { display: flex; align-items: center; justify-content: center; font-size: 13px; }
/* トーク一覧の右列（時刻＋未読バッジ）と会話内の日付・時刻 */
.talk-side { margin-left: auto; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.talk-time { font-size: 10.5px; color: var(--ink-soft); white-space: nowrap; font-weight: 700; }
.msg-line { display: flex; align-items: flex-end; gap: 5px; }
.msg-line.mine { justify-content: flex-end; }
.msg-line.theirs { justify-content: flex-start; }
.msg-time { font-size: 10px; color: var(--ink-soft); white-space: nowrap; padding-bottom: 3px; font-weight: 700; }
.date-sep {
  align-self: center; margin: 10px auto 2px;
  background: rgba(70, 110, 140, .45); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 999px;
}
/* グループチャットの発言者名 */
.gmsg { display: flex; flex-direction: column; align-items: flex-start; }
.gmsg-name { font-size: 11px; color: var(--ink-soft); margin: 0 0 2px 4px; font-weight: 700; }
.danger-text { color: var(--danger); }
.subtab-bar {
  display: flex; gap: 8px;
  background: #fff; border-radius: 999px; padding: 5px;
  box-shadow: var(--shadow);
}
.subtab {
  position: relative;
  flex: 1 1 0; border-radius: 999px; padding: 9px 0; font-weight: 800; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
/* 未読DMの赤バッジ（下部メニュー／トークタブの右上に重ねる） */
.nav-badge {
  position: absolute; top: 1px; right: 8px;
  min-width: 20px; height: 20px; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 11.5px; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
}
.subtab.active { background: var(--mint-bg); color: #128a54; }
.subpanel { padding: 26px 10px; }
/* サブタブ切り替えは LINE 式の横スライド（おぎ要望 2026-11-25）。
   2枚のパネルを横並びのトラックに入れ、トラックごと滑らせる。
   高さも同時に追随させ、切り替え後の余白が残らないようにする */
/* overflow: hidden だとこの要素がスクロールコンテナ扱いになり、
   overscroll-behavior: none と合わさって指のスクロールがここで
   吸われてしまう（2026-11-27 おぎ実機：フレンド／トーク画面が
   スクロールできない）。clip はスクロールコンテナを作らないので
   はみ出し隠しだけが効く。未対応ブラウザは hidden に落ちる */
#subpanel-viewport { overflow: hidden; overflow: clip; }
#subpanel-track {
  display: flex; align-items: flex-start;
  transition: transform .33s cubic-bezier(.25, .9, .25, 1), height .33s cubic-bezier(.25, .9, .25, 1);
}
#subpanel-track.to-friend { transform: translateX(-100%); }
#subpanel-track .subpanel { flex: 0 0 100%; min-width: 0; }
/* 非アクティブ側は visibility で消す（display:none にすると flex の
   並び位置がずれて、アクティブ側まで画面外へ押し出されるため） */
#subpanel-track .subpanel.panel-off { visibility: hidden; pointer-events: none; }
.empty-state { text-align: center; color: var(--ink-soft); }
.empty-icon { font-size: 44px; margin-bottom: 10px; }
.empty-state p { font-weight: 700; }
.empty-note { font-size: 13px; margin-top: 6px; font-weight: 400; }

/* モーダル */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(23, 50, 74, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 26px;
  z-index: 50;
}
.modal {
  position: relative;
  background: #fff; border-radius: var(--radius);
  width: 100%; max-width: 360px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(23, 50, 74, 0.25);
  max-height: calc(100dvh - 52px);
  display: flex; flex-direction: column;
}
/* モーダル内の長いリストは内部でスクロールさせる（リストが縦に伸びて
   「閉じる」ボタンが画面外に落ち、閉じられなくなる事故の対策） */
#invite-friend-list, #blocklist-items {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
}
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; text-align: center; }
/* ギフト到着のスライド通知：右からぬるっと出て約2秒でスライドアウト＋フェード。
   カードは軽く透かす（白92%＋ぼかし）ことで「ふわっと」感を出す（2026-11-25 おぎ）。
   文字と絵は透かさないので読みやすさは保つ */
.gift-notify {
  position: fixed; top: calc(66px + env(safe-area-inset-top)); right: 10px; z-index: 80;
  display: flex; align-items: center; gap: 10px; text-align: left;
  max-width: min(86vw, 340px); padding: 10px 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 16px;
  box-shadow: 0 8px 24px rgba(23, 50, 74, .22);
  transform: translateX(115%); opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.22, 1.25, .36, 1), opacity .35s ease;
}
.gift-notify.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.gift-notify.bye { transform: translateX(40%); opacity: 0; pointer-events: none; transition: transform .4s ease, opacity .4s ease; }
.gn-avatar { flex: none; }
.gn-avatar .avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 26px; }
.gn-texts { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gn-title { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-gift { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-art { width: 44px; height: 44px; flex: none; border-radius: 10px; }

/* ギフト段階エフェクト（2026-11-25 おぎ決定）：
   中額（1,000〜3,000）＝ポップアップにCSSキラキラ＋金のグロー。
   高額（5,000〜）＝全画面オーバーレイ（色替え放射＋中央に大きく表示） */
.gift-notify.fx-glow { animation: gn-glowp 1.5s ease-out; }
@keyframes gn-glowp {
  0% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0), 0 8px 24px rgba(23, 50, 74, .22); }
  25% { box-shadow: 0 0 0 6px rgba(255, 201, 60, .45), 0 8px 24px rgba(23, 50, 74, .22); }
  100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0), 0 8px 24px rgba(23, 50, 74, .22); }
}
/* 高額ギフト（5,000+）の通知ポップアップは中額より豪華に：
   金の縁＋強い発光。全画面演出の代わりの格付け（2026-11-26） */
.gift-notify.fx-luxe { border: 2px solid #f0b429; animation: gn-luxe 2.2s ease-out; }
@keyframes gn-luxe {
  0% { box-shadow: 0 0 0 0 rgba(255, 195, 60, 0), 0 8px 24px rgba(23, 50, 74, .22); }
  20% { box-shadow: 0 0 0 7px rgba(255, 195, 60, .55), 0 0 34px rgba(255, 180, 60, .55), 0 8px 24px rgba(23, 50, 74, .22); }
  55% { box-shadow: 0 0 0 3px rgba(255, 195, 60, .35), 0 0 22px rgba(255, 180, 60, .4), 0 8px 24px rgba(23, 50, 74, .22); }
  100% { box-shadow: 0 0 0 0 rgba(255, 195, 60, 0), 0 8px 24px rgba(23, 50, 74, .22); }
}
.gift-notify.fx-luxe-diamond { border-color: #9fd4ff; animation-name: gn-luxe-diamond; }
@keyframes gn-luxe-diamond {
  0% { box-shadow: 0 0 0 0 rgba(140, 200, 255, 0), 0 8px 24px rgba(23, 50, 74, .22); }
  20% { box-shadow: 0 0 0 7px rgba(140, 200, 255, .55), 0 0 34px rgba(140, 200, 255, .5), 0 8px 24px rgba(23, 50, 74, .22); }
  55% { box-shadow: 0 0 0 3px rgba(140, 200, 255, .35), 0 0 22px rgba(140, 200, 255, .38), 0 8px 24px rgba(23, 50, 74, .22); }
  100% { box-shadow: 0 0 0 0 rgba(140, 200, 255, 0), 0 8px 24px rgba(23, 50, 74, .22); }
}
.gn-spark {
  position: absolute; width: 15px; height: 15px; pointer-events: none; z-index: 2;
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
  opacity: 0; animation: gn-burst 1.5s ease-out forwards;
}
@keyframes gn-burst {
  0% { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(140deg); }
}
.gift-fx { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
/* 結果画面の紙吹雪（市民の勝ち／通常のウルフの勝ち）。操作は塞がない */
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 84; pointer-events: none; }
.gift-fx .gfx-dim { position: absolute; inset: 0; background: rgba(16, 42, 80, .38); animation: gfx-dimf 3.2s ease forwards; opacity: 0; }
@keyframes gfx-dimf { 0% { opacity: 0; } 10% { opacity: 1; } 68% { opacity: 1; } 100% { opacity: 0; } }
.gift-fx .gfx-rays-wrap {
  position: absolute; left: 50%; top: 44%; width: 150vmax; height: 150vmax;
  transform: translate(-50%, -50%);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  animation: gfx-spin 6s linear infinite, gfx-dimf 3.2s ease forwards; opacity: 0;
}
@keyframes gfx-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* 色替えのチカチカはやめ、金と水色の縞がそのまま回る形に（おぎ指定） */
.gift-fx .gfx-rays {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 90, .38) 0deg 9deg, rgba(140, 220, 255, .34) 9deg 18deg);
}
/* ダイヤ（Lottie）用はストライプでなくグロー：中心からパァッと光が広がる */
.gift-fx .gfx-glow-wrap {
  position: absolute; left: 50%; top: 44%; width: 135vmax; height: 135vmax;
  transform: translate(-50%, -50%); pointer-events: none;
}
.gift-fx .gfx-glow {
  position: absolute; inset: 0; border-radius: 50%;
  animation: gfx-bloom 3.2s ease-out forwards; opacity: 0;
}
.gift-fx .gfx-glow.halo {
  background: radial-gradient(circle, rgba(255, 246, 200, .8) 0%, rgba(160, 225, 255, .38) 36%, rgba(160, 225, 255, 0) 68%);
}
.gift-fx .gfx-glow.core {
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(255, 240, 190, .5) 30%, rgba(255, 240, 190, 0) 60%);
  animation-delay: .08s;
}
@keyframes gfx-bloom {
  0% { transform: scale(.3); opacity: 0; }
  20% { opacity: 1; }
  58% { transform: scale(1.05); opacity: .95; }
  100% { transform: scale(1.25); opacity: 0; }
}
.gift-fx .gfx-big-wrap {
  position: absolute; left: 50%; top: 44%; width: 200px; height: 200px;
  transform: translate(-50%, -50%) scale(.2); opacity: 0;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .35));
  animation: gfx-pop 3.2s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.gift-fx .gfx-big-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  animation: gfx-bob 1.4s ease-in-out .45s infinite alternate;
}
@keyframes gfx-bob { from { transform: translateY(-7px); } to { transform: translateY(7px); } }
.gift-fx .gfx-lot {
  position: absolute; left: 50%; top: 44%; width: 250px; height: 250px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .35));
  animation: gfx-pop 3.2s cubic-bezier(.2, 1.4, .4, 1) forwards; opacity: 0;
}
@keyframes gfx-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.25) rotate(-6deg); }
  13% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(1.5deg); }
  21% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  68% { opacity: 1; transform: translate(-50%, -54%) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.03); }
}
.gift-fx .gfx-cap {
  position: absolute; left: 0; right: 0; top: calc(44% + 122px); text-align: center;
  color: #fff; font-weight: 800; font-size: 19px; text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  opacity: 0; animation: gfx-dimf 3.2s ease forwards; padding: 0 16px;
}
.gift-fx .gfx-fall {
  position: absolute; top: -24px; width: 13px; height: 13px; pointer-events: none;
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
  animation: gfx-fall linear forwards; opacity: 0;
}
@keyframes gfx-fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  10% { opacity: 1; }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translateY(105vh) rotate(320deg); }
}

/* 入室確認ポップアップ：どれだけ画面が小さくても改行させない（2026-11-25 おぎ）。
   部屋名は長い場合に「…」で省略し、人数＋初心者歓迎の行は横並び固定 */
#modal-join-confirm h3 { white-space: nowrap; }
.jc-title {
  font-size: 19px; font-weight: 800; text-align: center; margin: 2px 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jc-meta {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  flex-wrap: nowrap; white-space: nowrap;
  color: var(--ink-soft); font-size: 13.5px; margin-bottom: 8px;
}
.jc-meta > span { white-space: nowrap; }
.jc-row { display: flex; gap: 8px; align-items: center; }
.tag-rev-off { background: #e8edf2; color: #5a6b7a; }
.modal-note { font-size: 13.5px; color: var(--ink-soft); text-align: center; margin: 8px 0; }
.modal-close {
  width: 100%; margin-top: 14px;
  background: #eef6fd; color: #1473c9;
  border-radius: 999px; padding: 10px 0; font-weight: 800;
}
.settings-list { list-style: none; }
.settings-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 13px 4px; font-weight: 700; border-bottom: 1px solid var(--line);
}
.settings-row.danger { color: var(--danger); }
.row-arrow { color: var(--ink-soft); }
.toggle-row { cursor: pointer; }
.toggle-sub { padding-left: 18px; font-weight: 400; }
/* 設定のON/OFFはスイッチ式（2026-11-26 おぎ選択）。
   中身は通常のチェックボックスのまま、見た目だけ差し替える */
.kl-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px; height: 27px; flex: none;
  border-radius: 999px;
  background: #cfdde6;
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
  outline: none;
}
.kl-switch::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23b9cdd9'%3E%3Cellipse cx='12' cy='15.2' rx='4.6' ry='3.9'/%3E%3Ccircle cx='5.4' cy='10' r='1.8'/%3E%3Ccircle cx='9.2' cy='7.4' r='1.9'/%3E%3Ccircle cx='14.8' cy='7.4' r='1.9'/%3E%3Ccircle cx='18.6' cy='10' r='1.8'/%3E%3C/g%3E%3C/svg%3E") center / 13px 13px no-repeat;
  box-shadow: 0 1px 3px rgba(30, 60, 90, .35);
  transition: transform .18s ease;
}
.kl-switch:checked { background: linear-gradient(90deg, #2b9df4, #2fd3c6); }
.kl-switch:checked::after {
  transform: translateX(18px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%232b9df4'%3E%3Cellipse cx='12' cy='15.2' rx='4.6' ry='3.9'/%3E%3Ccircle cx='5.4' cy='10' r='1.8'/%3E%3Ccircle cx='9.2' cy='7.4' r='1.9'/%3E%3Ccircle cx='14.8' cy='7.4' r='1.9'/%3E%3Ccircle cx='18.6' cy='10' r='1.8'/%3E%3C/g%3E%3C/svg%3E");
}
.kl-switch:disabled { opacity: .45; cursor: default; }
.charge-list { list-style: none; }
.charge-list li {
  display: flex; justify-content: space-between;
  padding: 12px 6px; border-bottom: 1px solid var(--line); font-weight: 800;
}
.charge-price { color: #1473c9; }
.form-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.form-label input, .form-label select {
  width: 100%; margin-top: 6px;
  border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font: inherit;
  background: #fff;
}
.radio-row { display: flex; gap: 16px; font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.form-error { color: var(--danger); font-weight: 700; font-size: 14px; margin: 8px 0; }
.form-note { font-size: 12px; color: var(--ink-soft); margin: 0 0 12px; }
/* ルーム名の警告は入力欄のすぐ下に寄せる（ラベルの下マージンを打ち消す） */
#create-title-error { margin: -6px 0 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions > * { flex: 1 1 0; min-width: 0; }
.modal-actions .modal-close { width: auto; margin-top: 0; }
.sub-btn {
  flex: 1 1 0; background: #eef6fd; color: #1473c9;
  border-radius: 999px; padding: 10px 0; font-weight: 800;
}
.primary-btn {
  flex: 1 1 0; background: linear-gradient(180deg, #3db2ff, var(--sky-deep)); color: #fff;
  border-radius: 999px; padding: 10px 0; font-weight: 800;
}
/* 「同意する」は見落とすと先へ進めないので、どの入口から開いても赤で目立たせる（おぎ指定） */
#btn-tutorial-agree { background: linear-gradient(180deg, #ff6b5e, var(--danger)); }

/* トースト */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: rgba(23, 50, 74, 0.92); color: #fff;
  border-radius: 999px; padding: 10px 18px;
  font-size: 14px; font-weight: 700;
  width: max-content; max-width: 94vw; white-space: nowrap;
  text-align: center;
  z-index: 60;
  transition: opacity 0.38s ease, transform 0.38s ease;
}
.toast-out { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* ===== フレンド／トーク／DM／ギフト（ソーシャル実装フェーズ） ===== */
.panel-head { font-size: 15px; font-weight: 800; margin: 16px 2px 8px; color: var(--ink); }
.search-row { display: flex; gap: 8px; margin: 4px 0 6px; }
.search-row .primary-btn { flex: 0 0 auto; padding: 0 20px; white-space: nowrap; }
/* グループ設定の見出し（SVGアイコン付き） */
#modal-group-members .panel-head { display: flex; align-items: center; gap: 6px; }
/* メンバー帯は横スクロール（縦は押しにくい。2026-11-25 おぎ） */
.member-strip {
  /* モーダル（flex縦）の中で潰れないよう固定。潰れると顔が下切れする */
  flex: 0 0 auto;
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}
/* その分、追加リスト側を低くして全体を収める（中はスクロールできる） */
#modal-group-members .pick-list { max-height: 30dvh; }
.member-strip::-webkit-scrollbar { display: none; }
.member-cell {
  flex: 0 0 auto; width: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.member-cell .avatar-sm { width: 48px; height: 48px; border-radius: 14px; }
.member-cell-name {
  max-width: 60px; font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.search-row input {
  flex: 1 1 auto; min-width: 0;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font: inherit; background: #fff; color: var(--ink);
}
.search-row .primary-btn { flex: 0 0 auto; }

.user-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 16px;
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.user-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.user-name { font-weight: 800; white-space: nowrap; overflow: hidden; overflow: clip; text-overflow: ellipsis; }
.user-sub { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; overflow: clip; text-overflow: ellipsis; }
/* フレンドカード：1行目＝名前＋最終ログイン、2行目＝ボタン（2026-11-25 おぎ） */
.friend-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.friend-line1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.friend-line1 .user-name { flex: 0 1 auto; }
.friend-last {
  margin-left: auto; flex: 0 0 auto;
  font-size: 11.5px; color: var(--ink-soft); white-space: nowrap;
}
.friend-last.on { color: #1d9e50; font-weight: 700; }
.friend-actions { display: flex; gap: 8px; }
.friend-actions .mini-btn {
  flex: 1 1 0; height: 38px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; text-align: center;
}
.mini-btn {
  flex: 0 0 auto;
  border-radius: 999px; padding: 7px 13px;
  background: #eef6fb; color: var(--ink); font-weight: 700; font-size: 13px;
}
.mini-btn.primary { background: var(--mint); color: #fff; }
.mini-btn.danger { background: #fdecea; color: var(--danger); }
.mini-btn:disabled { opacity: 0.55; cursor: default; }
.pending-label { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
/* 申請中ボタン（タップで取り消し確認へ）。見た目はラベルのまま */
.pending-btn { background: none; border: none; padding: 4px 2px; cursor: pointer; font-family: inherit; }

.talk-list { display: flex; flex-direction: column; gap: 8px; }
.talk-row {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border-radius: 16px;
  padding: 10px 12px; box-shadow: var(--shadow); width: 100%;
}
.talk-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.talk-name { font-weight: 800; }
.talk-preview {
  font-size: 13px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; overflow: clip; text-overflow: ellipsis;
}
.unread-badge {
  flex: 0 0 auto;
  min-width: 22px; height: 22px; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 12.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px;
}

/* DM画面：画面全体のオーバーレイ。発言は下端寄せ（本家のクランチャット様式） */
.dm-screen {
  position: fixed; z-index: 40;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%) translateX(100vw);
  transition: transform .33s cubic-bezier(.22, .9, .3, 1);
  width: min(430px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #e4fbf0 0%, #e0f3ff 55%, #d8efff 100%);
}
/* 開くと右からぬるっとスライドイン（2026-11-25 おぎ） */
.dm-screen.open { transform: translateX(-50%) translateX(0); }
.dm-header {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--line);
}
/* 戻るは大きめのシェブロンだけ（文字なし。2026-11-25 おぎ） */
.dm-back-btn {
  flex: 0 0 auto; width: 38px; height: 38px; margin-left: -9px;
  display: flex; align-items: center; justify-content: center; color: var(--sky);
}
.gift-open-btn.icon-only { padding: 7px 9px; }
/* 異議申し立てバー（システムDM内・対象の処分があるときだけ出す） */
.dm-appeal-bar {
  flex: 0 0 auto; margin: 8px 12px 0; padding: 10px 12px;
  border: none; border-radius: 12px; background: var(--sky); color: #fff;
  font: inherit; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); cursor: pointer;
}
.dm-appeal-bar[disabled] {
  background: #eaf6ff; color: var(--muted); box-shadow: none; cursor: default;
}
.appeal-summary {
  background: #eaf6ff; border-radius: 12px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.6; white-space: pre-line; margin: 0 0 10px;
}
.dm-peer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-peer-name { flex: 1 1 auto; font-weight: 800; }
.gift-open-btn {
  flex: 0 0 auto;
  background: #fff3d6; border-radius: 999px;
  padding: 8px 13px; font-weight: 800; font-size: 13.5px;
}
.dm-messages { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; overflow-anchor: none; }
/* 発言は上から流す（少ない時は上に寄る。2026-11-25 おぎ） */
.dm-msgs-inner { display: flex; flex-direction: column; gap: 8px; }
/* 過去ログから最新へ戻るワンタップボタン（上にスクロールした時だけ出す） */
.scroll-bottom-btn {
  position: absolute; right: 14px; bottom: 76px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .96); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; color: var(--sky);
}
.dm-msg {
  /* 吹き出し幅の基準（2026-11-24 おぎ）：日本語15文字が1行に入る
     幅（LINEの感覚）。font-size 基準の em で上限を決め、画面が
     狭いときは % 側で抑える */
  max-width: min(86%, calc(15em + 30px)); padding: 9px 13px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.45; word-break: break-word;
  background: #fff; align-self: flex-start; box-shadow: var(--shadow);
  /* 長押しメニュー用：選択・コールアウトを止め、押下フィードバックを滑らかに */
  -webkit-touch-callout: none; user-select: none;
  transition: transform .15s ease, opacity .15s ease;
}
.dm-msg.pressing { transform: scale(.96); opacity: .7; }
/* メッセージ長押しメニュー */
.msg-menu { padding: 8px; }
.msg-menu-btns { display: flex; flex-direction: column; }
.msg-menu-btn {
  background: none; border: none; padding: 13px 10px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--ink); border-radius: 10px;
}
.msg-menu-btn:active { background: #eef6fc; }
.msg-menu-btn.danger { color: #d64545; }
/* 自分の吹き出しはブランドの空色グラデ（LINEの緑に寄せない。2026-11-25 おぎ） */
.dm-msg.mine { background: linear-gradient(120deg, #9adcff 0%, #c9efff 100%); align-self: flex-end; }
.dm-gift-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 16px;
  background: #fff7e0; box-shadow: var(--shadow); align-self: flex-start;
}
.dm-gift-card.mine { align-self: flex-end; }
.gift-card-icon { font-size: 30px; }
.gift-card-img { width: 46px; height: 46px; object-fit: contain; display: block; }
.gift-card-main { display: flex; flex-direction: column; }
.gift-card-name { font-weight: 800; }
.gift-card-price { font-size: 12.5px; color: var(--ink-soft); }
.dm-invite-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 14px; border-radius: 16px;
  background: #e8f4ff; box-shadow: var(--shadow); align-self: flex-start;
}
.dm-invite-card.mine { align-self: flex-end; }
.invite-card-title { font-weight: 800; }
.invite-card-room { font-weight: 700; font-size: 13.5px; }
.invite-card-pw { font-size: 13.5px; }
.dm-input-row {
  flex: 0 0 auto;
  display: flex; gap: 8px; padding: 8px 12px; align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--line);
}
/* キーボード表示中（html.kb-open）は、待機室・対戦画面の上部ブロックを
   畳んでチャット領域を広く保つ。おぎの端末では被せる方式
   （overlays-content）だとキーボード検知が一切効かなかったため、
   縮む方式（resizes-content）＋この畳み込みで対応する（2026-11-26） */
html.kb-open #room-screen-tags,
html.kb-open #room-members,
html.kb-open .room-actions,
html.kb-open #game-slots { display: none; }
.dm-input-row input {
  flex: 1 1 auto; min-width: 0; height: 42px;
  /* 「ここに入力する」が色で分かるように、欄自体を空色に染める */
  border: 1.5px solid #7cc7f5; border-radius: 999px;
  padding: 0 16px; font: inherit; background: #eaf6ff; color: var(--ink);
}
.dm-input-row input:focus { border-color: var(--sky); background: #fff; outline: none; }
/* 送信ボタンは潰れない（固定幅・改行なし。2026-11-25 おぎ） */
.dm-input-row .primary-btn {
  flex: 0 0 auto; white-space: nowrap; height: 42px;
  padding: 0 20px; display: inline-flex; align-items: center; justify-content: center;
}

/* ギフト選択 */
.gift-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0;
  /* グリッド自体をコンテナにして、中身のサイズをその幅に連動させる */
  container-type: inline-size;
}
.gift-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #f4fbff; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 10px 2px;
}
.gift-item:active { background: var(--mint-bg); }
.gift-icon { font-size: 26px; }
.gift-cell-art { position: relative; width: clamp(32px, 14.8cqw, 44px); height: clamp(32px, 14.8cqw, 44px); display: block; }
.gift-cell-emoji {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.gift-cell-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 10px; display: block;
}
.gift-name { font-size: clamp(9.5px, 4.2cqw, 12.5px); font-weight: 700; white-space: nowrap; }
.gift-price {
  font-size: clamp(9px, 3.8cqw, 11.5px); color: var(--ink-soft); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 3px;
}
.gift-coin { width: clamp(11px, 4cqw, 14px); height: auto; flex: none; }
#gift-error { text-align: center; }
/* ギフト確認ポップアップ（第2レイヤー） */
.backdrop2 { z-index: 60; background: rgba(23, 50, 74, 0.58); }
/* 入力欄のある作業モーダルは、キーボードで枠が縮んだ時に中身が
   見切れないようモーダル自体がスクロールできるようにする */
#modal-create, #modal-group-create { overflow-y: auto; }
/* キーボード表示中（.kb-open）は席グリッドとお題カードを詰めて、
   発言欄の高さを確保する。名前は番号バッジで判別できるので隠す */
.kb-open .slot-grid { gap: 6px 8px; padding: 0 0 2px; }
.kb-open .slot-face { width: 34px; height: 34px; }
.kb-open .slot-face .avatar { width: 34px; height: 34px; border-radius: 10px; }
.kb-open .slot.empty .slot-face { border-radius: 10px; }
.kb-open .slot-wolf { width: 20px; }
.kb-open .slot-name { display: none; }
.kb-open .phase-genre-row { margin-bottom: 4px; }
.kb-open .topic-card { padding: 6px 12px; margin-bottom: 6px; }
.kb-open .topic-label { font-size: 11px; }
.kb-open .topic-words { font-size: 21px; }
.gc-art {
  position: relative; width: 84px; height: 84px; margin: 6px auto 0;
  display: flex; align-items: center; justify-content: center;
}
.gc-emoji { font-size: 52px; }
.gc-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 18px; display: block;
}
.gc-text {
  text-align: center; font-weight: 700; font-size: 15px;
  white-space: pre-line; margin: 12px 0 4px; line-height: 1.55;
}
/* 通報フォーム */
.up-report-row { text-align: center; margin: 10px 0 0; }
.danger-link { background: none; border: none; color: #d64545; font-size: 12.5px; font-weight: 700; padding: 4px 8px; cursor: pointer; }
.report-reasons { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.report-reason {
  text-align: left; padding: 11px 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid #cfe3f2; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700;
}
.report-reason.selected { border-color: var(--sky); background: #eaf6ff; }
#report-error { text-align: center; }
.gc-actions { display: flex; justify-content: center; margin-top: 12px; }
.gc-actions .primary-btn { min-width: 180px; }
.gift-name { font-size: 12px; font-weight: 700; }
.gift-price { font-size: 11.5px; color: var(--ink-soft); }

/* ===== 待機室／対戦画面（対戦画面フェーズ） ===== */
.room-screen {
  position: fixed; z-index: 20;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%) translateX(100vw);
  transition: transform .33s cubic-bezier(.32, .72, .24, 1);
  width: min(430px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #e4fbf0 0%, #e0f3ff 55%, #d8efff 100%);
}
.room-screen.open { transform: translateX(-50%) translateX(0); }
.room-count { flex: 0 0 auto; font-weight: 800; color: var(--ink-soft); font-size: 14px; }
.room-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 12px 10px 14px; }
.room-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.room-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.room-actions .primary-btn { flex: 0 0 auto; padding: 13px 0; font-size: 16px; }
.room-actions .sub-btn { flex: 0 0 auto; padding: 11px 0; }
.room-actions .primary-btn:disabled { opacity: 0.5; }
/* 全員準備OKでスタートが押せるようになったら、LIVEバッジと同じ
   赤オレンジ＋ゆるい鼓動で「今だよ」と知らせる（おぎ案） */
#btn-start-game:not(:disabled) {
  background: linear-gradient(180deg, #ff8a5c, #ff5a3c);
  animation: start-glow 1.4s ease-in-out infinite;
}
@keyframes start-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(255, 90, 60, 0); }
}
/* 参加者の「準備OK！」は青だと画面に馴染んで埋もれるので緑に
   （準備OKのリング・✓バッジと同じ緑。おぎ案） */
#btn-ready {
  background: linear-gradient(180deg, #4ad98f, #2bb673);
}
/* 席は上部グリッド（4列）＋お題・チャット全幅（おぎのスケッチ案・
   2026-11-25 採用）。待機室・対戦画面で共通 */
.slot-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px;
  flex: 0 0 auto; padding: 2px 0 6px;
}
.slot-grid .slot { width: auto; }
.slot-grid .slot-name { max-width: 100%; }
.game-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.game-layout.players-off #game-slots { display: none; }
.phase-genre-row {
  display: flex; align-items: baseline; justify-content: center; gap: 4px 14px;
  flex: 0 0 auto; flex-wrap: wrap; margin-bottom: 6px;
}
.game-phase-note {
  flex: 0 0 auto; text-align: center;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  white-space: nowrap; margin-bottom: 6px;
}
.phase-genre-row .game-phase-label { margin-bottom: 0; font-size: 17px; }
.phase-genre-row .game-genre-line { margin-bottom: 0; }
.room-chat-messages { flex: 1 1 auto; min-height: 0; }
.slot {
  position: relative; width: 56px; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.slot-face { position: relative; width: 48px; height: 48px; }
.end-countdown-pill {
  position: absolute; top: -46px; left: 50%;
  transform: translateX(-50%); z-index: 5; margin: 0;
  background: #eaf6ff; border: 1.5px solid #7cc7f5; color: #17557f;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(31, 90, 140, 0.18);
}
.end-countdown-pill .cd-num { font-size: 15px; font-weight: 800; color: #2b9df4; }
.slot.in-result .slot-face .avatar { filter: grayscale(1); opacity: 0.55; }
.slot-result-band {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  background: rgba(23, 50, 74, 0.8); color: #fff; z-index: 3;
  font-size: 10px; font-weight: 800; text-align: center; padding: 2px 0;
  pointer-events: none;
}
.slot-face .avatar { width: 48px; height: 48px; border-radius: 13px; }
.slot.empty .slot-face {
  border-radius: 14px; background: #e0ecf5;
  display: flex; align-items: center; justify-content: center;
}
.slot-wolf { width: 30px; height: auto; opacity: 0.3; }
.slot .slot-no {
  position: absolute; top: -5px; left: -5px; z-index: 2;
  min-width: 17px; height: 17px; padding: 0 2px;
  font-size: 10.5px; border-radius: 5px; border: 1.5px solid #fff;
}
.slot-name {
  font-size: 10.5px; font-weight: 700; max-width: 56px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.slot.empty .slot-name { color: var(--ink-soft); font-weight: 600; }
.slot.ready .slot-face .avatar { box-shadow: 0 0 0 3px #35cf8b; }
.slot-host-badge {
  position: absolute; top: -5px; right: -5px; z-index: 2;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--mint); border: 1.5px solid #fff;
  display: flex; align-items: center; justify-content: center;
}
.slot-ready-badge {
  position: absolute; bottom: -4px; right: -4px; z-index: 2;
  width: 18px; height: 18px; border-radius: 50%;
  background: #35cf8b; color: #fff; border: 1.5px solid #fff;
  font-size: 11px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.slot .slot-kick {
  position: absolute; bottom: -4px; left: -5px; z-index: 2;
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  background: #fdecea; color: var(--danger); border: 1.5px solid #fff;
  font-size: 12px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.game-center {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0; overflow: hidden;
}

/* プレイヤー番号バッジ（参加順1〜N、名前の前に出す小さい四角バッジ） */
.no-badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 3px;
  border-radius: 5px; background: #14549e; color: #fff;
  font-size: 11.5px; font-weight: 800; line-height: 1;
}


.game-timer {
  flex: 0 0 auto; font-weight: 800; font-size: 17px; color: #14549e;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 13px; min-width: 74px; text-align: center;
}
.game-timer.urgent { color: var(--danger); border-color: var(--danger); }
.game-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 10px 10px 0; }
.game-phase-label {
  flex: 0 0 auto; text-align: center; font-weight: 800; font-size: 16.5px;
  color: #14549e; margin-bottom: 8px;
}
.topic-card {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 2px solid var(--mint); border-radius: 18px;
  padding: 10px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.topic-label { font-size: 12.5px; font-weight: 800; color: #128a54; }
.topic-words { font-size: 26px; font-weight: 800; }
.game-genre-line {
  flex: 0 0 auto; text-align: center; font-size: 14.5px; font-weight: 800;
  color: #14549e;
}
.tag-genre { background: #e8f3ff; color: #14549e; }

/* min-height: 0 が無いと flex の自動最小サイズ（中身の高さ）までしか
   縮まず、投票・結果パネルが画面下にはみ出して見切れる（実機指摘）。
   チャット領域は内部スクロールに任せて縮められるようにする */
.game-messages { flex: 1 1 auto; min-height: 0; padding: 4px 0 10px; }
.game-msg-row { display: flex; flex-direction: column; max-width: 88%; align-self: flex-start; }
.game-msg-row.mine { align-self: flex-end; align-items: flex-end; }
/* 対戦画面の吹き出し：幅の基準は DM と同じ「日本語15文字／行」。
   バブル側に % の max-width を重ねると、行の shrink-to-fit と競合
   して短文でも極端に狭く潰れる（実機で「こんばんは」が割れた原因）
   ため、上限は em 基準で決める。自分・他人で基準は同一 */
.game-msg-row .dm-msg { max-width: min(100%, calc(15em + 30px)); }
.game-msg-sender { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin: 0 4px 2px; }
.game-panel {
  /* 高さ上限を持たせ、はみ出しはパネル内部のリスト側スクロールで
     吸収する。見出し・警告文・ボタンは固定表示（flex: 0 0 auto）で
     常に見える／押せる形にする（警告文が下端で見切れる問題の対策） */
  flex: 0 1 auto; min-height: 0; max-height: 52%;
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(255, 255, 255, 0.75); border-radius: 18px;
  padding: 6px 12px 14px; margin-bottom: 10px;
}
.game-panel > * { flex: 0 0 auto; }
#game-reversal-choices {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
}
/* 投票ボックス：対戦画面の中央に重ねて出す。候補はアイコン＋番号＋名前の
   コンパクトな行で、全員分をスクロールなしで見せる（2026-11-25 おぎ） */
.vote-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(88%, 340px); z-index: 30;
  background: #fff; border-radius: 20px;
  box-shadow: 0 16px 40px rgba(23, 50, 74, 0.35);
  padding: 16px 14px 12px;
}
.vote-overlay .panel-head { text-align: center; margin-bottom: 10px; }
/* 逆転回答は選択肢の言葉が長いので少しだけ幅広にする。位置は中央寄せ
   だとお題カードに被るため、上端をお題カードの下に固定する
   （2026-11-26 おぎ）。短い画面では選択肢側をスクロールさせる */
.reversal-overlay {
  width: min(92%, 360px);
  top: 204px; transform: translateX(-50%);
  max-height: calc(100% - 216px); overflow-y: auto;
}
/* 逆転回答パネルの見出し：1行目だけ赤く大きく（2026-11-26 おぎ） */
.reversal-title { display: block; color: #d92b3a; font-size: 21px; font-weight: 900; margin-bottom: 4px; }
.vote-overlay .modal-note { text-align: center; margin-top: 10px; }
#game-vote-list { display: flex; flex-direction: column; gap: 8px; }
.vote-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: #fff; border: 2px solid var(--line); border-radius: 14px;
  padding: 6px 10px; font-weight: 800; text-align: left;
}
.vote-btn.selected { border-color: var(--sky); background: #e8f4ff; }
.vote-btn:disabled { opacity: 0.55; }
.vote-warning {
  margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; color: #b3541e;
  background: #fff4e5; border: 1px solid #f5cf9f; border-radius: 8px; padding: 6px 8px;
}
/* 無発言警告バナー（話し合い終盤・発言0件の本人だけに表示） */
.afk-warning {
  flex: 0 0 auto; margin-bottom: 10px;
  background: #fff4e5; border: 1.5px solid #f5cf9f; border-radius: 12px;
  padding: 8px 12px; font-size: 13px; font-weight: 700; line-height: 1.5;
  color: #b3541e;
}
#game-vote-pass { width: 100%; margin-top: 2px; }
.reversal-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reversal-choice {
  background: #fff; border: 2px solid var(--line); border-radius: 14px;
  padding: 13px 8px; font-weight: 800; font-size: 16px;
}
.reversal-choice:active { background: var(--mint-bg); }
.result-banner {
  text-align: center; font-size: 24px; font-weight: 800;
  border-radius: 16px; padding: 14px 10px; margin: 8px 0 4px;
}
.result-banner.win { background: var(--mint-bg); color: #0d7a44; }
.result-banner.lose { background: #e8f4ff; color: #14549e; }
/* 逆転回答で勝利したときだけ赤枠バナー（2026-11-26 おぎ） */
.result-banner.reversal { background: #ffecec; color: #b91c1c; border: 3px solid #e5484d; }
/* 逆転成功カットイン：赤い帯が横から入って、少し見せて消える（2026-11-26 おぎ） */
.cutin {
  position: absolute; inset: 0; z-index: 40;
  pointer-events: none; overflow: hidden;
}
/* 帯は斜め（-5度）に構えて横から流す。幅120%・左-10%で回転時の端欠けを防ぐ */
.cutin-band {
  position: absolute; left: -10%; top: 50%; width: 120%;
  text-align: center; color: #fff;
  background: linear-gradient(90deg, #d92b3a, #f0564a);
  box-shadow: 0 10px 30px rgba(185, 28, 28, 0.45);
  padding: 16px 10px 14px;
  transform: translate(-110%, -50%) rotate(-5deg);
}
.cutin.play .cutin-band { animation: cutin-sweep 2.1s cubic-bezier(0.22, 0.9, 0.3, 1) forwards; }
@keyframes cutin-sweep {
  0% { transform: translate(-110%, -50%) rotate(-5deg); opacity: 1; }
  14% { transform: translate(0, -50%) rotate(-5deg); opacity: 1; }
  82% { transform: translate(0, -50%) rotate(-5deg); opacity: 1; }
  100% { transform: translate(0, -50%) rotate(-5deg); opacity: 0; }
}
.cutin-main { font-size: 34px; font-weight: 900; letter-spacing: 0.04em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
/* 結果ポップアップ：対戦画面の中央に重ねる（2026-11-25 おぎ手描きレイアウト）。
   勝敗バナー→理由（小）→アイコンの並び→ギフトボタン→一言→終了導線 */
.result-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(90%, 360px); z-index: 30; max-height: calc(100% - 120px);
  background: #fff; border-radius: 20px;
  box-shadow: 0 16px 40px rgba(23, 50, 74, 0.35);
  padding: 14px 14px 12px;
}
.result-overlay .result-banner { margin: 0 0 6px; font-size: 25px; }
/* 結果集計中：確定するまで結果を出さず、待つ画面を挟む（2026-11-26 おぎ） */
.tally-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(70%, 240px); z-index: 30;
  background: #fff; border-radius: 20px;
  box-shadow: 0 16px 40px rgba(23, 50, 74, 0.35);
  padding: 22px 14px 18px; text-align: center;
}
.tally-wolf {
  width: 64px; height: 64px; object-fit: contain;
  animation: tally-bob 0.9s ease-in-out infinite alternate;
}
@keyframes tally-bob { from { transform: translateY(3px); } to { transform: translateY(-5px); } }
.tally-text { margin-top: 10px; font-size: 16px; font-weight: 800; }
.tally-dots span { animation: tally-dot 1.2s infinite; }
.tally-dots span:nth-child(2) { animation-delay: 0.2s; }
.tally-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tally-dot { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.result-detail {
  text-align: center; font-size: 12.5px; line-height: 1.55;
  color: var(--ink-soft); font-weight: 700;
}
#game-reveal-list {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px;
  margin-top: 12px;
}
.reveal-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px 5px; border-radius: 14px; cursor: pointer;
}
.reveal-cell.selected { background: #e8f4ff; box-shadow: inset 0 0 0 2px var(--sky); }
.result-avatar-wrap { position: relative; display: inline-block; }
.result-gift-badge {
  position: absolute; right: -7px; top: -7px; width: 23px; height: 23px;
  border-radius: 50%; background: #fff; color: #e08900;
  border: 1.5px solid #f0b429; box-shadow: 0 2px 6px rgba(23, 50, 74, 0.25);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.reveal-nameline {
  display: flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: 12px; font-weight: 800;
}
.reveal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reveal-role { font-size: 10.5px; font-weight: 800; color: var(--ink-soft); }
.reveal-role.wolf { color: #d64541; }
.result-gift-cta { width: 100%; margin-top: 14px; }
.result-gift-note {
  text-align: center; font-size: 11.5px; font-weight: 700;
  color: var(--ink-soft); margin: 6px 0 0;
}
#game-end-actions { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.reveal-topic { font-size: 12.5px; color: var(--ink-soft); }
.role-badge {
  flex: 0 0 auto; font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 4px 10px;
}
.role-badge.wolf { background: #fdecea; color: var(--danger); }
.role-badge.citizen { background: var(--mint-bg); color: #128a54; }
/* 待機室チャット（ゲーム前・ゲーム間の雑談。本編と同じLINE式） */
.room-chat-messages {
  flex: 1 1 auto; min-height: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line); border-radius: 14px;
}
.room-chat-empty { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 14px 8px; }
/* 待機室のキックボタン（マスターのみ表示） */
.kick-btn {
  flex: 0 0 auto; font-size: 12px; font-weight: 800;
  color: var(--danger); background: #fdecea;
  border-radius: 999px; padding: 5px 12px;
}

/* ペナルティバナー（ロビー） */
.penalty-banner {
  background: #fff4e5; border: 1px solid #f5cf9f; color: #b3541e;
  border-radius: 14px; padding: 10px 12px; margin-bottom: 10px;
  font-size: 13px; font-weight: 700; line-height: 1.5;
}

/* チュートリアルモーダル（一個の大きいポップアップ内でスライド送り。
   本文は読みやすさ優先で従来フォント） */
.modal-tutorial { max-width: 400px; }
.tutorial-viewport { overflow: hidden; border-radius: 14px; }
.tutorial-track { display: flex; transition: transform 0.3s ease; }
.tutorial-slide {
  flex: 0 0 100%; min-width: 0; text-align: center; padding: 6px 8px 2px;
}
.tutorial-slide h4 { font-size: 17px; font-weight: 800; margin: 10px 0 8px; }
.tutorial-slide p {
  font-size: 13.5px; line-height: 1.65; color: var(--ink); text-align: left;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-weight: 400;
}
/* 紙芝居イラスト：スライド幅いっぱいに余白なしで貼る（2026-11-25 おぎ） */
.tutorial-art { margin: -6px -8px 0; aspect-ratio: 4 / 3; }
.tutorial-art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tutorial-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.tutorial-arrow {
  width: 38px; height: 38px; border-radius: 999px; flex: 0 0 auto;
  background: #eef6fd; color: #1473c9; font-size: 22px; font-weight: 800;
  line-height: 1;
}
.tutorial-dots { display: flex; gap: 7px; justify-content: center; flex: 1 1 auto; }
.tutorial-dot {
  width: 9px; height: 9px; border-radius: 999px; padding: 0;
  background: #cfe3f5;
}
.tutorial-dot.active { background: var(--sky-deep); }

/* フレンドタブの同意ゲート（未同意の間はグレーアウト） */
.tabbtn.locked { opacity: 0.45; filter: grayscale(0.7); }

/* ようこそDM内のチュートリアル導線ボタン */
.welcome-tutorial-btn {
  display: block; width: 100%; margin-top: 10px;
  background: linear-gradient(180deg, #3db2ff, var(--sky-deep)); color: #fff;
  border-radius: 999px; padding: 9px 0; font-weight: 800; font-size: 13.5px;
}

/* 対戦画面のシステムログ（強制退室など） */
.game-system-log {
  align-self: center; text-align: center;
  background: rgba(23, 50, 74, 0.08); color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px; margin: 4px auto;
  font-size: 12px; font-weight: 700; max-width: 92%;
}

/* DMのシステムメッセージ（ようこそ・ペナルティ通知など）。
   以前は「長文だから」と従来フォント＋全幅カードにしていたが、通常の
   吹き出しと並ぶと初期デザインのまま浮いて見えるため、吹き出しの
   形（白系＋影＋角丸16px）とアプリ標準フォントに統一した
   （2026-11-26 おぎ指摘）。水色地で「システムからの知らせ」とは分かる */
.dm-system-msg {
  align-self: flex-start; max-width: 94%;
  background: #eaf6ff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 10px 13px; margin: 4px 0;
  font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-line;
}
/* グループの参加・退出などの短いお知らせ（中央の小さいピル） */
.chat-notice {
  align-self: center; max-width: 92%; margin: 2px 0;
  background: rgba(255, 255, 255, .8); border-radius: 999px;
  padding: 5px 14px; box-shadow: 0 1px 4px rgba(90, 140, 190, .14);
  font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: center;
}

/* 横向きブロック（旧 .rotate-notice）は 2026-12-02 廃止。
   横向き・PC幅でも .phone の縦カラム（最大430px・中央寄せ）のまま遊べる */
.svg-ic { display: inline-block; vertical-align: -0.16em; flex: 0 0 auto; }
.empty-icon { color: #9db8cc; }
