/* Add transition for opacity changes */
/* #bg3-hotbar-container {
    transition: opacity 0.2s ease;
    position: relative;
  } */
  
  /* ==========================================================================
     Ability Card
     ========================================================================== */
  
  #bg3-hotbar-container .ability-card {
    position: absolute;
    left: 50%;
    top: -20px;
    transform: translate(-50%, -100%);
    width: 100%;
    background: rgba(34, 34, 34, 0.95);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 75;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    overflow: visible;
  }
  
  #bg3-hotbar-container .ability-card.visible {
    display: flex;
  }
  
  /* Ensure all child elements inherit opacity */
  #bg3-hotbar-container .ability-card *,
  #bg3-hotbar-container .bg3-ability-container * {
    opacity: inherit;
  }
  
  /* ==========================================================================
     Ability Score Components
     ========================================================================== */
  
  #bg3-hotbar-container .menu-item.ability-row {
    padding: 0;
    gap: 0;
    position: relative;
    width: 100%;
    height: 32px;
    box-sizing: border-box;
  }
  
  #bg3-hotbar-container .ability-score-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #2a2a2a;
    border: 1px solid transparent;
    box-sizing: border-box;
    width: 100%;
    height: 32px;
  }
  
  #bg3-hotbar-container .ability-score-display:hover {
    background: #333;
    border-color: transparent;
  }
  
  #bg3-hotbar-container .menu-item.ability-row.expanded .ability-score-display {
    background: #333;
    border-color: #cc3333;
  }
  
  #bg3-hotbar-container .ability-label {
    color: #dddddd;
    font-size: 14px;
    text-align: left;
  }
  
  #bg3-hotbar-container .ability-label.proficient,
  #bg3-hotbar-container .ability-value.proficient,
  #bg3-hotbar-container .skill-row.proficient,
  #bg3-hotbar-container .save-row.proficient {
    color: #3498db;
  }
  
  #bg3-hotbar-container .ability-value {
    color: #dddddd;
    font-size: 14px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  
  /* ==========================================================================
     Ability Button
     ========================================================================== */
  
  #bg3-hotbar-container .bg3-ability-container {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: rgba(34, 34, 34, 0.95);
    border: 1px solid #444;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 74;
    font-size: 16px;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
  }
  
  #bg3-hotbar-container .bg3-ability-container:hover {
    background: rgba(44, 44, 44, 0.95);
  }
  
  #bg3-hotbar-container .bg3-ability-container.active {
    background: rgba(44, 44, 44, 0.95);
    border: 1px solid #cc3333;
  }
  
  /* ==========================================================================
     Popup Panels
     ========================================================================== */
  
  #bg3-hotbar-container .popup-panel {
    position: absolute;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    pointer-events: auto;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    top: 0;
  }

  #bg3-hotbar-container .ability-row {
    position: relative;
  }
  
  #bg3-hotbar-container .popup-panel {
    display: none;
  }

  #bg3-hotbar-container .ability-row.expanded .popup-panel {
    display: flex;
  }
  
  #bg3-hotbar-container .popup-panel.saves {
    left: 100%;
    margin-left: 10px;
  }

  #bg3-hotbar-container .popup-panel.skills {
    right: 100%;
    margin-right: 10px;
  }

  /* Skill and save row styles */
  #bg3-hotbar-container .skill-row,
  #bg3-hotbar-container .save-row,
  #bg3-hotbar-container .check-row {
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  /* Left side with icon and label */
  #bg3-hotbar-container .skill-row .menu-item-icon,
  #bg3-hotbar-container .save-row .menu-item-icon,
  #bg3-hotbar-container .check-row .menu-item-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: #cc3333;
  }
  
  /* Container for icon and label */
  #bg3-hotbar-container .skill-row .left-group,
  #bg3-hotbar-container .save-row .left-group,
  #bg3-hotbar-container .check-row .left-group {
    display: flex;
    align-items: center;
  }
  
  /* Value on the right */
  #bg3-hotbar-container .skill-row .menu-item-value,
  #bg3-hotbar-container .save-row .menu-item-value,
  #bg3-hotbar-container .check-row .menu-item-value {
    color: #dddddd;
    font-size: 14px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 32px; /* Ensure consistent width for modifiers */
  }
  
  /* Ensure label text matches */
  #bg3-hotbar-container .skill-row .menu-item-label,
  #bg3-hotbar-container .save-row .menu-item-label,
  #bg3-hotbar-container .check-row .menu-item-label {
    color: #dddddd;
    font-size: 14px;
  }
  
  #bg3-hotbar-container .skill-row:hover,
  #bg3-hotbar-container .save-row:hover,
  #bg3-hotbar-container .check-row:hover {
    background: #333;
  }