:root {
  --accent: #00e5ff;
  --accent-2: #7c3aed;
  --bg-base: #060912;
  --bg-card: rgba(13, 19, 34, 0.78);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

#bg-image {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-size: cover;
  background-position: center;
  transition: filter 0.3s ease, background-image 0.3s ease;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.12), transparent 45%),
              rgba(6, 9, 18, 0.78);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

.container { width: min(1160px, 92%); margin: 0 auto; }

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 9, 18, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
  cursor: pointer;
}

.brand strong { color: var(--accent); }

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-btn:hover, .nav-btn.active {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.14);
  color: #fff;
}

.nav-admin { border-color: rgba(124, 58, 237, 0.5); }

.main-content { padding: 28px 0 64px; }
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.hero-text { max-width: 600px; }
.hero-text h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  margin: 10px 0 8px;
  line-height: 1.2;
}
.hero-text p { color: var(--muted); font-size: 0.95rem; }

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
  flex: 1;
  max-width: 320px;
}

.rate-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.35);
  font-size: 0.88rem;
}
.rate-pill strong { color: var(--accent); }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.18);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.35);
  text-transform: uppercase;
}

/* Catálogo */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.game-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(0, 229, 255, 0.18);
}

.game-cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.game-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.game-card:hover .game-cover-wrap img { transform: scale(1.06); }

.game-cover-wrap .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  backdrop-filter: blur(8px);
  background: rgba(6, 9, 18, 0.78);
}

.game-info { padding: 15px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.game-info h3 { font-family: 'Orbitron', sans-serif; font-size: 1rem; }
.game-info p { font-size: 0.83rem; color: var(--muted); }
.game-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

/* Inputs y Botones */
.input, select, textarea {
  width: 100%;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.field-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 12px 0 6px;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #030712;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #03150b;
  font-weight: 700;
}
.btn-whatsapp:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); }

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.28); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.full-width { width: 100%; }
.muted { color: var(--muted); }
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

/* Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 5, 12, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal { position: relative; width: 100%; max-height: 92vh; overflow-y: auto; }
.small-modal { max-width: 430px; padding: 26px; }
.checkout-modal { max-width: 620px; overflow: hidden; display: flex; flex-direction: column; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 9, 18, 0.75);
  color: #fff;
  cursor: pointer;
}

.checkout-banner {
  position: relative;
  padding: 24px 24px 18px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}
.checkout-banner h3 { font-family: 'Orbitron', sans-serif; font-size: 1.45rem; margin-top: 8px; }
.checkout-banner p { font-size: 0.85rem; color: #cbd5e1; }

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.step { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}
.step.active { color: #fff; font-weight: 600; }
.step.active span { background: var(--accent); color: #030712; }

.checkout-body { padding: 22px; overflow-y: auto; }

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-size: 0.85rem;
  cursor: pointer;
}
.checkbox-card input { margin-top: 3px; accent-color: var(--accent); }

/* Paquetes */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.pkg-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
}
.pkg-card:hover, .pkg-card.selected {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.12);
}
.pkg-card img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 8px;
  display: block;
}
.pkg-name { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.pkg-usd { color: var(--accent); font-weight: 700; font-size: 1rem; }
.pkg-bs { font-size: 0.76rem; color: var(--muted); }

/* Pagos y comprobante */
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 16px; }
.pay-option {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.pay-option.selected { border-color: var(--accent); background: rgba(0, 229, 255, 0.14); }

.pay-details-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}
.pay-details-box pre { font-family: inherit; white-space: pre-wrap; margin: 8px 0 0; color: #e2e8f0; }

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1.5px dashed rgba(0, 229, 255, 0.4);
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.05);
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
}
.upload-box:hover { background: rgba(0, 229, 255, 0.1); }
.receipt-preview {
  max-height: 170px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: contain;
}

.checkout-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Historial y Admin */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.history-list { display: grid; gap: 12px; }

.order-card {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-Pendiente { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.status-Procesando { background: rgba(0, 229, 255, 0.18); color: #38bdf8; }
.status-Completado { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.status-Rechazado { background: rgba(239, 68, 68, 0.18); color: #f87171; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.tab-btn.active { background: rgba(0, 229, 255, 0.16); border-color: var(--accent); color: #fff; }
.admin-panel { padding: 22px; }

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.admin-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.img-preview-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.img-preview {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  flex-shrink: 0;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0 16px;
}

.preset-btn {
  height: 68px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 2px 6px #000;
  cursor: pointer;
}
.preset-btn:hover { border-color: var(--accent); }

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(13, 19, 34, 0.96);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .hero { padding: 20px; }
  .stepper { font-size: 0.7rem; padding: 10px; }
  .pay-methods { grid-template-columns: 1fr; }
}
