/* 談合カード 観戦ビューア — ダーク基調CSS */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}

/* ヘッダ */
.header {
  background: #16213e;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid #0f3460;
}
.header h1 { font-size: 16px; color: #e94560; white-space: nowrap; }
.header select {
  background: #0f3460; color: #e0e0e0; border: 1px solid #533483;
  padding: 4px 8px; border-radius: 4px; font-size: 13px;
}
.header .stats {
  font-size: 14px; color: #a0a0c0; display: flex; gap: 16px;
}
.header .stats span { white-space: nowrap; }
.header label { font-size: 12px; color: #808090; cursor: pointer; }

/* グリッド */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  padding: 8px;
}

/* パネル */
.panel {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 120px;
}
.panel:hover { border-color: #e94560; }
.panel.eliminated { opacity: 0.6; }
.panel .pid { font-size: 18px; font-weight: bold; color: #e94560; }
.panel .model { font-size: 11px; color: #808090; margin-left: 8px; }
.panel .badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: bold; margin-left: 8px;
}
.badge.alive { background: #1b5e20; color: #a5d6a7; }
.badge.eliminated { background: #b71c1c; color: #ef9a9a; }
.badge.thinking { background: #e65100; color: #ffcc80; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.panel .strategy {
  font-size: 12px; color: #b0b0d0; margin-top: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.panel .stats-row {
  font-size: 11px; color: #808090; margin-top: 6px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.panel .stats-row span { white-space: nowrap; }

/* フッタ（最新メッセージ） */
.footer {
  background: #16213e;
  border-top: 1px solid #0f3460;
  padding: 8px 20px;
  font-size: 12px; color: #a0a0c0;
  max-height: 80px; overflow-y: auto;
}
.footer .msg { margin: 2px 0; }
.footer .sender { color: #e94560; font-weight: bold; }

/* 詳細モーダル */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 100;
}
.modal-overlay.active { display: flex; justify-content: center; align-items: flex-start; padding-top: 40px; }
.modal {
  background: #1a1a2e; border: 1px solid #533483; border-radius: 8px;
  width: 90%; max-width: 700px; max-height: 80vh; overflow-y: auto; padding: 16px;
}
.modal h2 { font-size: 16px; color: #e94560; margin-bottom: 12px; }
.modal .close { float: right; cursor: pointer; color: #e94560; font-size: 20px; }
.modal .timeline-item {
  border-left: 2px solid #0f3460; padding: 4px 0 4px 12px; margin: 4px 0;
  font-size: 12px;
}
.modal .timeline-item .phase-badge {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; background: #533483; color: #d0d0f0; margin-right: 6px;
}
.modal .timeline-item .action-type { color: #4fc3f7; font-weight: bold; }
.modal .timeline-item .content { color: #c0c0e0; margin-top: 2px; }
.modal .timeline-item .meta { color: #606080; font-size: 10px; }
.modal .reasoning {
  background: #0f3460; padding: 6px; border-radius: 4px;
  font-size: 11px; color: #a0a0c0; margin-top: 4px; cursor: pointer;
  max-height: 40px; overflow: hidden; transition: max-height 0.3s;
}
.modal .reasoning.expanded { max-height: 300px; overflow-y: auto; }

/* 感情表示 */
.emotion-icon { font-size: 1.6em; vertical-align: middle; margin-left: 4px; }
.emotion-history { font-size: 0.8em; letter-spacing: 2px; color: #8888aa; margin: 2px 0; }
.emotion-badge { font-size: 1.1em; margin-right: 2px; }
