/* =============================================
   戦国天下統一シミュレーション — メインCSS
   UI仕様: 1920×1080 横画面固定
   ============================================= */

/* --- CSS変数（カラーテーマ） --- */
:root {
  --bg-base:      #1a1a1a;
  --bg-surface:   #262218;
  --bg-surface2:  #2e2820;
  --bg-panel:     #1e1b14;
  --washi:        #f5f0e8;
  --washi-dim:    #c8c0a8;
  --vermilion:    #cc3300;
  --vermilion-d:  #991a00;
  --gold:         #c8a84b;
  --gold-dim:     #8a7230;
  --east:         #003366;
  --west:         #990000;
  --neutral:      #808080;
  --border:       rgba(200,168,75,0.25);
  --border-light: rgba(200,168,75,0.12);
  --text:         #e8e0d0;
  --text-muted:   #8a8070;
  --green:        #2d8a4e;
  --red:          #cc2200;
  --shadow:       0 2px 12px rgba(0,0,0,0.6);
}

/* --- リセット --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text);
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: none;
  touch-action: manipulation;
}
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* --- アプリルート --- */
#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =============================================
   タイトル画面
   ============================================= */
#title-screen {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d0a06 0%, #1a1208 50%, #0d0a06 100%);
  position: relative;
  overflow: hidden;
}
#title-screen::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(200,168,75,0.05) 0%, transparent 70%);
}
.title-deco {
  position: absolute;
  opacity: 0.04;
  font-size: 40vw;
  color: var(--gold);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  user-select: none;
}
.title-logo {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(200,168,75,0.4), 0 2px 4px rgba(0,0,0,0.8);
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.3;
}
.title-sub {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--washi-dim);
  letter-spacing: 0.3em;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}
.title-divider {
  width: 200px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 24px auto;
  position: relative; z-index: 1;
}
.title-buttons {
  display: flex; gap: 20px;
  position: relative; z-index: 1;
}
.title-btn {
  min-width: 180px;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border-radius: 3px;
  border: 1px solid;
  transition: all 0.2s;
  min-height: 56px;
}
.title-btn.primary {
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--washi);
  box-shadow: 0 0 20px rgba(204,51,0,0.4);
}
.title-btn.primary:hover { background: #e63a00; box-shadow: 0 0 30px rgba(204,51,0,0.6); }
.title-btn.secondary {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.title-btn.secondary:hover { background: rgba(200,168,75,0.1); }

/* =============================================
   シナリオ選択画面
   ============================================= */
#scenario-screen {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}
.scenario-header {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.scenario-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.scenario-list-pane {
  width: 30%;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.scenario-card {
  padding: 16px 14px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-surface);
  min-height: 80px;
}
.scenario-card:active, .scenario-card.selected {
  border-color: var(--vermilion);
  background: rgba(204,51,0,0.08);
}
.scenario-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.scenario-card-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.scenario-preview-pane {
  width: 45%;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.scenario-map-area {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, #0d1520 0%, #0a0e1a 100%);
  overflow: hidden;
}
.scenario-desc-area {
  height: 180px;
  padding: 14px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.scenario-config-pane {
  width: 25%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  gap: 16px;
}
.difficulty-buttons {
  display: flex; gap: 8px;
}
.diff-btn {
  flex: 1;
  padding: 12px 6px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-surface);
  color: var(--text-muted);
  transition: all 0.15s;
  min-height: 48px;
}
.diff-btn.selected {
  border-color: var(--vermilion);
  color: var(--vermilion);
  background: rgba(204,51,0,0.1);
}
.clan-select-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.clan-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  min-height: 56px;
  transition: background 0.15s;
}
.clan-select-item:active, .clan-select-item.selected {
  background: rgba(204,51,0,0.1);
}
.clan-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.clan-select-name {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}
.start-btn {
  width: 100%;
  padding: 18px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: var(--vermilion);
  border: none;
  color: var(--washi);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(204,51,0,0.5);
  transition: all 0.2s;
  min-height: 60px;
}
.start-btn:active { background: var(--vermilion-d); transform: scale(0.98); }
.start-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   ゲーム画面 — 基本レイアウト
   ============================================= */
#game-screen {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 上部固定バー 60px */
#top-bar {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
  gap: 12px;
}
.top-bar-date {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
  min-width: 140px;
}
.top-bar-turn {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.top-bar-resources {
  display: flex;
  gap: 16px;
  flex: 1;
  justify-content: center;
}
.resource-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 700;
}
.resource-icon {
  font-size: 1.2rem;
}
.resource-value {
  color: var(--washi);
  min-width: 60px;
}
.top-bar-right {
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all 0.15s;
}
.icon-btn:active { background: var(--bg-surface2); color: var(--gold); }

/* 史実イベント警告バナー */
#event-warning-banner {
  flex-shrink: 0;
  display: none;
}
.event-warning-bar {
  background: rgba(204,51,0,0.18);
  border-bottom: 2px solid rgba(204,51,0,0.6);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: #ff6633;
  cursor: pointer;
}
.event-warning-bar i { font-size: 1rem; }

/* メインエリア（上下バーの間） */
#game-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* 下部ナビゲーションバー 80px */
#bottom-nav {
  height: 80px;
  min-height: 80px;
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  border-top: 2px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-top: 3px solid transparent;
  transition: all 0.15s;
  min-width: 0;
  padding: 0 4px;
}
.nav-btn i { font-size: 1.4rem; display: block; }
.nav-btn.active {
  color: var(--vermilion);
  border-top-color: var(--vermilion);
  background: rgba(204,51,0,0.06);
}
.nav-btn:active { background: rgba(204,51,0,0.1); }

