/* ============================================================
   SpineDom — Estilos globales
   Tema: Casino Cyberpunk (neón azul, morado y dorado)
   Mobile-first, responsive
   ============================================================ */

:root {
  --bg-deep: #05050f;
  --bg-panel: #0e0e24;
  --bg-card: #14142e;

  --neon-blue: #00e5ff;
  --neon-purple: #b14bff;
  --neon-gold: #ffd166;
  --neon-pink: #ff3df0;

  --text-main: #f1f1ff;
  --text-muted: #9a9ac0;

  --success: #39ff88;
  --error: #ff4d6d;

  --radius: 14px;
  --transition: 0.2s ease;

  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #11102a 0%, var(--bg-deep) 60%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------
   VISTAS (SPA)
   ------------------------------------------------------------ */
.view {
  display: none;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
}

#loadingView {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------
   LOGO / TIPOGRAFÍA
   ------------------------------------------------------------ */
.logo {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: 2px;
  text-align: center;
  color: var(--neon-blue);
  text-shadow: 0 0 8px var(--neon-blue), 0 0 18px rgba(0, 229, 255, 0.4);
}

.logo span {
  color: var(--neon-gold);
  text-shadow: 0 0 8px var(--neon-gold), 0 0 18px rgba(255, 209, 102, 0.4);
}

.logo-small {
  font-size: 1.4rem;
  text-align: left;
}

.tagline {
  text-align: center;
  color: var(--text-muted);
  margin: 0.25rem 0 1.5rem;
  letter-spacing: 1px;
}

.section-title {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  color: var(--neon-purple);
  text-shadow: 0 0 6px rgba(177, 75, 255, 0.5);
  margin: 1.5rem 0 0.75rem;
  letter-spacing: 1px;
}

.muted {
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   LOADING SPINNER
   ------------------------------------------------------------ */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------
   LOGIN / REGISTER
   ------------------------------------------------------------ */
#loginView {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.08), 0 0 50px rgba(177, 75, 255, 0.06);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.auth-form h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  color: var(--text-main);
  margin: 0 0 0.25rem;
  text-align: center;
}

.auth-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.auth-form input {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-form input:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.auth-switch a {
  color: var(--neon-gold);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-error {
  display: none;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin: 0.75rem 0;
  text-align: center;
}

/* ------------------------------------------------------------
   BOTONES
   ------------------------------------------------------------ */
.btn {
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  color: #06061a;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(177, 75, 255, 0.55);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--neon-blue);
}

.btn-ghost:hover {
  background: rgba(0, 229, 255, 0.08);
}

.btn-play {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.85rem;
  margin-top: 1rem;
}

/* ------------------------------------------------------------
   DASHBOARD
   ------------------------------------------------------------ */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-panel);
  border-bottom: 1px solid rgba(177, 75, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.username {
  font-weight: 600;
  font-size: 0.95rem;
}

.vip-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vip-badge.vip-active {
  background: rgba(255, 209, 102, 0.12);
  color: var(--neon-gold);
  border-color: var(--neon-gold);
  text-shadow: 0 0 6px rgba(255, 209, 102, 0.6);
}

.coins-display {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  color: var(--neon-gold);
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.45);
  font-size: 0.95rem;
}

.dashboard-content {
  flex: 1;
  padding: 1rem 1.25rem 2rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------------------------------------
   GRID DE JUEGOS
   ------------------------------------------------------------ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  cursor: pointer;
  color: var(--text-main);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.game-card:hover,
.game-card:active {
  transform: translateY(-3px);
  border-color: var(--neon-purple);
  box-shadow: 0 0 18px rgba(177, 75, 255, 0.35);
}

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

.game-name {
  font-family: "Orbitron", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.game-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.game-min-bet {
  font-size: 0.7rem;
  color: var(--neon-gold);
  margin-top: 0.25rem;
}

/* ------------------------------------------------------------
   ACTAS / HISTORIAL
   ------------------------------------------------------------ */
.actas-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.acta-item,
.acta-empty {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.acta-action {
  color: var(--neon-blue);
  font-weight: 600;
  text-transform: capitalize;
}

.acta-detail {
  color: var(--text-muted);
  flex: 1;
  text-align: left;
}

.acta-date {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.acta-empty {
  justify-content: center;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   VISTA DE JUEGO
   ------------------------------------------------------------ */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-panel);
  border-bottom: 1px solid rgba(177, 75, 255, 0.2);
}

.game-content {
  flex: 1;
  padding: 1rem 1.25rem 2rem;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.game-display {
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius);
  font-size: 2.5rem;
  text-align: center;
  padding: 1.5rem;
  margin: 0.75rem 0;
  box-shadow: inset 0 0 25px rgba(0, 229, 255, 0.08);
  letter-spacing: 0.5rem;
}

.game-choices {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.choice-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 10px;
  padding: 0.6rem;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.choice-btn.active {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 12px rgba(177, 75, 255, 0.4);
}

.bet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
}

.bet-row label {
  font-weight: 600;
  color: var(--text-muted);
}

.bet-row input {
  width: 100px;
  background: transparent;
  border: none;
  color: var(--neon-gold);
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
  outline: none;
}

.game-result {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  min-height: 1.4em;
  margin-top: 0.85rem;
}

.game-result.result-win {
  color: var(--success);
  text-shadow: 0 0 10px rgba(57, 255, 136, 0.5);
}

.game-result.result-lose {
  color: var(--error);
  text-shadow: 0 0 10px rgba(255, 77, 109, 0.4);
}

/* ------------------------------------------------------------
   TOAST
   ------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--bg-panel);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 999;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.toast-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-success {
  border-color: var(--success);
  color: var(--success);
}

.toast-error {
  border-color: var(--error);
  color: var(--error);
}

.toast-info {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

/* ------------------------------------------------------------
   RESPONSIVE — escritorio
   ------------------------------------------------------------ */
@media (min-width: 720px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .dashboard-content,
  .game-content {
    padding-top: 1.5rem;
  }

  .auth-card {
    max-width: 420px;
    padding: 2.25rem 2rem;
  }
}
