/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --bg-card: #f8f9fa;
  --bg-card-hover: #eef0f2;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --text: #1e293b;
  --text-dim: #64748b;
  --gold: #d97706;
  --green: #10b981;
  --danger: #ef4444;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ 屏幕切换 ============ */
.screen { display: none; }
.screen.active { display: flex; }

/* ============ 开始画面 ============ */
#start-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #f0fdf4 100%);
}

.start-content { text-align: center; max-width: 500px; }
.start-content h1 { font-size: 3rem; margin-bottom: 16px; color: var(--text); }
.subtitle { color: var(--text-dim); font-size: 1.1rem; line-height: 1.8; margin-bottom: 32px; }

.tips {
  margin-top: 32px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
  border: 1px solid var(--border);
}
.tips p { font-size: 0.9rem; color: var(--text-dim); margin: 8px 0; }

/* ============ 按钮 ============ */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 48px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3); }

.btn-sm {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-sm:hover { background: var(--bg-card-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

/* ============ 加载画面 ============ */
#loading-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
}

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: var(--text-dim); font-size: 1.1rem; }

/* ============ 游戏主界面 ============ */
#game-screen { flex-direction: column; min-height: 100vh; max-height: 100vh; }

/* 顶部栏 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.game-info { display: flex; gap: 20px; align-items: center; }
.timer { font-size: 1.1rem; font-weight: 600; }
.rumor-level { font-size: 0.9rem; color: var(--gold); }
.top-actions { display: flex; gap: 8px; }

/* 主区域 */
.game-main { display: flex; flex: 1; min-height: 0; }

/* NPC面板 */
.town-map {
  width: 340px; min-width: 340px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}
.map-title { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.npc-grid { display: flex; flex-direction: column; gap: 8px; }

.npc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid var(--border);
  position: relative;
}
.npc-card:hover { background: var(--bg-card-hover); border-color: #cbd5e1; }
.npc-card.selected { border-color: var(--accent); background: rgba(99, 102, 241, 0.06); }
.npc-card.talking { border-color: var(--gold); animation: pulse-border 0.5s ease; }
.npc-card.drag-over { border-color: var(--accent) !important; background: rgba(99, 102, 241, 0.1) !important; box-shadow: 0 0 12px rgba(99, 102, 241, 0.25); transform: scale(1.03); transition: all 0.15s ease; }

.npc-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}
.npc-avatar img { width: 100%; height: 100%; object-fit: cover; }

.npc-info { flex: 1; min-width: 0; }
.npc-name { font-size: 0.95rem; font-weight: 600; }
.npc-role { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.npc-desc { font-size: 0.72rem; color: var(--text-dim); opacity: 0.7; margin-top: 2px; }

.npc-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  position: absolute; top: 10px; right: 10px;
  opacity: 0; transition: opacity 0.3s;
}
.npc-card.talking .npc-pulse { opacity: 1; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}
@keyframes pulse-border {
  0% { border-color: var(--gold); }
  100% { border-color: transparent; }
}



/* 对话区 */
.chat-area { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; max-width: calc(100% - 620px); }
.chat-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-dim); gap: 8px; }
.hint-text { font-size: 0.85rem; opacity: 0.7; }

.chat-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.chat-npc-icon { font-size: 1.5rem; }
.chat-npc-info { display: flex; flex-direction: column; gap: 2px; }
.chat-npc-name { font-weight: 600; }
.chat-npc-role { color: var(--text-dim); font-size: 0.85rem; }

