body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  margin: 0;
  padding: 16px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  box-sizing: border-box;
}

/* Добавляем общий контейнер для всего содержимого */
.game-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.slot-machine {
  position: relative;
  display: flex;
  gap: 10px;
  flex-direction: column;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 15px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* 🎰 free-spins status — takes the buy-bonus button's slot while the bonus
   plays out. Purple/pulsing on purpose, to read as a distinct "bonus is
   running" state vs the gold buy-bonus button and gold win notification. */
.bonus-active {
  width: 100%;
  box-sizing: border-box; /* no global reset here — without this, padding makes it 32px wider than the buttons */
  text-align: center;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #8a5bff 0%, #d63aff 100%);
  box-shadow: 0 6px 22px rgba(124, 77, 255, 0.5);
  /* pulse via glow only — scale() visually outgrew the neighbouring buttons */
  animation: bonusActivePulse 1.1s ease-in-out infinite;
}
.bonus-active b { font-size: 16px; }
@keyframes bonusActivePulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(124, 77, 255, 0.5); filter: brightness(1); }
  50%      { box-shadow: 0 8px 30px rgba(124, 77, 255, 0.85); filter: brightness(1.15); }
}

.reel {
  font-size: 50px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform 0.3s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.reel-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: inherit;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.reel:hover {
  transform: scale(1.02);
}

.reel-inner.spinning {
    animation: spin 0.2s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
  position: relative;
  z-index: 1000;
}

.user-info {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.user-name {
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  opacity: 0.92;
}

.back-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  padding-bottom: 2px;
}
.back-btn:hover  { background: rgba(255, 255, 255, 0.16); }
.back-btn:active { transform: scale(0.9); }

.avatar-container {
    position: relative;
    z-index: 1001;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.avatar:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.avatar-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: -4px;
    background: rgba(31, 41, 55, 0.95);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    z-index: 1002;
}

.avatar-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    width: 12px;
    height: 12px;
    background: rgba(31, 41, 55, 0.95);
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.avatar-container.active .avatar-menu {
    display: block;
    animation: menuAppear 0.2s ease-out;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    width: 100%;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item .icon {
    font-size: 18px;
}

.menu-item .text {
    font-size: 14px;
    font-weight: 500;
}

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

#balance {
  margin: 0;
  font-weight: 700;
  font-size: 13px;
  color: #ffd980;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(255,215,0,0.18), rgba(255,165,0,0.10));
  border: 1px solid rgba(255,215,0,0.25);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
#balance .currency {
  font-size: 13px;
}

.user-panel #addFundsButton,
.user-panel #bonusBtn {
    width: 30px !important;
    height: 30px !important;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
    font-weight: 700;
}
.user-panel #addFundsButton {
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}
#bonusBtn {
    background: linear-gradient(135deg, #f9a825, #e65100) !important;
    box-shadow: 0 2px 10px rgba(249, 168, 37, 0.45), inset 0 1px 0 rgba(255,255,255,0.2) !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 16px !important;
}
#addFundsButton:active, #bonusBtn:active { transform: scale(0.92); }

#spinButton {
    flex: 1;
    height: 60px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: white;
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#spinButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff7b7b 0%, #ff5767 100%);
}

