/* =========================================================
   STYLE.CSS - SLOT RIGGING SIMULATOR (EDUKASI)
   ========================================================= */

:root {
  --bg-dark: #070913;
  --bg-card: #0f172a;
  --bg-slot: #0b0f19;
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.4);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.35);
  --red: #ef4444;
  --green: #10b981;
  --purple: #8b5cf6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --admin-bg: #0d1117;
  --admin-border: #30363d;
  --admin-accent: #22c55e;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Floating Stealth Toggle Button */
.stealth-toggle-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  color: #38bdf8;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.2);
  transition: all 0.2s ease;
}

.stealth-toggle-btn:hover {
  background: #334155;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* App Main Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   SISI GAME (MESIN SLOT)
   ========================================================= */
.game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
  max-width: 800px;
  margin: 0 auto;
  transition: all 0.3s ease;
}

/* Header Game */
.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}

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

.brand-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #f59e0b, #fde047, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.demo-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.demo-tag:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  text-decoration: none;
}

.icon-btn:hover {
  background: #334155;
  color: #38bdf8;
  border-color: #38bdf8;
}

/* Status Board (Saldo & Win) */
.status-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-bottom: 24px;
}

.status-box {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.status-box .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-box .value {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
}

.status-box .win-text {
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold-glow);
}

/* =========================================================
   MESIN SLOT REEL CABINET
   ========================================================= */
.slot-cabinet {
  position: relative;
  width: 100%;
  background: radial-gradient(circle at center, #1e1b4b, #0f172a 80%);
  border: 3px solid #f59e0b;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.3), inset 0 0 30px rgba(0, 0, 0, 0.8);
  margin-bottom: 18px;
}

.reels-frame {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #000000;
  border-radius: 14px;
  padding: 10px;
  height: 330px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
}

.reel-column {
  position: relative;
  background: linear-gradient(180deg, #111827 0%, #1f2937 50%, #111827 100%);
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.8), inset 0 -4px 10px rgba(0,0,0,0.8);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.1s linear;
  will-change: transform;
}

.slot-cell {
  height: 103.33px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  transition: transform 0.2s;
}

.slot-cell.highlight {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, transparent 80%);
  transform: scale(1.08);
}

.symbol-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8));
  line-height: 1;
}

.symbol-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Garis Payline Tengah */
.payline-line {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ef4444 15%, #ef4444 85%, transparent);
  box-shadow: 0 0 10px #ef4444;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.6;
  z-index: 10;
}

.payline-indicator {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  transform: translateY(-50%);
  z-index: 11;
}
.payline-indicator.left {
  left: 2px;
  border-left: 12px solid #ef4444;
}
.payline-indicator.right {
  right: 2px;
  border-right: 12px solid #ef4444;
}

/* Message Banner */
.message-banner {
  width: 100%;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  margin-bottom: 20px;
}

.message-banner span {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--cyan);
}

/* =========================================================
   KONTROL PEMAIN (BET & SPIN)
   ========================================================= */
.player-controls {
  width: 100%;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 16px;
}

.bet-selector {
  margin-bottom: 16px;
}

.control-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bet-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.bet-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 10px 6px;
  border-radius: 8px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.bet-btn:hover {
  background: #334155;
  color: #fff;
}

.bet-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fde047;
  color: #000;
  box-shadow: 0 0 12px var(--gold-glow);
}

.spin-action-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 12px;
  align-items: center;
}

.secondary-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 16px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: #334155;
  color: #fff;
}

.main-spin-btn {
  position: relative;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 2px solid #34d399;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), 0 6px 0 #047857;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.main-spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.6), 0 8px 0 #047857;
}

.main-spin-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3), 0 2px 0 #047857;
}

.main-spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.spin-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.spin-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: #a7f3d0;
}

.game-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================================
   SISI BANDAR: ADMIN RIGGING CONTROL PANEL
   ========================================================= */
.admin-panel {
  width: 440px;
  background-color: var(--admin-bg);
  border-left: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  position: sticky;
  top: 0;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.app-layout.stealth-mode .admin-panel {
  margin-right: -440px;
  opacity: 0;
  pointer-events: none;
}

.admin-header {
  padding: 18px 20px;
  background: #161b22;
  border-bottom: 1px solid var(--admin-border);
}

.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.admin-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--admin-accent);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

.close-admin-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.close-admin-btn:hover {
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
}

.admin-header h2 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #f0f6fc;
}

.admin-desc {
  font-size: 0.78rem;
  color: #8b949e;
  margin-top: 4px;
  line-height: 1.4;
}

.admin-desc strong {
  color: #e6edf3;
}

