/* /test/game-card-fantasybattle/ テストページ用バンドル（旧 game_fantasybattle.html 先頭 <style> と同一）。
   game_fantasybattle.html / game_isekai_shooting.html はこのファイルを link のみで読み込む。編集はこの1ファイルへ。 */
/* 他ページと揃える（サイドバーが同じ色合いになるよう明るいテーマ） */
:root {
  --bg: #f5f5f8;
  --card: #ffffff;
  --text: #1a1a1e;
  --muted: #5c5c6a;
  --accent: #4f46e5;
  --border: #e2e4e8;
}
/* html/body/* のリセットは game-pages.css（土台）に含める（テスト環境ゲーム3ページは main-layout を読まない） */
/* レイアウト・ロビー接続行は game-pages.css（.fantasy-content-wrap + .main-below-header / .lobby-status-row）に統一 */
.game-panel { max-width: 480px; margin: 0 auto; }
.game-panel.game-wide { max-width: 1200px; }
.form-row { margin-bottom: 0.75rem; }
.form-row label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.25rem; }
.form-row input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font-size: 1rem; }
.btn { display: inline-block; padding: 0.5rem 1rem; border: none; border-radius: 8px; font-size: 0.9375rem; cursor: pointer; background: var(--accent); color: #fff; }
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-secondary:hover { background: rgba(79, 70, 229, 0.1); }
/* main-layout のニュートラル .btn-secondary より優先（ロビーは紫枠アウトラインのまま） */
.fantasy-battle-shell .main-area .btn.btn-secondary,
.page-test-fantasy-game-main .main-area .btn.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.fantasy-battle-shell .main-area .btn.btn-secondary:hover,
.page-test-fantasy-game-main .main-area .btn.btn-secondary:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
  border-color: var(--accent);
}
/* 青ボタン（.btn-secondary と同じ寸法・メインサイトの .btn-primary に相当） */
.fantasy-battle-shell .main-area .btn.btn-primary,
.page-test-fantasy-game-main .main-area .btn.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.fantasy-battle-shell .main-area .btn.btn-primary:hover,
.page-test-fantasy-game-main .main-area .btn.btn-primary:hover {
  background: var(--accent-hover, #4338ca);
  border-color: var(--accent-hover, #4338ca);
  opacity: 1;
}
.room-id-box { padding: 0.75rem 1rem; background: var(--card); border-radius: 8px; border: 1px solid var(--border); margin-bottom: 1rem; }
.room-id-box .label { font-size: 0.75rem; color: var(--muted); }
.room-id-box .value { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.1em; }
.room-chat, .game-chat { margin-top: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card); overflow: hidden; }
.room-chat .chat-title, .game-chat .chat-title { font-size: 0.8rem; color: var(--muted); padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }
.room-chat-messages, .game-chat-messages { max-height: 180px; overflow-y: auto; padding: 0.5rem 0.75rem; font-size: 0.875rem; line-height: 1.4; }
.room-chat-messages .chat-msg, .game-chat-messages .chat-msg { margin-bottom: 0.35rem; word-break: break-word; }
.room-chat-messages .chat-msg .chat-name, .game-chat-messages .chat-msg .chat-name { font-weight: 600; color: var(--accent); margin-right: 0.35rem; }
.room-chat-form, .game-chat-form { display: flex; gap: 0.5rem; padding: 0.5rem 0.75rem; border-top: 1px solid var(--border); }
.room-chat-form input, .game-chat-form input { flex: 1; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.875rem; }
.room-chat-form button, .game-chat-form button { flex-shrink: 0; padding: 0.4rem 0.75rem; font-size: 0.875rem; }
/* ゲーム中チャットはゲームエリアの外（下側）に配置。幅は #game-view の padding でゲームエリアと一致。背景はゲーム同様の濃い色で文字を見やすく */
#game-view .game-chat {
  flex-shrink: 0;
  margin: 0 0 12px;
  width: 100%;
  max-height: 140px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #0a4723 0%, #0d5c2e 50%, #0f6b38 100%);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  box-sizing: border-box;
}
#game-view .game-chat .chat-title { color: rgba(255,255,255,0.8); border-bottom-color: rgba(255,255,255,0.2); }
#game-view .game-chat-messages { max-height: 72px; color: #fff; font-size: 0.75rem; }
#game-view .game-chat-messages .chat-msg .chat-name { color: #e8c547; }
#game-view .game-chat-form { border-top-color: rgba(255,255,255,0.2); }
#game-view .game-chat-form input { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: #fff; }
#game-view .game-chat-form input::placeholder { color: rgba(255,255,255,0.5); }
.players-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.players-list li { padding: 0.5rem 0.75rem; background: var(--card); border-radius: 6px; margin-bottom: 0.25rem; border: 1px solid var(--border); }
.status { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.5rem; }
/* 緑のゲーム枠: 異世界衰弱 #game-view 内でも異世界シューティングでも同一クラス（見た目はこの定義のみ） */
.memory-game-wrap {
  position: relative;
  background: linear-gradient(160deg, #0a4723 0%, #0d5c2e 50%, #0f6b38 100%);
  border-radius: 16px 16px 0 0;
  padding: 8px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: none;
}
/* 異世界シューティング: #isekai-fs-target 配下は親の overflow が影を欠かすため、枠の影は常に見えるようにする（衰弱の #game-view 直下と同じ見え方） */
#isekai-fs-target .memory-game-wrap {
  overflow: visible;
}
#game-view { display: none; flex-direction: column; max-width: 1200px; margin: 0 auto; min-height: 0; padding: 0 12px 12px; box-sizing: border-box; }
/* 異世界シューティング: 衰弱の #game-view と同じ左右余白（.game-panel.game-wide 直下のシェル） */
.game-panel.game-wide > .isekai-shooting-page-shell {
  padding: 0 12px 12px;
  box-sizing: border-box;
  width: 100%;
}
/* ゲーム表示時は flex で .memory-game-wrap が伸び、.game-chat は下に固定。左右12pxでチャット幅をゲームエリアと一致 */
/* 全画面時は #game-view をビューポート全体に広げ、カード全体表示ロジック（updateGridLayout）が最大領域を使えるようにする */
#game-view:fullscreen { display: flex; flex-direction: column; max-width: none; width: 100vw; height: 100vh; margin: 0; padding: 0; overflow: hidden; }
/* 全画面時もゲームエリアが画面全体を占有しないようにし、下部にチャットエリア分の余白を確保する */
#game-view:fullscreen .memory-game-wrap { flex: 1; min-height: 0; max-height: calc(100vh - 180px); overflow: hidden; }
#game-view:fullscreen .game-container { min-height: 0; overflow: hidden; }
#game-view:fullscreen .game-board { min-height: 0; overflow: hidden; }
#game-view:-webkit-full-screen { display: flex; flex-direction: column; max-width: none; width: 100vw; height: 100vh; margin: 0; padding: 0; overflow: hidden; }
#game-view:-webkit-full-screen .memory-game-wrap { flex: 1; min-height: 0; max-height: calc(100vh - 180px); overflow: hidden; }
#game-view:-webkit-full-screen .game-container { min-height: 0; overflow: hidden; }
#game-view:-webkit-full-screen .game-board { min-height: 0; overflow: hidden; }
#game-view:-moz-full-screen { display: flex; flex-direction: column; max-width: none; width: 100vw; height: 100vh; margin: 0; padding: 0; overflow: hidden; }
#game-view:-moz-full-screen .memory-game-wrap { flex: 1; min-height: 0; max-height: calc(100vh - 180px); overflow: hidden; }
#game-view:-moz-full-screen .game-container { min-height: 0; overflow: hidden; }
#game-view:-moz-full-screen .game-board { min-height: 0; overflow: hidden; }
#game-view:-ms-fullscreen { display: flex; flex-direction: column; max-width: none; width: 100vw; height: 100vh; margin: 0; padding: 0; overflow: hidden; }
#game-view:-ms-fullscreen .memory-game-wrap { flex: 1; min-height: 0; max-height: calc(100vh - 180px); overflow: hidden; }
#game-view:-ms-fullscreen .game-container { min-height: 0; overflow: hidden; }
#game-view:-ms-fullscreen .game-board { min-height: 0; overflow: hidden; }
@media (max-width: 1200px) { .game-panel.game-wide { max-width: none; } .game-panel.game-wide #game-view .memory-game-wrap { min-height: 70vh; } }
/* スマホ時はゲームを最大化表示（神経衰弱同様）＋画面下にチャットを常時表示 */
body.game-maximized #game-view {
  position: fixed;
  inset: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0 8px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
body.game-maximized #game-view .memory-game-wrap {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 160px);
}
/* game-card-mobile 神経衰弱の表示をそのまま流用（54枚用） */
/* 非全画面時も画面内に全カード収めるため高さをビューポート内に制限（#game-view 内のみ） */
#game-view .memory-game-wrap {
  flex: 1;
  min-height: 60vh;
  max-height: calc(100vh - 100px);
}
#game-view .game-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
#game-view .game-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
}
/* 1行目: ポイント・残り時間・全画面ボタン */
#game-view .game-header .game-header-row1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
#game-view .game-header .game-header-row1 .game-points { font-size: 0.95rem; color: #fff; font-weight: 600; flex-shrink: 0; min-width: 4em; }
#game-view .game-header .game-header-row1 .game-turn-timer { flex-shrink: 0; font-size: 0.9rem; color: #e8c547; font-weight: 600; min-width: 5em; }
#game-view .game-header .game-header-row1 .btn-fullscreen,
.memory-game-wrap .btn-fullscreen,
.memory-game-wrap .isekaiFullscreenBtn {
  margin-left: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
#game-view .game-header .game-header-row1 .btn-fullscreen:hover,
.memory-game-wrap .btn-fullscreen:hover,
.memory-game-wrap .isekaiFullscreenBtn:hover {
  background: rgba(255,255,255,0.3);
}
/* シューティングは右上絶対配置のため、ヘッダー用の margin-left:auto を打ち消す */
.memory-game-wrap .isekai-shooting-fs-row .btn-fullscreen,
.memory-game-wrap .isekai-shooting-fs-row .isekaiFullscreenBtn {
  margin-left: 0;
}
/* 2行目: プレイヤー名一覧・観戦者数 */
#game-view .game-header .game-header-row2 {
  font-size: 0.7rem; color: #fff; line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 1.25em;
}
#game-view .game-header .game-header-row2 .players-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.5rem; justify-content: center; color: #fff; background: none; border: none; }
#game-view .game-header .game-header-row2 .players-list li { margin: 0; color: #fff; background: none; border: none; padding: 0; }
#game-view .game-header .game-header-row2 .players-list li.player-turn-current { color: #e8c547; animation: player-turn-blink 1s ease-in-out infinite; }
#game-view .game-spectator-count { white-space: nowrap; flex: 0 0 auto; }
@keyframes player-turn-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
/* スキル・時間切れ: 画面中央オーバーレイ・最前面・シースルー背景で文字を視認しやすく */
#game-view .game-effect-overlay {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 10000; pointer-events: none; display: none;
  padding: 0.5rem 1rem; border-radius: 8px;
  background: rgba(0,0,0,0.5); color: #fef08a; font-size: 1.05rem; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#game-view .game-header .game-turn-timer.turn-timer-low { color: #f87171; animation: turn-timer-pulse 1s ease-in-out infinite; }
