/* ─── SpineDom — Cyberpunk Casino CSS ─── */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Share+Tech+Mono&display=swap');

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

:root {
  --cyan:    #00f7ff;
  --purple:  #b000ff;
  --gold:    #ffd700;
  --red:     #ff003c;
  --green:   #39ff14;
  --bg0:     #06060f;
  --bg1:     #0b0b1e;
  --bg2:     #11112a;
  --bg3:     #181836;
  --text:    #e8e8ff;
  --muted:   #6060a0;
  --border:  rgba(0,247,255,0.18);
  --shadow-c: rgba(0,247,255,0.35);
  --shadow-p: rgba(176,0,255,0.35);
  --radius:  10px;
  --r-lg:    18px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 99px; }

/* ── Loading screen ── */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  transition: opacity 0.5s;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }

.loader-logo {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: pulse-logo 1.5s ease-in-out infinite;
}
@keyframes pulse-logo { 0%,100%{opacity:1} 50%{opacity:0.5} }

.loader-bar-wrap {
  width: 260px; height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden;
}
.loader-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 99px;
  animation: fill-bar 2s ease forwards;
}
@keyframes fill-bar { to { width: 100%; } }
.loader-text { color: var(--muted); font-family: 'Share Tech Mono', monospace; font-size: 0.8rem; letter-spacing: 0.08em; }

/* ── Top Nav ── */
/* #app siempre visible — el loading screen lo cubre con position:fixed.
   Nunca ocultar #app desde CSS para evitar pantalla en blanco si JS falla. */
#app { display: block; }

#topnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  height: 58px;
  background: rgba(6,6,15,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-size: 1.4rem; font-weight: 700; letter-spacing: 0.1em;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-btn {
  background: transparent; border: none; color: var(--muted);
  font-family: 'Rajdhani', sans-serif; font-size: 0.9rem; font-weight: 600;
  padding: 6px 14px; border-radius: var(--radius); cursor: pointer;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.04em;
}
.nav-btn:hover, .nav-btn.active { color: var(--cyan); background: rgba(0,247,255,0.08); }
.nav-coins { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.coin-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 12px;
  font-family: 'Share Tech Mono', monospace; font-size: 0.82rem;
  color: var(--gold);
}
.coin-badge .icon { font-size: 1rem; }
#nav-username { color: var(--cyan); font-size: 0.85rem; font-weight: 600; }

/* ── Sections ── */
.section { display: none; min-height: calc(100vh - 58px); padding: 32px 20px; }
.section.active { display: block; }

/* ── Landing ── */
#section-landing {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 28px;
  background: radial-gradient(ellipse at 50% 0%, rgba(176,0,255,0.12) 0%, transparent 70%),
              radial-gradient(ellipse at 80% 80%, rgba(0,247,255,0.08) 0%, transparent 60%),
              var(--bg0);
}
#section-landing.active { display: flex; }

.hero-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.2em;
  color: var(--purple); text-transform: uppercase;
}
.hero-title {
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 700; line-height: 1;
  letter-spacing: 0.05em;
}
.hero-title span.c { color: var(--cyan); text-shadow: 0 0 40px var(--cyan); }
.hero-title span.p { color: var(--purple); text-shadow: 0 0 40px var(--purple); }
.hero-sub {
  font-size: clamp(1rem, 3vw, 1.3rem); color: var(--muted);
  max-width: 500px; line-height: 1.6;
}
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.btn {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem;
  letter-spacing: 0.08em; padding: 12px 28px; border-radius: var(--radius);
  border: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  color: var(--bg0);
  box-shadow: 0 0 24px var(--shadow-c);
}
.btn-primary:hover { box-shadow: 0 0 36px var(--shadow-c), 0 0 12px var(--shadow-p); }

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--purple);
  color: var(--purple);
}
.btn-secondary:hover { background: rgba(176,0,255,0.12); box-shadow: 0 0 16px var(--shadow-p); }

.btn-gold {
  background: linear-gradient(135deg, #ffb800, var(--gold));
  color: var(--bg0);
  box-shadow: 0 0 20px rgba(255,215,0,0.4);
}
.btn-gold:hover { box-shadow: 0 0 32px rgba(255,215,0,0.6); }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { box-shadow: 0 0 16px rgba(255,0,60,0.5); }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; max-width: 700px; width: 100%;
}
.feature-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 18px; text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover { border-color: var(--cyan); box-shadow: 0 0 20px rgba(0,247,255,0.1); }
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 1rem; color: var(--cyan); margin-bottom: 4px; }
.feature-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* ── Auth ── */
#section-auth { display: flex; align-items: center; justify-content: center; }
#section-auth.active { display: flex; }

.auth-box {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 36px; width: 100%; max-width: 400px;
  box-shadow: 0 0 60px rgba(176,0,255,0.08);
}
.auth-tabs { display: flex; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px; background: none; border: none;
  color: var(--muted); font-family: 'Rajdhani', sans-serif; font-size: 1rem;
  font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s; margin-bottom: -1px;
}
.auth-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 0.82rem; color: var(--muted);
  margin-bottom: 7px; letter-spacing: 0.06em; text-transform: uppercase;
}
.form-group input {
  width: 100%; padding: 11px 14px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: 'Share Tech Mono', monospace; font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0,247,255,0.15);
}
.auth-msg {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius);
  font-size: 0.88rem; display: none;
}
.auth-msg.error { background: rgba(255,0,60,0.12); color: var(--red); border: 1px solid rgba(255,0,60,0.3); display: block; }
.auth-msg.success { background: rgba(57,255,20,0.1); color: var(--green); border: 1px solid rgba(57,255,20,0.3); display: block; }

