/* ============ Full-screen cosmic background ============ */

body {
  background: #ffffff;
  overflow-x: hidden;
}

.phone-app {
  background: transparent;
  position: relative;
  z-index: 1;
}

.slots-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.slots-bg-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 26% at 50% 8%, rgba(255, 200, 60, 0.22), transparent 70%),
    radial-gradient(45% 35% at 15% 75%, rgba(184, 92, 246, 0.18), transparent 70%),
    radial-gradient(45% 35% at 85% 70%, rgba(92, 168, 255, 0.16), transparent 70%);
  animation: bgGlowShift 12s ease-in-out infinite alternate;
}

@keyframes bgGlowShift {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.08) rotate(3deg); }
}

.star-field {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 10%, #fff, transparent),
    radial-gradient(1px 1px at 30% 40%, #ffd76b, transparent),
    radial-gradient(1.5px 1.5px at 65% 30%, #fff, transparent),
    radial-gradient(1px 1px at 90% 55%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 15% 65%, #ffd76b, transparent),
    radial-gradient(1px 1px at 50% 80%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 75% 90%, #fff, transparent),
    radial-gradient(1px 1px at 40% 15%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 5% 90%, #ffd76b, transparent);
  background-repeat: repeat;
  background-size: 220px 220px;
  animation: twinkle 4s ease-in-out infinite alternate;
  opacity: 0.8;
}

@keyframes twinkle {
  0% { opacity: 0.45; }
  100% { opacity: 0.9; }
}

.orb {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow: inset -6px -6px 10px rgba(0, 0, 0, 0.35), inset 4px 4px 8px rgba(255, 255, 255, 0.25), 0 0 18px rgba(255, 255, 255, 0.15);
  opacity: 0.35;
  filter: blur(0.3px);
  animation: orbFloat 9s ease-in-out infinite;
}

.orb::before {
  content: attr(data-label);
}

.orb-1 { top: 8%; left: 6%; width: 54px; height: 54px; background: radial-gradient(circle at 35% 30%, #c58bff, #6a2fc9 65%, #3d1a80); animation-duration: 10s; }
.orb-2 { top: 20%; right: 8%; width: 42px; height: 42px; background: radial-gradient(circle at 35% 30%, #8fe8a0, #1f9e4c 65%, #0f5c2c); animation-duration: 8s; animation-delay: 1.2s; }
.orb-3 { bottom: 22%; left: 4%; width: 60px; height: 60px; background: radial-gradient(circle at 35% 30%, #ffcf7a, #e08a1c 65%, #8a4c05); animation-duration: 11s; animation-delay: 0.6s; }
.orb-4 { top: 45%; left: 12%; width: 34px; height: 34px; background: radial-gradient(circle at 35% 30%, #8ec7ff, #2f78d6 65%, #17417a); animation-duration: 7.5s; animation-delay: 2s; }
.orb-5 { bottom: 10%; right: 10%; width: 50px; height: 50px; background: radial-gradient(circle at 35% 30%, #ff9fae, #d63a54 65%, #7a1626); animation-duration: 9.5s; animation-delay: 0.9s; }
.orb-6 { top: 65%; right: 5%; width: 38px; height: 38px; background: radial-gradient(circle at 35% 30%, #b8e0ff, #4fa3e8 65%, #1f5a91); animation-duration: 8.5s; animation-delay: 1.6s; }
.orb-w.orb {
  top: 35%;
  right: 22%;
  width: 44px;
  height: 44px;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #ffc107 60%, #a5710a);
  animation-duration: 10.5s;
  animation-delay: 0.3s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -18px) rotate(6deg); }
  66% { transform: translate(-12px, 10px) rotate(-5deg); }
}

.coin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #ffc107 60%, #a5710a);
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
  opacity: 0.5;
  animation: coinDrift 14s linear infinite;
}

.coin-1 { top: 12%; left: 40%; animation-duration: 13s; }
.coin-2 { top: 55%; left: 25%; animation-duration: 16s; animation-delay: 3s; }
.coin-3 { top: 30%; right: 30%; animation-duration: 15s; animation-delay: 5s; }
.coin-4 { bottom: 15%; left: 60%; animation-duration: 12s; animation-delay: 1.5s; }

@keyframes coinDrift {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-30px) rotate(180deg); opacity: 0.7; }
  100% { transform: translateY(0) rotate(360deg); opacity: 0.3; }
}

/* ============ Header ============ */

.slots-header {
  position: relative;
  z-index: 2;
}

.slots-title {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #fff6d8, #ffc107 55%, #ff9d00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(255, 193, 7, 0.45);
  letter-spacing: 0.5px;
}

.crown-icon {
  font-size: 15px;
  filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.8));
}

.slots-container {
  padding: 20px 16px;
  min-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: transparent;
  position: relative;
  z-index: 1;
}

.slots-balance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.balance-item {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4a2f9e 0%, #6a2fc9 55%, #8b3fe8 100%);
  color: white;
  text-align: center;
  box-shadow: 0 4px 18px rgba(107, 47, 201, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.balance-item span {
  font-size: 11px;
  opacity: 0.9;
  display: block;
  margin-bottom: 4px;
}

.balance-item strong {
  font-size: 16px;
  font-weight: 900;
}

.win-amount {
  color: #4caf50 !important;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.slots-machine {
  background: linear-gradient(180deg, #221a3d, #120c24);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55), inset 0 2px 10px rgba(36, 26, 61, 0.05);
  position: relative;
  overflow: hidden;
  border: 2px solid #ffc107;
  animation: machineGlow 3.5s ease-in-out infinite;
}

@keyframes machineGlow {
  0%, 100% { box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55), inset 0 2px 10px rgba(36, 26, 61, 0.05), 0 0 18px rgba(255, 193, 7, 0.35); }
  50% { box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55), inset 0 2px 10px rgba(36, 26, 61, 0.05), 0 0 34px rgba(255, 193, 7, 0.65); }
}

.slots-machine::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(255, 193, 7, 0.16) 0%, transparent 70%),
    linear-gradient(180deg, rgba(184, 92, 246, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.slots-reels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.reel {
  background: linear-gradient(180deg, #2a2350, #16112b);
  border-radius: 10px;
  overflow: hidden;
  height: 180px;
  position: relative;
  border: 2px solid #ffc107;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 193, 7, 0.35);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.1s ease-out;
}

.slot-symbol {
  height: 60px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slot-symbol::after {
  content: '';
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: -1;
}

.slot-symbol[data-symbol="W"],
.slot-symbol[data-symbol="I"],
.slot-symbol[data-symbol="N"],
.slot-symbol[data-symbol="G"],
.slot-symbol[data-symbol="O"] {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff3c4, #ffc107 55%, #8a5b04 100%);
  border: 2px solid #ffe08a;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  color: #3a2400;
  font-size: 20px;
  text-shadow: none;
  margin: 8px auto;
}

.slot-symbol[data-symbol="7"] {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #d9b8ff, #8b3fe8 55%, #3d1a80 100%);
  border: 2px solid #c58bff;
  box-shadow: 0 0 12px rgba(139, 63, 232, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  font-size: 22px;
  text-shadow: 0 0 8px rgba(197, 139, 255, 0.6);
  margin: 8px auto;
}

.slot-symbol[data-symbol="diamond"] {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #d6f3ff, #4fa3e8 55%, #1f5a91 100%);
  border: 2px solid #8ec7ff;
  box-shadow: 0 0 12px rgba(79, 163, 232, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  font-size: 22px;
  margin: 8px auto;
}

.slot-symbol[data-symbol="star"] {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #d9ffe0, #1f9e4c 55%, #0f5c2c 100%);
  border: 2px solid #8fe8a0;
  box-shadow: 0 0 12px rgba(31, 158, 76, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  font-size: 22px;
  margin: 8px auto;
}

.slot-symbol[data-symbol="cherry"] {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffd6dc, #d63a54 55%, #7a1626 100%);
  border: 2px solid #ff9fae;
  box-shadow: 0 0 12px rgba(214, 58, 84, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  font-size: 22px;
  margin: 8px auto;
}

.payline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ffc107, transparent);
  transform: translateY(-50%);
  z-index: 10;
  box-shadow: 0 0 15px #ffc107;
  opacity: 0.9;
  animation: paylinePulse 1.8s ease-in-out infinite;
}

@keyframes paylinePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.reel.spinning .reel-strip {
  animation: spin 0.1s linear infinite;
}

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

.reel.stopping .reel-strip {
  animation: stopSpin 0.3s ease-out forwards;
}

@keyframes stopSpin {
  0% {
    transform: translateY(-60px);
  }
  100% {
    transform: translateY(0);
  }
}

.slot-symbol.winning {
  animation: winPulse 0.5s ease-in-out infinite;
}

@keyframes winPulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
  50% {
    transform: scale(1.2);
    filter: brightness(1.6) drop-shadow(0 0 10px rgba(255, 193, 7, 0.8));
  }
}

.bet-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.auto-spin-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.auto-spin-toggle span,
.turbo-toggle span {
  color: var(--text);
}

.auto-spin-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #ffc107;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.rounds-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.round-btn {
  height: 36px;
  border: 2px solid rgba(255, 193, 7, 0.25);
  border-radius: 8px;
  background: #f4f1fb;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.round-btn:hover {
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.15);
}

.round-btn.active {
  background: linear-gradient(180deg, #ffc107, #ffb300);
  color: #2a1a00;
  border-color: #ffc107;
}

.turbo-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.turbo-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.turbo-slider {
  position: relative;
  width: 50px;
  height: 26px;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.turbo-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.turbo-toggle input:checked + .turbo-slider {
  background-color: #ffc107;
}

.turbo-toggle input:checked + .turbo-slider:before {
  transform: translateX(24px);
}

.auto-spin-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ffc107, #ffb300);
  border-radius: 12px;
  color: white;
  font-weight: 600;
}

.stop-auto-spin {
  background: white;
  color: #ffc107;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}

.stop-auto-spin:hover {
  background: #fff8e1;
}

.hidden {
  display: none !important;
}

.bet-control-btn {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 193, 7, 0.25);
  border-radius: 50%;
  background: #f4f1fb;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.bet-control-btn:hover {
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.15);
}

.bet-control-btn:active {
  transform: scale(0.95);
}

.bet-amount-display {
  text-align: center;
}

.bet-amount-display span {
  font-size: 12px;
  color: var(--muted);
  display: block;
}

.bet-amount-display strong {
  font-size: 20px;
  font-weight: 900;
  color: #ffc107;
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.spin-button {
  width: 100%;
  height: 64px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffdd66, #ffc107 45%, #ff9d00);
  color: #2a1a00;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(255, 193, 7, 0.5);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  animation: spinButtonPulse 2.2s ease-in-out infinite;
}

@keyframes spinButtonPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 193, 7, 0.5); }
  50% { box-shadow: 0 4px 28px rgba(255, 193, 7, 0.8); }
}

.spin-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: spinButtonShine 2.6s ease-in-out infinite;
}

@keyframes spinButtonShine {
  0% { left: -60%; }
  60%, 100% { left: 130%; }
}

.spin-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(255, 193, 7, 0.65);
}

.spin-button:active:not(:disabled) {
  transform: translateY(0);
}

.spin-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spin-icon svg {
  animation: spinIcon 1s linear infinite;
}

.spin-button:not(:disabled) .spin-icon svg {
  animation: none;
}

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

.paytable {
  background: linear-gradient(180deg, rgba(34, 26, 61, 0.75), rgba(14, 9, 28, 0.75));
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 193, 7, 0.25);
  backdrop-filter: blur(6px);
}

.paytable h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ffc107;
  margin: 0 0 12px;
  text-align: center;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.paytable-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.paytable-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 193, 7, 0.22);
  border-radius: 8px;
}

.paytable-symbols {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f4f1ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.paytable-multiplier {
  font-size: 12px;
  font-weight: 700;
  color: #ffc107;
}

.rtp-display {
  text-align: center;
  padding: 12px;
  background: #e8f8ef;
  border: 1px solid rgba(24, 185, 95, 0.35);
  border-radius: 8px;
  color: #1a8f4f;
  font-size: 12px;
  font-weight: 600;
}

.status-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  display: none;
}

.status-message.error {
  display: block;
  background: #fdeaec;
  color: #c0293e;
  border: 1px solid rgba(214, 58, 84, 0.4);
}

.status-message.success {
  display: block;
  background: #e8f8ef;
  color: #1a8f4f;
  border: 1px solid rgba(24, 185, 95, 0.35);
}

.status-message.win {
  display: block;
  background: linear-gradient(135deg, #ffdd66, #ffc107 45%, #ff9d00);
  color: #2a1a00;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(255, 193, 7, 0.6);
  animation: winMessage 0.5s ease-in-out;
}

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

@media (max-width: 360px) {
  .slots-balance {
    grid-template-columns: 1fr;
  }
  
  .paytable-grid {
    grid-template-columns: 1fr;
  }
  
  .slot-symbol {
    font-size: 28px;
  }
}
