/**
 * Components CSS - UI Components
 * Stat bars, exits, creatures, items, and other interactive elements
 */

/* ============================================
   Game Time Display (Phase 15.1)
   ============================================ */

.game-time-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 4px;
  font-size: 13px;
  margin: 8px 0;
  transition: all 0.3s ease;
}

.time-icon {
  font-size: 16px;
  line-height: 1;
}

.time-text {
  font-weight: bold;
  color: var(--theme-text-primary);
  font-family: var(--theme-font-mono, monospace);
}

.time-period {
  color: var(--theme-text-muted);
  font-size: 11px;
  text-transform: capitalize;
  padding: 2px 6px;
  background: var(--theme-bg-primary);
  border-radius: 3px;
}

/* Period-based styling */
.game-time-display.period-dawn {
  border-color: rgba(255, 183, 77, 0.4);
  background: rgba(255, 183, 77, 0.05);
}

.game-time-display.period-dawn .time-period {
  color: #FFB74D;
}

.game-time-display.period-day {
  border-color: rgba(255, 235, 59, 0.4);
  background: rgba(255, 235, 59, 0.05);
}

.game-time-display.period-day .time-period {
  color: #FFEB3B;
}

.game-time-display.period-dusk {
  border-color: rgba(255, 138, 101, 0.4);
  background: rgba(255, 138, 101, 0.05);
}

.game-time-display.period-dusk .time-period {
  color: #FF8A65;
}

.game-time-display.period-night {
  border-color: rgba(121, 134, 203, 0.4);
  background: rgba(121, 134, 203, 0.05);
}

.game-time-display.period-night .time-period {
  color: #7986CB;
}

/* ============================================
   Draggable Window States
   ============================================ */

/* Applied to window while being dragged */
.window-dragging {
  transition: none !important;
  user-select: none;
}

/* Applied to drag handle elements */
.window-drag-handle {
  cursor: move;
  user-select: none;
}

.window-drag-handle:active {
  cursor: grabbing;
}

/* Optional: Highlight active window (topmost z-index) */
.window-active {
  border-color: var(--theme-room-name);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
}

/* ============================================
   Weather/Time Overlay Isolation
   Prevents mix-blend-mode effects from body::before/after
   from darkening UI windows during storms or at night
   ============================================ */
.window,
.draggable-window,
.inventory-window,
.container-window,
.casting-overlay,
.context-menu,
.item-tooltip,
.inventory-context-menu,
.split-stack-modal,
#knowledge-window,
#quest-window,
#shop-window,
#currency-selector-window,
#tradeskills-window,
#recipes-window,
#trainer-window,
#inventory-window,
#character-sheet-window,
[id^="container-window-"] {
  isolation: isolate;
  mix-blend-mode: normal;
}

/* ============================================
   Auto-Attack Indicator
   ============================================ */

/* Pulsing red border on target section when auto-attacking */
#target-section.auto-attacking {
  border: 2px solid rgba(255, 0, 0, 0.8);
  animation: attackPulse 2s ease-in-out infinite;
}

@keyframes attackPulse {
  0%, 100% {
    border-color: rgba(255, 0, 0, 0.6);
    box-shadow: 0 0 0 rgba(255, 0, 0, 0);
  }
  50% {
    border-color: rgba(255, 0, 0, 1.0);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
  }
}

/* Attack icon indicator */
.attack-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 16px;
  animation: attackIconPulse 1s ease-in-out infinite;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

@keyframes attackIconPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ============================================
   Stat Bars
   ============================================ */
.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--theme-spacing-sm);
}

.bar-label {
  color: var(--theme-text-muted);
  font-size: 11px;
  min-width: 25px;
  text-align: right;
}

.bar-container {
  flex: 1;
  height: var(--layout-stat-bar-height);
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width var(--theme-transition-speed) ease, 
              background-color var(--theme-transition-speed) ease;
}

/* Health bar colors based on percentage */
.health-fill {
  background: var(--theme-health-high);
}

.health-fill[data-percent="medium"] {
  background: var(--theme-health-medium);
}

.health-fill[data-percent="low"] {
  background: var(--theme-health-low);
}

.health-fill[data-percent="critical"] {
  background: var(--theme-health-critical);
}

.mana-fill {
  background: var(--theme-mana);
}

.stamina-fill {
  background: var(--theme-stamina);
}

.chi-fill {
  background: linear-gradient(to right, #c9a226, #ffd700, #c9a226);
}

.exp-fill {
  background: var(--theme-exp);
}

.bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: white;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
}

/* Target/Group health bars */
.health-bar-container,
.mana-bar-container,
.stamina-bar-container {
  position: relative;
  height: 14px;
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 2px;
  margin: 3px 0;
}

