body {
    font-family: system-ui, sans-serif;
    background: url("img/back.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    text-align: center;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* запретить горизонтальный скролл */
    overflow-y: auto;   /* но разрешить вертикальный */
  }
  
  /* Контейнер */
  .case-container {
    margin-top: 60px;
  }
  
  /* Окно крутилки */
  .case-window {
    position: relative;
    width: 90vw;
    max-width: 700px;
    height: 180px;
    overflow: hidden;
    margin: 40px auto;
    border: 3px solid #f90;
    border-radius: 10px;
    background: rgba(10, 10, 10, 0.85);
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.3);
  }
  
  /* Лента предметов */
  .items {
    display: flex;
    position: absolute;
    top: 15px;
    left: 0;
    will-change: transform;
    transition: transform 5s cubic-bezier(0.05, 0.5, 0.1, 1);
  }
  
  /* Отдельный предмет */
  .item {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 150px;
    margin: 0 5px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #111;
  }
  
  /* Изображение предмета */
  .item img {
    position: relative;
    z-index: 2;
    width: 120px;
    height: auto;
    filter: grayscale(100%) brightness(0.6);
    transition: filter 0.3s ease, transform 0.3s ease;
  }
  
  /* Активный (в рамке) — цветной */
  .item.active img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
  }
  
  /* Название предмета */
  .item-name {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.4);
    border-radius: 0 0 8px 8px;
    padding: 2px 0;
    box-sizing: border-box;
  }
  
  /* Центральная рамка */
  .pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%);
    border: 3px solid #f90;
    box-shadow: 0 0 20px rgba(255,153,0,.8);
    border-radius: 8px;
    pointer-events: none;
    z-index: 10;
  }
  
  /* Кнопка */
  button {
    padding: 12px 25px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    background: #f90;
    color: #000;
    cursor: pointer;
    font-weight: bold;
  }
  button:hover {
    background: #ffaa33;
  }
  
  /* Победный предмет */
  .item.winner {
    animation: winner-pop 1s ease-out forwards;
    box-shadow: 0 0 25px 5px gold;
    transform: scale(1.2);
    z-index: 5;
  }
  @keyframes winner-pop {
    0% { transform: scale(1); box-shadow: none; }
    50% { transform: scale(1.3); box-shadow: 0 0 25px 5px gold; }
    100% { transform: scale(1.2); box-shadow: 0 0 25px 5px gold; }
  }
  
  /* Вспышка и искры */
  .flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,200,0.9) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
  }
  .spark {
    position: fixed;
    width: 4px;
    height: 4px;
    background: gold;
    border-radius: 50%;
    pointer-events: none;
    animation: spark 1s ease-out forwards;
    z-index: 101;
  }
  @keyframes spark {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
  }
  
  .item img {
    filter: grayscale(100%) brightness(0.6);
    transition: filter 0.3s ease, transform 0.3s ease;
  }
  
  .item.active img {
    filter: none !important;
    transform: scale(1.05);
  }
  
 


#login-btn-left:hover {
  background: linear-gradient(135deg, #ffaa33, #ffd47a);
  transform: scale(1.05);
}

/* === Верхняя панель (во всю ширину) === */
/* глобально включаем корректную модель коробки */
*, *::before, *::after { box-sizing: border-box; }

/* шапка */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;          /* вместо width:100% — растягиваем по краям */
  height: 60px;
  padding: 0 25px;   /* padding теперь входит в ширину */
  background: rgba(20,20,20,.9);
  border-bottom: 2px solid #f90;
  box-shadow: 0 0 15px rgba(255,153,0,.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 2000;
  backdrop-filter: blur(6px);
}
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 20px;
  background: rgba(20,20,20,0.9);
  border-bottom: 2px solid #f90;
  box-shadow: 0 0 15px rgba(255,153,0,0.2);
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* три колонки: слева / центр / справа */
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(6px);
}

/* центрируем контент внутри колонок */
.left-side {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.right-side {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* логотип по центру */
.logo-center {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255,153,0,0.7));
}

/* адаптив под телефон */
@media (max-width: 600px) {
  .top-bar {
    height: 50px;
    padding: 0 10px;
  }
  .logo-center {
    height: 32px;
  }
}

/* остальное оставляем как было */


/* адаптив под телефон */
@media (max-width: 600px) {
  .top-bar {
    height: 50px;
    padding: 0 12px;
  }

  .logo-center {
    height: 32px;
  }
}

/* Кнопка "Войти" в верхней панели */
.top-bar #login-btn-right {
  background: linear-gradient(135deg, #f90, #ffbf47);
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 15px;
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.5);
  transition: all 0.2s ease;
}

.top-bar #login-btn-right:hover {
  background: linear-gradient(135deg, #ffaa33, #ffd47a);
  transform: scale(1.05);
}

/* Адаптив под телефоны */
@media (max-width: 600px) {
  .top-bar {
    height: 50px;
    padding: 0 10px; /* было 25px — стало меньше */
  }

  .top-bar #login-btn-right {
    font-size: 13px;
    padding: 6px 10px;
    max-width: 100px;
    white-space: nowrap;
    box-shadow: 0 0 6px rgba(255,153,0,0.4);
  }
}
.top-bar #login-btn-right {
  margin-right: 4px;
}

#balance-display {
  margin-right: auto; /* отодвигает вправо всё остальное */
  color: #ffbf47;
  font-weight: bold;
  font-size: 16px;
  background: rgba(255, 153, 0, 0.1);
  border: 1px solid #f90;
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 0 8px rgba(255, 153, 0, 0.3);
}

/* адаптив */
@media (max-width: 600px) {
  #balance-display {
    font-size: 14px;
    padding: 4px 8px;
  }
}


/* === Нижняя панель === */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #000; /* Чёрный фон */
  border-top: 2px solid #f90;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 2000;
  box-shadow: 0 -2px 10px rgba(255, 153, 0, 0.15);
}

/* кнопки */
.nav-btn {
  background: none;
  border: none;
  color: #ccc;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 70px; /* фикс ширина для выравнивания */
  height: 100%;
  padding-top: 0px;
}

/* иконки */
.nav-btn img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: brightness(0.9) sepia(1) hue-rotate(-15deg) saturate(3) brightness(1.3);
  transition: filter 0.2s ease, transform 0.2s ease;
}

/* подписи */
.nav-btn span {
  font-size: 12px;
  color: #aaa;
  text-align: center;
}

/* hover */
.nav-btn:hover img {
  filter: brightness(1.4) drop-shadow(0 0 5px rgba(255,153,0,0.8));
  transform: scale(1.1);
}
.nav-btn:hover span {
  color: #ffbf47;
}

/* активная кнопка */
.nav-btn.active img {
  filter: brightness(1.5) drop-shadow(0 0 8px rgba(255,153,0,1));
}
.nav-btn.active span {
  color: #fff;
}

/* адаптив */
@media (max-width: 600px) {
  .bottom-bar {
    height: 75px;
  }
  .nav-btn {
    width: 64px;
  }
  .nav-btn img {
    width: 30px;
    height: 30px;
  }
  .nav-btn span {
    font-size: 11px;
  }
}


