/* Slot Machine Styles */

.slot-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  max-width: 500px;
  margin: 20px auto;
  position: relative;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 16px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 0 20px 2px rgb(0 0 0 / 96%), inset 0 0px 1px 0px rgb(255 255 255 / 82%);
}

/* Slot Header */
.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 0px 10px 0;
  margin-bottom: 12px;
  position: relative;
}

.slot-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffffff30, transparent);
}

.slot-header-side {
  display: flex;
  gap: 8px;
  width: 80px;
}

/* Правая сторона - иконки справа */
.slot-header-side:last-child {
  justify-content: flex-end;
}

.slot-icon-placeholder {
  width: 36px;
  height: 36px;
}

.slot-header-center {
  flex: 1 1;
  display: flex;
  justify-content: center;
}

.slot-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgb(255 255 255 / 0%);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px 1px rgb(255 255 255 / 15%), inset 0 0px 1px 0px rgb(255 255 255 / 30%);
}

.slot-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFD700;
}

.slot-icon-btn.close-game-btn {
  background: rgb(255 80 80 / 12%);
  color: #f22e2e;
}

.slot-icon-btn.close-game-btn:hover {
  background: rgba(255, 80, 80, 0.45);
  color: #fff;
}

/* Win Header Badge */
.win-header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  padding: 6px 16px;
  border-radius: 16px;
  animation: winPulse 1s ease-in-out 3;
}

.win-header-badge .win-label {
  font-size: 14px;
  font-weight: 800;
  color: #000;
}

.win-header-badge .win-value {
  font-size: 16px;
  font-weight: 800;
  color: #000;
}

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

.header-placeholder {
  height: 32px;
}

/* Free Spins Badge */
.free-spins-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  padding: 6px 16px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 13px;
  /* Убрана бесконечная анимация для экономии батареи */
}

.free-spins-badge .free-spins-wins {
  font-size: 12px;
  opacity: 0.8;
}

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