.health-bar,
.mana-bar,
.stamina-bar {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.health-bar-fill,
.mana-bar-fill,
.stamina-bar-fill {
  height: 100%;
  transition: width var(--theme-transition-speed);
}

.health-bar-fill {
  background: var(--theme-health-high);
}

.mana-bar-fill {
  background: var(--theme-mana);
}

.stamina-bar-fill {
  background: var(--theme-stamina);
}

.health-text,
.mana-text,
.stamina-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: white;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

/* ============================================
   Casting Bar
   ============================================ */
.casting-bar-container {
  position: relative;
  margin: 6px 0;
  padding: 4px;
  background: rgba(138, 43, 226, 0.1);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 3px;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(138, 43, 226, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
  }
}

.casting-label {
  font-size: 11px;
  color: var(--theme-text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.spell-name {
  color: #DA70D6;
  font-weight: bold;
}

.interruptible-indicator {
  color: #FFA500;
  font-size: 12px;
  margin-left: auto;
}

.cast-bar {
  height: 14px;
  background: var(--theme-bg-primary);
  border: 1px solid rgba(138, 43, 226, 0.5);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.cast-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B00FF 0%, #DA70D6 100%);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
}

.cast-time-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
  font-weight: bold;
  pointer-events: none;
}

/* ============================================
   Self-Casting Bar Overlay
   ============================================ */

/* Casting overlay - positioned fixed above hotkey bar, left of compass rose */
.casting-overlay {
  position: fixed;
  bottom: 81px; /* 42px (hotkey bar) + 36px (command area) + 3px gap = total bottom clearance */
  right: 416px; /* 312px (compass right) + 100px (compass width) + 4px gap */
  width: 300px;
  background: rgba(138, 43, 226, 0.2); /* Default purple/arcane */
  border: 2px solid rgba(138, 43, 226, 0.6);
  border-radius: 4px;
  padding: 10px 14px;
  animation: pulse-glow 1.5s ease-in-out infinite;
  backdrop-filter: blur(3px);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.4);
  z-index: 1000; /* Above hotkey bar and other UI elements */
}

/* Spell name color - default purple */
.casting-overlay .spell-name {
  color: #DA70D6;
}

/* Cast bar fill - default purple gradient */
.casting-overlay .cast-bar-fill {
  background: linear-gradient(90deg, #8B00FF 0%, #DA70D6 100%);
}

/* Category-based colors for casting bar background, border, and content */
.casting-overlay.category-healing {
  background: rgba(79, 195, 247, 0.2); /* Blue for healing */
  border-color: rgba(79, 195, 247, 0.6);
  box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.casting-overlay.category-healing .spell-name {
  color: #4FC3F7;
}

.casting-overlay.category-healing .cast-bar-fill {
  background: linear-gradient(90deg, #039BE5 0%, #4FC3F7 100%);
}

.casting-overlay.category-damage {
  background: rgba(255, 107, 107, 0.2); /* Red for damage spells */
  border-color: rgba(255, 107, 107, 0.6);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.casting-overlay.category-damage .spell-name {
  color: #FF6B6B;
}

.casting-overlay.category-damage .cast-bar-fill {
  background: linear-gradient(90deg, #E53935 0%, #FF6B6B 100%);
}

.casting-overlay.category-buff {
  background: rgba(102, 187, 106, 0.2); /* Green for buffs */
  border-color: rgba(102, 187, 106, 0.6);
  box-shadow: 0 4px 12px rgba(102, 187, 106, 0.4);
}

.casting-overlay.category-buff .spell-name {
  color: #66BB6A;
}

.casting-overlay.category-buff .cast-bar-fill {
  background: linear-gradient(90deg, #43A047 0%, #66BB6A 100%);
}

.casting-overlay.category-melee {
  background: rgba(255, 138, 101, 0.2); /* Orange for melee */
  border-color: rgba(255, 138, 101, 0.6);
  box-shadow: 0 4px 12px rgba(255, 138, 101, 0.4);
}

.casting-overlay.category-melee .spell-name {
  color: #FF8A65;
}

.casting-overlay.category-melee .cast-bar-fill {
  background: linear-gradient(90deg, #F4511E 0%, #FF8A65 100%);
}

.casting-overlay.category-debuff {
  background: rgba(255, 167, 38, 0.2); /* Orange/purple for debuffs */
  border-color: rgba(255, 167, 38, 0.6);
  box-shadow: 0 4px 12px rgba(255, 167, 38, 0.4);
}

.casting-overlay.category-debuff .spell-name {
  color: #FFA726;
}

.casting-overlay.category-debuff .cast-bar-fill {
  background: linear-gradient(90deg, #FB8C00 0%, #FFA726 100%);
}

.casting-overlay.category-utility {
  background: rgba(77, 208, 225, 0.2); /* Cyan for utility */
  border-color: rgba(77, 208, 225, 0.6);
  box-shadow: 0 4px 12px rgba(77, 208, 225, 0.4);
}

.casting-overlay.category-utility .spell-name {
  color: #4DD0E1;
}

.casting-overlay.category-utility .cast-bar-fill {
  background: linear-gradient(90deg, #00ACC1 0%, #4DD0E1 100%);
}

/* Interrupted state styling */
.casting-overlay.interrupted {
  animation: flash-red 0.3s ease-out;
  border-color: rgba(244, 67, 54, 0.6);
}

/* Red flash animation for interruptions */
@keyframes flash-red {
  0% {
    background: rgba(244, 67, 54, 0.3);
  }
  100% {
    background: rgba(138, 43, 226, 0.2);
  }
}

/* ============================================
   Exits
   ============================================ */
.exits-list {
  display: flex;
  gap: var(--theme-spacing-sm);
  flex-wrap: wrap;
}

.exit {
  color: #2874A6; /* Match room context button styling */
  cursor: pointer;
  padding: 4px 8px;
  background: rgba(40, 116, 166, 0.1);
  border: 1px solid rgba(40, 116, 166, 0.3);
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 14px;
  user-select: none;
  display: inline-block;
}

.exit:hover {
  background: rgba(40, 116, 166, 0.2);
  border-color: rgba(40, 116, 166, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   Creatures
   ============================================ */
.creatures-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.creature {
  cursor: pointer;
  padding: 2px 6px;
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  transition: all var(--theme-transition-speed);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
}

.creature:hover {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-border-highlight);
}

/* Creature types */
.creature.player {
  color: var(--theme-player-other);
}

.creature.friendly {
  color: var(--theme-faction-friendly);
}

.creature.neutral {
  color: var(--theme-faction-neutral);
}

.creature.hostile {
  color: var(--theme-faction-hostile);
}

.creature.enemy {
  color: var(--theme-faction-enemy);
}

/* Target indicator styles */
.creature.targeted {
  box-shadow: 0 0 4px #ffff00;
  border-bottom: 1px solid #ffff00;
  animation: targetPulse 2s ease-in-out infinite;
}

@keyframes targetPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Different highlight for hostile vs friendly targets */
.creature.targeted.hostile {
  box-shadow: 0 0 4px #FFA500;
  border-bottom: 1px solid #FFA500;
}

.creature.targeted.friendly {
  box-shadow: 0 0 4px #90EE90;
  border-bottom: 1px solid #90EE90;
}

.creature-separator {
  color: var(--theme-border-primary);
  margin: 0 4px;
}

/* Health indicators for creatures */
.creature-health {
  font-size: 10px;
  margin-left: 2px;
}

.creature-faction {
  margin-left: 2px;
}

/* Group member icon styling */
.group-member-icon {
  /* Use filter to tint the emoji green since color doesn't work on emojis */
  filter: hue-rotate(230deg) brightness(1.2) saturate(1.5);
  display: inline-block;
}

/* Pet label in room creature list */
.pet-label {
  opacity: 0.6;
  font-size: 0.9em;
}

/* ============================================
   Items
   ============================================ */
.items-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.item {
  color: var(--theme-item-color);
  cursor: pointer;
  padding: 2px 6px;
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  transition: all var(--theme-transition-speed);
  font-size: 13px;
}

.item:hover {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-item-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.item.corpse {
  color: var(--theme-corpse-color);
}

/* ============================================
   Harvest Action Buttons (Inline on corpses)
   ============================================ */
.harvest-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
  border-left: 1px solid var(--theme-border-secondary);
  padding-left: 6px;
  vertical-align: middle;
}

.harvest-btn {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
  padding: 2px;
  background: var(--theme-bg-primary);
  border: 1px solid var(--theme-border-secondary);
}

.harvest-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.harvest-btn:hover img {
  opacity: 1;
}

/* Con-colored harvest buttons */
.harvest-btn.con-easy {
  background: rgba(144, 238, 144, 0.2);
  border-color: rgba(144, 238, 144, 0.5);
}
.harvest-btn.con-easy:hover {
  background: rgba(144, 238, 144, 0.4);
  border-color: #90EE90;
}

.harvest-btn.con-advantage {
  background: rgba(135, 206, 235, 0.2);
  border-color: rgba(135, 206, 235, 0.5);
}
.harvest-btn.con-advantage:hover {
  background: rgba(135, 206, 235, 0.4);
  border-color: #87CEEB;
}

.harvest-btn.con-even {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}
.harvest-btn.con-even:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #FFFFFF;
}

.harvest-btn.con-challenging {
  background: rgba(255, 165, 0, 0.2);
  border-color: rgba(255, 165, 0, 0.5);
}
.harvest-btn.con-challenging:hover {
  background: rgba(255, 165, 0, 0.4);
  border-color: #FFA500;
}

.harvest-btn.con-dangerous {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.5);
}
.harvest-btn.con-dangerous:hover {
  background: rgba(255, 0, 0, 0.4);
  border-color: #FF0000;
}

.harvest-btn.con-extreme {
  background: rgba(139, 0, 139, 0.2);
  border-color: rgba(139, 0, 139, 0.5);
}
.harvest-btn.con-extreme:hover {
  background: rgba(139, 0, 139, 0.4);
  border-color: #8B008B;
}

.harvest-btn.done {
  background: rgba(102, 102, 102, 0.2);
  border-color: rgba(102, 102, 102, 0.3);
  opacity: 0.5;
  cursor: default;
}

.harvest-btn .harvest-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  margin-bottom: 4px;
  color: var(--theme-text-secondary);
}

.harvest-btn:hover .harvest-tooltip {
  opacity: 1;
}

.item-separator {
  color: var(--theme-border-primary);
  margin: 0 4px;
}

/* ============================================
   Command Buttons (Inline clickable commands)
   ============================================ */
.cmd-btn {
  display: inline-block;
  background: var(--theme-bg-secondary);
  color: var(--theme-exit-color);
  border: 1px solid var(--theme-border-secondary);
  padding: 1px 6px;
  margin: 0 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border-radius: 2px;
  transition: all 0.2s;
  text-decoration: none;
  vertical-align: baseline;
  line-height: 1.2;
}

.cmd-btn:hover {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-exit-color);
  color: var(--theme-exit-color);
  box-shadow: 0 0 3px rgba(135, 206, 235, 0.3);
}

.cmd-btn:active {
  transform: translateY(1px);
}

/* Primary action buttons (accept/join/yes) */
.cmd-btn.primary {
  color: var(--theme-room-name);
  border-color: #2a4a2a;
}

.cmd-btn.primary:hover {
  background: #2a4a2a;
  border-color: var(--theme-room-name);
  color: var(--theme-room-name);
  box-shadow: 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Danger action buttons (decline/refuse/no) */
.cmd-btn.danger {
  color: #FF6B6B;
  border-color: #4a2a2a;
}

.cmd-btn.danger:hover {
  background: #4a2a2a;
  border-color: #FF6B6B;
  color: #FF6B6B;
  box-shadow: 0 0 3px rgba(255, 107, 107, 0.3);
}

/* ============================================
   Reactive Combat Prompts
   ============================================ */
.reactive-prompt-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.reactive-trigger-msg {
  color: var(--theme-text-secondary, #b0b0b0);
  font-size: 0.9em;
}

.reactive-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--theme-warning, #d4a017);
  border-radius: 4px;
  background: color-mix(in srgb, var(--theme-warning, #d4a017) 10%, transparent);
  color: var(--theme-warning, #d4a017);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, opacity 0.3s;
}

.reactive-btn:hover {
  background: color-mix(in srgb, var(--theme-warning, #d4a017) 25%, transparent);
  box-shadow: 0 0 4px color-mix(in srgb, var(--theme-warning, #d4a017) 30%, transparent);
}

.reactive-btn-name {
  position: relative;
  z-index: 1;
}

.reactive-btn-hotkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  height: 18px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--theme-warning, #d4a017) 30%, transparent);
  color: var(--theme-warning, #d4a017);
  font-size: 0.75em;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

.reactive-countdown-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--theme-warning, #d4a017);
  transform-origin: left;
  animation: reactive-countdown linear forwards;
}

@keyframes reactive-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.reactive-btn.faded {
  opacity: 0.4;
  pointer-events: none;
  border-color: var(--theme-text-muted, #666);
  color: var(--theme-text-muted, #888);
}

.reactive-btn.faded .reactive-btn-hotkey,
.reactive-btn.faded .reactive-countdown-bar {
  display: none;
}

.reactive-btn.used {
  pointer-events: none;
  opacity: 0.5;
  background: transparent;
  border-color: var(--theme-text-muted, #666);
  color: var(--theme-text-muted, #888);
  box-shadow: none;
  animation: reactive-used-flash 0.4s ease-out;
}

.reactive-btn.used .reactive-countdown-bar,
.reactive-btn.used .reactive-btn-hotkey {
  display: none;
}

@keyframes reactive-used-flash {
  0% { background: color-mix(in srgb, var(--theme-success, #4CAF50) 40%, transparent); border-color: var(--theme-success, #4CAF50); color: var(--theme-success, #4CAF50); opacity: 1; }
  100% { background: transparent; opacity: 0.5; }
}

/* Reaction bar button styles (slightly larger for persistent bar) */
#reaction-bar .reactive-btn {
  min-width: 100px;
  padding: 5px 12px;
  font-size: 12px;
}

.reaction-bar-btn-exit {
  animation: reaction-bar-slide-out 0.25s ease-out forwards;
}

@keyframes reaction-bar-slide-out {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

/* ============================================
   Context Menu
   ============================================ */
.context-menu {
  position: fixed;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  min-width: 150px;
  z-index: 10000;
  display: none;
}

.context-menu-title {
  padding: 8px 12px;
  font-weight: bold;
  color: var(--theme-text-primary);
  border-bottom: 1px solid var(--theme-border-secondary);
  font-size: 13px;
}

.context-menu-item {
  padding: 8px 12px;
  color: var(--theme-text-secondary);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.context-menu-item:hover {
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-primary);
}

/* ============================================
   Command Suggestions Panel
   ============================================ */
.command-suggestion-panel {
  position: fixed;
  bottom: var(--layout-command-area-height);
  left: 0;
  right: 0;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-bottom: 2px;
}

.suggestions-list {
  padding: 4px 0;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: var(--theme-bg-tertiary);
}

.suggestion-icon {
  width: 20px;
  margin-right: 8px;
  color: var(--theme-text-muted);
  font-size: 12px;
}

.suggestion-content {
  flex: 1;
}

.suggestion-command {
  color: var(--theme-text-primary);
  font-size: 13px;
}

.suggestion-description {
  color: var(--theme-text-muted);
  font-size: 11px;
  margin-top: 2px;
}

/* ============================================
   Buff/Debuff Icons
   ============================================ */
.buff-icon,
.effect-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid var(--theme-border-secondary);
  border-radius: 2px;
  cursor: help;
  position: relative;
  transition: all var(--theme-transition-speed);
}

.buff-icon.buff,
.effect-icon.buff {
  background: rgba(76, 175, 80, 0.2);
  border-color: var(--theme-room-name);
}

.buff-icon.debuff,
.effect-icon.debuff {
  background: rgba(244, 67, 54, 0.2);
  border-color: var(--theme-error);
}

.buff-icon.other,
.effect-icon.other {
  background: rgba(156, 39, 176, 0.2);
  border-color: #9c27b0;
}

.buff-icon:hover,
.effect-icon:hover {
  transform: scale(1.1);
  z-index: 10000;
}

/* Buff tooltip using CSS ::after pseudo-element */
.buff-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--theme-bg-secondary);
  color: var(--theme-text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--theme-transition-speed);
  border: 1px solid var(--theme-border-primary);
  margin-bottom: 4px;
  z-index: 10001;
}

.buff-icon:hover::after {
  opacity: 1;
}

/* SVG Effect Icons */
.effect-svg-icon {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 2px;
}

/* Large effect icons in character sheet */
.effect-icon-large .effect-svg-icon {
  width: 32px;
  height: 32px;
}

/* Buff Duration Visual Indicators */
.buff-icon-wrapper {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
}

/* Radial duration overlay - "clock wipe" effect */
.buff-duration-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  pointer-events: none;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(0, 0, 0, 0.6) 0deg,
    rgba(0, 0, 0, 0.6) calc(360deg * (1 - var(--progress, 1))),
    transparent calc(360deg * (1 - var(--progress, 1))),
    transparent 360deg
  );
  transition: --progress 0.1s linear;
}

/* Permanent buffs show full overlay */
.buff-duration-overlay.permanent {
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 215, 0, 0.2) 0deg,
    rgba(255, 215, 0, 0.2) 360deg
  );
}

/* Countdown text (shown when < threshold) */
.buff-duration-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 2;
}

/* Expiring buff pulsing effect */
.buff-icon-wrapper.buff-expiring .buff-icon {
  animation: buff-pulse 1s ease-in-out infinite;
}

@keyframes buff-pulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(255, 255, 0, 0.8);
  }
  50% {
    box-shadow: 0 0 8px rgba(255, 255, 0, 1);
  }
}

/* Member effects container */
.member-effects {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Target effects container (same style as member-effects) */
.target-effects {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Group Section Styles */
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.group-title {
  font-size: 12px;
  color: var(--theme-text-secondary);
}

.group-btn {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--theme-error);
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--theme-transition-speed);
}

.group-btn:hover {
  background: var(--theme-error-hover, #e53935);
}

/* Group Member Styles */
.group-member {
  font-size: 11px;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--theme-bg-primary);
  border-radius: 3px;
  border: 1px solid var(--theme-border-secondary);
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.group-member.leader {
  border-color: var(--theme-accent-gold, #ffd700);
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
}

/* Room-based styling */
.group-member.other-room {
  opacity: 0.8;
  background: rgba(128, 128, 128, 0.05);
}

.member-name {
  color: var(--theme-player-other);
  font-weight: bold;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.member-level {
  color: var(--theme-text-secondary);
  font-size: 10px;
  margin-left: auto;
  font-weight: normal;
}

/* Location indicator text */
.member-location {
  color: var(--theme-text-tertiary);
  font-style: italic;
  font-size: 10px;
  margin-left: 4px;
}

.group-member.other-room .member-location {
  color: var(--theme-text-muted, #999);
  font-style: italic;
}

.member-class {
  color: var(--theme-text-muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.member-status {
  color: var(--theme-text-muted);
  font-size: 10px;
  font-style: italic;
  margin-top: 4px;
}

/* Group member stat bars - smaller than main player bars */
.group-member .health-bar-container,
.group-member .mana-bar-container,
.group-member .stamina-bar-container {
  position: relative;
  height: 14px;
  background: var(--theme-bg-tertiary, #111);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 2px;
  margin: 3px 0;
}

.group-member .health-bar,
.group-member .mana-bar,
.group-member .stamina-bar {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.group-member .health-bar-fill,
.group-member .mana-bar-fill,
.group-member .stamina-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.group-member .health-bar-fill {
  background: var(--theme-health-high);
}

.group-member .mana-bar-fill {
  background: var(--theme-mana);
}

.group-member .stamina-bar-fill {
  background: var(--theme-stamina);
}

/* Text overlays for group member bars */
.group-member .health-text,
.group-member .mana-text,
.group-member .stamina-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: white;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 1;
}

/* Pet row in group panel */
.group-pet-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 0 1px 12px;
  opacity: 0.8;
  font-size: 0.85em;
}

.group-pet-name {
  white-space: nowrap;
  min-width: 40px;
  color: var(--theme-text-secondary, #aaa);
}

.group-pet-row .health-bar-container {
  flex: 1;
  height: 6px;
}

/* ============================================
   Description Template Styles
   ============================================ */
.description-message {
  padding: 8px 0;
}

/* Stale room descriptions (previous locations) - greyed out and non-interactive */
.message.description.stale {
  opacity: 0.45;
  filter: saturate(0.3);
  pointer-events: none;
  position: relative;
}

/* Subtle indicator for stale rooms */
.message.description.stale::before {
  content: '(previous location)';
  display: block;
  font-size: 0.7em;
  color: var(--theme-text-muted);
  opacity: 0.7;
  margin-bottom: 2px;
  font-style: italic;
}

/* Current room - ensure full visibility */
.message.description.current-room {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

.description-header {
  margin-bottom: 8px;
}

.description-name {
  color: var(--theme-room-name);
  font-size: 1.1em;
}

.description-info {
  color: var(--theme-text-muted);
  font-size: 0.9em;
  margin-left: 8px;
}

.description-text {
  color: var(--theme-text-primary);
  margin: 8px 0;
  line-height: 1.4;
}

.creature-health,
.creature-mana,
.creature-equipment,
.creature-stats {
  color: var(--theme-text-secondary);
  margin: 4px 0;
  font-size: 0.95em;
}

.item-condition,
.item-value,
.item-stats,
.item-rarity {
  color: var(--theme-text-secondary);
  margin: 4px 0;
  font-size: 0.95em;
}

.room-exits,
.room-creatures,
.room-items {
  margin: 6px 0;
  color: var(--theme-text-muted);
}

/* ============================================
   Clickable Elements
   ============================================ */
.clickable {
  cursor: pointer;
  transition: all var(--theme-transition-speed);
  position: relative;
}

.clickable:hover {
  opacity: 0.9;
}

/* Clickable entities in message area */
.room-exit.clickable,
.room-exit {
  /* Override with consistent button styling */
  color: #2874A6 !important;
  cursor: pointer;
  padding: 4px 8px;
  background: rgba(40, 116, 166, 0.1);
  border: 1px solid rgba(40, 116, 166, 0.3);
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 14px;
  user-select: none;
  display: inline-block;
  text-decoration: none !important;
}

.room-exit.clickable:hover,
.room-exit:hover {
  background: rgba(40, 116, 166, 0.2) !important;
  border-color: rgba(40, 116, 166, 0.6) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-decoration: none !important;
}

/* Themed exits use destination theme color - MUST come after base .room-exit styles */
.exit.themed-exit,
.room-exit.themed-exit {
  color: var(--exit-theme-color, #2874A6) !important;
  background: color-mix(in srgb, var(--exit-theme-color, #2874A6) 10%, transparent) !important;
  border-color: color-mix(in srgb, var(--exit-theme-color, #2874A6) 30%, transparent) !important;
}

.exit.themed-exit:hover,
.room-exit.themed-exit:hover {
  background: color-mix(in srgb, var(--exit-theme-color, #2874A6) 20%, transparent) !important;
  border-color: var(--exit-theme-color, #2874A6) !important;
  box-shadow: 0 0 4px var(--exit-theme-color, rgba(40, 116, 166, 0.5));
  transform: translateY(-1px);
}

.exit.themed-exit:active,
.room-exit.themed-exit:active {
  background: color-mix(in srgb, var(--exit-theme-color, #2874A6) 30%, transparent) !important;
  transform: translateY(0);
}

/* ============================================
   Exit State Indicators (Exit Metadata System)
   For room context text-based exits
   ============================================ */

/* Blocked Exit - NPC blocking path */
.exit.exit-blocked {
  color: #ff6666;
  background: rgba(139, 0, 0, 0.2);
  border-color: rgba(139, 0, 0, 0.4);
  cursor: not-allowed;
}

.exit.exit-blocked:hover {
  background: rgba(139, 0, 0, 0.3);
  transform: none;
}

/* Locked Exit - Requires key or lockpicking */
.exit.exit-locked {
  color: #D4AF37;
  background: rgba(139, 119, 42, 0.2);
  border-color: rgba(139, 119, 42, 0.4);
  cursor: help;
}

.exit.exit-locked:hover {
  background: rgba(139, 119, 42, 0.3);
}

/* Sealed Exit - Magical barrier (boss fights) */
.exit.exit-sealed {
  color: #DDA0DD;
  background: rgba(148, 0, 211, 0.2);
  border-color: rgba(148, 0, 211, 0.4);
  cursor: not-allowed;
  animation: exit-seal-pulse 2s ease-in-out infinite;
}

@keyframes exit-seal-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(148, 0, 211, 0.4); }
  50% { box-shadow: 0 0 10px rgba(148, 0, 211, 0.7); }
}

.exit.exit-sealed:hover {
  transform: none;
}

/* Restricted Exit - Level/faction/quest requirements */
.exit.exit-restricted {
  color: #FFD700;
  background: rgba(255, 165, 0, 0.2);
  border-color: rgba(255, 165, 0, 0.4);
  cursor: help;
}

.exit.exit-restricted:hover {
  background: rgba(255, 165, 0, 0.3);
}

/* Hazardous Exit - Dangerous but passable */
.exit.exit-hazardous {
  color: #FF6347;
  background: rgba(255, 69, 0, 0.15);
  border-color: rgba(255, 69, 0, 0.35);
}

.exit.exit-hazardous:hover {
  background: rgba(255, 69, 0, 0.25);
  box-shadow: 0 0 6px rgba(255, 69, 0, 0.4);
}

/* Base room-creature styling - minimal container styling */
.room-creature {
  /* Let formatCreature spans provide all visual styling */
  display: inline;
}

/* Remove redundant hover styles - .creature class handles all styling now */
/* Remove faction-based colors - formatCreature handles all colors now */

.room-item.clickable {
  color: var(--theme-item);
  font-style: italic;
}

.room-item.clickable:hover {
  color: var(--theme-item-hover);
  text-decoration: underline;
}

/* Corpse items */
.room-item.corpse {
  color: #888;
  font-style: normal;
}

/* Rarity-based item colors */
.room-item.rarity-common {
  color: var(--theme-item);
}

.room-item.rarity-uncommon {
  color: #1eff00;
}

.room-item.rarity-rare {
  color: #0080ff;
}

.room-item.rarity-epic {
  color: #a335ee;
}

.room-item.rarity-legendary {
  color: #ff8000;
}

/* Context menu indicator */
.clickable::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 4px;
  height: 4px;
  background: var(--theme-accent-green);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--theme-transition-speed);
}

.clickable:hover::before {
  opacity: 1;
  animation: pulse 1s infinite;
}

/* ============================================
   Inventory Items
   ============================================ */
.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-item {
  font-size: var(--theme-font-size-small);
  color: var(--theme-item-color);
  padding: 2px 4px;
  cursor: pointer;
  transition: all var(--theme-transition-speed);
  border-radius: 2px;
}

.inventory-item:hover {
  background: var(--theme-bg-tertiary);
  padding-left: 8px;
}

.inventory-gold {
  color: var(--theme-faction-hostile);
  font-weight: bold;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--theme-border-secondary);
}

/* ============================================
   Equipment Slots
   ============================================ */
.equipment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.equipment-slot {
  font-size: var(--theme-font-size-small);
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.slot-name {
  color: var(--theme-text-muted);
}

.item-name {
  color: var(--theme-exit-color);
  cursor: pointer;
  transition: color var(--theme-transition-speed);
}

.item-name:hover {
  color: var(--theme-accent-blue);
}

.item-name.empty {
  color: var(--theme-text-muted);
  font-style: italic;
}

/* ============================================
   Command Suggestions Panel
   ============================================ */
.command-suggestion-panel {
  position: fixed;
  bottom: calc(var(--layout-command-height) + 5px);
  left: var(--theme-spacing-lg);
  right: calc(var(--layout-sidebar-width) + var(--theme-spacing-lg));
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 8px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  max-height: 400px;
  overflow: hidden;
  z-index: 1000;
}

.suggestions-list {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
}

.suggestion-item {
  padding: var(--theme-spacing-sm) var(--theme-spacing-md);
  cursor: pointer;
  transition: background var(--theme-transition-speed);
  display: flex;
  align-items: center;
  gap: var(--theme-spacing-sm);
  border-bottom: 1px solid var(--theme-border-secondary);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: var(--theme-bg-tertiary);
}

.suggestion-item.selected {
  border-left: 3px solid var(--theme-accent-green);
  padding-left: calc(var(--theme-spacing-md) - 3px);
}

/* Command categories */
.suggestion-item.category-combat { border-left-color: #ff6b6b; }
.suggestion-item.category-navigation { border-left-color: #4ecdc4; }
.suggestion-item.category-social { border-left-color: #ffe66d; }
.suggestion-item.category-inventory { border-left-color: #a8e6cf; }

.suggestion-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-accent-green);
  font-size: 16px;
}

/* Icon styles */
.icon-command::before { content: '>'; font-weight: bold; }
.icon-sword::before { content: '⚔️'; }
.icon-compass::before { content: '🧭'; }
.icon-chat::before { content: '💬'; }
.icon-eye::before { content: '👁️'; }
.icon-backpack::before { content: '🎒'; }
.icon-user::before { content: '👤'; }
.icon-cog::before { content: '⚙️'; }
.icon-monster::before { content: '👾'; }
.icon-cube::before { content: '📦'; }
.icon-shield::before { content: '🛡️'; }
.icon-door::before { content: '🚪'; }
.icon-home::before { content: '🏠'; }
.icon-info::before { content: 'ℹ️'; }
.icon-dot::before { content: '•'; }
.icon-default::before { content: '▸'; }

.suggestion-content {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

.suggestion-main {
  display: flex;
  align-items: baseline;
  gap: var(--theme-spacing-sm);
}

.suggestion-text {
  /* Let formatCreature spans provide all visual styling */
  display: inline;
}

/* Allow creature formatting to show through */
.suggestion-text .clickable {
  pointer-events: none; /* Disable nested clicking */
}

.suggestion-usage {
  color: var(--theme-text-muted);
  font-size: var(--theme-font-size-small);
  font-style: italic;
  margin-left: auto;
}

.suggestion-command {
  color: var(--theme-text-primary);
  font-weight: bold;
}

.suggestion-description {
  color: var(--theme-text-muted);
  font-size: var(--theme-font-size-small);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keyboard hints */
.suggestion-hints {
  padding: var(--theme-spacing-xs) var(--theme-spacing-md);
  background: var(--theme-bg-primary);
  border-top: 1px solid var(--theme-border-secondary);
  display: flex;
  gap: var(--theme-spacing-md);
  justify-content: center;
  font-size: var(--theme-font-size-small);
  color: var(--theme-text-muted);
}

.suggestion-hints .hint {
  display: flex;
  align-items: center;
  gap: var(--theme-spacing-xs);
}

.suggestion-hints kbd {
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: var(--theme-font-mono);
  font-size: var(--theme-font-size-small);
  color: var(--theme-text-primary);
  box-shadow: inset 0 -2px 0 var(--theme-border-secondary);
}

/* ============================================
   Loading States
   ============================================ */
.loading {
  opacity: 0.5;
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--theme-border-secondary);
  border-top-color: var(--theme-accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   Tooltips
   ============================================ */
.tooltip {
  position: relative;
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--theme-bg-secondary);
  color: var(--theme-text-primary);
  padding: var(--theme-spacing-xs) var(--theme-spacing-sm);
  border-radius: 4px;
  font-size: var(--theme-font-size-small);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--theme-transition-speed);
  border: 1px solid var(--theme-border-primary);
  margin-bottom: 4px;
  z-index: 1000;
}

.tooltip:hover .tooltip-content {
  opacity: 1;
}

/* ============================================
   Position Indicator Styles
   ============================================ */
#position-indicator {
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
  text-transform: capitalize;
  display: inline-block;
  transition: all var(--theme-transition-speed);
}

/* Position-specific colors */
.position-standing {
  color: white;
}

.position-sitting {
  background: var(--theme-accent-blue);
  color: white;
}

.position-meditating {
  background: #9C27B0;
  color: white;
  animation: pulse 2s infinite;
}

.position-sleeping {
  background: #607D8B;
  color: white;
}

.position-resting {
  background: #FF9800;
  color: white;
}

.position-prone {
  background: #795548;
  color: white;
}

.position-kneeling {
  background: #3F51B5;
  color: white;
}

.position-flying {
  background: linear-gradient(45deg, #2196F3, #03A9F4);
  color: white;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ============================================
   Stats/Skills/Equipment Display Styles
   ============================================ */
.stats-display,
.equipment-display,
.skills-display {
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 4px;
  padding: 15px;
  margin: 10px 0;
  color: var(--theme-text-primary);
}

.stats-display h4,
.equipment-display h4,
.skills-display h4 {
  color: var(--theme-accent-green);
  font-size: 16px;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.stats-display h5,
.skills-display h5 {
  color: var(--theme-accent-green);
  font-size: 14px;
  margin: 12px 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.playtime-section {
  margin-bottom: 12px;
  padding: 8px;
  background: var(--theme-bg-primary);
  border-radius: 3px;
}

.stat-row {
  padding: 4px 0;
  font-size: 13px;
}

.points-available-section {
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-accent-green);
  border-radius: 3px;
  padding: 10px;
  margin: 12px 0;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: var(--theme-accent-green);
  }
  50% {
    border-color: var(--theme-accent-green-hover);
  }
}

.points-available-section p {
  margin: 4px 0;
  color: var(--theme-accent-green);
  font-weight: bold;
}

.attributes-list,
.derived-stats-list,
.equipment-list,
.skills-list {
  margin-top: 8px;
}

.attribute-item,
.stat-item,
.equipment-item,
.skill-item {
  padding: 4px 8px;
  margin: 2px 0;
  font-size: 13px;
  background: var(--theme-bg-primary);
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attribute-item:hover,
.stat-item:hover,
.equipment-item:hover,
.skill-item:hover {
  background: var(--theme-bg-tertiary);
}

.attr-name,
.skill-name {
  color: var(--theme-text-secondary);
  min-width: 100px;
  font-weight: 500;
}

.attr-value,
.stat-value {
  color: var(--theme-accent-blue);
  font-weight: bold;
}

.attr-spent {
  color: var(--theme-accent-green);
  font-size: 11px;
}

/* Skills specific styles */
.skill-rank {
  color: var(--theme-accent-blue);
  font-weight: bold;
}

.skill-tier {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: bold;
}

.skill-tier.novice {
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-secondary);
}

.skill-tier.apprentice {
  background: rgba(76, 175, 80, 0.2);
  color: var(--theme-accent-green);
}

.skill-tier.journeyman {
  background: rgba(33, 150, 243, 0.2);
  color: var(--theme-accent-blue);
}

.skill-tier.expert {
  background: rgba(156, 39, 176, 0.2);
  color: #9c27b0;
}

.skill-tier.master {
  background: rgba(255, 193, 7, 0.2);
  color: var(--theme-item-color);
}

.skill-proficiency {
  color: var(--theme-text-muted);
  font-size: 11px;
}

.skill-effectiveness {
  color: var(--theme-warning);
  font-size: 11px;
  font-style: italic;
}

.skill-max {
  background: var(--theme-accent-green);
  color: white;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.skills-help {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--theme-border-secondary);
}

.help-text {
  color: var(--theme-text-secondary);
  font-size: 12px;
  font-style: italic;
}

/* ============================================
   Interactive Command Buttons
   ============================================ */
.cmd-btn {
  display: inline-block;
  padding: 4px 8px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--theme-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--theme-font-family);
  font-size: 13px;
  transition: all 0.2s ease;
  text-decoration: none !important;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}

.cmd-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--theme-text-highlight);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cmd-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Category-specific button styles */
.cmd-btn.btn-social {
  border-color: var(--theme-accent-green);
  color: var(--theme-accent-green);
}

.cmd-btn.btn-social:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: var(--theme-accent-green);
  color: var(--theme-accent-green);
}

.cmd-btn.btn-danger {
  border-color: var(--theme-error);
  color: var(--theme-error);
}

.cmd-btn.btn-danger:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: var(--theme-error);
  color: var(--theme-error);
}

.cmd-btn.btn-primary {
  border-color: var(--theme-accent-blue);
  color: var(--theme-accent-blue);
}

.cmd-btn.btn-primary:hover {
  background: rgba(33, 150, 243, 0.2);
  border-color: var(--theme-accent-blue);
  color: var(--theme-accent-blue);
}

.cmd-btn.btn-secondary {
  border-color: var(--theme-text-muted);
  color: var(--theme-text-muted);
}

.cmd-btn.btn-secondary:hover {
  background: rgba(102, 102, 102, 0.2);
  border-color: var(--theme-text-muted);
  color: var(--theme-text-secondary);
}

.cmd-btn.btn-movement {
  border-color: var(--theme-accent-green);
  color: var(--theme-accent-green);
}

.cmd-btn.btn-movement:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: var(--theme-accent-green);
  color: var(--theme-accent-green);
}

.cmd-btn.btn-position {
  border-color: var(--theme-warning);
  color: var(--theme-warning);
}

.cmd-btn.btn-position:hover {
  background: rgba(255, 193, 7, 0.2);
  border-color: var(--theme-warning);
  color: var(--theme-warning);
}

.cmd-btn.btn-inventory {
  border-color: var(--theme-info);
  color: var(--theme-info);
}

.cmd-btn.btn-inventory:hover {
  background: rgba(33, 150, 243, 0.2);
  border-color: var(--theme-info);
  color: var(--theme-info);
}

.cmd-btn.btn-info {
  border-color: var(--theme-info);
  color: var(--theme-info);
}

.cmd-btn.btn-info:hover {
  background: rgba(33, 150, 243, 0.2);
  border-color: var(--theme-info);
  color: var(--theme-info);
}

/* ============================================
   Combat Damage & Attack Type Indicators
   ============================================ */
.attack {
  color: var(--theme-combat-damage);
  font-weight: bold;
}

.attack-type {
  color: var(--theme-warning);
  font-size: 0.9em;
  font-style: italic;
  margin-left: 4px;
  opacity: 0.9;
}

/* ============================================
   Inventory & Equipment Window
   ============================================ */
.inventory-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--theme-bg-tertiary);
  border-bottom: 1px solid var(--theme-border-primary);
  cursor: move; /* For future drag functionality */
}

.window-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--theme-room-name);
}

.window-controls {
  display: flex;
  gap: 8px;
}

.window-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  cursor: pointer;
  font-size: 18px;
  color: var(--theme-text-secondary);
  transition: all 0.2s;
}

.window-btn:hover {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  border-color: var(--theme-border-primary);
}

.window-close {
  color: var(--theme-error);
}

.window-close:hover {
  background: var(--theme-error);
  color: white;
}

.window-content {
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Equipment Panel (Left Side) */
.equipment-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.equipment-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--theme-room-name);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.equipment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.rings-section {
  margin-top: 12px;
}

.rings-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--theme-accent-gold);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.rings-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

/* Equipment/Inventory Slots */
.equipment-slot,
.inventory-slot {
  background: var(--theme-bg-primary);
  border: 2px solid var(--theme-border-secondary);
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.equipment-slot:hover,
.inventory-slot:hover {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-border-highlight);
  transform: translateY(-1px);
}

.equipment-slot.empty,
.inventory-slot.empty {
  opacity: 0.5;
}

.equipment-slot.filled,
.inventory-slot.filled {
  border-color: var(--theme-success);
  opacity: 1;
}

/* Stack count badge for stackable items */
.stack-count-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 10;
}

/* Stack merge highlight during drag */
.stack-merge-target {
  outline: 2px solid #4CAF50;
  outline-offset: -2px;
  animation: pulse-merge 0.5s ease-in-out infinite;
}

@keyframes pulse-merge {
  0%, 100% { outline-color: #4CAF50; }
  50% { outline-color: #8BC34A; }
}

/* Split Stack Modal */
.split-stack-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.split-stack-content {
  background: var(--theme-bg-primary);
  border: 2px solid var(--theme-border-highlight);
  border-radius: 8px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.split-stack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--theme-bg-secondary);
  border-bottom: 1px solid var(--theme-border-secondary);
  border-radius: 6px 6px 0 0;
}

.split-stack-header h3 {
  margin: 0;
  color: var(--theme-text-primary);
  font-size: 14px;
}

.split-stack-close {
  background: none;
  border: none;
  color: var(--theme-text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.split-stack-close:hover {
  color: var(--theme-error);
}

.split-stack-body {
  padding: 16px;
}

.split-info {
  color: var(--theme-text-secondary);
  font-size: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.split-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.split-controls label {
  color: var(--theme-text-secondary);
  font-size: 12px;
}

.split-controls input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.split-controls input[type="number"] {
  width: 80px;
  padding: 6px 8px;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 4px;
  color: var(--theme-text-primary);
  font-size: 14px;
  text-align: center;
}

.split-preview {
  background: var(--theme-bg-tertiary);
  padding: 12px;
  border-radius: 4px;
}

.split-preview-row {
  display: flex;
  justify-content: space-between;
  color: var(--theme-text-secondary);
  font-size: 12px;
  padding: 4px 0;
}

.split-preview-row span:last-child {
  color: var(--theme-success);
  font-weight: bold;
}

.split-stack-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--theme-border-secondary);
}

.split-cancel-btn,
.split-confirm-btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.split-cancel-btn {
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-secondary);
  color: var(--theme-text-secondary);
}

.split-cancel-btn:hover {
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-primary);
}

.split-confirm-btn {
  background: var(--theme-success);
  border: 1px solid var(--theme-success);
  color: #000;
  font-weight: bold;
}

.split-confirm-btn:hover {
  background: #5dbb63;
}

/* Inventory Notifications */
.inventory-notification {
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 12px;
  animation: slideIn 0.3s ease-out;
}

.inventory-notification.notification-info {
  background: rgba(0, 128, 255, 0.9);
  color: #fff;
}

.inventory-notification.notification-error {
  background: rgba(255, 80, 80, 0.9);
  color: #fff;
}

.inventory-notification.notification-success {
  background: rgba(76, 175, 80, 0.9);
  color: #fff;
}

.inventory-notification.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.equipment-slot.blocked {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-error);
  opacity: 0.4;
  cursor: not-allowed;
}

.equipment-slot.blocked:hover {
  transform: none;
}

.slot-label {
  font-size: 9px;
  color: var(--theme-text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
  text-align: center;
}

.slot-icon {
  font-size: 20px;
  margin: 4px 0;
}

.slot-item-name {
  font-size: 10px;
  color: var(--theme-text-secondary);
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Rarity Colors */
.rarity-common .slot-item-name { color: #aaaaaa; }
.rarity-uncommon .slot-item-name { color: #1eff00; }
.rarity-rare .slot-item-name { color: #0080ff; }
.rarity-epic .slot-item-name { color: #a335ee; }
.rarity-legendary .slot-item-name { color: #ff8000; }
.rarity-artifact .slot-item-name { color: #e6cc80; }

/* Inventory Panel (Right Side) */
.inventory-panel {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inventory-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--theme-room-name);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.inventory-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--theme-border-secondary);
}

.weight-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  margin-bottom: 6px;
}

.weight-label {
  color: var(--theme-text-muted);
}

.weight-value {
  color: var(--theme-text-primary);
  font-weight: bold;
}

.encumbrance-level {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  text-align: center;
  font-weight: bold;
}

.encumbrance-light {
  background: rgba(76, 175, 80, 0.2);
  color: var(--theme-success);
}

.encumbrance-medium {
  background: rgba(255, 193, 7, 0.2);
  color: var(--theme-warning);
}

.encumbrance-heavy {
  background: rgba(255, 152, 0, 0.2);
  color: #FF9800;
}

.encumbrance-overloaded {
  background: rgba(244, 67, 54, 0.2);
  color: var(--theme-error);
}

/* Currency Display in Inventory (above footer) */
.currency-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}

.currency-label {
  color: var(--theme-text-muted);
}

.currency-coins {
  display: flex;
  gap: 6px;
  font-family: monospace;
}

.coin {
  padding: 2px 4px;
  border-radius: 2px;
}

.coin.platinum {
  color: #e5e5e5;
  text-shadow: 0 0 4px rgba(229, 229, 229, 0.5);
}

.coin.gold {
  color: #ffd700;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

.coin.silver {
  color: #c0c0c0;
}

.coin.copper {
  color: #b87333;
}

/* Item Tooltip */
.item-tooltip {
  position: fixed;
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 4px;
  padding: 12px;
  max-width: 300px;
  z-index: 100000;  /* Always on top of all UI elements */
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.tooltip-header {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.tooltip-section {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 4px 0;
}

.tooltip-label {
  color: var(--theme-text-muted);
}

.tooltip-value {
  color: var(--theme-text-primary);
}

.tooltip-description {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--theme-border-secondary);
  font-size: 11px;
  color: var(--theme-text-secondary);
  font-style: italic;
}

/* Container tooltip styles */
.tooltip-container-info .tooltip-value {
  color: var(--theme-info);
  font-weight: bold;
}

.tooltip-container-quick {
  margin-top: 4px;
  padding: 4px 8px;
  background: rgba(139, 90, 43, 0.2);
  border-radius: 3px;
}

.tooltip-container-quick .tooltip-stat {
  color: #d4a555;
  font-size: 11px;
}

/* Requirement indicators */
.tooltip-requirement-met {
  color: var(--theme-success);
}

.tooltip-requirement-not-met {
  color: var(--theme-error);
}

/* Durability color indicators */
.tooltip-durability-high {
  color: var(--theme-success); /* Green for >50% */
}

.tooltip-durability-medium {
  color: #FFA500; /* Orange for 26-50% */
}

.tooltip-durability-low {
  color: #FF8C00; /* Dark orange for 11-25% */
}

.tooltip-durability-critical {
  color: var(--theme-error); /* Red for ≤10% */
  font-weight: bold;
  animation: pulse 1.5s ease-in-out infinite;
}

.tooltip-warning {
  color: var(--theme-error);
  font-weight: bold;
  background: rgba(244, 67, 54, 0.1);
  padding: 4px 8px;
  border-radius: 3px;
  margin-top: 4px;
}

/* Proc styles for tooltips */
.tooltip-procs-header {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--theme-border-secondary);
}

.tooltip-proc {
  margin: 6px 0;
  padding: 4px 0;
}

.tooltip-proc-details {
  font-size: 11px;
  margin-left: 8px;
  color: var(--theme-text-secondary);
}

.tooltip-proc-trigger {
  margin: 2px 0;
}

.tooltip-proc-effect {
  margin: 2px 0;
  color: var(--theme-text-primary);
}

.tooltip-proc-cooldown {
  margin: 2px 0;
  color: var(--theme-text-muted);
  font-size: 10px;
}

/* Proc type color classes */
.tooltip-proc-damage {
  color: #ff6b6b; /* Red for damage procs */
}

.tooltip-proc-heal {
  color: #51cf66; /* Green for healing procs */
}

.tooltip-proc-buff {
  color: #74c0fc; /* Blue for buff procs */
}

.tooltip-proc-debuff {
  color: #ffa94d; /* Orange for debuff procs */
}

.tooltip-proc-spell {
  color: #da77f2; /* Purple for spell procs */
}

/* Inventory Context Menu */
.inventory-context-menu {
  position: fixed;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 3px;
  padding: 4px 0;
  z-index: 100001;  /* Always on top of all UI elements (higher than tooltips) */
  min-width: 150px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.inventory-context-menu .menu-item {
  padding: 6px 12px;
  cursor: pointer;
  color: var(--theme-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  transition: all 0.2s;
}

.inventory-context-menu .menu-item:hover {
  background: var(--theme-bg-tertiary);
  color: var(--theme-success);
}

.inventory-context-menu .menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inventory-context-menu .menu-item.disabled:hover {
  background: transparent;
  color: var(--theme-text-primary);
}

.inventory-context-menu .menu-icon {
  width: 16px;
  text-align: center;
}

.inventory-context-menu .menu-text {
  flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .inventory-window {
    width: 95vw;
    max-height: 90vh;
  }

  .window-content {
    flex-direction: column;
  }

  .inventory-panel {
    width: 100%;
  }

  .equipment-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .rings-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===============================================
   MODIFIER VISIBILITY SYSTEM
   =============================================== */

/* Modifier Hints (subtle, low wisdom 10-14) */
.modifier-hint {
  color: var(--theme-text-muted, #888);
  font-style: italic;
  margin: 0.4em 0;
  font-size: 0.95em;
}

/* Modifier Categories (medium wisdom 15-19) - Subtle styling */
.modifier-categories {
  margin: 0.5em 0;
  font-size: 0.95em;
  border: 1px solid var(--theme-border-primary);
  padding: 4px;
}

.modifier-categories strong {
  color: var(--theme-text-primary, #ccc);
  font-weight: normal;
  display: inline;
}

.modifier-categories em {
  color: var(--theme-text-secondary, #aaa);
  font-style: normal;
  font-weight: normal;
}

.modifier-categories ul {
  margin: 0.2em 0 0.3em 1em;
  padding-left: 1em;
  list-style-type: none;
}

.modifier-categories ul li {
  margin: 0.1em 0;
  color: var(--theme-text-secondary, #aaa);
}

.modifier-categories ul li::before {
  content: "• ";
  color: var(--theme-text-muted, #888);
}

/* Detailed Modifier Values (high wisdom 20+) - Subtle monospace */
.modifier-details {
  margin: 0.5em 0;
  font-size: 0.92em;
  color: var(--theme-text-secondary, #aaa);
}

.modifier-details strong {
  color: var(--theme-text-primary, #ccc);
  font-weight: normal;
  display: inline;
}

.modifier-details em {
  color: var(--theme-text-secondary, #aaa);
  font-style: normal;
  font-weight: normal;
}

.modifier-details ul {
  margin: 0.2em 0 0.3em 1em;
  padding-left: 1em;
  list-style-type: none;
}

.modifier-details ul li {
  margin: 0.1em 0;
}

.modifier-details ul li::before {
  content: "- ";
  color: var(--theme-text-muted, #888);
}

/* Resistances - Subtle green tint */
.resistances {
  margin: 0.3em 0;
  font-size: 0.95em;
}

.resistances strong {
  color: var(--theme-text-primary, #ccc);
  font-weight: normal;
}

/* Weaknesses - Subtle red tint */
.weaknesses {
  margin: 0.3em 0;
  font-size: 0.95em;
}

.weaknesses strong {
  color: var(--theme-text-primary, #ccc);
  font-weight: normal;
}

/* Specific modifier type sections - minimal spacing */
.env-mods, .effect-mods, .equip-mods,
.skill-mods, .combat-mods, .knowledge-mods, .group-mods {
  margin-top: 0.2em;
}

.env-mod-detail, .effect-mod-detail, .equip-mod-detail,
.skill-mod-detail, .combat-mod-detail, .knowledge-mod-detail, .group-mod-detail {
  margin-top: 0.2em;
}

/* ============================================
   Container Window
   ============================================ */
.container-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.container-window .window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--theme-bg-tertiary);
  border-bottom: 1px solid var(--theme-border-primary);
  cursor: move;
}

.container-window .window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: bold;
  color: var(--theme-room-name);
}

.container-window .container-icon {
  font-size: 16px;
}

.container-window .container-name {
  color: var(--theme-text-primary);
}

.container-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.container-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.container-slots {
  color: var(--theme-text-primary);
  font-weight: bold;
}

.container-restrictions {
  color: var(--theme-text-muted);
  font-size: 11px;
}

.container-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.container-slot {
  background: var(--theme-bg-primary);
  border: 2px solid var(--theme-border-secondary);
  border-radius: 4px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.container-slot:hover {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-border-highlight);
  transform: translateY(-1px);
}

.container-slot.empty {
  opacity: 0.5;
  cursor: default;
}

.container-slot.empty:hover {
  transform: none;
}

.container-slot.filled {
  border-color: var(--theme-success);
  opacity: 1;
}

.container-slot.filled:hover {
  border-color: var(--theme-accent-green);
}

.container-slot .slot-icon {
  font-size: 18px;
  margin-bottom: 4px;
}

.container-slot .slot-item-name {
  font-size: 10px;
  color: var(--theme-text-secondary);
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.2;
}

.container-slot .stack-count-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.container-slot.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.container-slot.drag-over {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-accent-blue);
  border-style: dashed;
}

.container-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--theme-border-secondary);
  font-size: 12px;
}

.container-weight {
  color: var(--theme-text-muted);
}

/* Magical container styling */
.container-window.magical .window-header {
  border-bottom-color: rgba(138, 43, 226, 0.4);
}

.container-window.magical .container-icon {
  animation: magicGlow 2s ease-in-out infinite;
}

@keyframes magicGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(138, 43, 226, 0.6)); }
  50% { filter: drop-shadow(0 0 8px rgba(138, 43, 226, 1)); }
}

/* Container tooltip */
#container-tooltip {
  position: fixed;
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 4px;
  padding: 10px;
  max-width: 250px;
  z-index: 100000;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

/* Container in inventory indicator */
.inventory-slot.container-item {
  border-color: var(--theme-accent-gold, #ffd700);
}

/* Container type badge (replaces static ::after pseudo-element) */
.container-type-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 4px;
  border-radius: 3px;
  z-index: 2;
}

.container-type-badge .container-count {
  color: var(--theme-text-secondary);
  font-size: 9px;
}

/* Quick access containers get a gold border glow */
.inventory-slot.container-quick-access {
  box-shadow: 0 0 6px 1px rgba(255, 215, 0, 0.4);
}

.inventory-slot.container-quick-access .container-type-badge {
  background: rgba(139, 90, 43, 0.8);
}

.inventory-slot.container-quick-access .container-count {
  color: #d4a555;
}

/* ============================================
   Audio Controls (Phase 1)
   ============================================ */

#audio-controls {
  position: fixed;
  bottom: 8px;
  right: 8px;
  z-index: 1000;
}

#audio-toggle {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--theme-border-secondary);
  background: var(--theme-bg-secondary);
  color: var(--theme-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s, border-color 0.2s;
}

#audio-toggle:hover {
  color: var(--theme-text-primary);
  border-color: var(--theme-border-highlight);
}

#audio-toggle.muted {
  color: var(--theme-text-muted);
  opacity: 0.6;
}

#audio-settings-panel {
  position: absolute;
  bottom: 40px;
  right: 0;
  width: 220px;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-radius: 6px;
  padding: 10px;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.audio-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: bold;
  color: var(--theme-text-primary);
}

.audio-settings-close {
  background: none;
  border: none;
  color: var(--theme-text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.audio-settings-close:hover {
  color: var(--theme-text-primary);
}

.audio-slider {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.audio-slider label {
  width: 52px;
  flex-shrink: 0;
  color: var(--theme-text-muted);
  text-align: right;
}

.audio-slider input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--theme-bg-tertiary);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.audio-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-accent-green);
  cursor: pointer;
}

.audio-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-accent-green);
  border: none;
  cursor: pointer;
}

.audio-slider .volume-value {
  width: 32px;
  flex-shrink: 0;
  text-align: right;
  color: var(--theme-text-muted);
  font-size: 10px;
  font-family: var(--theme-font-mono, monospace);
}

.audio-mute-btn {
  width: 100%;
  padding: 4px 0;
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.audio-mute-btn:hover {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
}

.audio-mute-btn.muted {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border-color: rgba(244, 67, 54, 0.3);
}

.audio-category-divider {
  height: 1px;
  background: var(--theme-border-secondary);
  margin: 2px 0;
}