.admin-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-section {
  background: #161b22;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8b949e;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Presets */
.preset-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-btn {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn .p-title {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 3px;
}

.preset-btn .p-desc {
  display: block;
  font-size: 0.72rem;
  color: #8b949e;
  line-height: 1.35;
}

.preset-btn:hover {
  background: #1c2128;
  border-color: #58a6ff;
}

.preset-btn.active {
  background: rgba(88, 166, 255, 0.1);
  border-color: #58a6ff;
  color: #58a6ff;
}

/* Instant Action Buttons */
.instant-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  border: 1px solid;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s;
}

.action-btn small {
  font-weight: 400;
  font-size: 0.7rem;
  opacity: 0.85;
}

.action-btn.win-btn {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #fbbf24;
}
.action-btn.win-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

.action-btn.scatter-btn {
  background: rgba(147, 51, 234, 0.12);
  border-color: #a855f7;
  color: #c084fc;
}
.action-btn.scatter-btn:hover {
  background: rgba(147, 51, 234, 0.25);
}

.action-btn.lose-btn {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #f87171;
}
.action-btn.lose-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Slider */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.slider-val {
  font-family: 'JetBrains Mono', monospace;
  color: #58a6ff;
  font-weight: 700;
}

#slider-winrate {
  width: 100%;
  accent-color: #58a6ff;
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #8b949e;
}

/* Console Logger */
.console-box {
  background: #090d13;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 10px;
  height: 140px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  line-height: 1.4;
  word-break: break-word;
}
.log-entry.info { color: #8b949e; }
.log-entry.warn { color: #e3b341; }
.log-entry.success { color: #3fb950; }
.log-entry.danger { color: #f85149; }

/* Balance Action Buttons */
.balance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pill-btn {
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn:hover {
  background: #30363d;
  color: #fff;
}

/* =========================================================
   POPUP CELEBRATION MODAL (BIG WIN / JACKPOT)
   ========================================================= */
.win-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.win-modal-overlay.show {
  display: flex;
}

.win-modal-content {
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
  border: 3px solid #f59e0b;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.6);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-stars {
  font-size: 2rem;
  margin-bottom: 8px;
  animation: pulse 1s infinite;
}

.modal-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #fde047);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #38bdf8;
  margin-bottom: 16px;
}

.modal-amount {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: #4ade80;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
  margin-bottom: 20px;
}

.modal-evidence-tag {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.4;
}

.modal-close-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #000;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.15s;
}

.modal-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

/* Responsive */
@media (max-width: 950px) {
  .app-layout {
    flex-direction: column;
  }
  .admin-panel {
    width: 100%;
    position: relative;
    border-left: none;
    border-top: 2px solid var(--admin-border);
  }
  .app-layout.stealth-mode .admin-panel {
    margin-right: 0;
    display: none;
  }
}

/* Mobile Friendly untuk Klien Pemain (HP / Smartphone) */
@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .game-container {
    padding: 12px 10px 24px;
    max-width: 100%;
  }

  .game-header {
    margin-bottom: 12px;
  }

  .brand-badge {
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .brand-title {
    font-size: 1.2rem;
    white-space: nowrap;
  }

  .demo-tag {
    font-size: 0.6rem;
    padding: 2px 6px;
    white-space: nowrap;
  }

  .status-board {
    gap: 10px;
    margin-bottom: 14px;
  }

  .status-box {
    padding: 10px 8px;
    border-radius: 10px;
  }

  .status-box .label {
    font-size: 0.62rem;
    letter-spacing: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-box .value {
    font-size: 1.25rem;
  }

  .slot-cabinet {
    padding: 10px 8px;
    border-radius: 14px;
    margin-bottom: 12px;
    border-width: 2px;
  }

  .reels-frame {
    height: 270px;
    gap: 8px;
    padding: 6px;
    border-radius: 10px;
  }

  .slot-cell {
    height: 86px;
  }

  .symbol-icon {
    font-size: 2.3rem;
  }

  .symbol-name {
    font-size: 0.58rem;
    margin-top: 2px;
  }

  .message-banner {
    padding: 8px 12px;
    margin-bottom: 12px;
  }

  .message-banner span {
    font-size: 0.8rem;
  }

  .player-controls {
    padding: 14px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .bet-buttons {
    gap: 6px;
  }

  .bet-btn {
    padding: 8px 4px;
    font-size: 0.82rem;
  }

  .spin-action-row {
    gap: 8px;
  }

  .secondary-btn {
    padding: 12px 6px;
    font-size: 0.72rem;
    border-radius: 10px;
  }

  .main-spin-btn {
    padding: 10px;
    border-radius: 12px;
  }

  .spin-title {
    font-size: 1.35rem;
    letter-spacing: 1px;
  }

  .spin-sub {
    font-size: 0.72rem;
  }

  .win-modal-content {
    padding: 24px 16px;
    max-width: 90%;
  }

  .modal-title {
    font-size: 1.7rem;
  }

  .modal-amount {
    font-size: 1.9rem;
  }
}

@media (max-width: 380px) {
  .reels-frame {
    height: 240px;
  }

  .slot-cell {
    height: 76px;
  }

  .symbol-icon {
    font-size: 2rem;
  }

  .bet-btn {
    font-size: 0.72rem;
    padding: 7px 2px;
  }

  .spin-title {
    font-size: 1.2rem;
  }
}
