/* >>> BLOCK trpg_styles type=stylesheet */
/* @why: [2026-09-09] オンラインTRPGセッションツールのCSS。黒基調・85-90%の広大な盤面UI・折りたたみ式チャット＆パレット・yui検知基準（はみ出し防止・44pxタップ領域）を遵守。モバイル対応。 */
/* @why: [2026-09-11] ユーザー要望「ひたすらUI強化・フラットデザイン・直角化」。グラデーション/すりガラス(backdrop-filter)/半透明カード/ドロップシャドウ（奥行き）を廃し、単色フラット＋角丸ゼロ（直角）へ一本化。階層は「黒の濃度（実線面）と境界線・余白」で表現する。 */
/* @tags: SPEC, UI, CSS, VTT, FLAT, SQUARE */

/* ピクセルアートアイコン（絵文字代替。親の font-size に1emで追従する） */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; shape-rendering: crispEdges; fill: currentColor; pointer-events: none; }

:root {
  --bg-base: #0f1117;
  --bg-surface: #171a23;
  --bg-card: #1c2029;          /* フラット：半透明でなく単色 */
  --bg-card-hover: #242a36;
  --border: #2a2f3c;           /* フラット：実線の境界色 */
  --border-focus: #4facfe;
  --text-main: #f0f3fa;
  --text-muted: #8e99b0;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #9d50bb;
  --accent-crimson: #ff4b4b;
  --accent-gold: #f6d365;
  --accent-green: #2ecc71;
  --hud-height: 52px;
  --chat-width: 360px;
  --radius: 0;                 /* 直角化：角丸を全廃 */
  --shadow-popup: none;        /* フラット：影なし */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

/* アプリ全体コンテナ */
#app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* === 上部 HUD バー (Header) === */
.hud-header {
  height: var(--hud-height);
  background: #12151d;              /* ソリッド */
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 50;
  flex-shrink: 0;
  gap: 8px;
  overflow: hidden;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.room-logo {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-cyan);       /* フラット単色 */
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.room-title-tag {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* イニシアティブ・手番表示 (中央) */
.hud-center {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 360px;
  padding: 4px;
  flex-shrink: 1;
}

.hud-center::-webkit-scrollbar {
  display: none;
}

.initiative-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1a1e28;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.initiative-badge.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #06222e;
}

.round-counter {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-cyan);
  padding: 4px 6px;
  background: #102a30;
  border-radius: var(--radius);
  white-space: nowrap;
}

/* ツールバー (右側ボタン群) */
.hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-btn {
  min-height: 44px;
  padding: 6px 10px;
  background: #1a1e28;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.hud-btn:hover {
  background: #262c3a;
  border-color: #3a4152;
}

.hud-btn.primary {
  background: #2b6cb0;             /* フラット単色 */
  border-color: #2b6cb0;
}

.hud-btn.primary:hover {
  background: #3182ce;
}

/* === メイン作業領域 (Board + Chat Drawer) === */
.workspace {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
  height: calc(100vh - var(--hud-height));
  width: 100%;
}

/* === 盤面ビューポート (Tabletop Board) === */
.board-viewport {
  flex: 1;
  height: 100%;
  width: 100%;
  position: relative;
  background-color: #14161d;
  background-position: center;
  background-size: cover;
  overflow: hidden;
  cursor: grab;
}

.board-viewport.panning {
  cursor: grabbing;
}

/* 仮想盤面コンテナ（ズーム＆パン対象） */
.board-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 2000px;
  height: 1600px;
  transform-origin: 0 0;
  will-change: transform;
}

/* グリッドキャンバス */
.grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

/* スクリーンパネル */
.screen-panel {
  position: absolute;
  background: #121620;
  border: 1px solid #333a48;
  border-radius: var(--radius);
  padding: 12px;
  user-select: text;
  color: var(--text-main);
  z-index: 5;
  transition: border-color 0.2s;
  cursor: move;
}

.screen-panel:hover {
  border-color: var(--accent-blue);
}

.panel-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--accent-cyan);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.panel-content {
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #d1d5db;
  pointer-events: none;
}

/* キャラクターコマ (Token) */
.token {
  position: absolute;
  z-index: 10;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease-out;
}

.token.dragging {
  cursor: grabbing;
  z-index: 30;
  transition: none;
}

.token.selected {
  z-index: 20;
}

.token.selected .token-body {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 1px;
}

.token.active-turn .token-body {
  outline: 2px solid var(--accent-gold);
  outline-offset: 1px;
}

