/* styles.css - Версия для ФИКСИРОВАННОГО размера комнаты */

/* Скрытие элементов (для вкладок, модалок и т.д.) */
.hidden {
  display: none;
}

/* === Модальные окна и попапы === */
#loginModal,
#registerModal,
#profileModal,
#notificationModal,
#adminPanelModal,
#walletModal,
#itemPopup,
#questsModal {
    z-index: 1000; /* Общий для большинства модалок */
    min-width: 150px;
}

/* Отдельно для #questsModal, чтобы он был выше других */
#questsModal {
    z-index: 1050;
}

/* Кнопки закрытия модальных окон */
#closeLogin,
#closeRegister,
#closeProfile,
#closeNotification,
#closeWallet,
#closeAdminPanel {
  cursor: pointer;
}

/* Стили для попапа информации о предмете */
#itemPopup {
  background-color: #2d3748; /* Tailwind bg-gray-700 */
  border: 1px solid #4a5568; /* Tailwind border-gray-600 */
  padding: 0.75rem; /* 12px */
  border-radius: 0.375rem; /* 6px */
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  /* z-index уже задан выше */
}
.item-popup-content {
  /* Используется flex из JS для расположения колонок */
}
.item-popup-info {
  /* Стили для левой колонки (текст) */
}
.item-popup-image {
  /* Стили для правой колонки (картинка) */
}
.popup-item-preview {
  display: block;
  width: 64px;  /* Размер картинки в попапе (ПОДОБРАТЬ!) */
  height: 64px;
  object-fit: contain;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* --- Стили для страницы Лидерборда --- */
#leaderboard-table {
    width: 100%;
    border-collapse: collapse; /* Убираем двойные рамки */
}

#leaderboard-table thead th {
    background-color: #374151; /* bg-gray-700 */
    border-bottom: 2px solid #4b5563; /* bg-gray-600 */
}

#leaderboard-table tbody tr:nth-child(even) {
    background-color: rgba(55, 65, 81, 0.5); /* Полупрозрачный bg-gray-700 */
}

#leaderboard-table tbody tr:hover {
    background-color: #4b5563; /* bg-gray-600 */
}

#leaderboard-table td, #leaderboard-table th {
    padding: 0.75rem 1rem; /* p-3 px-4 */
    border-bottom: 1px solid #374151; /* bg-gray-700 */
}

/* Добавляем стиль для кликабельных строк */
#leaderboard-table .player-row {
    cursor: pointer;
}

/* --- Стили для Модального Окна Просмотра Комнаты --- */
#viewRoomModal {
    /* Стили позиционирования уже есть в HTML */
}

/* Убедимся, что контейнер комнаты в модалке не имеет лишних отступов */
#view-room-parent-container {
   padding: 0 !important; /* Убираем padding родителя, если он был */
   display: flex; /* Используем flex для центрирования */
   justify-content: center;
   align-items: center;
   width: 100%;
   min-height: 300px; /* Минимальная высота для показа лоадера */
   box-sizing: border-box;
}

/* Обертка .fixed-room-wrapper должна быть display: block по умолчанию */
#viewRoomModal .fixed-room-wrapper {
   margin: 0; /* Убираем margin auto, т.к. центрирует родитель */
   transform-origin: top left; /* Для масштабирования */
   /* Размеры width/height будут заданы через JS */
   box-shadow: 0 0 15px rgba(0,0,0,0.5); /* Небольшая тень для выделения */
}

/* Убедимся, что сетка внутри видима */
#viewRoomModal .shelf-grid-container {
    /* Стили grid/position/top/left будут заданы через JS */
    /* border: 1px dashed yellow; */ /* Для отладки */
}
#viewRoomModal .shelf-spot {
    /* border: 1px dashed cyan; */ /* Для отладки */
}


/* === Стили для Игр === */
.game-card.on-cooldown {
    opacity: 0.6;
    filter: grayscale(80%) blur(1px);
    pointer-events: none;
    position: relative;
}
.game-card.on-cooldown .cooldown-timer {
   pointer-events: auto;
   width: 100%;
}
.cooldown-timer {
    min-height: 1.5rem;
}
#finish-game-btn.active {
    display: block;
}
#active-game-container.game-won #close-game-btn {
    display: none;
}

/* === Общие стили макета === */
.bg-gray-800 { /* Основной фон контейнеров */
  background-color: #1f2937;
}

#sidebar { /* Боковое меню */
  position: fixed;
  left: 0;
  top: 4rem; /* Отступ от шапки */
  bottom: 0;
  z-index: 50;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

#main-content { /* Основной контент */
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
    /* Отступы pt-16 ml-16 заданы в HTML */
}

#notificationMessage { /* Текст уведомления */
  color: #D1D5DB;
  display: block;
  visibility: visible;
}

.cursor-pointer {
  cursor: pointer;
}

/* === СТИЛИ ДЛЯ ИГРОВОЙ КОМНАТЫ (ФИКСИРОВАННЫЙ РАЗМЕР) === */

