/* Mahjong Wins 3 - Black Scatter Styles */

:root {
  --bg-primary: #1a0a2e;
  --bg-secondary: #2d1b4e;
  --bg-reel: #0d0520;
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.6);
  --win-green: #00ff88;
  --scatter-purple: #9b59b6;
  --black-scatter: #2c2c2c;
  --text-primary: #ffffff;
  --text-secondary: #b8a9c9;
  --btn-primary: #e74c3c;
  --btn-hover: #c0392b;
  --btn-disabled: #555;
  --border-color: #4a3a6a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

#game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
  position: relative;
}

/* Header */
.game-header {
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin-bottom: 10px;
}

.game-header h1 {
  font-size: 1.8rem;
  background: linear-gradient(45deg, var(--gold), #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.header-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Info Bar */
.info-bar {
  display: flex;
  justify-content: space-around;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  margin-bottom: 10px;
}

.info-item {
  text-align: center;
}

.info-item .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.info-item .value {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--gold);
}

.multiplier-display .value {
  color: #00ff88;
}

.win-display .value {
  color: #ff6b6b;
}

.win-display .value.winning {
  color: var(--win-green);
  animation: pulse 0.5s infinite;
}

/* Free Spin Banner */
.free-spin-banner {
  background: linear-gradient(90deg, #9b59b6, #8e44ad, #9b59b6);
  padding: 10px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 8px;
  margin-bottom: 10px;
  animation: fsGlow 1.5s infinite;
}

.free-spin-banner.hidden {
  display: none;
}

.fs-icon {
  margin: 0 10px;
  animation: starSpin 2s linear infinite;
}

@keyframes fsGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(155, 89, 182, 0.5); }
  50% { box-shadow: 0 0 30px rgba(155, 89, 182, 0.8); }
}