#spinButton:active {
    transform: translateY(1px);
    transition: all 0.1s ease;
    background: linear-gradient(135deg, #ff5b5b 0%, #ff3747 100%);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

.spinning {
    animation: spin 0.2s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.controls {
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.spin-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    width: 100%;
    box-sizing: border-box;
}

.bet-buttons-container {
    display: flex;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 10px;
    gap: 2px;
    margin: 12px 0 10px;
    box-sizing: border-box;
    align-items: center;
}

/* Кнопка «+» рядом с 500: увеличивает активную ставку */
.bet-plus {
    flex: 0 0 40px;
    height: 40px;
    margin-left: 4px;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    background: linear-gradient(135deg, #2ea6ff, #1c89e0);
    color: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(46, 166, 255, 0.35);
    transition: transform 0.15s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.bet-plus:active { transform: scale(0.92); }
.bet-plus:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    box-shadow: none;
    cursor: not-allowed;
}

.action-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 0 0;
    box-sizing: border-box;
}

.bet-button {
    flex: 1;
    height: 40px;
    padding: 0;
    font-size: 16px;
    cursor: pointer;
    background: transparent;
    color: white;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.bet-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bet-button.active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Остальные стили для #spinButton и #autoplayButton остаются без изменений */

/* Общие медиа-запросы */
@media (max-width: 480px) {

  .user-panel {
    padding: 12px 15px;
  }

  .avatar {
    width: 35px;
    height: 35px;
  }

  #balance {
    font-size: 0.9em;
  }

  #addFundsButton {
    padding: 6px 12px;
    font-size: 13px;
  }


  .grid {
    gap: 8px;
    padding: 10px;
  }

  .reel-inner {
    font-size: min(10vw, 40px);
  }

  .reel {
    font-size: 32px;
    /*width: 80px;*/
    height: 80px;
  }
}

/* Специально для очень узких экранов */
@media (max-width: 370px) {
  body {
    padding-top: 100px;
  }

  .user-panel {
    gap: 8px;
  }

  .user-info {
    gap: 8px;
  }

  .slot-machine {
    padding: 10px;
  }

  .grid {
    gap: 6px;
    padding: 8px;
  }

  .reel-inner {
    font-size: min(12vw, 32px);
  }

  .controls {
    gap: 15px;
    padding: 0;
  }

  .bet-controls {
    flex-direction: column;
    width: 100%;
    padding: 10px;
    gap: 8px;
    align-items: center;
  }

  .bet-label {
    font-size: 12px;
    margin: 0;
    width: 100%;
    text-align: center;
  }

  .bet-buttons-container {
    display: flex;
    gap: 5px;
    justify-content: center;
    width: 100%;
  }

  .bet-button {
    min-width: 55px;
    padding: 6px 8px;
    font-size: 13px;
  }

  #spinButton {
    height: 50px;
    font-size: 16px;
  }

  #addFundsButton {
    width: 100%;
    margin-top: 5px;
  }

  .reel {
    font-size: 28px;
    height: 65px;
    border-radius: 8px;
  }
}

/* Для ландшафтной ориентации на маленьких экранах */
@media (max-height: 480px) and (orientation: landscape) {
  body {
    padding-top: 10px;
    padding-bottom: 10px;
    justify-content: flex-start;
  }

  .user-panel {
    margin-bottom: 10px;
  }

  .slot-machine {
    margin: 10px 0;
  }
}

.reset-button {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.reset-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.reel.win {
    animation: winPulse 1s ease-in-out;
    background: rgba(255, 215, 0, 0.3); /* Золотистая подсветка */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.win-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: gold;
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    animation: notificationAppear 2s ease-in-out forwards;
    z-index: 1000;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes notificationAppear {
    0% { 
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
}

.test-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.test-button {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.test-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.money-particle {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    font-size: 20px;
}

@keyframes moneyFly {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--endX), var(--endY)) scale(1.5) rotate(var(--rotation));
        opacity: 0;
    }
}

/* Стили для панели управления */
.controls-panel {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.control-button {
    padding: 10px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.control-button.active {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 30px;
    border-radius: 20px;
    min-width: 300px;
    max-width: 90%;
    width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal h2 {
    color: #fff;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Стили для таблицы выплат */
.paytable-grid {
    display: grid;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-top: 20px;
}

.paytable-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.paytable-row span:last-child {
    color: #10B981;
    font-weight: 600;
}

/* Стили для статистики */
.stats-grid {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.stats-grid div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stats-grid div span:first-child {
    color: rgba(255, 255, 255, 0.8);
}

.stats-grid div span:last-child {
    font-weight: 600;
    color: #fff;
}

/* Стили для автоигры */
.autoplay-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.setting-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.setting-group input {
    -moz-appearance: textfield;
}

.setting-group input::-webkit-outer-spin-button,
.setting-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.setting-group select:focus,
.setting-group input:focus {
    outline: none;
    border-color: #10B981;
}

#startAutoplay {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#startAutoplay:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    .setting-group {
        padding: 12px;
    }

    .setting-group label {
        font-size: 13px;
    }

    .setting-group select,
    .setting-group input {
        padding: 8px;
        font-size: 13px;
    }

    #startAutoplay {
        padding: 10px;
        font-size: 14px;
    }
}

/* Анимация появления модального окна */
@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-content {
    animation: modalAppear 0.3s ease-out;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .paytable-row {
        padding: 6px 10px;
        font-size: 14px;
    }
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-controls .control-button {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-controls .control-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Обновляем стиль для кнопки пополнения */
#addFundsButton {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    content: '+';
}

#addFundsButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.spin-controls {
    display: flex;
    gap: 10px;
    width: 100%;
}

#spinButton, #autoplayButton {
    height: 60px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: white;
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#spinButton {
    flex: 1;
}

#autoplayButton {
    min-width: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#spinButton:hover, #autoplayButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff7b7b 0%, #ff5767 100%);
}

#spinButton:active, #autoplayButton:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
    background: linear-gradient(135deg, #ff5b5b 0%, #ff3747 100%);
}

#autoplayButton.active {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ACD 100%);
    box-shadow: 0 0 15px rgba(123, 104, 238, 0.4);
    width: 75%;
}