/* НОВЫЙ Контейнер с фиксированными размерами */
.fixed-room-wrapper {
  /* --- ЗАДАЙ ЖЕЛАЕМЫЕ РАЗМЕРЫ КОМНАТЫ (ПОДОБРАТЬ!) --- */
  width: 800px;  /* Ширина комнаты */
  height: 552px; /* Высота комнаты (рассчитана из 800px для пропорции ~1.45) */
  /* ------------------------------------------------------ */
  position: relative; /* Для позиционирования сетки внутри */
  
  /* Кибер стая с CSS градиенти и ефекти */
  background-image: 
    /* Grid линии (първи слой - най-отгоре) */
    linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px),
    /* Основните градиенти */
    linear-gradient(135deg, #0a0e27 0%, #1a1f3a 25%, #0f1419 50%, #1a1f3a 75%, #0a0e27 100%),
    /* Неоново осветление отгоре */
    radial-gradient(ellipse at top center, rgba(0, 255, 255, 0.15) 0%, transparent 70%),
    /* Неоново осветление отдолу */
    radial-gradient(ellipse at bottom center, rgba(138, 43, 226, 0.1) 0%, transparent 70%),
    /* Централно осветление */
    radial-gradient(circle at center, rgba(0, 255, 255, 0.08) 0%, transparent 60%);
  
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 50%, 100% 50%, 100% 100%;
  background-position: center, center, center, top, bottom, center;
  
  /* Border с неонов ефект */
  border: 2px solid rgba(0, 255, 255, 0.3);
  box-shadow: 
    inset 0 0 30px rgba(0, 255, 255, 0.1),
    0 0 20px rgba(0, 255, 255, 0.2),
    0 0 40px rgba(138, 43, 226, 0.1);
  
  margin: 0 auto; /* Центрирует блок в родительском контейнере */
  overflow: hidden; /* Обрезаем все выходящее за рамки */
  
  /* Псевдо-елементи за допълнителни ефекти */
}

/* Добавяне на кибер ефекти с псевдо-елементи */
.fixed-room-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    /* Вертикални неонови линии отстрани */
    linear-gradient(90deg, transparent 0%, rgba(0, 255, 255, 0.1) 10%, transparent 20%),
    linear-gradient(90deg, transparent 80%, rgba(0, 255, 255, 0.1) 90%, transparent 100%),
    /* Хоризонтални линии */
    linear-gradient(0deg, transparent 0%, rgba(138, 43, 226, 0.08) 5%, transparent 10%),
    linear-gradient(0deg, transparent 90%, rgba(138, 43, 226, 0.08) 95%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.fixed-room-wrapper::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 255, 255, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 1;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateX(-50%) scale(1.2);
  }
}

/* === ROOM BACKGROUND WRAPPER === */
.room-background-area {
  position: relative;
  min-height: 100%;
  padding: 1.5rem; /* Add padding if needed */
}

/* Прилагаме background на цялата стая когато има room_background setting */
/* Background-ът се задава inline в game.php, тази стилизация е fallback */
.room-background-area[data-has-room-bg="1"] {
  /* Background се задава inline в game.php */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Ако background е зададен, правим fixed-room-wrapper по-прозрачен за да се вижда background-ът */
.room-background-area[data-has-room-bg="1"] .fixed-room-wrapper {
  background: 
    /* Grid линии (първи слой - най-отгоре) - по-слаби */
    linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px),
    /* Основните градиенти с по-ниска opacity за да се вижда background-ът */
    linear-gradient(135deg, rgba(10, 14, 39, 0.4) 0%, rgba(26, 31, 58, 0.4) 25%, rgba(15, 20, 25, 0.4) 50%, rgba(26, 31, 58, 0.4) 75%, rgba(10, 14, 39, 0.4) 100%);
  background-blend-mode: overlay;
}

/* Също правим room-parent-container по-прозрачен когато има background */
.room-background-area[data-has-room-bg="1"] #room-parent-container {
  background-color: rgba(17, 24, 39, 0.5); /* bg-gray-900/50 вместо bg-gray-900/80 */
}

/* === LOADING OVERLAY СТИЛОВЕ === */
.room-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.85); /* Dark overlay - 85% opacity */
  backdrop-filter: blur(8px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.room-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.room-loading-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  text-align: center;
  padding: 2rem;
  z-index: 11;
}

/* Brand Core */
.room-loading-brand {
  margin-bottom: 3rem;
  animation: fadeInDown 0.6s ease-out;
}

.room-loading-logo {
  font-size: 4rem;
  color: #facc15;
  text-shadow: 0 0 20px rgba(250, 204, 21, 0.8), 0 0 40px rgba(250, 204, 21, 0.4);
  margin-bottom: 1rem;
  animation: logoPulse 2s ease-in-out infinite;
}

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

.room-loading-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  letter-spacing: 0.1em;
}

.room-loading-slogan {
  font-size: 0.9rem;
  color: rgba(0, 255, 255, 0.7);
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* Core Animation */
.room-loading-core {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 2rem auto;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

.core-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border: 3px solid rgba(0, 255, 255, 0.4);
  border-radius: 50%;
  animation: corePulse 2s ease-in-out infinite;
}

.core-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  box-shadow: 
    0 0 30px rgba(0, 255, 255, 0.6),
    inset 0 0 20px rgba(0, 255, 255, 0.2);
  animation: coreGlow 1.5s ease-in-out infinite;
}

.core-scan {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.8), transparent);
  transform: translateY(-50%);
  animation: coreScan 2s linear infinite;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

@keyframes corePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.8;
  }
}

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

@keyframes coreScan {
  0% {
    top: 0;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Progress Indicator */
.room-loading-progress {
  margin: 2rem 0;
  animation: fadeIn 0.8s ease-out 0.5s both;
}

.progress-bar-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    rgba(0, 255, 255, 0.8) 0%,
    rgba(138, 43, 226, 0.8) 50%,
    rgba(0, 255, 255, 0.8) 100%);
  background-size: 200% 100%;
  animation: progressFlow 2s linear infinite, progressFill 0.3s ease-out;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
  transition: width 0.3s ease-out;
}

.progress-bar-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, 
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent);
  animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

@keyframes progressGlow {
  0%, 100% { transform: translateX(-100%); opacity: 0; }
  50% { transform: translateX(400%); opacity: 1; }
}

.progress-percentage {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  letter-spacing: 0.1em;
}

/* Status Text */
.room-loading-status {
  margin-top: 2rem;
  animation: fadeIn 0.8s ease-out 0.7s both;
}

