/* === module: player_dialogue === */
.player-dialogue-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.player-dialogue-overlay.active { display: flex; }

.player-dialogue-container {
  width: 600px;
  max-width: 90%;
  max-height: 80vh;
  background: #0f0f15;
  border: 2px solid #2a2a3a;
  border-radius: 16px;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.player-dialogue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #2a2a3a;
  background: #1a1a22;
}

.player-dialogue-header h3 {
  margin: 0;
  font-size: 18px;
  color: #74c0fc;
}

.dialogue-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.dialogue-close-btn:hover {
  background: #2a2a3a;
  color: #ddd;
}

.player-dialogue-selection,
.player-dialogue-trust,
.player-dialogue-input-section {
  padding: 20px 24px;
}

.dialogue-label {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 12px;
  display: block;
}

.dialogue-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.dialogue-char-btn {
  padding: 14px;
  background: #1a1a22;
  border: 2px solid #2a2a3a;
  border-radius: 8px;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.dialogue-char-btn:hover {
  background: #2a2a3a;
  border-color: #4a6fa5;
  transform: translateY(-2px);
}

.dialogue-char-btn.selected {
  background: #2a3a4a;
  border-color: #74c0fc;
}

.char-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.char-trust-mini {
  font-size: 11px;
  color: #888;
}

.player-dialogue-trust {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #1a1a22;
  border-top: 1px solid #2a2a3a;
  border-bottom: 1px solid #2a2a3a;
}

.trust-bar {
  flex: 1;
  height: 8px;
  background: #1a1a22;
  border: 1px solid #3a3a4a;
  border-radius: 4px;
  overflow: hidden;
}

.trust-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #fcc419, #51cf66);
  transition: width 0.3s ease;
}

.trust-value {
  font-size: 13px;
  color: #ddd;
  min-width: 60px;
}

.player-dialogue-history {
  max-height: 300px;
  overflow-y: auto;
  padding: 16px 24px;
  background: #0a0a0f;
  margin: 0;
}

.dialogue-message {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 8px;
  animation: messageSlideIn 0.3s ease;
}

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

.dialogue-message.player {
  background: #1a2a3a;
  margin-left: 40px;
  border-left: 3px solid #4a6fa5;
}

.dialogue-message.character {
  background: #2a1a2a;
  margin-right: 40px;
  border-left: 3px solid #c92a2a;
}

.dialogue-speaker {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
  font-weight: 500;
}

.dialogue-text {
  font-size: 14px;
  color: #ddd;
  line-height: 1.6;
}

.dialogue-trust-change {
  margin-top: 8px;
  font-size: 11px;
  color: #fcc419;
}

.dialogue-empty {
  text-align: center;
  color: #666;
  padding: 40px 20px;
  font-size: 13px;
}

.player-dialogue-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  background: #1a1a22;
  border: 1px solid #3a3a4a;
  border-radius: 8px;
  color: #ddd;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

.player-dialogue-textarea:focus {
  outline: none;
  border-color: #4a6fa5;
}

.player-dialogue-hint {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

.player-dialogue-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.dialogue-count {
  font-size: 12px;
  color: #888;
}

.player-dialogue-actions {
  display: flex;
  gap: 8px;
}

.player-dialogue-send-btn,
.player-dialogue-cancel-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.player-dialogue-send-btn {
  background: #4a6fa5;
  color: white;
}

.player-dialogue-send-btn:hover {
  background: #5a7fb5;
}

.player-dialogue-send-btn:disabled {
  background: #3a3a4a;
  cursor: not-allowed;
}

.player-dialogue-cancel-btn {
  background: #2a2a3a;
  color: #aaa;
}

.player-dialogue-cancel-btn:hover {
  background: #3a3a4a;
  color: #ddd;
}

/* === end module: player_dialogue === */