/* Reels Container */
.reels-container {
  position: relative;
  background: linear-gradient(180deg, #1a1a1d 0%, #2d2d30 100%);
  border-radius: 12px;
  padding: 12px;
  box-shadow:
    0 0 20px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.reels-container.win-animation {
  animation: winGlow 0.8s ease-in-out 4 alternate;
}

/* Скрываем барабаны пока идёт restore сессии */
.reels-container.restoring .reels-frame {
  opacity: 0;
}

@keyframes winGlow {
  from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
  to { box-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
}

.reels-frame {
  display: flex;
  gap: 4px;
  background: #0a0a0a;
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
  position: relative;
}

/* Egypt Treasures - кастомные reels */
.game-egypt-treasures .reels-container {
  background: linear-gradient(0deg, #5e2f09 0%, #b8870d 100%);
  box-shadow: 0 0 20px 10px rgb(0 0 0), inset 0 2px 4px rgb(250 212 121);
}

/* 3-reel slot (777) - увеличенные размеры */
.reels-container.reels-3 .reels-frame {
  max-width: 320px;
  margin: 0 auto;
  justify-content: center;
}

.reels-container.reels-3 .slot-reel {
  width: 90px;
  height: 180px;
}

.reels-container.reels-3 .reel-symbol {
  width: 90px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reels-container.reels-3 .symbol-svg {
  width: 52px;
  height: 52px;
}

/* Контролы для 777 - пропорционально шире */
.slot-machine.slot-777 .slot-controls {
  max-width: 340px;
  margin: 0 auto;
}

.slot-machine.slot-777 .gamble-options {
  max-width: 320px;
  margin: 0 auto;
}

/* Отступ сверху для логотипа 777 */
.slot-machine.slot-777 .slot-header {
  margin-top: 12px;
}

/* Красная кнопка SPIN для 777 */
.slot-machine.slot-777 .spin-btn {
  background: linear-gradient(180deg, #E63946 0%, #C5303C 100%);
}

@media (hover: hover) and (pointer: fine) {
  .slot-machine.slot-777 .spin-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #EF4D5A 0%, #D43946 100%);
  }
}

.slot-machine.slot-777 .spin-btn:active:not(:disabled),
.slot-machine.slot-777 .spin-btn.spinning {
  background: linear-gradient(180deg, #C5303C 0%, #A3242E 100%);
}

/* Анимация спина для 3-reel (высота символа 60px, 12 символов) */
.reels-container.reels-3 .reel-spin-strip {
  top: -720px;
  animation: reelScroll777 0.8s linear infinite;
}

@keyframes reelScroll777 {
  0% { transform: translateY(0); }
  100% { transform: translateY(720px); }
}

/* Lines Badge on Frame (like TV brand logo) - Gold */
.lines-frame-badge {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 215, 0, 0.7);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 10;
}

/* SVG Win Line Overlay */
.win-line-svg {
  position: absolute;
  top: 8px;
  left: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  pointer-events: none;
  z-index: 5;
}

.win-line-path {
  opacity: 1;
  /* Убрана анимация для экономии батареи */
}

.win-line-marker {
  /* Убрана анимация для экономии батареи */
}

@keyframes markerPulse {
  from { r: 6; }
  to { r: 10; }
}

/* Single Reel */
.slot-reel {
  width: 70px;
  height: 180px;
  /* Выпуклый эффект барабана - края тёмные, середина светлее */
  background: linear-gradient(180deg, #1a1a1d 0%, #3a3a3e 50%, #1a1a1d 100%);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.slot-reel::before,
.slot-reel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 25px; /* Уменьшена тень чтобы не закрывать символы */
  z-index: 2;
  pointer-events: none;
}

.slot-reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.slot-reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.reel-inner {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* Скрываем финальные символы во время спина */
.reel-inner.hidden {
  opacity: 0;
}

/* Лента для анимации скролла сверху вниз (15 символов, прокручиваем 12) */
.reel-spin-strip {
  position: absolute;
  top: -720px; /* Начинаем выше видимой области (12 символов * 60px) */
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  animation: reelScroll 0.8s linear infinite;
  will-change: transform;
}

/* Анимация скролла - прокручиваем ВСЕ 12 символов за цикл */
@keyframes reelScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(720px); /* Все 12 символов = полный цикл */
  }
}

/* Stopping bounce animation - барабан проезжает вниз и возвращается */
.slot-reel.stopping .reel-inner {
  animation: reelBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reelBounce {
  0% { transform: translateY(-8px); opacity: 0; }
  40% { transform: translateY(4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}


.reel-symbol {
  width: 70px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* Символы в ленте скролла */
.reel-symbol.spin-symbol {
  transition: none;
}

/* Highlighted winning symbol */
.reel-symbol.highlighted {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.5) 0%, rgba(255, 200, 0, 0.2) 50%, transparent 80%);
  z-index: 3;
  box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.4);
}

.reel-symbol.highlighted .symbol-emoji {
  animation: symbolBounce 0.6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1)) drop-shadow(0 0 6px rgba(255, 255, 0, 0.8));
}

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

.symbol-emoji {
  font-size: 44px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* SVG Symbol */
.symbol-svg {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Egypt Treasures & Rise of Ra - увеличенные иконки */
/* Для экранов 350-389px */
@media (min-width: 350px) and (max-width: 389px) {
  .game-egypt-treasures .symbol-svg,
  .game-rise-of-ra .symbol-svg {
    width: 50px;
    height: 50px;
  }
}
/* Для экранов < 350px - стандартный размер */
@media (max-width: 349px) {
  .game-egypt-treasures .symbol-svg,
  .game-rise-of-ra .symbol-svg {
    width: 40px;
    height: 40px;
  }
}
/* Для экранов 390-425px (промежуточный) */
@media (min-width: 390px) and (max-width: 425px) {
  .game-egypt-treasures .symbol-svg,
  .game-rise-of-ra .symbol-svg {
    width: 52px;
    height: 52px;
  }
}
/* Для экранов > 425px */
@media (min-width: 426px) {
  .game-egypt-treasures .symbol-svg,
  .game-rise-of-ra .symbol-svg {
    width: 58px;
    height: 58px;
  }
}

/* Star Fruits - увеличенные иконки (3x3 слот, широкие символы) */
/* Более специфичный селектор чтобы перебить .reels-container.reels-3 .symbol-svg */
/* Для экранов < 350px */
@media (max-width: 349px) {
  .game-star-fruits .reels-container.reels-3 .symbol-svg {
    width: 55px;
    height: 48px;
  }
}
/* Для экранов 350-389px */
@media (min-width: 350px) and (max-width: 389px) {
  .game-star-fruits .reels-container.reels-3 .symbol-svg {
    width: 62px;
    height: 54px;
  }
}
/* Для экранов 390-425px */
@media (min-width: 390px) and (max-width: 425px) {
  .game-star-fruits .reels-container.reels-3 .symbol-svg {
    width: 68px;
    height: 50px;
  }
}
/* Для экранов > 425px */
@media (min-width: 426px) {
  .game-star-fruits .reels-container.reels-3 .symbol-svg {
    width: 70px;
    height: 50px;
  }
}

.reel-symbol.highlighted .symbol-svg {
  animation: symbolBounce 0.6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1)) drop-shadow(0 0 6px rgba(255, 255, 0, 0.8));
}

/* Win Overlay */
.win-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.win-amount-big {
  font-size: 28px;
  font-weight: 800;
  color: #FFD700;
  text-align: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 12px 24px;
  border-radius: 12px;
  border: 3px solid #FFD700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(255, 215, 0, 0.1);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  animation: winBounce 0.5s ease-out;
}

@keyframes winBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Expanding Wild Badge (Royal Crown) */
.expanded-wild-badge {
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  animation: expandPulse 1s ease-in-out 2;
  text-shadow: none;
}

@keyframes expandPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(147, 51, 234, 0.5); }
  50% { transform: scale(1.02); box-shadow: 0 0 15px rgba(147, 51, 234, 0.6); }
}

/* Win Info Block - FIXED HEIGHT */
.win-info-block {
  min-height: 44px;
  display: grid;
  grid-template-columns: 2fr auto 2fr;
  align-items: center;
  width: 100%;
  margin: 8px 0;
  grid-gap: 4px;
  gap: 4px;
  position: relative;
  padding-bottom: 8px;
}

.win-info-block::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffffff30, transparent);
}