.status-text {
  font-size: 1rem;
  color: rgba(0, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  min-height: 1.5rem;
  font-weight: 500;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.status-steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.status-step {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
}

.status-step.active {
  color: #00ffff;
  border-color: rgba(0, 255, 255, 0.6);
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.status-step.completed {
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.6);
  background: rgba(34, 211, 238, 0.1);
}

.status-step.completed::before {
  content: '✓ ';
  margin-right: 0.25rem;
}

/* Ambient Particles */
.room-loading-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(0, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
  animation-duration: 10s;
}

.particle:nth-child(2) {
  left: 30%;
  top: 60%;
  animation-delay: 2s;
  animation-duration: 12s;
}

.particle:nth-child(3) {
  left: 70%;
  top: 30%;
  animation-delay: 4s;
  animation-duration: 9s;
}

.particle:nth-child(4) {
  left: 50%;
  top: 80%;
  animation-delay: 1s;
  animation-duration: 11s;
}

.particle:nth-child(5) {
  left: 90%;
  top: 50%;
  animation-delay: 3s;
  animation-duration: 13s;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translate(20px, -30px) scale(1.2);
    opacity: 0.8;
  }
  50% {
    transform: translate(-15px, -50px) scale(0.8);
    opacity: 1;
  }
  75% {
    transform: translate(30px, -20px) scale(1.1);
    opacity: 0.6;
  }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Контейнер СЕТКИ полок - позиционируется ВНУТРИ .fixed-room-wrapper */
.shelf-grid-container {
  display: grid;

  /* --- НАСТРОЙКА РАЗМЕРОВ ЯЧЕЕК И ОТСТУПОВ - ОТНОСИТЕЛНИ ЗА РАВНОМЕРНО РАЗПРЕДЕЛЕНИЕ --- */
  /* Използваме 4 колони и 3 реда за 12 слота (4x3 = 12) */
  grid-template-columns: repeat(4, 1fr); /* Равномерно разпределение - 1fr за всяка колона */
  grid-template-rows: repeat(3, 1fr);    /* Равномерно разпределение - 1fr за всеки ред */
  column-gap: clamp(8px, 2%, 16px);      /* Относителен gap с минимум/максимум */
  row-gap: clamp(8px, 2%, 16px);         /* Относителен gap с минимум/максимум */

  /* --- ПОЗИЦИОНИРАНЕ: ИЗПОЛЗВА ЦЯЛАТА ПЛОЩ НА .fixed-room-wrapper --- */
  position: absolute;
  inset: 0;                              /* Top, right, bottom, left = 0 - заема цялата площ */
  padding: clamp(16px, 3%, 24px);        /* Относителен padding с минимум/максимум */
  box-sizing: border-box;                 /* Padding се включва в размер */
  
  /* Визуално подреждане - центриране на слотовете */
  justify-content: center;
  align-content: center;
}

/* ----- Стили отдельного слота/места для полки В СЕТКЕ КОМНАТЫ ----- */
.shelf-spot {
  position: relative;
  overflow: visible; /* Позволяваме визуалния scale да излиза извън контейнера */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Размеры задаются через grid-template-... в .shelf-grid-container */
  cursor: default;
  
  /* ВИДИМОСТ НА ПРАЗЕН СЛОТ: Лек dashed border и полупрозрачен background */
  border: 1px dashed rgba(0, 255, 255, 0.25);      /* Циан dashed border - видим но ненатрапчив */
  background-color: rgba(0, 255, 255, 0.03);        /* Много лека фонова окраска */
  border-radius: 4px;                                /* Леко закръглени ъгли */
  transition: border-color 0.2s ease, background-color 0.2s ease; /* Smooth transitions */
}

/* Hover ефект за празен слот - по-видим */
.shelf-spot:hover:not(:has(.shelf-content)) {
  border-color: rgba(0, 255, 255, 0.4);             /* По-ярък border при hover */
  background-color: rgba(0, 255, 255, 0.08);        /* По-ярък background при hover */
}

/* Стиль для подсветки пустого спота при размещении ПОЛКИ */
.shelf-spot.highlight-shelf {
  background-color: rgba(0, 150, 255, 0.3);
  border: 2px dashed rgba(0, 150, 255, 0.7);
  cursor: pointer;
}


/* ----- Стили СОДЕРЖИМОГО полки (когда она установлена) ----- */
/* Этот div добавляется в .shelf-spot через JS */
/* Размерите се задават директно от JS базирани на grid_w и grid_h */
.shelf-content {
  position: absolute;
  top: 50%;
  left: 50%;
  /* transform се задава от JS (scale за rack-овете) */
  /* JS ще комбинира translate(-50%, -50%) с scale() */
  /* width и height се задават от JS: gridW * TILE_WIDTH * scale */
  /* НЕ включваме gap-овете, защото grid вече ги управлява */
  display: block;
  cursor: pointer;
  overflow: visible; /* Позволяваме визуалния scale да излиза извън контейнера */
  box-sizing: border-box; /* Включва padding/border в width/height */
}

/* Стили картинки самой полки - grid-based размери */
.shelf-content img.shelf-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;  /* Заема целия контейнер */
  height: 100%; /* Заема целия контейнер */
  object-fit: contain; /* Запазваме aspect ratio, побираме в контейнера */
  display: block;
  z-index: 0;
  pointer-events: none; /* Не блокираме кликовете на slots */
}

/* Специален стил за rack изображения - същите размери */
.shelf-content img.shelf-image.rack-image {
  /* Същите стилове като останалите - без допълнително мащабиране */
}

/* Контейнер для ряда слотов НА полке */
.slot-row {
  position: absolute;
  width: 90%;      /* Ширина ряда на полке - увеличена за по-добро разпределение */
  display: flex;
  align-items: center;
  justify-content: space-around; /* Равномерно разпределение на слота */
  gap: 2%;
  z-index: 1;
  left: 5%;
}
/* --- НАСТРОЙКА ПОЛОЖЕНИЯ РЯДОВ СЛОТОВ НА ПОЛКЕ --- */
.slot-row.top    { top: 5%; } /* % от высоты .shelf-content */
.slot-row.middle { top: 40%; } /* % от высоты .shelf-content */
.slot-row.bottom { top: 75%; } /* % от высоты .shelf-content */

/* Стили отдельной ячейки (слота) НА полке */
.shelf-slot {
  /* --- НАСТРОЙКА РАЗМЕРОВ СЛОТОВ ОТНОСИТЕЛЬНО ПОЛКИ --- */
  flex: 0 0 auto;      /* Не се разтяга, фиксиран размер */
  width: 50px;         /* Фиксиран размер на слота */
  height: 50px;        /* Фиксиран размер на слота */
  min-width: 40px;     /* Минимален размер */
  min-height: 40px;
  max-width: 60px;     /* Макс. размер иконок */
  max-height: 60px;

  /* ВИЗУАЛИЗАЦИЯ НА СЛОТА - видими граници за да се виждат ясно */
  background-color: rgba(0, 255, 255, 0.05); /* Светъл фон за да се вижда слота */
  border: 1px solid rgba(0, 255, 255, 0.3); /* Видима рамка за да се различават слота */
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 2px; /* Spacing между слотовете */
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  position: relative; /* За позициониране на badges */
  box-shadow: 0 0 2px rgba(0, 255, 255, 0.2); /* Лека сянка за по-добра видимост */
}

/* Стил за празен слот - по-видим */
.shelf-slot.empty {
  background-color: rgba(0, 255, 255, 0.1);
  border: 1px dashed rgba(0, 255, 255, 0.5);
}

/* Стил за зает слот - по-тъмен */
.shelf-slot:not(.empty) {
  background-color: rgba(0, 255, 255, 0.15);
  border: 1px solid rgba(0, 255, 255, 0.6);
}

/* Drag and drop styles - SNAP-TO-SLOT */
/* СТЪПКА 4: Подсветка само на най-близкия слот (таргет) */
.shelf-slot.drag-target {
  z-index: 20 !important; /* По-висок z-index за да е видимо над други слота */
  position: relative;
}

.shelf-slot.drag-over-valid {
  background-color: rgba(16, 185, 129, 0.5) !important; /* По-ярко зелено за таргет слот */
  border-color: rgba(16, 185, 129, 1) !important;
  border-width: 3px !important;
  border-style: solid !important;
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(16, 185, 129, 1);
  z-index: 20;
}

.shelf-slot.drag-over-invalid.drag-target {
  background-color: rgba(239, 68, 68, 0.4) !important; /* По-ярко червено за зает таргет слот */
  border-color: rgba(239, 68, 68, 1) !important;
  border-width: 3px !important;
  border-style: dashed !important;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.9);
  z-index: 20;
}

