:root {
  --bg-deep: #08090d;
  --bg-surface: #12141c;
  --bg-card: #181b26;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.35);
  --neon-cyan: #06b6d4;
  --neon-magenta: #ec4899;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #262a38;
  --win-green: #10b981;
  --win-glow: rgba(16, 185, 129, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 10%, #1c1f2e 0%, var(--bg-deep) 70%);
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* TOP NAV */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(18, 20, 28, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 16px;
  background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e2230;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #2f3547;
}

.coin-icon {
  font-size: 14px;
}

.balance-num {
  font-weight: 800;
  font-size: 15px;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s ease;
}

.balance-num.pulse {
  transform: scale(1.15);
  color: #34d399;
}

.coin-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-btn {
  background: #1e2230;
  border: 1px solid #2f3547;
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.nav-btn:active {
  transform: scale(0.92);
}

/* FLOOR & PLAYER TAG */
.casino-floor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 12px;
}

.player-tag-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 4px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--win-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--win-green);
}

#player-alias {
  font-weight: 600;
  color: #e2e8f0;
  margin-right: auto;
}

.text-link {
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.text-link:hover {
  background: rgba(6, 182, 212, 0.1);
}

/* SLOT CABINET */
.slot-cabinet {
  background: linear-gradient(180deg, #181b26 0%, #10121a 100%);
  border: 2px solid #282d3f;
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* MARQUEE */
.display-marquee {
  background: #090a0f;
  border: 1px solid #232738;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold-glow);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.display-marquee.win-anim {
  color: #34d399;
  text-shadow: 0 0 14px var(--win-glow);
  animation: marqueePulse 0.4s infinite alternate;
}

@keyframes marqueePulse {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

/* REELS WINDOW */
.reels-window {
  position: relative;
  background: #07080d;
  border: 2px solid #282d40;
  border-radius: 14px;
  padding: 8px 30px;
  overflow: hidden;
  box-shadow: inset 0 8px 16px rgba(0,0,0,0.9), inset 0 -8px 16px rgba(0,0,0,0.9);
}

.line-indicators {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  z-index: 5;
}

.line-indicators.left { left: 4px; }
.line-indicators.right { right: 4px; }

.indicator {
  font-size: 10px;
  font-weight: 800;
  color: #4b5563;
  background: #11141e;
  border: 1px solid #242938;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.indicator.active {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.reels-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative;
  height: 250px;
}

.reel {
  background: #10121b;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid #1f2333;
}

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

.slot-item {
  height: 83.33px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  position: relative;
}

.slot-item.winner {
  animation: itemPop 0.5s ease infinite alternate;
}

@keyframes itemPop {
  from { transform: scale(1); filter: drop-shadow(0 0 2px var(--gold)); }
  to { transform: scale(1.18); filter: drop-shadow(0 0 12px var(--gold)); }
}

.payline-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

/* CONTROLS */
.slot-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0d0f17;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #212534;
}

.bet-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
}

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

.bet-pill {
  background: #161824;
  border: 1px solid #282c3f;
  color: #cbd5e1;
  padding: 8px 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.bet-pill.active {
  background: linear-gradient(180deg, #2b3044 0%, #1b1e2c 100%);
  border-color: var(--gold);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.action-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auto-toggle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.auto-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #212534;
  border-radius: 24px;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #9ca3af;
  border-radius: 50%;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--neon-cyan);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

.spin-button {
  flex: 1;
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all 0.1s;
}

.spin-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.spin-button:disabled {
  opacity: 0.5;
  filter: grayscale(0.8);
  cursor: not-allowed;
  transform: none;
}

.spin-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #000;
}

.spin-sub {
  font-size: 11px;
  font-weight: 800;
  color: #451a03;
}

/* FOOTER */
.safe-footer {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #4b5563;
  padding: 8px 0;
}

/* MODALES */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

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

.pay-card {
  background: #181b26;
  border: 1px solid #282d3f;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pay-icon { font-size: 26px; }
.pay-name { font-size: 12px; font-weight: 600; color: #cbd5e1; }
.pay-mult { font-size: 14px; font-weight: 800; color: var(--gold); }

.lines-info {
  margin-top: 10px;
  background: #141722;
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.lines-info h4 { color: #e2e8f0; margin-bottom: 4px; }

/* CAJERO */
.cashier-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

.cashier-id-box {
  background: #0f1118;
  border: 1px dashed var(--gold);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.cashier-id-box .label { font-size: 11px; color: var(--text-muted); display: block; }
.cashier-id-box .code { font-size: 18px; font-weight: 900; color: var(--gold); letter-spacing: 1px; }

.cashier-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #181b26;
  padding: 10px;
  border-radius: 8px;
}

.rule-item .icon { font-size: 20px; }

/* HISTORIAL */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #181b26;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.history-item.win { border-left: 3px solid var(--win-green); }
.history-item.loss { border-left: 3px solid #64748b; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px 0;
}

/* AUTH MODAL */
.auth-box { text-align: center; }
.brand-center { margin-bottom: 8px; }
.brand-center h2 { font-weight: 900; letter-spacing: 3px; font-size: 22px; margin-top: 6px; }
.brand-center p { font-size: 12px; color: var(--text-muted); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #0f1118;
  padding: 4px;
  border-radius: 10px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn.active {
  background: #1f2434;
  color: #fff;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

.auth-panel.hidden { display: none; }
.hint { font-size: 12px; color: var(--text-muted); }

.text-input {
  background: #0f1118;
  border: 1px solid #292e42;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 4px;
}

.text-input:focus {
  outline: none;
  border-color: var(--gold);
}

.primary-btn {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  border: none;
  color: #000;
  padding: 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
