/*
 * DM Control Panel & DM Mode Styles
 * ==================================
 * Styles for when the player assumes DM role
 */

/* ========================================
   DM Mode Body State
   ======================================== */

/* Add gold border to status bar when in DM mode */
body.dm-mode .status-bar {
  border-top: 2px solid var(--color-gold);
}

/* Change input border to gold in DM mode */
body.dm-mode .terminal-input-container input,
body.dm-mode .terminal-input-container textarea {
  border-color: var(--color-gold);
}

/* ========================================
   DM Narrative Styling
   ======================================== */

/* Gold left border for human DM narration */
.narrative-entry[data-content-type="dm_human"] {
  border-left: 3px solid var(--color-gold);
  padding-left: 0.75rem;
  background: rgba(212, 175, 55, 0.05);
}

.narrative-entry[data-content-type="dm_human"]::before {
  content: '[DM]';
  font-size: 0.75rem;
  color: var(--color-gold);
  font-weight: 600;
  margin-right: 0.5rem;
}

/* ========================================
   DM Control Panel
   ======================================== */

.dm-control-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-panel-bg, #1a1a2e);
  color: var(--color-text, #e0e0e0);
}

.dm-control-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border, #333);
  background: rgba(212, 175, 55, 0.1);
}

.dm-control-header .crown-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  animation: crown-pulse 2s ease-in-out infinite;
}

.dm-control-header .crown-icon .svg-icon,
.dm-control-header .crown-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes crown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.dm-control-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gold);
  flex: 1;
}

.dm-control-status {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Tab Navigation */
.dm-control-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border, #333);
  background: rgba(0, 0, 0, 0.2);
}

.dm-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.5rem 0.25rem;
  background: transparent;
  border: none;
  color: var(--color-text-muted, #888);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.dm-tab-icon {
  font-size: 1rem;
}

.dm-tab-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dm-tab:hover {
  color: var(--color-text, #e0e0e0);
  background: rgba(255, 255, 255, 0.05);
}

.dm-tab.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
  background: rgba(212, 175, 55, 0.05);
}

.dm-tab.active .dm-tab-icon {
  transform: scale(1.1);
}

/* Tab Content */
.dm-control-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.dm-tab-panel {
  display: none;
}

.dm-tab-panel.active {
  display: block;
}

/* ========================================
   Quick Narrate Section
   ======================================== */

.dm-narrate-section {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.dm-narrate-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}

.dm-narrate-icon {
  font-size: 1rem;
}

.dm-narrate-input {
  width: 100%;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border, #333);
  border-radius: 0.375rem;
  color: var(--color-text, #e0e0e0);
  font-family: inherit;
  font-size: 0.8125rem;
  resize: vertical;
  min-height: 3rem;
}

.dm-narrate-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.dm-narrate-input::placeholder {
  color: var(--color-text-muted, #888);
}

.dm-narrate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: var(--color-gold);
  border: none;
  border-radius: 0.375rem;
  color: #1a1a2e;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dm-narrate-btn:hover {
  background: #e5c453;
  transform: translateY(-1px);
}

.dm-narrate-btn:active {
  transform: translateY(0);
}

/* ========================================
   Scene Info Section
   ======================================== */

.dm-scene-info {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.dm-scene-info h4 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scene-info-icon {
  font-size: 0.875rem;
}

.dm-scene-details {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.dm-scene-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dm-scene-detail:last-child {
  border-bottom: none;
}

.dm-scene-detail .detail-label {
  font-size: 0.75rem;
  color: var(--color-text-muted, #888);
}

.dm-scene-detail .detail-value {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text, #e0e0e0);
}

.dm-scene-phase {
  padding: 0.125rem 0.375rem;
  background: rgba(212, 175, 55, 0.2);
  border-radius: 0.25rem;
  color: var(--color-gold);
}

/* Scene Actions */
.dm-scene-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.dm-tool-btn--scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
}

.dm-tool-btn--scene .btn-icon {
  font-size: 1.25rem;
}

.dm-tool-btn--scene .btn-label {
  font-size: 0.6875rem;
}

/* Tool Palette */
.dm-tool-category {
  margin-bottom: 0.875rem;
}

.dm-tool-category h4 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 0.5rem 0;
  font-size: 0.6875rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-icon {
  font-size: 0.875rem;
}

.dm-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
}

.dm-tool-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border, #333);
  border-radius: 0.25rem;
  color: var(--color-text, #e0e0e0);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.dm-tool-btn .btn-icon {
  font-size: 0.875rem;
  flex-shrink: 0;
}

.dm-tool-btn .btn-label {
  flex: 1;
  font-size: 0.6875rem;
}

.dm-tool-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.dm-tool-btn:active {
  transform: translateY(0);
}

/* Tool Button Variants */
.dm-tool-btn--danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.dm-tool-btn--danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-error, #ef4444);
}

.dm-tool-btn--success {
  border-color: rgba(34, 197, 94, 0.3);
}

.dm-tool-btn--success:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
}

