/* ==========================================
   INVENTORY BAR - між bottom-bar і energy-bar
   ========================================== */

.inventory-bar {
   position: fixed;
   bottom: var(--bottom-bar-height, 78px); /* Висота bottom-bar */
   left: 0;
   right: 0;
   display: flex;
   gap: 12px;
   padding: 10px 8px;
   z-index: 998;
   background: #000D50;
   width: 100%;
   max-width: none;
   height: var(--inventory-bar-height, 77px); /* Фіксована висота */
   align-items: center;
   justify-content: center;
   box-sizing: border-box;
   box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.inventory-bar::before {
   content: "";
   position: absolute;
   top: calc(-1 * var(--inventory-spacing, 12px));
   left: 0;
   right: 0;
   height: var(--inventory-spacing, 12px);
   background: inherit;
   pointer-events: none;
   z-index: -1;
}
  
  /* Приховати на інших екранах */
  body:has(#profile-page[style*="display: block"]) .inventory-bar,
  body:has(#leaderboard-page[style*="display: block"]) .inventory-bar,
  body:has(#store-page[style*="display: block"]) .inventory-bar {
    display: none !important;
  }
  
  /* Показувати тільки на головному екрані */
  body:has(#app[style*="display: block"]) .inventory-bar {
    display: flex;
  }
  
  /* ==========================================
     INVENTORY SLOT - BASE
     ========================================== */
  
  .inventory-slot {
    position: relative;
    width: 96px;
    height: 57px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    box-sizing: border-box;
  }
  
  /* Стан 1: ПУСТО (quantity = 0) */
  .inventory-slot[data-state="empty"] {
    background: radial-gradient(50% 50% at 50% 50%, #2977FF 0%, #1C24FF 100%);
    box-shadow: 0px 2px 8px -2px rgba(0, 0, 0, 0.25);
  }
  
  .inventory-slot[data-state="empty"]:active {
    transform: scale(0.95);
  }
  
  /* Стан 2: В НАЯВНОСТІ (quantity > 0) */
  .inventory-slot[data-state="available"] {
    background: radial-gradient(50% 50% at 50% 50%, #2977FF 0%, #1C24FF 100%);
    box-shadow: 0px 2px 8px -2px rgba(0, 0, 0, 0.25);
  }
  
  .inventory-slot[data-state="available"]:active {
    transform: scale(0.95);
  }
  
  /* Стан 3: АКТИВНИЙ (активований) */
  .inventory-slot[data-state="active"] {
    background: radial-gradient(50% 50% at 50% 50%, #29CDFF 0%, #1CFF86 100%);
    box-shadow: 0px 0px 12px 4px rgba(255, 255, 255, 0.25);
    cursor: default;
  }
  
  /* ==========================================
     ICON
     ========================================== */
  
  .slot-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  
  .slot-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
  }
  
  /* Пуста - напівпрозора іконка */
  .inventory-slot[data-state="empty"] .slot-icon {
    opacity: 0.2;
  }
  
  /* В наявності і активна - повна непрозорість */
  .inventory-slot[data-state="available"] .slot-icon,
  .inventory-slot[data-state="active"] .slot-icon {
    opacity: 1;
  }
  
  /* ==========================================
     COUNTER (кружечок з кількістю)
     ========================================== */
  
  .slot-counter {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: #FFFFFF;
    padding: 0 5px;
    transition: all 0.3s ease;
    box-sizing: border-box;
  }
  
  /* Пуста - синій кружок */
  .inventory-slot[data-state="empty"] .slot-counter {
    background: #00AAFF;
  }
  
  /* В наявності - червоний кружок */
  .inventory-slot[data-state="available"] .slot-counter {
    background: #FF0000;
  }
  
  /* Активна - приховуємо */
  .inventory-slot[data-state="active"] .slot-counter {
    display: none;
  }
  
  /* ==========================================
     TIMER (таймер для активного бустера)
     ========================================== */
  
  .slot-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
    border-radius: 0px 0px 5px 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .timer-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 230, 0, 0.7) 0%, rgba(255, 0, 204, 0.7) 100%);
    transition: width 1s linear;
    width: 100%;
  }
  
  .timer-text {
    position: relative;
    z-index: 1;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 10px;
    line-height: 12px;
    color: #FFFFFF;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.8);
  }
  
  /* ==========================================
     RESPONSIVE
     ========================================== */
  
  @media (max-width: 420px) {
    .inventory-bar {
      gap: 8px;
      padding: 8px 6px;
    }
  
    .inventory-slot {
      width: 80px;
      height: 48px;
    }

    .slot-counter {
      min-width: 16px;
      height: 16px;
      font-size: 10px;
      top: 2px;
      right: 2px;
    }
  
    .timer-text {
      font-size: 9px;
    }
  }
  
  @media (max-width: 360px) {
    .inventory-bar {
      gap: 6px;
    }
  
    .inventory-slot {
      width: 70px;
      height: 42px;
    }
  
    .slot-counter {
      min-width: 14px;
      height: 14px;
      font-size: 9px;
    }
  }