/* ターン終了ボタン（右下固定） */
#end-turn-btn {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--vermilion);
  border: 3px solid rgba(255,255,255,0.2);
  color: var(--washi);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 4px 20px rgba(204,51,0,0.6);
  z-index: 200;
  transition: all 0.15s;
  cursor: pointer;
}
#end-turn-btn i { font-size: 1.4rem; display: block; }
#end-turn-btn.pressing {
  transform: scale(0.93);
  background: var(--vermilion-d);
}
#end-turn-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 左パネル内ターン終了ボタン（ワンタップ即実行） */
.left-end-turn-btn {
  width: 100%;
  padding: 14px 8px;
  border-radius: 8px;
  background: var(--vermilion);
  border: 2px solid rgba(255,255,255,0.18);
  color: var(--washi);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(204,51,0,0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.05s, background 0.05s;
}
.left-end-turn-btn i { font-size: 1.05rem; }
.left-end-turn-btn:active {
  transform: scale(0.97);
  background: var(--vermilion-d);
}

/* =============================================
   マップタブ — 3分割レイアウト
   ============================================= */
#map-layout {
  display: flex;
  width: 100%; height: 100%;
  overflow: hidden;
}

/* 左情報パネル 220px */
#left-panel {
  width: 220px;
  min-width: 220px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  gap: 12px;
  flex-shrink: 0;
}
.panel-section-title {
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.info-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 3px 0;
}
.info-stat-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.info-stat-value {
  font-weight: 700;
  color: var(--washi);
}
.action-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
}
.action-badge.available {
  background: rgba(45,138,78,0.2);
  color: #5dba7a;
  border: 1px solid rgba(45,138,78,0.4);
}
.action-badge.used {
  background: rgba(204,51,0,0.2);
  color: #ff6633;
  border: 1px solid rgba(204,51,0,0.4);
}
.mini-general {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.82rem;
}
.mini-general-name { flex: 1; color: var(--washi); }
.mini-general-val { color: var(--text-muted); font-size: 0.75rem; }

/* 警告バナー（左パネル内） */
.event-warn-item {
  background: rgba(204,51,0,0.12);
  border: 1px solid rgba(204,51,0,0.5);
  border-radius: 3px;
  padding: 8px;
  font-size: 0.78rem;
  color: #ff6633;
  cursor: pointer;
}
.event-warn-turns {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 中央マップエリア */
#map-center {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0a1520;
}
#map-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}
#japan-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}
#map-zoom-ctrl {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#map-zoom-ctrl button {
  width: 32px; height: 32px;
  background: rgba(20,30,45,0.85);
  border: 1px solid rgba(200,168,75,0.4);
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#map-zoom-ctrl button:hover {
  background: rgba(200,168,75,0.2);
}
#zoom-level-display {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(200,168,75,0.7);
  letter-spacing: 0.05em;
}
.map-prov {
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.52rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: all 0.15s;
  word-break: break-all;
  text-align: center;
  line-height: 1.1;
  padding: 1px;
  -webkit-user-select: none;
  user-select: none;
}
.map-prov:active, .map-prov.selected {
  z-index: 10;
  width: 36px; height: 36px;
  border-color: var(--washi);
  box-shadow: 0 0 12px rgba(255,255,255,0.4);
}
.map-prov.player-prov {
  border-color: rgba(200,168,75,0.7);
  box-shadow: 0 0 6px rgba(200,168,75,0.3);
}