/* 聊天头部压力条 */
.chat-npc-pressure { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 12px; }
.chat-npc-pressure .pressure-label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.pressure-bar-track { width: 80px; height: 6px; background: var(--bg-card-hover); border-radius: 3px; overflow: hidden; }
.pressure-bar-fill { height: 100%; background: var(--danger); border-radius: 3px; transition: width 0.4s ease; width: 0%; }
.pressure-bar-fill.full { background: #ff6b6b; }

.btn-close-chat { margin-left: auto; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.2rem; padding: 4px 8px; }
.btn-close-chat:hover { color: var(--text); }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.message { max-width: 80%; padding: 10px 14px; border-radius: 12px; line-height: 1.6; font-size: 0.9rem; animation: fadeIn 0.3s ease; }
.message.player { align-self: flex-end; background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.message.npc { align-self: flex-start; background: var(--bg-card); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.message.system { align-self: center; background: #fef3c7; color: #92400e; font-size: 0.8rem; max-width: 90%; text-align: center; border-radius: 8px; }
.message.npc-thinking { align-self: flex-start; background: transparent; color: var(--text-dim); font-style: italic; font-size: 0.85rem; }

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

.message-label { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 4px; }
.message.player .message-label { text-align: right; color: rgba(255,255,255,0.7); }
.action-tag { display: inline-block; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; margin-left: 6px; background: rgba(255,255,255,0.2); }

/* 输入区 */
.chat-input-area { padding: 12px 16px; background: var(--bg-card); border-top: 1px solid var(--border); }

.chat-actions { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.btn-action { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg); color: var(--text-dim); font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.btn-action:hover { border-color: var(--accent); color: var(--text); background: var(--bg-card-hover); }
.btn-action.active { background: var(--accent); border-color: var(--accent); color: white; }

.chat-input-row { display: flex; gap: 8px; }
#chat-input { flex: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.9rem; outline: none; }
#chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
#btn-send { padding: 10px 20px; border-radius: 20px; border: none; background: var(--accent); color: white; cursor: pointer; font-weight: 600; }
#btn-send:hover { background: var(--accent-light); }

/* 底部状态栏 */
.status-bar { padding: 8px 20px; background: var(--bg-card); border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-dim); flex-shrink: 0; }
#status-text.disconnected { color: var(--danger); }

/* ============ 模态弹窗 ============ */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 100; align-items: center; justify-content: center; }
.modal.active { display: flex; }

.modal-content { background: var(--bg); border-radius: 16px; padding: 24px; width: 90%; max-width: 520px; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); border: 1px solid var(--border); }
.modal-large { max-width: 640px; }
.modal-relations { max-width: 90vw; max-height: 90vh; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h2 { font-size: 1.2rem; }
.modal-desc { color: var(--text-dim); margin-bottom: 16px; font-size: 0.9rem; }

.btn-close { background: none; border: none; color: var(--text-dim); font-size: 1.2rem; cursor: pointer; }

#report-text { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); resize: vertical; font-size: 0.9rem; font-family: inherit; margin-bottom: 16px; }
#report-text:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

/* 证据板 */
.evidence-section { margin-bottom: 20px; }
.evidence-section h3 { font-size: 0.95rem; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

.evidence-item { padding: 8px 12px; background: var(--bg-card); border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem; }
.evidence-item .npc-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--accent); color: white; font-size: 0.75rem; margin-right: 8px; }
.evidence-item .player-q { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; }

/* 拖拽 */
.evidence-item.draggable { cursor: grab; position: relative; padding-left: 28px; }
.evidence-item.draggable:active { cursor: grabbing; }
.evidence-item.draggable .drag-handle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: var(--text-dim); opacity: 0.3; font-size: 0.85rem; letter-spacing: -2px; user-select: none; }
.evidence-item.dragging { opacity: 0.5; border: 1px dashed var(--accent); }

/* 线索 */
.clue-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #ecfdf5; border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem; border-left: 3px solid var(--green); }
.clue-item.new-clue { animation: clueHighlight 2s ease; }
@keyframes clueHighlight { 0% { background: #d1fae5; } 100% { background: #ecfdf5; } }
.clue-icon { font-size: 1rem; flex-shrink: 0; }

/* 矛盾 */
.contradiction-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; background: #fef2f2; border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem; border-left: 3px solid var(--danger); }
.contradiction-icon { font-size: 1rem; flex-shrink: 0; }

/* ============ 结果画面 ============ */
#result-screen { flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #f0fdf4 100%); }
.result-content { text-align: center; max-width: 560px; width: 100%; }
.result-content h1 { font-size: 2rem; margin-bottom: 24px; }

.score-display { margin-bottom: 20px; }
.score-circle { width: 100px; height: 100px; border-radius: 50%; background: var(--accent); color: white; font-size: 2.5rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: 0 0 30px rgba(99, 102, 241, 0.3); }
.score-label { color: var(--text-dim); margin-top: 8px; }

.score-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; text-align: left; }
.score-item { padding: 10px; background: var(--bg-card); border-radius: 8px; font-size: 0.85rem; border: 1px solid var(--border); }
.score-item .label { color: var(--text-dim); font-size: 0.75rem; }
.score-item .value { font-weight: 600; font-size: 1rem; }
.score-comment { background: var(--bg-card); border-radius: 8px; padding: 16px; margin: 16px 0; font-style: italic; color: var(--text-dim); border: 1px solid var(--border); }

.truth-reveal { background: var(--bg-card); border-radius: 12px; padding: 16px; margin: 16px 0; text-align: left; border: 1px solid var(--border); }
.truth-reveal h3 { color: var(--gold); margin-bottom: 8px; }
.truth-reveal p { line-height: 1.8; }
.truth-compare { background: var(--bg-card); border-radius: 12px; padding: 16px; margin: 16px 0; text-align: left; border: 1px solid var(--border); }
.compare-section h4 { color: var(--accent); font-size: 0.9rem; margin-bottom: 8px; }
.compare-section p { color: var(--text-dim); font-size: 0.85rem; line-height: 1.8; }
.result-actions { margin-top: 24px; }

/* 谣言简报 */
.btn-rumors { background: #fef3c7 !important; border-color: var(--gold) !important; color: #92400e !important; }
.btn-rumors:hover { background: #fde68a !important; }

.rumor-event-info { background: var(--bg-card); border-radius: 10px; padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); }
.rumor-event-info h4 { color: var(--text); font-size: 1rem; margin-bottom: 6px; }
.rumor-surface { color: var(--text-dim); font-size: 0.85rem; line-height: 1.6; }
.rumor-list h4 { color: var(--gold); font-size: 0.9rem; margin-bottom: 12px; }

.rumor-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #fef3c7; border-radius: 10px; margin-bottom: 8px; font-size: 0.9rem; line-height: 1.6; border-left: 3px solid var(--gold); }
.rumor-text { flex: 1; }
.rumor-hint { margin-top: 6px; font-size: 0.78rem; color: var(--accent); font-style: italic; }
.rumor-tag { font-weight: 700; color: var(--gold); flex-shrink: 0; font-size: 1.1rem; }
.rumor-tip { margin-top: 16px; padding: 12px; background: rgba(99, 102, 241, 0.06); border-radius: 8px; font-size: 0.85rem; color: var(--text-dim); }

.hidden { display: none !important; }

/* ============ 线索计数器 ============ */
.clue-counter {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: #ecfdf5; color: var(--green);
  border-radius: 16px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid #a7f3d0;
  transition: all 0.3s ease;
  cursor: pointer;
}
.clue-counter:hover { background: #d1fae5; }
.clue-counter.pulse { animation: cluePulse 0.5s ease; }
@keyframes cluePulse {
  0% { transform: scale(1); background: #d1fae5; }
  50% { transform: scale(1.15); background: #a7f3d0; }
  100% { transform: scale(1); background: #ecfdf5; }
}

/* ============ Toast 通知 ============ */
#toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--bg); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  font-size: 0.9rem; max-width: 360px;
  animation: toastIn 0.4s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto; cursor: pointer;
}
.toast.clue-toast {
  border-left: 4px solid var(--green);
  background: #f0fdf4;
}
.toast .toast-icon { font-size: 1.3rem; flex-shrink: 0; }
.toast .toast-body { flex: 1; }
.toast .toast-title { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.toast .toast-text { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ============ 合作按钮 ============ */
.coop-buttons {
  display: flex; gap: 12px; justify-content: center; margin-bottom: 16px;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent); }

/* ============ 右侧面板 ============ */
.right-panel {
  width: 280px; min-width: 280px;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
}

/* ============ 人物关系图 ============ */
.relationship-graph {
  min-height: 350px;
  overflow: hidden;
}
.rel-svg { display: block; width: 100%; }
.rel-line { transition: stroke 0.3s; }
.rel-node { transition: all 0.2s; cursor: pointer; }
.rel-node:hover { filter: brightness(0.95); }
.rel-name { pointer-events: none; }

/* ============ 侦探推理板 ============ */
.corkboard-section { margin-bottom: 20px; }
.corkboard-section h3 { font-size: 0.95rem; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

.corkboard-clues {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 60px;
  padding: 8px;
  background: #fefce8;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.cork-clue-card {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: #fef3c7;
  border-radius: 8px;
  border: 1px solid #fde68a;
  font-size: 0.82rem;
  cursor: grab;
  transition: all 0.2s;
  max-width: 280px;
}
.cork-clue-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.cork-clue-card.dragging { opacity: 0.5; transform: scale(0.95); }
.cork-clue-badge { font-size: 1rem; flex-shrink: 0; }
.cork-clue-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cork-clue-source { color: var(--text-dim); font-size: 0.72rem; white-space: nowrap; }
.cork-empty { color: var(--text-dim); font-size: 0.82rem; text-align: center; width: 100%; padding: 12px; }

.corkboard-reason {
  min-height: 100px;
  padding: 12px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.8;
  outline: none;
}
.corkboard-reason:empty:before {
  content: attr(placeholder);
  color: var(--text-dim);
  pointer-events: none;
}
.corkboard-reason:focus { border-color: var(--accent); }
.cork-reason-clue {
  display: inline-block; padding: 2px 8px; margin: 2px;
  background: #fef3c7; border-radius: 4px; font-size: 0.82rem;
  border: 1px solid #fde68a;
}

/* 谣言传播记录 */
.corkboard-rumor-log {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.rumor-log-entry {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
}
.rumor-log-entry:last-child { margin-bottom: 0; }
.rumor-log-round {
  background: var(--accent); color: #fff; padding: 1px 6px;
  border-radius: 4px; font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.rumor-log-from { color: #1e40af; font-weight: 600; }
.rumor-log-arrow { color: var(--text-dim); }
.rumor-log-to { color: #991b1b; font-weight: 600; }
.rumor-log-fact {
  color: var(--text-dim); font-size: 0.72rem; font-style: italic;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rumor-log-time { color: var(--text-dim); font-size: 0.68rem; margin-left: auto; }

/* ============ 双人合作 ============ */
.coop-section {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0;
}
.coop-section.hidden { display: none; }
.coop-header {
  padding: 12px 16px; font-weight: 600; font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  background: #f0f4ff;
}

.partner-chat-msgs {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.partner-msg {
  padding: 6px 10px; border-radius: 8px; font-size: 0.82rem; line-height: 1.5;
  max-width: 90%;
}
.partner-msg.me { align-self: flex-end; background: #e0e7ff; color: var(--text); }
.partner-msg.them { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); }
.partner-msg-author { font-weight: 600; font-size: 0.72rem; color: var(--text-dim); display: block; margin-bottom: 2px; }

.partner-chat-input-row {
  display: flex; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--border);
}
#partner-chat-input {
  flex: 1; padding: 8px 12px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 0.82rem; outline: none;
}
#partner-chat-input:focus { border-color: var(--accent); }
#partner-chat-send {
  padding: 8px 14px; border-radius: 16px; border: none;
  background: var(--accent); color: white; cursor: pointer; font-size: 0.82rem; font-weight: 600;
}
#partner-chat-send:hover { background: var(--accent-light); }

/* ============ NPC锁定状态 ============ */
.npc-card.locked { opacity: 0.6; border-color: #f59e0b; background: #fffbeb; cursor: not-allowed; }
.npc-card.locked:hover { border-color: #f59e0b; background: #fffbeb; }
.npc-lock-badge {
  position: absolute; top: 6px; right: 6px;
  padding: 2px 8px; background: #fef3c7; color: #92400e;
  border-radius: 10px; font-size: 0.7rem; font-weight: 600;
  border: 1px solid #fde68a;
}

/* ============ 房间大厅 ============ */
.room-lobby { text-align: center; }
.room-code-box {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; margin-bottom: 16px;
  background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border);
}
.room-code-label { color: var(--text-dim); font-size: 0.9rem; }
.room-code-number {
  font-size: 2.5rem; font-weight: 700; color: var(--accent);
  letter-spacing: 8px; font-family: monospace;
}
.room-status { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .game-main { flex-direction: column; }
  .town-map { width: 100%; min-width: 100%; max-height: 30vh; border-right: none; border-bottom: 1px solid var(--border); }
  .npc-grid { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .npc-card { flex: 1 1 calc(50% - 6px); padding: 8px; gap: 8px; }
  .npc-avatar { width: 36px; height: 36px; font-size: 1.2rem; }
  .chat-messages { padding: 10px; }
  .message { max-width: 90%; }
  .chat-actions { gap: 4px; }
  .btn-action { padding: 4px 8px; font-size: 0.75rem; }
  .right-panel { width: 100%; min-width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 40vh; }
  .coop-section { max-height: 25vh; }
  .coop-buttons { flex-direction: column; align-items: center; }
  .chat-area { max-width: 100%; }
}

/* ============ 老虎机 ============ */
.modal-slot { max-width: 460px; text-align: center; }

.btn-slot { position: relative; }
.badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
  vertical-align: middle;
}

.slot-info {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.slot-info strong { color: var(--primary); font-size: 1.3rem; }

.slot-machine {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}

.slot-reels {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.slot-reel {
  width: 80px;
  height: 80px;
  background: #fef3c7;
  border: 3px solid #f59e0b;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.slot-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.08s linear;
  will-change: transform;
}

.slot-strip.spinning {
  transition: none;
}

.slot-symbol {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
}

.slot-reel.win {
  animation: slotWin 0.5s ease-in-out 3;
  border-color: #22c55e;
  background: #dcfce7;
  box-shadow: 0 0 25px rgba(34,197,94,0.5);
}

@keyframes slotWin {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.slot-result {
  min-height: 32px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--gold);
}

.btn-spin {
  font-size: 1.1rem;
  padding: 12px 32px;
  width: 100%;
}

.btn-redeem {
  font-size: 0.95rem;
  padding: 10px 24px;
  width: 100%;
  margin-top: 8px;
  background: var(--gold);
  border-color: #d97706;
  color: #fff;
}
.btn-redeem:disabled { background: #d1d5db; border-color: #9ca3af; color: #9ca3af; }
.btn-redeem:not(:disabled):hover { background: #d97706; }

.slot-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 12px;
}