/* СТЪПКА 6: Shake animation и slot-reject стилове при опит за drop върху зает слот */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shelf-slot.shake-animation {
  animation: shake 0.6s ease-in-out;
  background-color: rgba(239, 68, 68, 0.6) !important;
  border-color: rgba(239, 68, 68, 1) !important;
  border-width: 3px !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 1);
}

.shelf-slot.slot-reject {
  background-color: rgba(239, 68, 68, 0.5) !important;
  border-color: rgba(239, 68, 68, 1) !important;
  border-width: 3px !important;
}

.shelf-slot.drag-over {
  background-color: rgba(0, 255, 255, 0.3) !important;
  border-color: rgba(0, 255, 255, 1) !important;
  border-width: 2px !important;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

/* Highlight за празни слота при placement режим */
.shelf-slot.slot-highlight {
  background-color: rgba(16, 185, 129, 0.3) !important;
  border-color: rgba(16, 185, 129, 0.8) !important;
  border-style: dashed !important;
  border-width: 2px !important;
  animation: pulse-slot 2s infinite;
}

@keyframes pulse-slot {
  0%, 100% {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.8);
  }
}

/* Preview на слота които ще се заемат при hover */
.shelf-slot.slot-preview {
  background-color: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  border-style: dashed;
}

/* Inventory items draggable */
[draggable="true"] {
  cursor: grab;
  user-select: none;
}

[draggable="true"]:active {
  cursor: grabbing;
}

.inventory-item-icon {
  pointer-events: auto;
}

/* Стили для иконки предмета внутри слота */
.shelf-slot .item-icon { /* Класс для тега <img> иконки */
    display: block;
    max-width: 100%; /* Макс. размер иконки внутри слота */
    max-height: 100%;
    object-fit: contain;
}

/* Стиль подсветки пустого слота при размещении ПРЕДМЕТА */
.shelf-slot.slot-highlight {
  background-color: rgba(0, 255, 0, 0.3);
  border: 1px dashed rgba(0, 255, 0, 0.9);
}

/* === КОНЕЦ СТИЛЕЙ ДЛЯ КОМНАТЫ === */


/* === СТИЛИ ИНВЕНТАРЯ === */
.inventory-item-icon {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 40px;   /* Размер иконки в инвентаре (ПОДОБРАТЬ!) */
  height: 40px;
  object-fit: contain;
}
.inventory-shelf-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
}

/* === ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ЦВЕТОВ И ТЕНЕЙ === */
:root {
  --color-bg-main: #181926;
  --color-bg-card: #23272f;
  --color-bg-glow: #3b3b5c;
  --color-accent: #facc15;
  --color-accent2: #f472b6;
  --color-accent3: #38bdf8;
  --color-accent4: #a21caf;
  --color-success: #22d3ee;
  --color-error: #ef4444;
  --color-warning: #fbbf24;
  --color-glow: 0 0 16px 2px var(--color-accent2), 0 0 32px 4px var(--color-accent);
  --color-shadow: 0 4px 24px 0 rgba(0,0,0,0.25), 0 1.5px 0 0 #2d3748;
  --color-shadow-card: 0 2px 12px rgba(0,0,0,0.18);
  --color-shadow-btn: 0 2px 8px rgba(250,204,21,0.10);
  --color-shadow-btn-hover: 0 4px 16px rgba(250,204,21,0.18);
  --avatar-left: 153px; /* adjust X coordinate within 800x552 room */
  --avatar-top: 82px;  /* adjust Y coordinate */
  --avatar-size: 67px; /* sprite width */
}