/* 右アクションパネル 220px */
#right-panel {
  width: 220px;
  min-width: 220px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  gap: 10px;
  flex-shrink: 0;
}
.prov-detail-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-align: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.prov-owner-badge {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 4px 0;
}
.stat-bar-row {
  margin-bottom: 6px;
}
.stat-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.stat-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.action-btn-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.action-btn {
  width: 100%;
  padding: 12px 8px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 3px;
  border: 1px solid;
  transition: all 0.15s;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.action-btn.primary {
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--washi);
}
.action-btn.primary:active { background: var(--vermilion-d); }
.action-btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.action-btn.secondary:active { background: var(--bg-surface2); color: var(--text); }
.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.no-prov-hint {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.8;
  padding: 12px;
}

/* =============================================
   汎用コンテンツタブエリア（マップ以外）
   ============================================= */
#tab-content {
  width: 100%; height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

/* セクションタイトル */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  border-left: 3px solid var(--vermilion);
  padding-left: 8px;
  margin-bottom: 10px;
}

/* 汎用グリッド */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 10px 8px;
  text-align: center;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--washi);
}

/* アクションカード */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.action-card:active { background: var(--bg-surface2); border-color: var(--gold); transform: scale(0.97); }
.action-card.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.action-card-icon { font-size: 1.8rem; }
.action-card-name { font-size: 0.88rem; font-weight: 700; color: var(--gold); }
.action-card-desc { font-size: 0.7rem; color: var(--text-muted); }
.action-card-cost { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* リストアイテム */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
  min-height: 56px;
  cursor: pointer;
  transition: background 0.15s;
}
.list-item:active { background: var(--bg-surface2); }

/* プログレスバー */
.progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s;
}

/* タグ・バッジ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-allied   { background: rgba(0,51,102,0.3);  color: #6699cc; border: 1px solid rgba(0,51,102,0.6); }
.badge-friendly { background: rgba(45,138,78,0.2); color: #5dba7a; border: 1px solid rgba(45,138,78,0.5); }
.badge-neutral  { background: rgba(128,128,128,0.2); color: #aaa; border: 1px solid rgba(128,128,128,0.4); }
.badge-tense    { background: rgba(200,80,0,0.2);  color: #ff9944; border: 1px solid rgba(200,80,0,0.5); }
.badge-enemy    { background: rgba(153,0,0,0.2);   color: #ff4444; border: 1px solid rgba(153,0,0,0.5); }
.badge-vassal   { background: rgba(45,138,78,0.2); color: #5dba7a; border: 1px solid rgba(45,138,78,0.5); }

/* 忠誠度バー */
.loyalty-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  margin-top: 3px;
}
.loyalty-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* =============================================
   武将カード
   ============================================= */
.general-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.general-card:active { border-color: var(--gold); background: var(--bg-surface2); }
.general-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--washi);
  margin-bottom: 4px;
}
.general-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.general-params {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.param-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
}
.param-label { font-size: 0.6rem; color: var(--text-muted); }
.param-value { font-size: 0.88rem; font-weight: 700; color: var(--gold); }

/* =============================================
   モーダル
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: min(600px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow);
}

/* =============================================
   国詳細モーダル（600×400px相当）
   ============================================= */
.prov-modal-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 340px;
}
.prov-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.prov-modal-body {
  display: flex;
  gap: 16px;
  flex: 1;
}
.prov-modal-left {
  flex: 1.4;
  min-width: 0;
}
.prov-modal-right {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--border-light);
  padding-left: 16px;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.modal-select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  margin-top: 4px;
  min-height: 48px;
}
.modal-input {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  margin-top: 4px;
  min-height: 48px;
}
.modal-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-top: 12px;
  margin-bottom: 2px;
}
.modal-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-primary {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--vermilion);
  border: none;
  color: var(--washi);
  border-radius: 4px;
  min-height: 52px;
  transition: all 0.15s;
}
.btn-primary:active { background: var(--vermilion-d); transform: scale(0.98); }
.btn-secondary {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  min-height: 52px;
  transition: all 0.15s;
}
.btn-secondary:active { background: var(--bg-surface2); color: var(--text); }

