:root {
  --lw-gold: #ffd700;
  --lw-gold-deep: #b8860b;
  --lw-green: #0a2e15;
  --lw-green-dark: #031408;
  --border-radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Baloo Bhaijaan 2", sans-serif; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
  background-color: var(--lw-green-dark);
  background-image: url('assets/bg-jungle.jpg');
  background-position: center;
  background-repeat: no-repeat;
  color: #fff; 
  display: flex; 
  justify-content: center; 
  align-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-size: cover;
  animation: moveJungle 30s ease-in-out infinite alternate;
}

@keyframes moveJungle { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@keyframes lw-reel { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
@keyframes lw-win { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); } 50% { transform: scale(1.1); filter: drop-shadow(0 0 20px var(--lw-gold)); } }
@keyframes lw-spin { to { transform: rotate(360deg); } }
@keyframes pulse-jackpot { 0%, 100% { transform: scale(1); text-shadow: 0 2px 4px rgba(0,0,0,0.8); } 50% { transform: scale(1.05); text-shadow: 0 0 15px #ff3333, 0 0 25px var(--lw-gold); } }

.game-container { 
  width: 100%; 
  max-width: 420px; 
  height: 100%;
  max-height: 850px;
  padding: 8px; 
  display: flex; 
  flex-direction: column; 
  justify-content: space-between;
  z-index: 10; 
}

.hud { display: flex; gap: 6px; }

.hud-box, .slot-machine, .bet-control, .modal-content {
  background: linear-gradient(180deg, rgba(10, 46, 21, 0.92), rgba(3, 20, 8, 0.95));
  border: 2px solid rgba(255, 215, 0, 0.6); 
  box-shadow: 0 8px 25px rgba(0,0,0,0.9), inset 0 0 10px rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(8px); 
  border-radius: var(--border-radius); 
  padding: 6px;
}

.hud-box { flex: 1; text-align: center; }
.hud-box .label, .bet-amount .label { display: block; font-size: clamp(0.65rem, 2.2vw, 0.85rem); color: #a8dba8; font-weight: bold; }
.value, .toon-title { display: block; font-size: clamp(0.9rem, 3.5vw, 1.2rem); font-weight: 800; background: linear-gradient(180deg, #fff, var(--lw-gold), var(--lw-gold-deep)); -webkit-background-clip: text; color: transparent; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.jackpot .value { animation: pulse-jackpot 1.5s infinite; color: #ffeb3b; }

.slot-machine { padding: 6px; display: flex; flex-direction: column; justify-content: center; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: rgba(0,0,0,0.7); padding: 5px; border-radius: 8px; box-shadow: inset 0 0 12px #000; }
.cell { aspect-ratio: 1/1; background: radial-gradient(circle, #2a5a3a 0%, #051a0d 100%); border-radius: 6px; display: flex; justify-content: center; align-items: center; overflow: hidden; border: 1px solid var(--lw-gold-deep); box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.cell img { width: 85%; height: 85%; object-fit: contain; }
.cell.spin-anim img { animation: lw-reel 0.12s linear infinite; filter: blur(2.5px) brightness(1.2); }
.cell.win-anim img { animation: lw-win 0.8s ease-in-out infinite; z-index: 5; position: relative; }

.status-strip { margin-top: 6px; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.8), transparent); text-align: center; padding: 4px; border-radius: 6px; font-weight: 900; color: var(--lw-gold); font-size: clamp(0.75rem, 3vw, 1rem); letter-spacing: 1px; }

.controls { display: flex; gap: 6px; }
.bet-control { display: flex; flex: 1; align-items: center; justify-content: space-between; padding: 2px 4px; }
.btn-icon { width: clamp(32px, 9vw, 40px); height: clamp(32px, 9vw, 40px); border-radius: 8px; border: none; background: linear-gradient(180deg, var(--lw-gold), var(--lw-gold-deep)); font-size: clamp(1.1rem, 4.5vw, 1.5rem); font-weight: bold; cursor: pointer; color: #000; box-shadow: 0 3px 0 #8b6508; display: flex; justify-content: center; align-items: center; }
.btn-icon:active { transform: translateY(3px); box-shadow: 0 0 0 #8b6508; }
.bet-amount { text-align: center; }

.btn-spin, .btn-bonus { color: #000; border: none; border-radius: var(--border-radius); padding: 8px 12px; font-size: clamp(0.9rem, 4vw, 1.1rem); font-weight: 900; cursor: pointer; background: linear-gradient(180deg, #ffd700, #b8860b); box-shadow: 0 0 15px rgba(218, 165, 32, 0.5), 0 4px 0 #8b6508; text-transform: uppercase; }
.btn-spin:active, .btn-bonus:active { transform: translateY(4px); box-shadow: 0 0 0 #8b6508; }
.btn-bonus { padding: 6px; font-size: clamp(0.8rem, 3.5vw, 0.95rem); display: flex; flex-direction: column; align-items: center; color: #fff; background: linear-gradient(180deg, #b30000, #660000); box-shadow: 0 4px 0 #3a0000, 0 0 10px rgba(255,0,0,0.4); }
.bonus-price { font-size: clamp(0.7rem, 3vw, 0.85rem); color: var(--lw-gold); font-weight: bold; margin-top: 2px; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; z-index: 100; backdrop-filter: blur(5px); }
.modal-overlay.hidden { display: none; }
.modal-content { text-align: center; width: 85%; max-width: 300px; border: 2px solid var(--lw-gold); }
.modal-content p { margin-bottom: 12px; font-size: clamp(0.95rem, 4vw, 1.1rem); color: #fff; }

.loading-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--lw-green-dark); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.loading-content { text-align: center; }
.spinner { width: 45px; height: 45px; border: 5px solid rgba(255, 215, 0, 0.2); border-top-color: var(--lw-gold); border-radius: 50%; margin: 12px auto 0; animation: lw-spin 1s linear infinite; }

.symbol-letter { font-size: clamp(2rem, 9vw, 3.5rem); font-weight: 900; text-shadow: 0 2px 6px rgba(0, 0, 0, 1), inset 0 2px 0 rgba(255,255,255,0.8); display: inline-block; line-height: 1; }
.sym-A { color: #ff4d4d; text-shadow: 0 0 12px rgba(255, 77, 77, 0.8); }
.sym-K { color: #4dffff; text-shadow: 0 0 12px rgba(77, 255, 255, 0.8); }
.sym-Q { color: #d966ff; text-shadow: 0 0 12px rgba(217, 102, 255, 0.8); }

/* 🌟 تم ضبط التموضع ليصبح بالسنتر تماماً ومناسب للجوال 🌟 */
.bonus-transition { 
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
  background: radial-gradient(circle, rgba(255, 215, 0, 0.9) 0%, rgba(255, 69, 0, 0.95) 50%, #000 100%); 
  z-index: 10000; display: flex; justify-content: center; align-items: center; 
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease; 
}
.bonus-transition.active { opacity: 1; pointer-events: all; animation: flashScreen 2.5s ease-out; }

.bonus-text { 
    font-size: clamp(2rem, 8vw, 3.2rem); 
    color: #fff; 
    text-shadow: 0 0 15px #fff, 0 0 30px #ff0000, 0 0 50px #ff8c00; 
    transform: scale(0.1); 
    text-align: center; 
    white-space: nowrap; 
    margin: 0;
}
.bonus-transition.active .bonus-text { animation: scaleTextUp 2.5s forwards; }

@keyframes flashScreen { 0%, 100% { filter: brightness(1) hue-rotate(0deg); } 50% { filter: brightness(2) hue-rotate(45deg); } }
@keyframes scaleTextUp { 0% { transform: scale(0.1); opacity: 0; } 50% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }

/* 🌟 شاشات Big Win و MegaWin محسنة ومسنترة حصراً بمنتصف الشاشة 🌟 */
.win-screen { 
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
  background: rgba(0, 0, 0, 0.85); z-index: 10000; 
  display: flex; flex-direction: column; justify-content: center; align-items: center; 
  opacity: 0; pointer-events: none; transition: opacity 0.3s; 
}
.win-screen.active { opacity: 1; pointer-events: all; animation: flashBg 0.5s infinite alternate; }

.win-text { 
    font-size: clamp(2rem, 8vw, 3.2rem); 
    margin: 0; 
    text-align: center; 
    transform: scale(0.1); 
    white-space: nowrap;
}
.win-screen.active .win-text { animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.win-amount { font-size: clamp(1.5rem, 6.5vw, 2.5rem); font-weight: 900; color: #fff; text-shadow: 0 0 15px #ffd700; margin-top: 10px; opacity: 0; text-align: center; }
.win-screen.active .win-amount { animation: fadeIn 0.5s 0.8s forwards; }

.big-win-text { color: #00ffff; text-shadow: 0 0 15px #00ffff, 0 0 30px #0000ff; }
.mega-win-text { color: #ff00ff; text-shadow: 0 0 15px #ff00ff, 0 0 30px #ff0000; animation: colorShift 2s infinite !important; }

@keyframes popIn { 0% { transform: scale(0.1); } 80% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes flashBg { from { background: rgba(0,0,0,0.85); } to { background: rgba(50,30,0,0.85); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes colorShift { 0%, 100% { color: #ff00ff; } 50% { color: #ffd700; } }