body {
  background: var(--color-bg-main);
  color: #fff;
  font-family: 'Montserrat', 'Arial', sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.3s;
}

/* --- МОДАЛКИ, УВЕДОМЛЕНИЯ, ПОПАПЫ --- */
#notificationModal, #loginModal, #registerModal, #profileModal, #walletModal, #itemPopup, #adminPanelModal {
  animation: fadeInModal 0.35s cubic-bezier(.4,0,.2,1);
  background: rgba(24,25,38,0.92) !important;
  backdrop-filter: blur(2px);
}
@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
#notificationModal .modal-content, .modal-content {
  background: var(--color-bg-card);
  border-radius: 18px;
  box-shadow: var(--color-shadow);
  padding: 2rem 1.5rem;
  animation: popIn 0.3s cubic-bezier(.4,0,.2,1);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- КНОПКИ --- */
button, .btn {
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent2) 100%);
  color: #23272f;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--color-shadow-btn);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.15s;
  outline: none;
}
button:hover, .btn:hover {
  background: linear-gradient(90deg, var(--color-accent2) 0%, var(--color-accent) 100%);
  color: #fff;
  box-shadow: var(--color-shadow-btn-hover), 0 0 8px 2px var(--color-accent2);
  transform: translateY(-2px) scale(1.03);
}
button:active, .btn:active {
  transform: scale(0.97);
}
button:disabled, .btn:disabled {
  background: #444;
  color: #bbb;
  cursor: not-allowed;
  opacity: 0.7;
}

/* --- ВКЛАДКИ --- */
.market-tab, .wallet-tab, .history-tab {
  background: var(--color-bg-card);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px 10px 0 0;
  padding: 10px 28px;
  border: none;
  outline: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  margin-right: 2px;
}
.market-tab.active, .wallet-tab.active, .history-tab.active {
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent2) 100%);
  color: #23272f;
  box-shadow: 0 4px 16px rgba(250,204,21,0.12);
}
.market-tab:not(.active):hover, .wallet-tab:not(.active):hover, .history-tab:not(.active):hover {
  background: var(--color-bg-glow);
  color: #fff;
}

/* --- VALUE-BOX (инфо-блоки в комнате) --- */
.value-box {
  position: relative;
  background: linear-gradient(135deg, var(--color-bg-card) 80%, var(--color-bg-glow) 100%);
  border-radius: 18px;
  box-shadow: var(--color-shadow);
  padding: 1.2rem 1rem 1rem 1rem;
  margin-bottom: 0.7rem;
  min-height: 80px;
  overflow: visible;
  border: 2px solid transparent;
  transition: box-shadow 0.22s, border 0.22s;
  animation: fadeInBox 0.5s cubic-bezier(.4,0,.2,1);
}
@keyframes fadeInBox {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.value-box:hover {
  border: 2px solid var(--color-accent2);
  box-shadow: 0 0 24px 0 var(--color-accent2), var(--color-shadow);
}

/* --- КАРТОЧКИ (market, sell, инвентарь) --- */
.bg-gray-700, .sell-card, .inventory-card, .market-card {
  background: var(--color-bg-card) !important;
  border-radius: 16px !important;
  box-shadow: var(--color-shadow-card) !important;
  border: 2px solid #444 !important;
  transition: border 0.18s, box-shadow 0.18s, background 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
}
.sell-card:hover, .inventory-card:hover, .market-card:hover, .bg-gray-700:hover {
  border-color: var(--color-accent);
  background: #2d3748 !important;
  box-shadow: 0 0 32px 0 var(--color-accent2), var(--color-shadow-card);
  transform: translateY(-2px) scale(1.03);
}

/* --- ИНВЕНТАРЬ --- */
.inventory-item-icon, .inventory-shelf-icon {
  filter: drop-shadow(0 2px 8px var(--color-accent2));
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  transition: filter 0.18s, background 0.18s;
}
.inventory-item-icon:hover, .inventory-shelf-icon:hover {
  filter: drop-shadow(0 4px 16px var(--color-accent));
  background: rgba(255,255,255,0.10);
}

/* --- SCROLLBAR --- */
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: var(--color-accent2);
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* --- TOOLTIP --- */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(34,34,44,0.95);
  color: var(--color-accent);
  font-weight: bold;
  font-size: 15px;
  border-radius: 50%;
  cursor: pointer;
  text-align: center;
  line-height: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 2px solid #444;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  z-index: 10;
}
.tooltip-icon:hover {
  background: var(--color-accent);
  color: #23272f;
  box-shadow: 0 4px 16px var(--color-accent2);
}
.tooltip-icon:hover::after {
  content: attr(data-tip);
  position: absolute;
  right: 110%;
  top: 50%;
  transform: translateY(-50%) scale(1);
  background: #23272f;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  white-space: pre-line;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  z-index: 100;
  min-width: 180px;
  max-width: 260px;
  font-size: 14px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  font-family: 'Montserrat', 'Arial', sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.tooltip-icon::after {
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  transform: scale(0.95);
}

/* --- АНИМАЦИИ ДЛЯ СПИСКОВ, КАРТОЧЕК, ПОЯВЛЕНИЯ --- */
@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sell-card, .market-card, .inventory-card, .bg-gray-700 {
  animation: fadeInCard 0.5s cubic-bezier(.4,0,.2,1);
}

/* --- МОДАЛЬНЫЕ КНОПКИ ЗАКРЫТИЯ --- */
#closeLogin, #closeRegister, #closeProfile, #closeNotification, #closeWallet, #closeAdminPanel {
  background: none;
  color: var(--color-error);
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  transition: color 0.18s;
}
#closeLogin:hover, #closeRegister:hover, #closeProfile:hover, #closeNotification:hover, #closeWallet:hover, #closeAdminPanel:hover {
  color: var(--color-accent2);
}