/* Обновляем медиа-запрос для мобильных устройств */
@media (max-width: 480px) {
    .spin-controls {
        gap: 8px;
    }

    #spinButton, #autoplayButton {
        height: 50px;
        font-size: 16px;
    }

    #autoplayButton {
        padding: 0 15px;
    }

    #autoplayButton.active {
        width: 70%;
    }
}

/* Добавляем медиа-запрос для мобильных устройств */
@media (max-width: 480px) {
    .avatar-menu {
        min-width: 140px;
    }

    .menu-item {
        padding: 8px 12px;
    }

    .menu-item .icon {
        font-size: 16px;
    }

    .menu-item .text {
        font-size: 13px;
    }
}

/* Для мобильных устройств уменьшаем размер */
@media (max-width: 480px) {
    .bet-button {
        font-size: 14px;
        gap: 2px;
    }
}

.dice-symbol {
    display: inline-block;
    transition: transform 0.2s;
}

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

#autoplayButton.active .dice-symbol {
    animation: rotateDiceSymbol 1s linear infinite;
}

/* Остальные стили для autoplayButton остаются без изменений */
#autoplayButton.active {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ACD 100%);
    box-shadow: 0 0 15px rgba(123, 104, 238, 0.4);
    width: 75%;
}

#spinButton.spinning-active {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ACD 100%);
    box-shadow: 0 0 15px rgba(123, 104, 238, 0.4);
}

#spinButton .dice-symbol {
    display: inline-block;
    animation: rotateDiceSymbol 1s linear infinite;
}

#addFundsButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #808080 0%, #666666 100%);
    box-shadow: none;
}

#addFundsButton:disabled:hover {
    transform: none;
    box-shadow: none;
}

.tap-instruction {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 20px;
    padding: 10px;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .tap-instruction {
        font-size: 12px;
        margin-top: 15px;
    }
}

/* Отключаем стандартное выделение при тапе */
.slot-machine {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.buy-bonus-button {
    background: linear-gradient(135deg, #ffd24a, #f7a600);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;
    color: #2a1c00;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 14px rgba(247, 166, 0, 0.35);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.buy-bonus-button:active { transform: scale(0.98); }
.buy-bonus-button:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

.luck-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    border: none;
    border-radius: 15px;
    padding: 30px 30px;
    width: 100%;
    height: auto;
    color: white;
    font-size: 24px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.5s ease;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    background-size: 200% 200%;
}

/* Добавляем стиль только для активного состояния */
.luck-button:active,
.luck-button.pressed {
    animation: gradientPulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(123, 104, 238, 0.3);
}

@keyframes gradientPulse {
    0% {
        background: linear-gradient(135deg, #7B68EE 0%, #6A5ACD 100%);
        opacity: 1;
    }
    50% {
        background: linear-gradient(135deg, #9281FF 0%, #7A6BEE 100%);
        opacity: 0.8;
    }
    100% {
        background: linear-gradient(135deg, #7B68EE 0%, #6A5ACD 100%);
        opacity: 1;
    }
}

/* Стили для кнопок в модальном окне */
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-funds-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.add-funds-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.cancel-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}
.shop-item {
    position: relative;
    padding: 18px 12px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.shop-item:active {
    transform: scale(0.97);
}
.shop-item:hover {
    box-shadow: 0 8px 24px rgba(255,215,0,0.2);
}
.shop-coins {
    font-size: 18px;
    font-weight: 700;
}
.shop-price {
    font-size: 14px;
    color: #ffd700;
    font-weight: 600;
}
.shop-bonus {
    position: absolute;
    top: 6px;
    right: 8px;
    background: #ff6b6b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
}

.cancel-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Стили для текста в модальном окне */
.modal-content p {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 15px 0;
    font-size: 16px;
}

button {
    -webkit-tap-highlight-color: transparent; /* Убирает подсветку на мобильных устройствах */
}

button:active {
    transition: all 0.1s ease;
}