/* Left & Right columns: two-line label + amount */
.win-info-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.win-info-left {
  align-items: flex-start;
}

.win-info-right {
  align-items: flex-end;
}

.win-info-label {
  font-size: 9px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 2px;
}

.win-info-amount {
  font-size: 14px;
  font-weight: 700;
  color: #FFD700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* Center: current line info */
.win-info-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.win-line-current {
  display: flex;
  align-items: center;
  flex-direction: column-reverse;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
}

.line-info {
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-info .small-symbol {
  width: 12px;
  height: 12px;
}

.line-counter {
  font-size: 10px;
  color: #8E8E93;
  flex-shrink: 0;
}

.win-center-text {
  font-size: 12px;
  font-weight: 500;
}

.win-center-text.good-luck {
  color: #ffffff;
}

.win-center-text.try-again {
  color: #FF9500;
}

.win-center-text.you-win {
  color: #22A849;
  font-weight: 700;
}

/* Controls */
.slot-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bet Section */
.bet-section {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Bet Arrows */
.bet-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, #3D3D42 0%, #2a2a2e 100%);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bet-arrow:hover:not(:disabled) {
  background: linear-gradient(180deg, #0A84FF 0%, #0066CC 100%);
  transform: scale(1.05);
}

.bet-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bet-arrow:active:not(:disabled) {
  transform: scale(0.95);
}

/* Bet Options - Horizontal Scroll */
.bet-options-scroll {
  flex: 1 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.bet-options-scroll::-webkit-scrollbar {
  display: none;
}

.bet-option {
  flex-shrink: 0;
  min-width: 52px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, #3D3D42 0%, #2a2a2e 100%);
  color: #8E8E93;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.bet-option:focus {
  outline: none;
}

.bet-option:hover:not(:disabled):not(.active) {
  background: linear-gradient(180deg, #4D4D52 0%, #3a3a3e 100%);
  color: #fff;
}

.bet-option.active {
  background: linear-gradient(180deg, #0A84FF 0%, #0066CC 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4);
}

.bet-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Action Section */
.action-section {
  display: flex;
  justify-content: center;
}

.spin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 350px;
}

/* Auto-spin */
.auto-spin-wrapper {
  position: relative;
}

.auto-spin-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #3D3D42 0%, #2a2a2e 100%);
  color: #8E8E93;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

@media (hover: hover) and (pointer: fine) {
  .auto-spin-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #4D4D52 0%, #3a3a3e 100%);
    color: #fff;
  }
}

.auto-spin-btn.active {
  background: linear-gradient(180deg, #FF9500 0%, #CC7700 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
}

.auto-spin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auto-icon {
  font-size: 12px;
  letter-spacing: -2px;
}

.auto-count {
  font-size: 18px;
  font-weight: 700;
}

.auto-menu {
  position: absolute;
  bottom: 60px;
  left: 0;
  background: #29292c;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 6px;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 100;
  min-width: 150px;
}

.auto-menu::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #29292c;
}

.auto-menu button {
  padding: 10px 8px;
  border-radius: 8px;
  border: none;
  background: #3D3D42;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auto-menu button:hover {
  background: #0A84FF;
}

.auto-menu button:last-child {
  font-size: 18px;
}

/* Gamble button (same size as auto-spin) */
.gamble-btn-small {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #FF9500 0%, #CC7700 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
}

.gamble-btn-small:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.5);
}

.gamble-btn-small:active {
  transform: scale(0.98);
}

.spin-btn {
  flex: 1 1;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #9D4EDD 0%, #7B2CBF 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Shine effect on hover - только для устройств с мышкой */
.spin-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.4s ease;
}

/* Блики для разных цветов кнопок */
/* Красная (777) - яркий белый блик */
.slot-machine.slot-777 .spin-btn::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

/* Золотая (Rise of Ra, Dice and Roll, Royal Crown, Egypt) - золотистый блик */
.game-rise-of-ra .spin-btn::before,
.game-dice-and-roll .spin-btn::before,
.spin-btn.royal-crown::before,
.spin-btn.egypt-treasures::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,200,0.5), transparent);
}