/* --- АДАПТИВНОСТЬ (дополнительно) --- */
@media (max-width: 768px) {
  .value-box { padding: 0.7rem 0.5rem 0.5rem 0.5rem; min-height: 60px; }
  .sell-card, .market-card, .inventory-card, .bg-gray-700 { padding: 10px 4px 8px 4px !important; }
  .market-tab, .wallet-tab, .history-tab { padding: 7px 10px; font-size: 0.95rem; }
}

/* --- ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ АДМИНКИ --- */
#adminPanelModal, .admin-panel-section, .admin-panel-table, .admin-panel-btn {
  background: var(--color-bg-card);
  border-radius: 16px;
  box-shadow: var(--color-shadow-card);
  border: 2px solid #444;
  transition: border 0.18s, box-shadow 0.18s, background 0.18s;
}
.admin-panel-section {
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}
.admin-panel-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.admin-panel-table th, .admin-panel-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #374151;
}
.admin-panel-btn {
  margin-top: 10px;
  background: linear-gradient(90deg, var(--color-accent3) 0%, var(--color-accent4) 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(56,189,248,0.10);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.admin-panel-btn:hover {
  background: linear-gradient(90deg, var(--color-accent4) 0%, var(--color-accent3) 100%);
  color: var(--color-accent);
  box-shadow: 0 4px 16px var(--color-accent3);
}

/* --- ФИНАЛЬНЫЕ ДОПОЛНЕНИЯ --- */
::-webkit-scrollbar {
  width: 8px;
  background: #23272f;
}
::-webkit-scrollbar-thumb {
  background: var(--color-accent2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* === СТИЛИ СКРОЛЛБАРА === */
.max-h-40 { max-height: 10rem; }
.overflow-y-auto { overflow-y: auto; }
.overflow-y-auto::-webkit-scrollbar { width: 8px; }
.overflow-y-auto::-webkit-scrollbar-track { background: #2d3748; }
.overflow-y-auto::-webkit-scrollbar-thumb { background: #4a5568; border-radius: 4px; }
.overflow-y-auto::-webkit-scrollbar-thumb:hover { background: #718096; }

.value-box {
  position: relative;
  background: linear-gradient(135deg, #23272f 80%, #3b3b5c 100%);
  border-radius: 16px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.25), 0 1.5px 0 0 #2d3748;
  padding: 1.5rem 1rem 1.2rem 1rem;
  margin-bottom: 1.2rem;
  min-height: 90px;
  overflow: visible;
}
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(34,34,44,0.95);
  color: #facc15;
  font-weight: bold;
  font-size: 15px;
  border-radius: 50%;
  cursor: pointer;
  text-align: center;
  line-height: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 2px solid #444;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  z-index: 10;
}
.tooltip-icon:hover {
  background: #facc15;
  color: #23272f;
  box-shadow: 0 4px 16px rgba(250,204,21,0.18);
}
.tooltip-icon:hover::after {
  content: attr(data-tip);
  position: absolute;
  right: 110%;
  top: 50%;
  transform: translateY(-50%) scale(1);
  background: #23272f;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  white-space: pre-line;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  z-index: 100;
  min-width: 180px;
  max-width: 260px;
  font-size: 14px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  font-family: 'Montserrat', 'Arial', sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.tooltip-icon::after {
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  transform: scale(0.95);
}

.market-tab {
  background: #23272f;
  color: #facc15;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px 8px 0 0;
  padding: 8px 22px;
  border: none;
  outline: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  margin-right: 2px;
}
.market-tab.active {
  background: linear-gradient(90deg, #facc15 0%, #f472b6 100%);
  color: #23272f;
  box-shadow: 0 4px 16px rgba(250,204,21,0.12);
}
.market-tab:not(.active):hover {
  background: #3b3b5c;
  color: #fff;
}
.sell-card {
  background: #23272f;
  border: 2px solid #444;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 18px 10px 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border 0.18s, box-shadow 0.18s, background 0.18s;
  position: relative;
}
.sell-card:hover {
  border-color: #facc15;
  background: #2d3748;
  box-shadow: 0 4px 24px rgba(250,204,21,0.10);
}
.sell-btn {
  margin-top: 10px;
  background: linear-gradient(90deg, #facc15 0%, #f472b6 100%);
  color: #23272f;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(250,204,21,0.10);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.sell-btn:disabled {
  background: #444;
  color: #bbb;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Мобильные стили для игр */
@media (max-width: 768px) {
    #main-content {
        margin-left: 0 !important;
        padding-top: 1rem !important;
    }

    .game-card {
        margin-bottom: 1rem;
    }

    #active-game-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        background: #000;
        display: flex;
        flex-direction: column;
    }

    .game-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        overflow: hidden;
        position: relative;
        width: 100vw;
        height: 100vh;
    }

    #game-iframe {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transform: none !important;
        border: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /* Специальные стили для змейки */
    #game-iframe[src*="snake"] {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transform: scale(0.9) !important; /* Уменьшаем масштаб для змейки */
    }

    .game-controls {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 1010;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        pointer-events: auto;
    }

    #close-game-btn {
        background: rgba(220, 38, 38, 0.8);
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-size: 0.875rem;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    #game-status-message {
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-size: 0.875rem;
        z-index: 1010;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        max-width: 90%;
    }

    #finish-game-btn {
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(234, 179, 8, 0.8);
        color: #000;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-size: 0.875rem;
        z-index: 1010;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Стили для полноэкранного режима */
.game-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Стили для модального окна победы в полноэкранном режиме */
#winModal {
    z-index: 2000 !important;
}

#winModal .bg-gray-800 {
    background: rgba(31, 41, 55, 0.95) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Стили для баннеров на мобильных */
@media (max-width: 768px) {
    #top-banner-slot {
        height: 3rem;
    }

    #left-banner-slot,
    #right-banner-slot {
        display: none;
    }
}

/* Стили для списка игр на мобильных */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-card {
        margin-bottom: 0;
    }

    .game-card img {
        height: 8rem;
    }

    .game-card h2 {
        font-size: 1.125rem;
    }

    .game-card p {
        font-size: 0.875rem;
    }

    .play-game-btn {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
}

/* Стили для таймеров кулдауна на мобильных */
@media (max-width: 768px) {
    .cooldown-timer {
        font-size: 0.875rem;
    }
}

/* Стили для сообщений о статусе игры на мобильных */
@media (max-width: 768px) {
    #game-status-message {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        max-width: 90%;
        text-align: center;
    }
}

/* Стили для страницы помощи */
.help-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    color: #333;
}

.help-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.help-container h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 30px;
}