@keyframes starSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Reels Container */
.reels-container {
  background: linear-gradient(180deg, #0d0520 0%, #1a0a2e 100%);
  border-radius: 15px;
  padding: 15px;
  border: 3px solid var(--border-color);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

.reels {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.reel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 10px;
}

.symbol {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(145deg, #2a1a4a, #1a0a2e);
  border-radius: 10px;
  border: 2px solid #3a2a5a;
  transition: all 0.3s ease;
  position: relative;
}

.symbol.empty {
  color: #3a2a5a;
  font-size: 2rem;
}
  transition: all 0.3s ease;
  position: relative;
}

.symbol.gold {
  border: 3px solid var(--gold);
  box-shadow: 0 0 15px var(--gold-glow), inset 0 0 15px rgba(255, 215, 0, 0.2);
  animation: goldShimmer 2s infinite;
}

@keyframes goldShimmer {
  0%, 100% { box-shadow: 0 0 15px var(--gold-glow), inset 0 0 15px rgba(255, 215, 0, 0.2); }
  50% { box-shadow: 0 0 25px var(--gold-glow), inset 0 0 25px rgba(255, 215, 0, 0.4); }
}

.symbol.winning {
  animation: winPulse 0.5s ease-in-out;
  border-color: var(--win-green);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

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

.symbol.scatter {
  background: linear-gradient(145deg, #9b59b6, #8e44ad);
}

.symbol.black-scatter {
  background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
  border-color: #ff0000;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.symbol.wild {
  background: linear-gradient(145deg, #27ae60, #2ecc71);
  border-color: #27ae60;
}

.symbol.transform {
  animation: transformToWild 0.6s ease-in-out;
}

@keyframes transformToWild {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); opacity: 0.5; }
  100% { transform: rotateY(0deg); }
}

.symbol.removing {
  animation: symbolRemove 0.4s ease-out forwards;
}

@keyframes symbolRemove {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

.symbol.falling {
  animation: symbolFall 0.3s ease-in;
}

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

/* Win Popup */
.win-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.win-popup.hidden {
  display: none;
}

.win-popup-content {
  text-align: center;
  animation: winPopIn 0.5s ease-out;
}

@keyframes winPopIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.win-label {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold);
  margin-bottom: 10px;
}

.win-amount {
  font-size: 4rem;
  font-weight: bold;
  color: var(--win-green);
  text-shadow: 0 0 40px var(--win-green);
  animation: winGlow 0.5s infinite alternate;
}

@keyframes winGlow {
  0% { text-shadow: 0 0 20px var(--win-green); }
  100% { text-shadow: 0 0 50px var(--win-green), 0 0 80px var(--win-green); }
}

/* Free Spin Trigger Popup */
.fs-trigger-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.fs-trigger-popup.hidden {
  display: none;
}

.fs-popup-content {
  text-align: center;
  background: linear-gradient(145deg, #2d1b4e, #1a0a2e);
  padding: 40px;
  border-radius: 20px;
  border: 3px solid var(--scatter-purple);
  box-shadow: 0 0 50px rgba(155, 89, 182, 0.5);
  animation: fsPopIn 0.6s ease-out;
}

@keyframes fsPopIn {
  0% { transform: scale(0) rotate(-10deg); }
  70% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.fs-title {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--gold);
}

.fs-spins {
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 20px;
}

.fs-instant-win {
  font-size: 1.5rem;
  color: var(--win-green);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.fs-instant-win.hidden {
  display: none;
}

.black-scatter-icon {
  font-size: 2rem;
  animation: bsGlow 1s infinite;
}

@keyframes bsGlow {
  0%, 100% { text-shadow: 0 0 10px #ff0000; }
  50% { text-shadow: 0 0 30px #ff0000, 0 0 50px #ff0000; }
}

.fs-continue-btn {
  font-size: 1.2rem;
  padding: 15px 40px;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.control-group label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.bet-size-controls,
.bet-level-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bet-value {
  min-width: 50px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--gold);
}

.total-bet-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--gold);
}

/* Buttons */
.btn {
  background: var(--btn-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn:hover:not(:disabled) {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

.btn:disabled {
  background: var(--btn-disabled);
  cursor: not-allowed;
  transform: none;
}

.btn-small {
  padding: 8px 15px;
  font-size: 1rem;
}

.spin-btn {
  width: 120px;
  height: 60px;
  font-size: 1.3rem;
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.spin-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.spin-btn.spinning .spin-text {
  animation: spinText 0.5s linear infinite;
}

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

.btn-toggle {
  background: #34495e;
}

.btn-toggle[data-active="true"] {
  background: #27ae60;
}

.btn-reset {
  background: #9b59b6;
}

.auto-controls {
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.auto-spin-wrapper {
  display: flex;
  gap: 5px;
  align-items: center;
}

.auto-count-select {
  background: #34495e;
  color: var(--text-primary);
  border: none;
  border-radius: 5px;
  padding: 8px 5px;
  font-size: 14px;
  cursor: pointer;
  min-width: 50px;
}

.auto-count-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.paytable-toggle,
.history-link {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.paytable-toggle:hover,
.history-link:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(145deg, #2d1b4e, #1a0a2e);
  padding: 30px;
  border-radius: 15px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.modal-content h2,
.modal-content h3 {
  color: var(--gold);
  margin-bottom: 15px;
}

.modal-content h3 {
  margin-top: 20px;
}

.paytable-content {
  margin-bottom: 20px;
}

.paytable-bet-info {
  background: linear-gradient(90deg, var(--gold), #ffaa00);
  color: #000;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.paytable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.paytable-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 10px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.paytable-item:hover {
  border-color: var(--gold);
  transform: scale(1.02);
}

.paytable-item.high-pay {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
}

.paytable-item .symbol-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.paytable-item .payouts {
  font-size: 0.85rem;
}

.paytable-item .payout-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 5px;
  margin: 2px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.paytable-item .payout-row span:first-child {
  color: var(--text-secondary);
  font-weight: bold;
}

.paytable-item .payout-row span:last-child {
  color: var(--win-green);
  font-weight: bold;
}

.paytable-item.high-pay .payout-row span:last-child {
  color: var(--gold);
}

.paytable-special {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #333;
}

.paytable-special h4 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 1rem;
}

.black-scatter-pays {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.bs-pay {
  background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #ff0000;
}

.bs-pay span:first-child {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.bs-pay span:last-child {
  display: block;
  color: #ff4444;
  font-weight: bold;
  font-size: 0.9rem;
}

.features-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.feature-icon {
  font-size: 1.5rem;
}

.gold-icon {
  color: var(--gold);
}

.multiplier-info {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
}

.multiplier-info p {
  margin-bottom: 5px;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 600px) {
  .symbol {
    width: 55px;
    height: 55px;
    font-size: 2rem;
  }
  
  .controls {
    gap: 10px;
  }
  
  .spin-btn {
    width: 100px;
    height: 50px;
    font-size: 1.1rem;
  }
  
  .game-header h1 {
    font-size: 1.4rem;
  }
  
  .info-item .value {
    font-size: 1.2rem;
  }
}