/* Зелёная (Star Fruits) - яркий белый блик */
.game-star-fruits .spin-btn::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
}

/* Hover эффекты только на desktop (не на touch) */
@media (hover: hover) and (pointer: fine) {
  .spin-btn:hover:not(:disabled)::before {
    left: 100%;
  }

  .spin-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #B066E8 0%, #8B3DC8 100%);
  }
}

/* Блик анимация для touch устройств (через JS класс) */
@keyframes shineSlide {
  0% { left: -100%; }
  100% { left: 100%; }
}

.spin-btn.shine-animate::before {
  animation: shineSlide 0.4s ease forwards;
}

.spin-btn:active:not(:disabled) {
  background: linear-gradient(180deg, #7B2CBF 0%, #5A189A 100%);
}

.spin-btn:disabled {
  background: #3D3D42 !important;
  cursor: not-allowed;
  opacity: 0.6;
  color: #888 !important;
}

.spin-btn.spinning {
  background: linear-gradient(180deg, #7B2CBF 0%, #5A189A 100%);
}

.spin-btn.free-spin {
  background: linear-gradient(180deg, #FFD700 0%, #E6AC00 100%);
  color: #fff;
}

.spin-btn.auto-active {
  background: linear-gradient(180deg, #E63946 0%, #C5303C 100%);
}

/* Royal Crown / Egypt Treasures - золотая кнопка (высокая специфичность чтобы перекрыть все состояния) */
.spin-btn.royal-crown,
.spin-btn.royal-crown.auto-active,
.spin-btn.royal-crown.spinning,
.spin-btn.royal-crown.collect-mode,
.spin-btn.egypt-treasures,
.spin-btn.egypt-treasures.auto-active,
.spin-btn.egypt-treasures.spinning,
.spin-btn.egypt-treasures.collect-mode {
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 100%) !important;
  color: #fff !important;
}

@media (hover: hover) and (pointer: fine) {
  .spin-btn.royal-crown:hover:not(:disabled),
  .spin-btn.royal-crown.collect-mode:hover:not(:disabled),
  .spin-btn.egypt-treasures:hover:not(:disabled),
  .spin-btn.egypt-treasures.collect-mode:hover:not(:disabled) {
    background: linear-gradient(180deg, #FFE033 0%, #DAA520 100%) !important;
  }
}

.spin-btn.royal-crown:active:not(:disabled),
.spin-btn.royal-crown.collect-mode:active:not(:disabled),
.spin-btn.egypt-treasures:active:not(:disabled),
.spin-btn.egypt-treasures.collect-mode:active:not(:disabled) {
  background: linear-gradient(180deg, #B8860B 0%, #8B6914 100%) !important;
}

.spin-btn.collect-mode {
  background: linear-gradient(180deg, #FFD700 0%, #E6AC00 100%);
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .spin-btn.collect-mode:hover:not(:disabled) {
    background: linear-gradient(180deg, #FFE033 0%, #F0BB00 100%);
    color: #fff;
  }
}

/* ========== BET BUTTON (next to spin) ========== */
.slot-bet-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #3D3D42 0%, #2a2a2e 100%);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
}

.slot-bet-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #4D4D52 0%, #3a3a3e 100%);
}

.slot-bet-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slot-bet-btn .bet-label {
  font-size: 9px;
  font-weight: 700;
  color: #8E8E93;
  letter-spacing: 0.5px;
}

.slot-bet-btn .bet-value {
  font-size: 12px;
  font-weight: 700;
  color: #FFD700;
}

/* ========== BET SELECTION POPUP ========== */
.slot-bet-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.slot-bet-popup {
  background: linear-gradient(180deg, #2a2a2e 0%, #1a1a1d 100%);
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 16px;
  width: 90%;
  max-width: 280px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.slot-bet-popup-title {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #FFD700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.slot-bet-popup-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 6px;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.slot-bet-popup-item {
  padding: 10px 4px;
  background: #2a2a3e;
  border: 2px solid #3a3a4e;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.slot-bet-popup-item:hover {
  background: #3a3a4e;
  border-color: #4a4a5e;
}

.slot-bet-popup-item.active {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  border-color: #ffd700;
  color: #000;
}

.slot-bet-popup-item:active {
  transform: scale(0.98);
}

/* Touch devices - disable sticky hover for bet popup */
@media (hover: none) {
  .slot-bet-popup-item:hover:not(.active) {
    background: #2a2a3e;
    border-color: #3a3a4e;
  }
}

.spin-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Gamble Choice */
.gamble-choice {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 400px;
}

.collect-btn,
.gamble-btn {
  flex: 1 1;
  height: 52px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}

/* Shine effect */
.collect-btn::before,
.gamble-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.4s ease;
}

.collect-btn:hover::before,
.gamble-btn:hover::before {
  left: 100%;
}

.collect-btn {
  background: linear-gradient(180deg, #FFD700 0%, #E6AC00 100%);
  color: #000;
}

.collect-btn:hover {
  background: linear-gradient(180deg, #FFE033 0%, #F0BB00 100%);
}

.gamble-btn {
  background: linear-gradient(180deg, #E63946 0%, #C5303C 100%);
  color: #fff;
}

.gamble-btn:hover {
  background: linear-gradient(180deg, #EF4D5A 0%, #D43946 100%);
}

/* Medium screens (390-425px) - промежуточный размер для iPhone 16 и подобных */
@media (min-width: 390px) and (max-width: 425px) {
  .slot-machine {
    padding: 10px;
  }

  .slot-reel {
    width: 62px;
    height: 165px;
  }

  .reel-symbol {
    width: 62px;
    height: 55px;
  }

  /* Адаптация анимации (15 символов, прокручиваем 12) */
  .reel-spin-strip {
    top: -660px; /* 12 символов * 55px */
  }

  @keyframes reelScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(660px); /* 12 символов * 55px */ }
  }

  .symbol-emoji {
    font-size: 38px;
  }

  .symbol-svg {
    width: 45px;
    height: 45px;
  }

  .spin-btn {
    height: 52px;
    font-size: 17px;
  }

  .bet-option {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* Mobile Adjustments (< 390px) */
@media (max-width: 389px) {
  .slot-machine {
    padding: 8px;
  }

  .slot-reel {
    width: 56px;
    height: 150px;
  }

  .reel-symbol {
    width: 56px;
    height: 50px;
  }

  /* Адаптация анимации для мобильных (15 символов, прокручиваем 12) */
  .reel-spin-strip {
    top: -600px; /* 12 символов * 50px */
  }

  @keyframes reelScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(600px); /* 12 символов * 50px */ }
  }

  .symbol-emoji {
    font-size: 34px;
  }

  .symbol-svg {
    width: 40px;
    height: 40px;
  }

  .spin-btn {
    height: 48px;
    font-size: 16px;
  }

  .collect-btn,
  .gamble-btn {
    height: 48px;
    font-size: 13px;
  }

  .bet-option {
    padding: 8px 12px;
    font-size: 13px;
  }

  .win-amount-big {
    font-size: 24px;
  }

  .sound-toggle {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .free-spins-banner {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Very small screens (< 350px) */
@media (max-width: 350px) {
  .slot-machine {
    padding: 4px;
  }

  .slot-reel {
    width: 46px;
    height: 126px;
  }

  .reel-symbol {
    width: 46px;
    height: 42px;
  }

  /* Адаптация анимации для очень маленьких экранов (15 символов, прокручиваем 12) */
  .reel-spin-strip {
    top: -504px; /* 12 символов * 42px */
  }

  @keyframes reelScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(504px); /* 12 символов * 42px */ }
  }

  .symbol-emoji {
    font-size: 28px;
  }

  .symbol-svg {
    width: 32px;
    height: 32px;
  }

  .spin-btn {
    height: 42px;
    font-size: 14px;
  }

  .collect-btn,
  .gamble-btn {
    height: 42px;
    font-size: 11px;
    padding: 0 8px;
  }

  .bet-controls {
    gap: 4px;
  }

  .bet-option {
    padding: 6px 8px;
    font-size: 11px;
  }

  .win-amount-big {
    font-size: 20px;
  }

  .sound-toggle {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .free-spins-banner {
    padding: 6px 8px;
    font-size: 10px;
  }

  .slot-header {
    margin-bottom: 4px;
  }

  .slot-logo {
    height: 28px;
  }

  .lines-info {
    font-size: 10px;
    padding: 2px 6px;
  }

  .balance-display {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* ========== FULLSCREEN MODE ========== */
.slot-machine.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px;
  box-sizing: border-box;
}

/* Скрываем кнопку fullscreen на мобильных */
@media (max-width: 768px) {
  .fullscreen-toggle-btn {
    display: none !important;
  }
}

.slot-machine.fullscreen-mode .slot-header {
  max-width: 800px;
  margin: 0 auto 16px;
  width: 100%;
}

.slot-machine.fullscreen-mode .slot-header::after {
  background: linear-gradient(90deg, transparent, #ffffff30, transparent);
}

.slot-machine.fullscreen-mode .slot-logo {
  height: 60px;
}

.slot-machine.fullscreen-mode .reels-container {
  max-width: 800px;
  margin: 0 auto;
}

.slot-machine.fullscreen-mode .slot-reel {
  width: 120px;
  height: 300px;
}

.slot-machine.fullscreen-mode .reel-symbol {
  width: 120px;
  height: 100px;
}

/* Адаптация анимации для fullscreen (15 символов, прокручиваем 12) */
.slot-machine.fullscreen-mode .reel-spin-strip {
  top: -1200px; /* 12 символов * 100px */
  animation: reelScrollFullscreen 0.8s linear infinite;
}

@keyframes reelScrollFullscreen {
  0% { transform: translateY(0); }
  100% { transform: translateY(1200px); /* 12 символов * 100px */ }
}

.slot-machine.fullscreen-mode .symbol-svg {
  width: 80px;
  height: 80px;
}

/* Egypt Treasures fullscreen - пропорционально увеличенные */
.slot-machine.fullscreen-mode.game-egypt-treasures .symbol-svg,
.slot-machine.fullscreen-mode.game-rise-of-ra .symbol-svg {
  width: 92px;
  height: 92px;
}

.slot-machine.fullscreen-mode .symbol-emoji {
  font-size: 70px;
}

.slot-machine.fullscreen-mode .win-info-block {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.slot-machine.fullscreen-mode .slot-controls {
  max-width: 800px;
  margin: 8px auto 0;
  width: 100%;
}

.slot-machine.fullscreen-mode .spin-btn {
  height: 60px;
  font-size: 22px;
}

.slot-machine.fullscreen-mode .collect-btn,
.slot-machine.fullscreen-mode .gamble-btn {
  height: 50px;
  font-size: 16px;
}

.slot-machine.fullscreen-mode .bet-display {
  font-size: 16px;
  padding: 10px 16px;
}

.slot-machine.fullscreen-mode .balance-display {
  font-size: 16px;
  padding: 10px 16px;
}

.slot-machine.fullscreen-mode .win-amount-big {
  font-size: 48px;
}

.slot-machine.fullscreen-mode .lines-info {
  font-size: 14px;
  padding: 6px 12px;
}

/* Fullscreen buttons container */
.fullscreen-buttons {
  position: absolute;
  top: 60px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 10000;
}

.fullscreen-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.fullscreen-btn.close-game {
  background: rgba(255, 100, 100, 0.3);
}

.fullscreen-btn.close-game:hover {
  background: rgba(255, 100, 100, 0.5);
}

/* Fullscreen Game Logo - part of flex flow, stays above reels */
.fullscreen-game-logo {
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 12px;
  padding-top: 20px;
}

.fullscreen-game-logo img {
  height: 100px;
  max-width: 500px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

/* Semi-transparent game content wrapper */
.slot-game-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.slot-machine.fullscreen-mode .slot-game-content {
  background: rgb(0 0 0 / 32%);
  border-radius: 16px;
  padding: 16px;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  max-width: 832px;
  /* margin: 0 auto; */
  /* width: 100%; */
  box-shadow: 0 0 20px 2px rgb(0 0 0 / 96%), inset 0 0px 2px 0px rgb(255 255 255 / 61%);
}

.fullscreen-game-title {
  font-size: 48px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  letter-spacing: 2px;
}

/* ========== FULLSCREEN BACKGROUNDS ========== */
/* Royal Crown - fullscreen background set via inline style in JSX */

/* Clover Hot, 20 Super 7, Champion - fullscreen backgrounds set via inline style in JSX */

/* Egypt Treasures - fullscreen background set via inline style in JSX */

/* ========== FULLSCREEN MODE для Rise of Ra ========== */
/* Rise of Ra - fullscreen background set via inline style in JSX */

.slot-machine.fullscreen-mode.game-rise-of-ra .symbol-svg {
  width: 92px;
  height: 92px;
}

/* Rise of Ra golden spin button */
.game-rise-of-ra .spin-btn {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
  color: #000 !important;
  font-weight: 800 !important;
}

@media (hover: hover) and (pointer: fine) {
  .game-rise-of-ra .spin-btn:hover {
    background: linear-gradient(135deg, #FFC000 0%, #FF8C00 100%) !important;
  }
}

/* ========== FULLSCREEN MODE для Dice and Roll ========== */
/* Dice and Roll - fullscreen background set via inline style in JSX */

.slot-machine.fullscreen-mode.game-dice-and-roll .symbol-svg {
  width: 92px;
  height: 92px;
}

/* Dice and Roll golden spin button */
.game-dice-and-roll .spin-btn {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
  color: #000 !important;
  font-weight: 800 !important;
}

@media (hover: hover) and (pointer: fine) {
  .game-dice-and-roll .spin-btn:hover {
    background: linear-gradient(135deg, #FFC000 0%, #FF8C00 100%) !important;
  }
}

/* ========== FULLSCREEN MODE для 3-reel слота (777) ========== */
/* 777 - fullscreen background set via inline style in JSX */

.slot-machine.fullscreen-mode.slot-777 .reels-container {
  max-width: 400px;
}

.slot-machine.fullscreen-mode.slot-777 .reels-frame {
  max-width: 360px;
}

.slot-machine.fullscreen-mode.slot-777 .slot-reel {
  width: 110px;
  height: 300px;
}

.slot-machine.fullscreen-mode.slot-777 .reel-symbol {
  width: 110px;
  height: 100px;
}

.slot-machine.fullscreen-mode.slot-777 .symbol-svg {
  width: 75px;
  height: 75px;
}

/* Анимация для 3-reel fullscreen */
.slot-machine.fullscreen-mode.slot-777 .reel-spin-strip {
  top: -1200px;
  animation: reelScrollFullscreen 0.8s linear infinite;
}

/* Контролы для 3-reel fullscreen */
.slot-machine.fullscreen-mode.slot-777 .slot-controls {
  max-width: 400px;
}

.slot-machine.fullscreen-mode.slot-777 .gamble-options {
  max-width: 360px;
}

/* ========== REELS LOADER (загрузка внутри барабанов) ========== */
.reels-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #080808 0%, #1a1a1a 50%, #080808 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 8px;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.reels-loader.fade-out {
  opacity: 0;
}

.reels-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 80%;
  max-width: 240px;
}

.reels-loader-brand {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.reels-loader-logo {
  width: 180px;
  height: auto;
  margin-bottom: 16px;
  opacity: 0.9;
}

.reels-loader-progress-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.reels-loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
  border-radius: 3px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.reels-loader-percent {
  color: #FFD700;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

/* ========== Star Fruits Game Styles ========== */

/* Star Fruits - fullscreen background set via inline style in JSX */

/* Star Fruits uses same 3x3 reels as 777 */
.slot-machine.fullscreen-mode.game-star-fruits .reels-container {
  max-width: 400px;
}

.slot-machine.fullscreen-mode.game-star-fruits .reels-frame {
  max-width: 360px;
}

.slot-machine.fullscreen-mode.game-star-fruits .slot-reel {
  width: 110px;
  height: 300px;
}

.slot-machine.fullscreen-mode.game-star-fruits .reel-symbol {
  width: 110px;
  height: 100px;
}

.slot-machine.fullscreen-mode.game-star-fruits .symbol-svg {
  width: 95px;
  height: 85px;
}

/* Star Fruits golden spin button */
.game-star-fruits .spin-btn {
  background: linear-gradient(135deg, #62A217 0%, #4a8012 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
}

@media (hover: hover) and (pointer: fine) {
  .game-star-fruits .spin-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #74B31E 0%, #5a9618 100%) !important;
  }
}

.game-star-fruits .spin-btn:active:not(:disabled),
.game-star-fruits .spin-btn.spinning {
  background: linear-gradient(135deg, #4a8012 0%, #3a600e 100%) !important;
}

/* ========== RECONNECTING OVERLAY ========== */
.reels-reconnecting-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 8px;
}

.reels-reconnecting-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.reconnecting-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 215, 0, 0.2);
  border-top: 3px solid #FFD700;
  border-radius: 50%;
  animation: reconnectSpin 0.8s linear infinite;
}

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

.reels-reconnecting-content span {
  color: #FFD700;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: reconnectPulse 1.5s ease-in-out infinite;
}

@keyframes reconnectPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