.help-container h3 {
    color: #34495e;
    margin-top: 20px;
}

.story-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.mechanics-section, .games-section, .tips-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.help-container ul {
    list-style-type: none;
    padding-left: 20px;
}

.help-container ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.help-container ul li:before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: 0;
}

.bonus-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.bonus-info h4 {
    color: #2c3e50;
    margin-top: 0;
}

@media (max-width: 600px) {
    .help-container {
        padding: 10px;
    }
    
    .story-section, .mechanics-section, .games-section, .tips-section {
        padding: 15px;
    }
}

/* === Avatar (cashier) ============================== */
.room-avatar {
    position: absolute;
    left: var(--avatar-left);
    top: var(--avatar-top);
    width: var(--avatar-size);
    pointer-events: none; /* clicks pass through */
    z-index: 2;          /* above shelves */
}

/* --- ОФЕРВОЛЫ --- */
.offerwall-card {
  background: linear-gradient(120deg, #1e293b 80%, #22c55e 100%);
  border-radius: 18px;
  box-shadow: 0 4px 24px 0 #22c55e33, var(--color-shadow-card);
  border: 2px solid #22c55e;
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  margin-bottom: 1.2rem;
  transition: box-shadow 0.22s, border 0.22s, background 0.22s;
  animation: fadeInBox 0.5s cubic-bezier(.4,0,.2,1);
}
.offerwall-card:hover {
  border: 2px solid #16a34a;
  background: linear-gradient(120deg, #22c55e 80%, #1e293b 100%);
  box-shadow: 0 0 32px 0 #22c55e99, var(--color-shadow-card);
  transform: translateY(-2px) scale(1.03);
}

/* === KIBERNETES LOADER STYLES === */
.kb-loader{
  position:fixed; 
  inset:0; 
  z-index:99999;
  display:flex; 
  align-items:center; 
  justify-content:center;
  background:
    radial-gradient(1200px 600px at 50% 35%, rgba(0,255,255,.10), rgba(0,0,0,.92)),
    linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.85));
  backdrop-filter: blur(6px);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.kb-card{
  width:min(920px, 92vw);
  border-radius:18px;
  border:1px solid rgba(0,255,255,.18);
  background: rgba(8,14,24,.72);
  box-shadow: 0 20px 70px rgba(0,0,0,.55);
  padding:22px 22px 18px;
  position:relative;
  overflow:hidden;
}

.kb-card:before{
  content:"";
  position:absolute; 
  inset:-2px;
  background:
    linear-gradient(90deg, transparent, rgba(0,255,255,.14), transparent);
  transform: translateX(-60%);
  animation: kb-scan 2.4s linear infinite;
  pointer-events:none;
}
@keyframes kb-scan{
  0%{transform:translateX(-60%)}
  100%{transform:translateX(60%)}
}

.kb-header{ 
  text-align:center; 
  margin-bottom:14px; 
}
.kb-logo{ 
  display:flex; 
  align-items:center; 
  justify-content:center; 
  gap:10px; 
}
.kb-bolt{ 
  font-size:26px; 
  filter: drop-shadow(0 0 10px rgba(255,255,0,.25)); 
}
.kb-title{ 
  font-size:28px; 
  letter-spacing:.06em; 
  color: rgba(220,255,255,.95); 
  font-weight: 700;
}
.kb-sub{ 
  margin-top:6px; 
  color: rgba(160,230,255,.75); 
  font-size:13px; 
  letter-spacing:.08em; 
}

.kb-core{
  position:relative;
  height:260px;
  display:flex; 
  align-items:center; 
  justify-content:center;
  margin:10px 0 18px;
}

.kb-ring{
  position:absolute; 
  width:170px; 
  height:170px; 
  border-radius:50%;
  border:1px solid rgba(0,255,255,.25);
  box-shadow: 0 0 40px rgba(0,255,255,.07) inset;
  animation: kb-rot 5s linear infinite;
}
.kb-ring2{ 
  width:240px; 
  height:240px; 
  opacity:.65; 
  animation-duration: 7.5s; 
}
.kb-ring3{ 
  width:310px; 
  height:310px; 
  opacity:.35; 
  animation-duration: 10s; 
}

@keyframes kb-rot { 
  to { transform: rotate(360deg); } 
}

.kb-grid{
  display:grid;
  grid-template-columns: repeat(3, 16px);
  gap:10px;
  padding:16px;
  border-radius:16px;
  background: rgba(0,255,255,.04);
  border:1px solid rgba(0,255,255,.12);
  box-shadow: 0 0 30px rgba(0,255,255,.06);
}

.kb-node{
  width:16px; 
  height:16px; 
  border-radius:4px;
  background: rgba(0,255,255,.18);
  border:1px solid rgba(0,255,255,.25);
  animation: kb-pulse 1.6s ease-in-out infinite;
}
.kb-node:nth-child(2){ animation-delay:.12s }
.kb-node:nth-child(3){ animation-delay:.24s }
.kb-node:nth-child(4){ animation-delay:.36s }
.kb-node:nth-child(5){ animation-delay:.48s }
.kb-node:nth-child(6){ animation-delay:.60s }
.kb-node:nth-child(7){ animation-delay:.72s }
.kb-node:nth-child(8){ animation-delay:.84s }
.kb-node:nth-child(9){ animation-delay:.96s }

@keyframes kb-pulse{
  0%,100%{ 
    transform:scale(1); 
    box-shadow:none; 
    opacity:.65 
  }
  50%{ 
    transform:scale(1.25); 
    box-shadow:0 0 18px rgba(0,255,255,.22); 
    opacity:1 
  }
}

.kb-pods{
  position:absolute; 
  bottom:22px;
  display:flex; 
  gap:10px; 
  flex-wrap:wrap; 
  justify-content:center;
}
.kb-pod{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,255,255,.18);
  color: rgba(190,240,255,.88);
  background: rgba(0,0,0,.18);
  font-size:12px; 
  letter-spacing:.06em;
}

