/* =============================================
   MaharajaFunHub - Games Styles
   ============================================= */

/* ---- Game UI Base ---- */
.game-wrapper {
  min-height: calc(100vh - 72px);
  background: linear-gradient(160deg, #1a0a2e 0%, #0d1a40 100%);
  padding: 32px 24px 64px;
}

.game-container {
  max-width: 900px;
  margin: 0 auto;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.game-title {
  font-family: 'Cinzel', serif;
  color: #FFD700;
  font-size: 1.8rem;
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
}

.game-social-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #c0a0e0;
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: 20px;
}

/* ---- Balance / Stats Bar ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-box {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.stat-box .sb-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9070b0;
  margin-bottom: 4px;
}

.stat-box .sb-value {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFD700;
}

.stat-box .sb-value.win { color: #4CAF50; }
.stat-box .sb-value.bet { color: #FF9800; }

/* ---- SLOT MACHINE ---- */
.slot-machine {
  background: linear-gradient(145deg, #2d1060, #1a0a2e);
  border: 3px solid #FFD700;
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 0 40px rgba(212,160,23,0.2),
    inset 0 0 40px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.slot-machine::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #FFD700, transparent);
  animation: scanline 2s linear infinite;
}

@keyframes scanline {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.slot-title-bar {
  text-align: center;
  margin-bottom: 24px;
}

.slot-title-bar h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #FFD700;
  letter-spacing: 3px;
}

.slot-lights {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.slot-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}
.slot-light:nth-child(1) { background: #E91E63; animation-delay: 0s; }
.slot-light:nth-child(2) { background: #FFD700; animation-delay: 0.2s; }
.slot-light:nth-child(3) { background: #4CAF50; animation-delay: 0.4s; }
.slot-light:nth-child(4) { background: #2196F3; animation-delay: 0.6s; }
.slot-light:nth-child(5) { background: #FF9800; animation-delay: 0.8s; }
.slot-light:nth-child(6) { background: #E91E63; animation-delay: 1s; }
.slot-light:nth-child(7) { background: #FFD700; animation-delay: 1.2s; }

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; }
  50% { opacity: 0.3; box-shadow: none; }
}

/* ---- Reels ---- */
.reels-area {
  background: rgba(0,0,0,0.4);
  border: 2px solid rgba(212,160,23,0.4);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
}

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

.reel {
  flex: 1;
  max-width: 140px;
  height: 160px;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(212,160,23,0.5);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

.reel-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.1s linear;
  will-change: transform;
}

.reel-symbol {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  user-select: none;
  flex-shrink: 0;
}

.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    transparent 30%,
    transparent 70%,
    rgba(0,0,0,0.25) 100%
  );
  pointer-events: none;
}

.win-line {
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  height: 3px;
  background: rgba(255, 60, 60, 0.7);
  transform: translateY(-50%);
  pointer-events: none;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(255, 60, 60, 0.5);
}

.win-line::before,
.win-line::after {
  content: '◄';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #FF4500;
  font-size: 1rem;
  line-height: 1;
}
.win-line::before { left: -18px; }
.win-line::after  { right: -18px; content: '►'; }

/* ---- Win Message ---- */
.win-message {
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.win-text {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  animation: winPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
  display: none;
}

.win-text.show { display: block; }
.win-text.big-win { color: #FFD700; text-shadow: 0 0 20px rgba(255,215,0,0.7); }
.win-text.small-win { color: #4CAF50; }
.win-text.no-win { color: #FF7043; font-size: 1.1rem; }

@keyframes winPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---- Slot Controls ---- */
.slot-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bet-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bet-label { font-size: 0.8rem; color: #9070b0; text-transform: uppercase; letter-spacing: 1px; }

.bet-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(212,160,23,0.4);
  color: #FFD700;
  border-radius: 8px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}
.bet-btn:hover { background: rgba(212,160,23,0.2); transform: scale(1.05); }

.bet-amount {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #FF9800;
  min-width: 80px;
  text-align: center;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,152,0,0.3);
  border-radius: 8px;
  padding: 6px 12px;
}

.spin-btn {
  background: linear-gradient(135deg, #E91E63, #C62828);
  color: white;
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 16px 48px;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 6px 25px rgba(233,30,99,0.4);
  transition: all 0.2s;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.spin-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.5s;
}
.spin-btn:hover::before { left: 100%; }

.spin-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 35px rgba(233,30,99,0.6); }
.spin-btn:active { transform: translateY(-1px); }
.spin-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.spin-btn.spinning { animation: spinPulse 0.5s ease infinite; }

@keyframes spinPulse {
  0%, 100% { box-shadow: 0 6px 25px rgba(233,30,99,0.4); }
  50%       { box-shadow: 0 6px 35px rgba(233,30,99,0.8); }
}

.max-bet-btn {
  background: rgba(212,160,23,0.2);
  border: 1px solid rgba(212,160,23,0.4);
  color: #FFD700;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.max-bet-btn:hover { background: rgba(212,160,23,0.35); }

/* ---- Paytable ---- */
.paytable {
  margin-top: 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 12px;
  padding: 20px;
}

.paytable h4 {
  font-family: 'Cinzel', serif;
  color: #FFD700;
  font-size: 0.9rem;
  margin-bottom: 14px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

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

.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 0.82rem;
}

.pay-symbols { font-size: 1rem; letter-spacing: 2px; }
.pay-amount  { color: #FFD700; font-weight: 700; }

/* ============================================
   HIGH or LOW CARD GAME
   ============================================ */

.hilo-board {
  background: linear-gradient(145deg, #0a1a2e, #1a2a50);
  border: 3px solid #4A0080;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 0 40px rgba(74,0,128,0.4), inset 0 0 40px rgba(0,0,0,0.3);
  position: relative;
}

/* Table felt texture */
.hilo-board::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 20px;
  background: rgba(0,60,20,0.05);
  pointer-events: none;
}

.hilo-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* ---- Playing Card ---- */
.playing-card {
  width: 140px;
  height: 200px;
  background: white;
  border-radius: 14px;
  box-shadow:
    0 10px 40px rgba(0,0,0,0.5),
    0 0 0 2px rgba(255,255,255,0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  cursor: default;
  transition: all 0.3s ease;
  transform-style: preserve-3d;
}

.playing-card.red-suit { color: #C62828; }
.playing-card.black-suit { color: #1a1a2e; }
.playing-card.hidden-card { background: linear-gradient(135deg, #1a3a80, #0d2040); color: transparent; }
.playing-card.hidden-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.05) 0px,
    rgba(255,255,255,0.05) 4px,
    transparent 4px,
    transparent 12px
  );
  border-radius: 8px;
  border: 2px solid rgba(212,160,23,0.4);
}
.playing-card.hidden-card .card-center { color: rgba(255,215,0,0.5); font-size: 3rem; }
.playing-card.hidden-card .card-corner { display: none; }

.card-corner { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card-corner .rank { font-size: 1.3rem; font-weight: 900; font-family: 'Cinzel', serif; }
.card-corner .suit { font-size: 0.9rem; }
.card-corner.bottom { transform: rotate(180deg); }

.card-center {
  text-align: center;
  font-size: 3.5rem;
  line-height: 1;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.card-flip-enter { animation: cardFlip 0.4s ease; }
@keyframes cardFlip {
  0%   { transform: perspective(600px) rotateY(90deg) scale(0.8); opacity: 0; }
  100% { transform: perspective(600px) rotateY(0deg) scale(1);   opacity: 1; }
}

.card-win-glow { animation: cardWinGlow 0.6s ease 3; }
@keyframes cardWinGlow {
  0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 10px 40px rgba(76,175,80,0.8), 0 0 30px rgba(76,175,80,0.5); }
}

.card-lose-shake { animation: cardShake 0.5s ease; }
@keyframes cardShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-6px); }
  80%     { transform: translateX(6px); }
}

/* Arrow between cards */
.card-arrow {
  font-size: 2.5rem;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* ---- HiLo Controls ---- */
.hilo-controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-higher {
  flex: 1;
  max-width: 220px;
  background: linear-gradient(135deg, #1B5E20, #2E7D32);
  color: white;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 18px 24px;
  border-radius: 14px;
  border: 2px solid rgba(76,175,80,0.4);
  box-shadow: 0 6px 25px rgba(46,125,50,0.4);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-higher:hover:not(:disabled) { transform: translateY(-4px); box-shadow: 0 10px 35px rgba(76,175,80,0.6); }
.btn-higher:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-lower {
  flex: 1;
  max-width: 220px;
  background: linear-gradient(135deg, #B71C1C, #C62828);
  color: white;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 18px 24px;
  border-radius: 14px;
  border: 2px solid rgba(198,40,40,0.4);
  box-shadow: 0 6px 25px rgba(198,40,40,0.4);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-lower:hover:not(:disabled) { transform: translateY(-4px); box-shadow: 0 10px 35px rgba(198,40,40,0.6); }
.btn-lower:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cashout {
  flex: 1;
  max-width: 180px;
  background: linear-gradient(135deg, #E65100, #FF6D00);
  color: white;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 18px 20px;
  border-radius: 14px;
  border: 2px solid rgba(255,109,0,0.4);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-cashout:hover:not(:disabled) { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(255,109,0,0.5); }
.btn-cashout:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- HiLo History ---- */
.hilo-history {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.history-label { font-size: 0.78rem; color: #6040a0; text-transform: uppercase; letter-spacing: 1px; }

.history-mini-card {
  width: 36px; height: 50px;
  background: white;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid rgba(255,255,255,0.2);
}
.history-mini-card.red  { color: #C62828; }
.history-mini-card.black { color: #1a1a2e; }
.history-mini-card.win  { border-color: #4CAF50; box-shadow: 0 0 6px rgba(76,175,80,0.4); }
.history-mini-card.lose { border-color: #f44336; box-shadow: 0 0 6px rgba(244,67,54,0.4); }

/* ---- Streak Display ---- */
.streak-display {
  text-align: center;
  padding: 12px;
  margin-bottom: 16px;
}
.streak-value {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: #FFD700;
}
.streak-label { font-size: 0.8rem; color: #9070b0; text-transform: uppercase; letter-spacing: 1px; }
.streak-multiplier { font-size: 1rem; color: #FF9800; font-weight: 600; }

/* ---- HiLo Odds Display ---- */
.odds-display {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.odds-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
}
.odds-item .oi-label { font-size: 0.72rem; color: #7060a0; text-transform: uppercase; letter-spacing: 0.5px; }
.odds-item .oi-value { font-family: 'Cinzel', serif; font-size: 1rem; color: #FFD700; }

/* ---- Result Overlay ---- */
.result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  border-radius: 21px;
  z-index: 10;
  animation: fadeIn 0.3s ease;
  display: none;
}
.result-overlay.show { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.result-box {
  text-align: center;
  background: rgba(20,5,40,0.95);
  border: 2px solid var(--gold, #FFD700);
  border-radius: 16px;
  padding: 32px 40px;
  max-width: 320px;
  animation: popupIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.result-box h3 { font-family: 'Cinzel', serif; font-size: 1.8rem; margin-bottom: 10px; }
.result-box.win h3  { color: #4CAF50; }
.result-box.lose h3 { color: #f44336; }
.result-box p { color: #c0a0e0; margin-bottom: 20px; font-size: 0.9rem; }
.result-box .amount { font-family: 'Cinzel', serif; font-size: 2rem; color: #FFD700; display: block; }

.btn-new-game {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: #1a0a2e;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 50px;
  margin-top: 16px;
  transition: all 0.2s;
  border: 2px solid rgba(255,255,255,0.2);
}
.btn-new-game:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,215,0,0.5); }

/* ---- Confetti / Coin Rain ---- */
@keyframes coinFall {
  0%   { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  top: 0;
  pointer-events: none;
  z-index: 9999;
  animation: coinFall linear forwards;
  font-size: 1.2rem;
}

/* ---- Mobile responsive for games ---- */
@media (max-width: 600px) {
  .slot-controls { flex-direction: column; align-items: center; }
  .reels-wrap { gap: 6px; }
  .reel { max-width: 100px; height: 130px; }
  .reel-symbol { height: 130px; font-size: 2.8rem; }
  .spin-btn { width: 100%; }
  .playing-card { width: 110px; height: 160px; }
  .card-center { font-size: 2.8rem; }
  .hilo-controls { flex-direction: column; align-items: stretch; }
  .btn-higher, .btn-lower, .btn-cashout { max-width: 100%; }
  .game-wrapper { padding: 20px 16px 48px; }
}