.token-body {
  width: 100%;
  height: 100%;
  border-radius: 0;               /* 直角化（コマも四角） */
  background: rgba(26, 30, 41, 0.75);
  border: 1px solid var(--border);
  overflow: visible;              /* 枠外をクリップせず、立ち絵の全身・頭部を美しく表示 */
  position: relative;
  display: flex;
  align-items: flex-end;          /* 底面に接地 */
  justify-content: center;
}

.token-img {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 150%;
  max-height: 240%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}

.token-img.preset-icon {
  position: static;
  transform: none;
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: none;
  margin: auto;
}

.token-name {
  margin-top: 4px;
  background: #0f1117;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ステータスバー（HP/MP/SANゲージ） */
.token-bars {
  position: absolute;
  bottom: -14px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.stat-bar {
  height: 4px;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.stat-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.stat-fill.hp { background: #ff4b4b; }
.stat-fill.mp { background: #4facfe; }
.stat-fill.san { background: #9d50bb; }

/* 盤面操作コントロール (左下) */
.board-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 8px;
  z-index: 30;
}

.board-control-btn {
  width: 44px;
  height: 44px;
  background: #161a24;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-main);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.board-control-btn:hover {
  background: #242a36;
  border-color: var(--accent-blue);
}

/* === 右側 チャット＆ダイスドロワー (Chat Drawer) === */
.chat-drawer {
  width: var(--chat-width);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.chat-drawer.collapsed {
  transform: translateX(100%);
  position: absolute;
  right: 0;
}

/* チャットタブバー */
.chat-tabs {
  display: flex;
  background: #10131b;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  flex-shrink: 0;
}

.chat-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-tab:hover {
  color: var(--text-main);
}

.chat-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: #0e2327;
}

/* チャットメッセージログ */
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: text;
}

.chat-log::-webkit-scrollbar {
  width: 6px;
}
.chat-log::-webkit-scrollbar-thumb {
  background: #2a3040;
  border-radius: 0;
}

.chat-msg {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: #252a38;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.chat-msg-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-muted);
}

.chat-msg-text {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  color: #e2e8f0;
}

/* ダイス結果カード表示 */
.dice-card {
  margin-top: 4px;
  padding: 8px 12px;
  background: #161b26;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.dice-card.critical {
  border-left-color: var(--accent-gold);
  background: #2a2212;
  color: #fff;
}

.dice-card.fumble {
  border-left-color: var(--accent-crimson);
  background: #2a1518;
  color: #fff;
}

.dice-card.success {
  border-left-color: var(--accent-green);
}

.dice-card.failure {
  border-left-color: #718096;
}

/* チャット入力エリア */
.chat-input-area {
  padding: 10px;
  background: #141821;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-sender-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-sender-select {
  flex: 1;
  min-height: 44px;
  background: #12151d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  padding: 0 8px;
  font-size: 12px;
}

.color-picker-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid #3a4152;
  cursor: pointer;
  padding: 0;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 100px;
  background: #0f1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: inherit;
}

.chat-textarea:focus {
  border-color: var(--accent-blue);
}

.chat-send-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  background: #00b8d4;              /* フラット単色 */
  border: none;
  border-radius: var(--radius);
  color: #06222e;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.chat-send-btn:hover {
  background: #00cfe8;
}

/* パレット＆便利ボタンバー */
.chat-sub-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-sub-btn {
  min-height: 44px;
  padding: 4px 10px;
  background: #1a1e28;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-sub-btn:hover {
  color: var(--text-main);
  background: #242a36;
}

/* === チャットパレット ドロワー/ポップアップ === */
.palette-drawer {
  position: absolute;
  bottom: 0;
  right: var(--chat-width);
  width: 320px;
  height: 380px;
  background: #161a24;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  z-index: 45;
}

.palette-drawer.hidden {
  display: none;
}

.palette-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
}

.palette-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.palette-item {
  padding: 8px 10px;
  background: #191d27;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.palette-item:hover {
  background: #1d3b56;
  border-color: var(--accent-blue);
  color: #fff;
}

.palette-item.active {
  background: #21466a;
  border-color: var(--accent-blue);
  color: #fff;
}

.palette-item.muted {
  cursor: default;
  color: #6a7385;
}

.palette-item.muted:hover {
  background: #191d27;
  border-color: transparent;
}

/* === BGM ドロワー拡張 === */
.bgm-drawer {
  width: 360px;
  height: 480px;
}

.bgm-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 10px 12px;
  gap: 8px;
}