.kb-progress{ 
  margin-top:6px; 
}
.kb-bar{
  height:10px; 
  border-radius:999px;
  border:1px solid rgba(0,255,255,.18);
  background: rgba(0,0,0,.28);
  overflow:hidden;
}
.kb-bar-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(0,255,255,.12), rgba(0,255,255,.65), rgba(0,255,255,.18));
  box-shadow: 0 0 18px rgba(0,255,255,.18);
  transition: width .18s ease;
}

.kb-meta{
  display:flex; 
  justify-content:space-between; 
  gap:16px;
  margin-top:8px;
  color: rgba(170,235,255,.82);
  font-size:12px; 
  letter-spacing:.08em;
}

.kb-steps{
  display:flex; 
  justify-content:center; 
  gap:18px;
  margin-top:14px; 
  flex-wrap:wrap;
  color: rgba(130,210,255,.55);
  font-size:12px;
}
.kb-step.active{ 
  color: rgba(210,255,255,.95); 
  text-shadow:0 0 12px rgba(0,255,255,.14); 
}

.kb-foot{
  margin-top:12px;
  text-align:center;
  color: rgba(140,210,255,.55);
  font-size:12px;
}

/* === CYBER LOGO STYLES === */
.cyber-logo-container {
  position: relative;
}

.cyber-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.cyber-logo:hover {
  transform: scale(1.05);
}

.cyber-logo-icon {
  width: 48px;
  height: 48px;
  position: relative;
  filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.5));
}

.cyber-logo-svg {
  width: 100%;
  height: 100%;
  animation: cyberRotate 8s linear infinite;
}

.cyber-ring {
  animation: cyberPulse 2s ease-in-out infinite;
}

.cyber-core {
  animation: cyberGlow 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(0, 255, 255, 0.8));
}

@keyframes cyberRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes cyberPulse {
  0%, 100% { 
    opacity: 0.6;
    stroke-width: 2;
  }
  50% { 
    opacity: 1;
    stroke-width: 3;
  }
}

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

.cyber-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.cyber-logo-main {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #00ffff 0%, #ff00ff 50%, #00ffff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: cyberTextShine 3s linear infinite;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.cyber-logo-sub {
  font-size: 11px;
  color: rgba(0, 255, 255, 0.7);
  letter-spacing: 0.15em;
  font-weight: 500;
  text-transform: uppercase;
}

@keyframes cyberTextShine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Navigation Links */
.nav-link {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
}

.nav-link:hover {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ffff, transparent);
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-link.active {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Header Navigation Links */
.nav-link-header {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
}

.nav-link-header:hover {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.nav-link-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ffff, transparent);
  transition: transform 0.3s ease;
}

.nav-link-header:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Profile Modal Tabs */
.profile-tab {
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.profile-tab.active {
  color: #22d3ee;
  border-bottom: 2px solid #22d3ee;
}

.profile-tab-content {
  animation: fadeIn 0.3s ease;
}

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

/* Profile Modal Scrollbar */
#profileModal::-webkit-scrollbar {
  width: 8px;
}

#profileModal::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.5);
  border-radius: 4px;
}

#profileModal::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.5);
  border-radius: 4px;
}

#profileModal::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.7);
}

/* ===== ADMIN PANEL SIDEBAR STYLES ===== */
#admin-sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.5) transparent;
}

#admin-sidebar::-webkit-scrollbar {
  width: 6px;
}

#admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#admin-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(107, 114, 128, 0.5);
  border-radius: 3px;
}

#admin-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(107, 114, 128, 0.7);
}

.admin-menu-link.active {
  background-color: rgba(6, 182, 212, 0.1) !important;
  color: rgb(34, 211, 238) !important;
  border-left: 3px solid rgb(34, 211, 238);
}

.admin-menu-toggle.active {
  background-color: rgba(6, 182, 212, 0.1) !important;
  color: rgb(34, 211, 238) !important;
}

.admin-submenu {
  animation: slideDown 0.2s ease-out;
}

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

/* Admin main content area adjustment */
#main-content.ml-64 {
  margin-left: 16rem; /* 64 * 0.25rem = 16rem for 256px sidebar */
}

/* Toast Notifications - Small notifications from the side */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    color: #e5e7eb;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.3);
    z-index: 9999;
    max-width: 350px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification:hover {
    border-color: rgba(59, 130, 246, 0.5);
}