/* ── Dashboard ── */
.dash-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.dash-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: var(--bg0);
  flex-shrink: 0;
}
.dash-info h2 { font-size: 1.5rem; line-height: 1; }
.dash-info p { color: var(--muted); font-size: 0.85rem; margin-top: 3px; }
.vip-badge {
  padding: 3px 12px; border-radius: 99px; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.vip-0 { background: rgba(96,96,160,0.3); color: var(--muted); }
.vip-1 { background: rgba(192,192,192,0.2); color: #c0c0c0; border: 1px solid #c0c0c0; }
.vip-2 { background: rgba(255,215,0,0.15); color: var(--gold); border: 1px solid var(--gold); }
.vip-3 { background: rgba(0,247,255,0.12); color: var(--cyan); border: 1px solid var(--cyan); box-shadow: 0 0 12px rgba(0,247,255,0.3); }

.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--purple); }
.stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-value.gold { color: var(--gold); }
.stat-value.cyan { color: var(--cyan); }
.stat-value.purple { color: var(--purple); }

.section-title {
  font-size: 1.1rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Games ── */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.game-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,247,255,0.1); }
.game-thumb {
  height: 160px; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.game-thumb-dash {
  background: linear-gradient(135deg, #060614 0%, #0d1a2e 100%);
}
.game-thumb-jump {
  background: linear-gradient(135deg, #0a0614 0%, #160b28 100%);
}
.game-thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-big-icon {
  font-size: 3.5rem; z-index: 1; pointer-events: none;
  text-shadow: 0 0 30px currentColor;
}
.game-info { padding: 18px; }
.game-info h3 { font-size: 1.1rem; margin-bottom: 6px; }
.game-info p { color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin-bottom: 14px; }
.game-reward {
  font-family: 'Share Tech Mono', monospace; font-size: 0.78rem;
  color: var(--gold); margin-bottom: 14px;
}

/* ── Game Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--r-lg); width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.2rem; color: var(--cyan); }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 6px; transition: color 0.2s;
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 20px; }

.game-canvas-wrap {
  width: 100%; aspect-ratio: 16/9; position: relative;
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg0);
}
.game-canvas-wrap canvas { width: 100%; height: 100%; display: block; }

.game-hud {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg2); border-radius: var(--radius);
  font-family: 'Share Tech Mono', monospace; font-size: 0.85rem;
}
.game-hud span { color: var(--cyan); }
.game-hud .gold-text { color: var(--gold); }

.game-controls {
  margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.controls-hint {
  color: var(--muted); font-size: 0.8rem;
  font-family: 'Share Tech Mono', monospace;
  flex: 1;
}

.game-result {
  text-align: center; padding: 20px; display: none;
}
.game-result.show { display: block; }
.result-earned {
  font-size: 3rem; font-weight: 700; color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
  margin: 12px 0;
}
.result-label { color: var(--muted); font-size: 0.9rem; }

/* ── VIP ── */
.vip-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px;
}
.vip-card {
  background: var(--bg2); border-radius: var(--r-lg); padding: 24px;
  border: 1.5px solid transparent; text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative; overflow: hidden;
}
.vip-card:hover { transform: translateY(-3px); }
.vip-card.silver { border-color: #c0c0c0; }
.vip-card.gold { border-color: var(--gold); box-shadow: 0 0 30px rgba(255,215,0,0.12); }
.vip-card.diamond { border-color: var(--cyan); box-shadow: 0 0 30px rgba(0,247,255,0.14); }

.vip-card-icon { font-size: 2.5rem; margin-bottom: 10px; }
.vip-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.vip-card.silver h3 { color: #c0c0c0; }
.vip-card.gold h3 { color: var(--gold); }
.vip-card.diamond h3 { color: var(--cyan); }

.vip-card .price {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 12px 0;
}
.vip-card .price span { font-size: 0.85rem; color: var(--muted); }
.vip-perks { list-style: none; margin: 14px 0 20px; text-align: left; }
.vip-perks li {
  font-size: 0.85rem; color: var(--muted); padding: 5px 0;
  display: flex; align-items: center; gap: 8px;
}
.vip-perks li::before { content: '▶'; font-size: 0.55rem; color: var(--cyan); }
.vip-current {
  position: absolute; top: 12px; right: 12px;
  background: var(--green); color: var(--bg0);
  font-size: 0.65rem; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Historial ── */
.actas-list { display: flex; flex-direction: column; gap: 8px; }
.acta-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.acta-icon { font-size: 1.2rem; flex-shrink: 0; }
.acta-info { flex: 1; }
.acta-type {
  font-size: 0.88rem; font-weight: 600; text-transform: capitalize;
  color: var(--text);
}
.acta-time { font-size: 0.75rem; color: var(--muted); font-family: 'Share Tech Mono', monospace; }
.acta-amount {
  font-family: 'Share Tech Mono', monospace; font-size: 0.95rem;
  color: var(--gold); font-weight: 700;
}
.acta-amount.negative { color: var(--red); }

.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ── Toast ── */
#toast-wrap {
  position: fixed; bottom: 24px; right: 20px; z-index: 9000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 18px;
  font-size: 0.88rem; color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: slide-in 0.3s ease, fade-out 0.4s ease 2.6s forwards;
  max-width: 280px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.info { border-color: var(--cyan); color: var(--cyan); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Mobile ── */
@media (max-width: 600px) {
  #topnav { gap: 8px; padding: 0 12px; }
  .nav-btn { padding: 5px 8px; font-size: 0.78rem; }
  .coin-badge { padding: 4px 8px; font-size: 0.75rem; }
  .section { padding: 20px 14px; }
  .auth-box { padding: 24px 18px; }
  .game-canvas-wrap { aspect-ratio: 4/3; }
}