.bgm-nowplaying {
  font-size: 12px;
  color: var(--accent-blue);
  padding: 2px 0;
  min-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bgm-list {
  flex: 1;
  min-height: 0;
  padding: 4px 0;
}

.bgm-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.bgm-volume-row input[type="range"] {
  flex: 1;
}

/* === モーダルダイアログ === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  background: #191c26;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  min-height: 44px;
  background: #12151d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-blue);
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 56px;
  align-items: center;
  flex-wrap: wrap;
}

/* トースト通知 (左下) */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #181c27;
  border: 1px solid var(--accent-blue);
  padding: 10px 16px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* モバイル対応 (768px以下) */
@media (max-width: 768px) {
  .hud-header {
    padding: 0 6px;
  }
  .room-title-tag {
    display: none;
  }
  .hud-center {
    display: none; /* スマホ幅では手番をすっきりさせ盤面と操作を優先 */
  }
  /* ヘッダーボタンをアイコンのみにして横スクロール可能に */
  .hud-right {
    overflow-x: auto;
    max-width: 240px;
    gap: 4px;
  }
  .hud-right::-webkit-scrollbar {
    display: none;
  }
  .hud-btn {
    padding: 6px 8px;
    min-width: 38px;
  }
  .hud-btn span:nth-of-type(2) {
    display: none; /* テキストを隠してアイコンだけにする */
  }
  /* モバイルではチャットドロワーを全画面オーバーレイ（初期非表示）に */
  .chat-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100%;
    z-index: 60;
    transform: translateX(100%);
  }
  .chat-drawer.open {
    transform: translateX(0);
  }
  .palette-drawer {
    right: 0;
    width: 100vw;
    z-index: 70;
  }
  .modal-card {
    width: 95%;
  }
  .modal-footer {
    justify-content: stretch;
  }
  .modal-footer .hud-btn {
    flex: 1;
    min-width: 100px;
  }
}

.rating-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rating-badge.all {
  background: #12281c;
  color: #2ecc71;
  border: 1px solid #1f4a33;
}
.rating-badge.r18 {
  background: #241530;
  color: #d175f5;
  border: 1px solid #4a2a5e;
}
.rating-badge.r18g {
  background: #2a1518;
  color: #ff4b4b;
  border: 1px solid #532527;
}

/* ===== シーン演出オーバーレイ ===== */
.scene-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #0a0c12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.scene-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.scene-overlay-inner {
  max-width: 720px;
  width: 100%;
  text-align: center;
}
.scene-overlay-title {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
  letter-spacing: .02em;
}
.scene-overlay-text {
  font-size: 17px;
  line-height: 2;
  color: #d1d5db;
  white-space: pre-wrap;
}
.scene-overlay-hint {
  margin-top: 36px;
  font-size: 12px;
  color: #718096;
}

/* 接続状態インジケータ（同期状態） */
.conn-indicator { position: fixed; top: 8px; right: 12px; z-index: 9999; font-size: 10px; color: var(--text-muted); pointer-events: none; opacity: 0.7; }

/* キャラクター立ち絵ライブラリ */
.portrait-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.portrait-filter { padding: 6px 13px; font-size: 12px; min-height: 32px; border: 1px solid var(--border); background: #161a24; color: var(--text-main); border-radius: 0; cursor: pointer; }
.portrait-filter.active { background: var(--accent-blue); border-color: var(--accent-blue); color: #06222e; }
.portrait-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; max-height: 460px; overflow-y: auto; }
.portrait-item { cursor: pointer; border: 2px solid transparent; border-radius: 0; overflow: hidden; position: relative; aspect-ratio: 3 / 4; background: var(--bg-card); }
.portrait-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-item:hover { border-color: var(--accent-blue); }
.portrait-item .p-label { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; background: rgba(0,0,0,0.72); color: #fff; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portrait-loading { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 40px 0; font-size: 13px; }

/* 画面エフェクト（霧・煙などのスクロール・オーバーレイ） */
.fx-overlay { position: absolute; inset: 0; pointer-events: none; background-size: auto 100%; background-repeat: repeat-x; z-index: 3; }
@keyframes fx-scroll { from { background-position: 0 0; } to { background-position: -1024px 0; } }

/* 検索入力欄（共通） */
.modal-search-box {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-main);
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}
.modal-search-box:focus {
  border-color: var(--accent-cyan);
}

/* 背景モーダル用ヘッダー操作 */
.bg-modal-top-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bg-modal-top-bar .modal-search-box {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}

/* <<< /BLOCK trpg_styles */