.dm-tool-btn--warning {
  border-color: rgba(234, 179, 8, 0.3);
}

.dm-tool-btn--warning:hover {
  background: rgba(234, 179, 8, 0.2);
  border-color: #eab308;
}

/* ========================================
   NPC Section
   ======================================== */

.dm-npc-header {
  margin-bottom: 0.75rem;
}

.dm-npc-header h4 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-gold);
}

.npc-header-icon {
  font-size: 1rem;
}

.dm-npc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.dm-npc-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.dm-npc-item:hover {
  border-color: rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.3);
}

.dm-npc-avatar {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  flex-shrink: 0;
}

.npc-avatar-icon {
  font-size: 1rem;
}

.dm-npc-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dm-npc-name {
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-npc-type {
  font-size: 0.6875rem;
  color: var(--color-text-muted, #888);
  text-transform: capitalize;
}

.dm-npc-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.dm-npc-action-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid var(--color-border, #333);
  border-radius: 0.25rem;
  color: var(--color-text, #e0e0e0);
  font-size: 0.675rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dm-npc-action-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-gold);
}

.dm-npc-speak-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

/* Quick Add NPC */
.dm-npc-quick-add {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  padding: 0.75rem;
  border: 1px dashed var(--color-border, #333);
}

.dm-quick-add-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.dm-quick-add-row {
  display: flex;
  gap: 0.375rem;
}

.dm-npc-name-input {
  flex: 1;
  padding: 0.375rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border, #333);
  border-radius: 0.25rem;
  color: var(--color-text, #e0e0e0);
  font-size: 0.8125rem;
}

.dm-npc-name-input:focus {
  outline: none;
  border-color: var(--color-gold);
}

.dm-npc-name-input::placeholder {
  color: var(--color-text-muted, #888);
}

.dm-add-npc-btn {
  flex-shrink: 0;
}

/* ========================================
   AI Assist Section
   ======================================== */

.dm-assist-header {
  margin-bottom: 0.75rem;
}

.dm-assist-header h4 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-gold);
}

.assist-header-icon {
  font-size: 1rem;
}

.dm-assist-description {
  margin: 0.25rem 0 0 0;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #888);
}

.dm-assist-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dm-assist-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border, #333);
  border-radius: 0.5rem;
  color: var(--color-text, #e0e0e0);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.dm-assist-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-gold);
  transform: translateX(2px);
}

.assist-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.assist-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.assist-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-text, #e0e0e0);
}

.assist-desc {
  font-size: 0.6875rem;
  color: var(--color-text-muted, #888);
}

/* ========================================
   Empty State
   ======================================== */

.dm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted, #888);
}

.dm-empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.dm-empty-state p {
  margin: 0;
  font-size: 0.8125rem;
}

.dm-empty-state .empty-hint {
  font-size: 0.6875rem;
  margin-top: 0.25rem;
  opacity: 0.7;
}

/* ========================================
   Exit DM Mode Button
   ======================================== */

.dm-exit-container {
  padding: 0.75rem;
  border-top: 1px solid var(--color-border, #333);
  margin-top: auto;
}

.dm-exit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-error, #ef4444);
  border-radius: 0.375rem;
  color: var(--color-error, #ef4444);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dm-exit-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

.dm-exit-btn:active {
  transform: translateY(0);
}

.dm-exit-btn .exit-icon {
  font-size: 1rem;
}

.dm-exit-btn .exit-label {
  font-size: 0.8125rem;
}

/* ========================================
   DM Insights Section
   ======================================== */

.dm-insights {
  margin-top: 0.75rem;
}

.dm-insights-section {
  background: rgba(138, 43, 226, 0.05);
  border: 1px solid rgba(138, 43, 226, 0.2);
  border-radius: 0.5rem;
  overflow: hidden;
}

.dm-insights-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(138, 43, 226, 0.1);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.dm-insights-header:hover {
  background: rgba(138, 43, 226, 0.15);
}

.insights-icon {
  font-size: 1rem;
}

.insights-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #a855f7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dm-insights-content {
  padding: 0.75rem;
}

.dm-insight-group {
  margin-bottom: 0.75rem;
}

.dm-insight-group:last-child {
  margin-bottom: 0;
}

.dm-insight-group h5 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 0.375rem 0;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insight-icon {
  font-size: 0.75rem;
}

.dm-insight-empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted, #888);
  opacity: 0.7;
}

/* Rolls Log */
.dm-rolls-log {
  max-height: 100px;
  overflow-y: auto;
}

.dm-roll-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.375rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
}

.dm-roll-item:last-child {
  margin-bottom: 0;
}

.roll-expression {
  font-family: var(--font-family-mono, monospace);
  color: var(--color-gold);
}

.roll-result {
  font-weight: 600;
  color: var(--color-text, #e0e0e0);
}

.roll-purpose {
  color: var(--color-text-muted, #888);
  font-size: 0.625rem;
}

/* World State */
.dm-world-state {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dm-state-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.375rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.state-label {
  color: var(--color-text-muted, #888);
}

.state-value {
  font-weight: 500;
  color: var(--color-text, #e0e0e0);
}

.dm-danger-low {
  color: #22c55e;
}

.dm-danger-medium {
  color: #eab308;
}

.dm-danger-high {
  color: #ef4444;
}

.dm-danger-extreme {
  color: #dc2626;
  font-weight: 700;
}

/* Scene Stakes */
.dm-scene-stakes {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.375rem;
  padding: 0.5rem;
}

.dm-scene-stakes p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-error, #ef4444);
}

/* Tool History */
.dm-tool-history {
  max-height: 100px;
  overflow-y: auto;
}

.dm-tool-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.375rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
}

.dm-tool-log-item:last-child {
  margin-bottom: 0;
}

.tool-name {
  color: var(--color-text, #e0e0e0);
}

.tool-time {
  color: var(--color-text-muted, #888);
  font-size: 0.625rem;
}

/* ========================================
   DM Tool Modal
   ======================================== */

.dm-tool-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dm-tool-modal--open {
  opacity: 1;
  pointer-events: auto;
}

.dm-tool-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.dm-tool-modal__content {
  position: relative;
  background: var(--color-panel-bg, #1a1a2e);
  border: 2px solid var(--color-gold);
  border-radius: 0.5rem;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.1);
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s ease;
}

.dm-tool-modal--open .dm-tool-modal__content {
  transform: scale(1) translateY(0);
}

.dm-tool-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(212, 175, 55, 0.1);
  border-bottom: 1px solid var(--color-border, #333);
}

.dm-tool-modal__header h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gold);
}

.dm-tool-modal__close {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #888);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}

.dm-tool-modal__close:hover {
  color: var(--color-text, #e0e0e0);
}

.dm-tool-modal__body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.dm-tool-modal__field {
  margin-bottom: 0.875rem;
}

.dm-tool-modal__field:last-child {
  margin-bottom: 0;
}

.dm-tool-modal__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted, #888);
  margin-bottom: 0.375rem;
  text-transform: capitalize;
}

.dm-tool-modal__input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border, #333);
  border-radius: 0.375rem;
  color: var(--color-text, #e0e0e0);
  font-family: inherit;
  font-size: 0.875rem;
}

.dm-tool-modal__input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.dm-tool-modal__input::placeholder {
  color: var(--color-text-muted, #888);
}

.dm-tool-modal__textarea {
  min-height: 80px;
  resize: vertical;
}

.dm-tool-modal__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

.dm-tool-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border, #333);
  background: rgba(0, 0, 0, 0.2);
}

.dm-tool-modal__btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dm-tool-modal__btn--cancel {
  background: transparent;
  border: 1px solid var(--color-border, #333);
  color: var(--color-text-muted, #888);
}

.dm-tool-modal__btn--cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text, #e0e0e0);
}

.dm-tool-modal__btn--submit {
  background: var(--color-gold);
  border: none;
  color: #1a1a2e;
}

.dm-tool-modal__btn--submit:hover {
  background: #e5c453;
}

/* Quick presets for common values */
.dm-tool-modal__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.dm-tool-modal__preset {
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border, #333);
  border-radius: 0.25rem;
  color: var(--color-text-muted, #888);
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dm-tool-modal__preset:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-gold);
  color: var(--color-text, #e0e0e0);
}

/* ========================================
   SVG Icon Sizing
   ========================================
   SVGs don't respond to font-size, so we need explicit sizing.
   These rules ensure icons inherit container dimensions.
*/

/* Tab icons - 1rem */
.dm-tab-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.dm-tab-icon svg,
.dm-tab-icon .svg-icon,
.dm-tab-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Scene info icons - 0.875rem */
.scene-info-icon {
  display: inline-flex;
  width: 0.875rem;
  height: 0.875rem;
}

.scene-info-icon svg,
.scene-info-icon .svg-icon,
.scene-info-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Narrate icon - 1rem */
.dm-narrate-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.dm-narrate-icon svg,
.dm-narrate-icon .svg-icon,
.dm-narrate-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Category icons - 0.875rem */
.category-icon {
  display: inline-flex;
  width: 0.875rem;
  height: 0.875rem;
}

.category-icon svg,
.category-icon .svg-icon,
.category-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* NPC header icon - 1rem */
.npc-header-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.npc-header-icon svg,
.npc-header-icon .svg-icon,
.npc-header-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* NPC avatar icon - 1rem */
.npc-avatar-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.npc-avatar-icon svg,
.npc-avatar-icon .svg-icon,
.npc-avatar-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Assist header icon - 1rem */
.assist-header-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.assist-header-icon svg,
.assist-header-icon .svg-icon,
.assist-header-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Assist button icon - 1.25rem */
.assist-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.assist-icon svg,
.assist-icon .svg-icon,
.assist-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Insights header icon - 1rem */
.insights-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.insights-icon svg,
.insights-icon .svg-icon,
.insights-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Individual insight icons - 0.75rem */
.insight-icon {
  display: inline-flex;
  width: 0.75rem;
  height: 0.75rem;
}

.insight-icon svg,
.insight-icon .svg-icon,
.insight-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Exit button icon - 1rem */
.exit-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.exit-icon svg,
.exit-icon .svg-icon,
.exit-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Tool button icons - 0.875rem */
.dm-tool-btn .btn-icon {
  display: inline-flex;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.dm-tool-btn .btn-icon svg,
.dm-tool-btn .btn-icon .svg-icon,
.dm-tool-btn .btn-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Scene tool button icons - 1.25rem */
.dm-tool-btn--scene .btn-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
}

.dm-tool-btn--scene .btn-icon svg,
.dm-tool-btn--scene .btn-icon .svg-icon,
.dm-tool-btn--scene .btn-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* Empty state icons - 2rem */
.dm-empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.dm-empty-state .empty-icon svg,
.dm-empty-state .empty-icon .svg-icon,
.dm-empty-state .empty-icon .svg-icon svg {
  width: 100%;
  height: 100%;
}

/* ========================================
   Cards Tab Styles
   ======================================== */

/* Cards section headers */
.dm-cards-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  margin-bottom: 1rem;
}

.dm-cards-header h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cards-header-icon {
  color: var(--color-gold);
}

/* Cards sections */
.dm-cards-section {
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
}

.dm-section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted, #a0a0a0);
  margin-bottom: 0.75rem;
}

.section-icon {
  opacity: 0.7;
}

/* Deck buttons grid */
.dm-deck-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.dm-deck-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.25rem;
  background: var(--color-panel-bg-lighter, #252538);
  border: 1px solid var(--color-border, #333348);
  border-radius: 0.375rem;
  color: var(--color-text, #e0e0e0);
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.25rem;
}

.dm-deck-btn:hover {
  background: var(--color-panel-bg-hover, #2a2a40);
  border-color: var(--color-border-hover, #444460);
}

.dm-deck-btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

.deck-icon {
  font-size: 1.25rem;
  opacity: 0.9;
}

.deck-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

/* Deck type colors */
.dm-deck-btn--quest:hover { border-color: #22c55e; }
.dm-deck-btn--encounter:hover { border-color: #ef4444; }
.dm-deck-btn--npc:hover { border-color: #a855f7; }
.dm-deck-btn--event:hover { border-color: #f97316; }
.dm-deck-btn--mixed:hover { border-color: var(--color-gold); }

/* Hand section */
.dm-card-hand {
  min-height: 120px;
  background: var(--color-panel-bg-dark, #151525);
  border-radius: 0.375rem;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hand-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: 0.25rem;
}

/* Empty hand state */
.dm-empty-hand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--color-text-muted);
}

.dm-empty-hand .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.3;
}

.dm-empty-hand p {
  margin: 0;
  font-size: 0.875rem;
}

.dm-empty-hand .empty-hint {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* Hand cards */
.dm-hand-card {
  flex: 0 0 calc(50% - 0.25rem);
  background: var(--color-panel-bg-lighter, #252538);
  border: 1px solid var(--color-border, #333348);
  border-radius: 0.375rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.dm-hand-card:hover {
  border-color: var(--color-border-hover, #444460);
}

.dm-hand-card--playing {
  animation: card-play 0.3s ease-out;
}

.dm-hand-card--discarding {
  animation: card-discard 0.3s ease-out;
}

@keyframes card-play {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

@keyframes card-discard {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* Rarity colors */
.dm-hand-card--common { border-left: 3px solid #6b7280; }
.dm-hand-card--uncommon { border-left: 3px solid #22c55e; }
.dm-hand-card--rare { border-left: 3px solid #3b82f6; }
.dm-hand-card--legendary { border-left: 3px solid #a855f7; }

.dm-hand-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dm-hand-card__icon {
  font-size: 1rem;
}

.dm-hand-card__rarity {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.6;
}

.dm-hand-card__title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.dm-hand-card__type {
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.dm-hand-card__teaser {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dm-hand-card__actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.dm-hand-card__btn {
  flex: 1;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dm-hand-card__btn--play {
  background: var(--color-gold);
  color: #1a1a2e;
  border: none;
}

.dm-hand-card__btn--play:hover {
  background: #e6c04a;
}

.dm-hand-card__btn--discard {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.dm-hand-card__btn--discard:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Deck stats */
.dm-stats-details {
  background: var(--color-panel-bg-dark, #151525);
  border-radius: 0.375rem;
  overflow: hidden;
}

.dm-stats-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.dm-stats-summary:hover {
  background: var(--color-panel-bg-lighter);
}

.stats-icon {
  opacity: 0.7;
}

.stats-title {
  font-weight: 500;
}

.dm-stats-content {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dm-deck-stat {
  flex: 1 1 calc(50% - 0.25rem);
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  background: var(--color-panel-bg-lighter, #252538);
  border-radius: 0.25rem;
}

.dm-deck-stat .stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.dm-deck-stat .stat-value {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ========================================
   Tactical Suggestions Section
   ======================================== */

.dm-tactical-group {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 0.75rem;
}

.dm-tactical-group h5 {
  color: var(--color-error, #ef4444);
}

.dm-tactical-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dm-tactical-summary-item {
  display: flex;
  flex-direction: column;
  padding: 0.375rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.25rem;
  min-width: 60px;
}

.tactical-label {
  font-size: 0.625rem;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tactical-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text, #e0e0e0);
  text-transform: capitalize;
}

/* Urgency indicators */
.dm-urgency-low {
  color: #22c55e;
}

.dm-urgency-medium {
  color: #eab308;
}

.dm-urgency-high {
  color: #f97316;
}

.dm-urgency-critical {
  color: #ef4444;
  font-weight: 700;
  animation: urgency-pulse 1s ease-in-out infinite;
}

@keyframes urgency-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Tactical details */
.dm-tactical-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dm-tactical-threats,
.dm-tactical-opportunities {
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
}

.dm-tactical-threats h6,
.dm-tactical-opportunities h6 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.375rem 0;
}

.dm-tactical-threats h6 {
  color: #ef4444;
}

.dm-tactical-opportunities h6 {
  color: #22c55e;
}

.dm-tactical-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dm-tactical-item {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  padding: 0.25rem 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.dm-tactical-threat {
  color: var(--color-text, #e0e0e0);
  border-left: 2px solid #ef4444;
  padding-left: 0.375rem;
  margin-left: 0.125rem;
}

.dm-tactical-opportunity {
  color: var(--color-text, #e0e0e0);
  border-left: 2px solid #22c55e;
  padding-left: 0.375rem;
  margin-left: 0.125rem;
}

.threat-icon,
.opp-icon {
  flex-shrink: 0;
  font-size: 0.875rem;
}

.threat-text,
.opp-text {
  flex: 1;
}