@keyframes turn-timer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.game-end-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.75); border-radius: 0;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
/* ゲームクリアボックスは常に画面（ビューポート）の中央に表示 */
.game-end-overlay .game-end-box {
  position: relative;
  left: 0; top: 0;
  transform: none;
}
.game-end-box {
  background: var(--card); color: var(--text); border-radius: 12px; padding: 1.5rem; max-width: 360px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.game-end-box .game-end-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem; text-align: center; }
.game-end-box .game-end-title.you-win { color: #16a34a; }
.game-end-box .game-end-title.you-lost { color: #dc2626; }
.game-end-box .game-end-detail { font-size: 0.95rem; color: var(--muted); margin: 0 0 1rem; text-align: center; line-height: 1.4; white-space: pre-line; }
.game-end-box .game-end-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.game-end-box .game-end-buttons .btn { width: 100%; }
.game-end-rematch-countdown { margin: 0.75rem 0; padding: 0.75rem; background: rgba(79, 70, 229, 0.08); border-radius: 8px; }
.game-end-rematch-message { font-size: 0.9rem; color: var(--text); margin: 0 0 0.25rem; }
.game-end-rematch-timer { font-size: 0.85rem; font-weight: 600; color: var(--accent); margin: 0; }
.game-end-rematch-timer.rematch-timeout { color: #dc2626; }
.game-end-box .game-end-buttons .btn-rematch-timeout-lobby { background: #dc2626; color: #fff; }
.game-end-box .game-end-buttons .btn-rematch-timeout-lobby:hover { background: #b91c1c; }
#game-view { position: relative; }
#game-view .game-end-overlay { position: fixed; inset: 0; border-radius: 0; }
#game-view .game-board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  align-content: center;
  overflow: hidden;
  perspective: 1200px;
}
#game-view .game-board > * { min-width: 0; min-height: 0; }
#game-view .card {
  width: 100%; height: 100%; min-width: 0; min-height: 0;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  perspective: 1000px;
}
#game-view .card-inner {
  position: relative;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  min-width: 0; min-height: 0;
  aspect-ratio: 80 / 112;
  border-radius: 8px;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
  overflow: hidden;
}
#game-view .card.flipped { cursor: default; pointer-events: none; }
#game-view .card.card-gone { opacity: 0; pointer-events: none; }
#game-view .card .face {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#game-view .card .face.back { background: transparent; transform: rotateY(0deg) translateZ(0); z-index: 0; }
#game-view .card .face.front { background: transparent; transform: rotateY(180deg) translateZ(1px); z-index: 1; }
#game-view .card .face.back img,
#game-view .card .face.front img {
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
#game-view .card.revealed .card-inner { transform: rotateY(180deg); }
#game-view .card.revealed .face.front {
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
}
/* ペア成立アニメ: ゲームエリア内に収まるよう拡大率・グローを抑えつつ中央へ移動＋2回転＋拡大→グロー→フェードアウト */
.pair-anim-overlay { position: fixed; inset: 0; z-index: 9999; pointer-events: none; background: rgba(0,0,0,0.5); overflow: visible; }
.pair-anim-wrapper { position: fixed; transform-origin: 50% 50%; transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); overflow: visible; will-change: transform; }
.pair-glow-radial { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 90vmin; height: 90vmin; max-width: 400px; max-height: 400px; border-radius: 50%; background: radial-gradient(circle at center, rgba(255,252,240,0.95) 0%, rgba(255,248,220,0.6) 25%, rgba(255,236,180,0.35) 45%, transparent 70%); pointer-events: none; opacity: 0; transition: opacity 0.5s ease-out; z-index: 0; }
.pair-anim-overlay .pair-anim-wrapper { z-index: 1; }
.pair-anim-overlay.pair-glow .pair-glow-radial { opacity: 1; }
.pair-anim-overlay.pair-anim-fadeout .pair-anim-wrapper { opacity: 0; transition: opacity 0.3s ease; }
/* c1動画: オーバーレイ内で絶対配置（fullscreen時の fixed 包含ブロックずれを避ける）。はみ出し可・最前面 */
.pair-c1-overlay { position: absolute; z-index: 100; pointer-events: none; overflow: visible; }
/* 闇の力: 消えるカードの放射線アニメ（中央濃紫→黒） */
.vanished-ray-overlay { position: absolute; inset: 0; pointer-events: none; border-radius: 8px; overflow: hidden; }
.vanished-ray-inner {
  position: absolute; inset: -50%;
  background: radial-gradient(circle at center,
    rgba(60,0,80,0.95) 0%, rgba(30,0,40,0.9) 25%,
    rgba(0,0,0,0.95) 50%, black 100%);
  animation: vanished-ray-expand 1.5s ease-out forwards;
}
@keyframes vanished-ray-expand {
  0% { transform: scale(0); opacity: 0; }
  20% { transform: scale(1.2); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
/* 場荒らし: 対象カードの赤い光（闇の力と同じ構造） */
.scramble-glow-overlay { position: absolute; inset: 0; pointer-events: none; border-radius: 8px; overflow: hidden; }
.scramble-glow-inner {
  position: absolute; inset: -50%;
  background: radial-gradient(circle at center,
    rgba(180,0,0,0.85) 0%, rgba(120,0,0,0.7) 30%,
    rgba(80,0,0,0.5) 60%, transparent 100%);
  animation: scramble-glow-pulse 2s ease-in-out forwards;
}
@keyframes scramble-glow-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
/* クローンは #game-view 外に置くため、神経衰弱と同じ表表示・レイアウトを指定 */
.pair-anim-clone { border-radius: 8px; overflow: hidden; position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; perspective: 1000px; }
.pair-anim-clone .card-inner { position: relative; width: 100%; height: 100%; aspect-ratio: 80/112; border-radius: 8px; transform-style: preserve-3d; transform: rotateY(180deg); }
.pair-anim-clone .face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pair-anim-clone .face.back { transform: rotateY(0deg) translateZ(0); z-index: 0; }
.pair-anim-clone .face.front { transform: rotateY(180deg) translateZ(1px); z-index: 1; backface-visibility: visible; -webkit-backface-visibility: visible; }
.pair-anim-clone .face img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
/* ロビー用ヒーロー：画像を背景として表示 */
.fantasy-lobby-hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  background-image: url(../images/fantasy_lobby_visual.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 5 / 3;
  min-height: 260px;
  overflow: hidden;
}
.fantasy-lobby-hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  color: #fff;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0,0,0,0.65);
}
/* ランキングページ用ヒーロー：ロビー .fantasy-lobby-hero と同じく背景画像＋角丸・影（文言は画像内） */
.fantasy-ranking-hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  background-image: url(../images/fantasy_point_ranking_visual.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 21 / 9;
  min-height: 140px;
  overflow: hidden;
}
.fantasy-ranking-hero-copy {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* ロビー入力エリア：ニックネーム〜ランキングを枠で囲む・メイン幅MAX */
.lobby-input-area {
  width: 100%;
  max-width: 100%;
  padding: 1.25rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
/* .game-rules 系は main-layout.css に一元化 */
.lobby-room-list { margin-top: 0.25rem; }
.lobby-room-list-empty { margin: 0; font-size: 0.875rem; color: var(--muted); }
.lobby-room-list-ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--card); max-height: 12rem; overflow-y: auto; }
.lobby-room-list-ul li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.9rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.lobby-room-list-ul li:last-child { border-bottom: none; }
.lobby-room-list-ul li:hover { background: rgba(79, 70, 229, 0.08); }
.lobby-room-list-ul li.state-playing { color: var(--muted); cursor: not-allowed; }
.lobby-room-list-ul li.state-playing:hover { background: transparent; }
.lobby-room-list-ul li.state-rematch-pending { color: var(--accent); }
.spectator-rematch-message { color: #dc2626; }
.lobby-room-list-label { flex: 1 1 auto; min-width: 0; }
.lobby-room-spectate-btn { flex: 0 0 auto; font-size: 0.8rem; padding: 0.25rem 0.5rem; }
.lobby-room-private-badge { color: #dc2626; font-weight: 700; margin-left: 0.4rem; }
/* 公開/非公開の折り返し禁止は共通CSS（main-layout.css）のユーティリティを使用 */

/* ポイントランキングページ: ニックネーム行をロビー（/test/game-card-fantasybattle/）と同一レイアウトに */
.form-row .u-flex > input[type="text"] {
  flex: 1;
  min-width: 120px;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}
.form-row .u-flex > .btn {
  flex-shrink: 0;
}
.fantasy-ranking-page #fantasy-ranking-nickname-save.fantasy-nickname-save--initial-hidden {
  display: none;
}
.fantasy-ranking-page #fantasy-ranking-nickname-change.fantasy-nickname-change--initial-hidden {
  display: none;
}
.fantasy-ranking-page .fantasy-ranking-nickname-status.status {
  font-size: 0.85rem;
  margin: 0.35rem 0 0.65rem 0;
  color: var(--muted);
  line-height: 1.45;
}
.fantasy-ranking-page .fantasy-ranking-nickname-warning {
  display: block;
  margin-top: 0.5rem;
  color: #b91c1c;
  font-weight: 500;
  line-height: 1.45;
}
.fantasy-ranking-page .lobby-input-area .fantasy-ranking-nickname-guest a {
  color: var(--accent);
}