/* =============================================
   ターン終了確認・サマリー
   ============================================= */
.endturn-confirm {
  text-align: center;
  padding: 8px 0 16px;
}
.endturn-confirm-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.endturn-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: left;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}

/* =============================================
   史実イベント画面
   ============================================= */
#event-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.88);
}
.event-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(204,51,0,0.12) 0%, transparent 60%);
}
.event-title-block {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 20px;
}
.event-title-text {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--vermilion);
  letter-spacing: 0.2em;
  text-shadow: 0 0 40px rgba(204,51,0,0.6);
}
.event-date-small {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.event-content {
  position: relative;
  z-index: 1;
  width: min(720px, 90vw);
  background: rgba(20,16,10,0.9);
  border: 1px solid rgba(204,51,0,0.4);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.event-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--washi);
  margin-bottom: 14px;
}
.event-effects {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.event-effect-item {
  padding: 8px 10px;
  background: rgba(204,51,0,0.08);
  border-left: 3px solid var(--vermilion);
  font-size: 0.88rem;
  color: var(--washi);
}
.event-choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.event-choice-btn {
  flex: 1;
  min-width: 180px;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--washi);
  transition: all 0.15s;
  min-height: 56px;
  cursor: pointer;
}
.event-choice-btn:active, .event-choice-btn:hover {
  border-color: var(--vermilion);
  background: rgba(204,51,0,0.1);
}
.event-ok-btn {
  min-width: 200px;
  padding: 16px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--vermilion);
  border: none;
  color: var(--washi);
  border-radius: 4px;
  min-height: 56px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

/* =============================================
   ターン開始演出
   ============================================= */
#turn-start-screen {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  animation: fadeInOut 1.6s ease forwards;
}
@keyframes fadeInOut {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}
.turn-start-text {
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.3em;
  text-shadow: 0 0 40px rgba(200,168,75,0.5);
  text-align: center;
  writing-mode: vertical-rl;
}

/* =============================================
   ゲームオーバー / エンディング
   ============================================= */
#gameover-screen {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}
#gameover-screen.defeat {
  background: linear-gradient(135deg, #0d0a06 0%, #1a0a00 100%);
}
#gameover-screen.victory {
  background: linear-gradient(135deg, #0a0c00 0%, #1a1800 100%);
}
.gameover-title {
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.3em;
}
.gameover-title.defeat-text { color: var(--text-muted); }
.gameover-title.victory-text {
  color: var(--gold);
  text-shadow: 0 0 60px rgba(200,168,75,0.5);
}
.gameover-record {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 24px;
  min-width: 320px;
  text-align: center;
}
.gameover-record-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-light);
}
.gameover-btns {
  display: flex;
  gap: 12px;
}

/* =============================================
   ローディング
   ============================================= */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--vermilion);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

/* =============================================
   トースト通知
   ============================================= */
#toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: 90vw;
  text-align: center;
}
#toast.success { background: rgba(45,138,78,0.92); color: #fff; border: 1px solid #2d8a4e; }
#toast.error   { background: rgba(204,51,0,0.92);  color: #fff; border: 1px solid #cc3300; }
#toast.info    { background: rgba(0,51,102,0.92);  color: #fff; border: 1px solid #003366; }

/* =============================================
   フェードイン
   ============================================= */
.fade-in {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =============================================
   スクロールバー非表示
   ============================================= */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* =============================================
   ユーティリティ
   ============================================= */
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }

/* =============================================
   ルビ・家紋スタイル
   ============================================= */
ruby { display: inline; ruby-align: center; }
ruby rt {
  font-size: 0.6em;
  letter-spacing: 0;
  color: var(--text-muted);
  line-height: 1.2;
}
.kamon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.kamon-icon svg {
  width: 100%;
  height: 100%;
}
/* 家名プレフィックス付き武将表示 */
.clan-prefix {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 4px;
}
/* シナリオ選択の大名名 */
.clan-select-name ruby rt {
  font-size: 0.65em;
  color: rgba(232,224,208,0.6);
}
