: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; }

.hidden { display: none !important; }

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-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
  flex-shrink: 0;
}

.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;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.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); }

.nav-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Campanita de notificaciones */
.nav-notif {
  position: relative;
  padding: 8px 11px;
  font-size: 1rem;
}

.nav-notif.has-unread {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.14);
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
  border: 1.5px solid var(--bg-base);
}

.main-content { padding: 28px 0 92px; }
.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;
}

.badge-pin {
  background: rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.45);
}

/* 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; }
#name-change-modal-content h3 { padding-right: 36px; }

.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); }

/* Códigos de descuento y referidos */
.price-strike {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 0.82rem;
}

.promo-box {
  margin: 12px 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.22);
}

.promo-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.promo-input-row .input {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.promo-applied-note {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #34d399;
}

.promo-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.promo-stat-chip {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 92px;
}

.promo-stat-chip span {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.promo-stat-chip strong {
  font-size: 0.92rem;
  margin-top: 2px;
}

/* 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,
.status-Aprobado { 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); }

/* ================= AVATARES Y MARCOS DE NIVEL ================= */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 229, 255, 0.45);
  background: #0f172a;
  flex-shrink: 0;
  display: block;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(124, 58, 237, 0.45));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
}

.avatar-nav { width: 22px; height: 22px; font-size: 0.7rem; border-width: 1.5px; }
.avatar-xs  { width: 26px; height: 26px; font-size: 0.75rem; border-width: 1.5px; }
.avatar-sm  { width: 34px; height: 34px; font-size: 0.85rem; }
.avatar-md  { width: 46px; height: 46px; font-size: 1rem; }
.avatar-lg  { width: 78px; height: 78px; font-size: 1.7rem; }
.avatar-xl  { width: 108px; height: 108px; font-size: 2.3rem; }

.avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}

/* Contenedor de marco por nivel (envuelve el avatar sin rotar la foto) */
.avatar-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 3px;
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}

.avatar-frame .avatar {
  border: 1.5px solid rgba(6, 9, 18, 0.9);
  box-shadow: none;
}

.frame-avatar-nav,
.frame-avatar-xs { padding: 2px; }
.frame-avatar-sm,
.frame-avatar-md { padding: 2.5px; }
.frame-avatar-lg { padding: 4px; }
.frame-avatar-xl { padding: 5px; }

/* 7 Marcos exclusivos por nivel */
.frame-bronze {
  background: linear-gradient(135deg, #5c2e0e, #cd7f32, #f4b27a, #8b4513);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.45);
}

.frame-iron {
  background: linear-gradient(135deg, #334155, #94a3b8, #cbd5e1, #475569);
  box-shadow: 0 0 14px rgba(148, 163, 184, 0.45);
}

.frame-silver {
  background: linear-gradient(135deg, #64748b, #f8fafc, #94a3b8, #e2e8f0);
  background-size: 200% 200%;
  animation: frameShimmer 5s ease infinite;
  box-shadow: 0 0 16px rgba(226, 232, 240, 0.55);
}

.frame-gold {
  background: linear-gradient(135deg, #92400e, #fde047, #f59e0b, #fef08a, #b45309);
  background-size: 220% 220%;
  animation: frameShimmer 4s ease infinite;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.65);
}

.frame-emerald {
  background: linear-gradient(135deg, #065f46, #34d399, #a7f3d0, #10b981, #047857);
  background-size: 240% 240%;
  animation: frameShimmer 3.6s ease infinite;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.72);
}

.frame-diamond {
  background: linear-gradient(135deg, #0284c7, #00e5ff, #e0f2fe, #a855f7, #38bdf8);
  background-size: 260% 260%;
  animation: frameShimmer 3s linear infinite, diamondPulse 2.8s ease-in-out infinite;
}

.frame-ruby {
  background: linear-gradient(135deg, #7f1d1d, #ff1e56, #fda4af, #dc2626, #fbbf24);
  background-size: 260% 260%;
  animation: frameShimmer 2.6s linear infinite, rubyPulse 2.4s ease-in-out infinite;
}

@keyframes frameShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes diamondPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(0, 229, 255, 0.65), 0 0 26px rgba(168, 85, 247, 0.45); }
  50% { box-shadow: 0 0 22px rgba(0, 229, 255, 0.95), 0 0 36px rgba(168, 85, 247, 0.7); }
}

@keyframes rubyPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 30, 86, 0.7), 0 0 28px rgba(220, 38, 38, 0.5); }
  50% { box-shadow: 0 0 24px rgba(255, 30, 86, 1), 0 0 40px rgba(251, 191, 36, 0.55); }
}

/* Insignias de nivel */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
  line-height: 1.2;
}

.level-badge-sm {
  padding: 2px 7px;
  font-size: 0.68rem;
  gap: 3px;
}

.level-bronze  { background: rgba(205, 127, 50, 0.2);  color: #f4b27a; border-color: rgba(205, 127, 50, 0.5); }
.level-iron    { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.5); }
.level-silver  { background: rgba(226, 232, 240, 0.2); color: #f8fafc; border-color: rgba(226, 232, 240, 0.55); }
.level-gold    { background: rgba(250, 204, 21, 0.2);  color: #fde047; border-color: rgba(250, 204, 21, 0.55); }
.level-emerald { background: rgba(16, 185, 129, 0.2);  color: #6ee7b7; border-color: rgba(16, 185, 129, 0.55); }
.level-diamond { background: rgba(0, 229, 255, 0.2);   color: #7dd3fc; border-color: rgba(0, 229, 255, 0.6); }
.level-ruby    { background: rgba(255, 30, 86, 0.22);  color: #fda4af; border-color: rgba(255, 30, 86, 0.65); }

/* Tarjeta de progreso de nivel en Mi Perfil */
.level-card {
  position: relative;
  overflow: hidden;
}

.level-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.level-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.level-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

.level-fill-bronze  { background: linear-gradient(90deg, #9a5523, #f4b27a); }
.level-fill-iron    { background: linear-gradient(90deg, #475569, #cbd5e1); }
.level-fill-silver  { background: linear-gradient(90deg, #94a3b8, #f8fafc); }
.level-fill-gold    { background: linear-gradient(90deg, #d97706, #fde047); }
.level-fill-emerald { background: linear-gradient(90deg, #059669, #6ee7b7); }
.level-fill-diamond { background: linear-gradient(90deg, #0284c7, #00e5ff, #a855f7); }
.level-fill-ruby    { background: linear-gradient(90deg, #b91c1c, #ff1e56, #fbbf24); }

.level-alert {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 0.84rem;
  line-height: 1.45;
}

.levels-roadmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.roadmap-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  opacity: 0.45;
  transition: 0.2s;
}

.roadmap-item.unlocked {
  opacity: 0.88;
  border-color: rgba(255, 255, 255, 0.16);
}

.roadmap-item.current {
  opacity: 1;
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.14);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.22);
}

.roadmap-icon { font-size: 1.15rem; }
.roadmap-name { font-size: 0.72rem; font-weight: 700; margin-top: 3px; }
.roadmap-min  { font-size: 0.66rem; color: var(--muted); }

/* ================= RECORTADOR CIRCULAR DE AVATAR (ZOOM + ARRASTRE) ================= */
.crop-modal h3 { padding-right: 36px; }

.crop-stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 14px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: #060912;
  user-select: none;
}

#crop-canvas {
  display: block;
  width: 280px;
  height: 280px;
  touch-action: none;
  cursor: grab;
}

#crop-canvas:active { cursor: grabbing; }

.crop-circle-guide {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 999px rgba(6, 9, 18, 0.62);
  pointer-events: none;
}

.crop-controls {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}

.crop-zoom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

#crop-zoom {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ================= MI PERFIL Y PERFIL PÚBLICO ================= */
.profile-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-card { padding: 24px; }

.profile-top {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.profile-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 174px;
}

.profile-info-col { flex: 1; min-width: 0; }

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-name-row h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.profile-chip {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #e2e8f0;
}

.public-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 6px 4px;
}

.public-profile-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
}

.public-bio {
  margin: 12px 0;
  padding: 12px 14px;
  width: 100%;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ================= MODAL DE NOTIFICACIONES ================= */
.notif-modal {
  max-width: 500px;
  padding: 22px;
}

.notif-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 40px;
  margin-bottom: 14px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
}

.notif-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
  font-family: inherit;
}

.notif-item:hover {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.09);
}

.notif-item.unread {
  border-color: rgba(0, 229, 255, 0.45);
  background: rgba(0, 229, 255, 0.1);
}

.notif-icon { flex-shrink: 0; }

.notif-emoji-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid rgba(0, 229, 255, 0.3);
  font-size: 1rem;
}

.notif-content { flex: 1; min-width: 0; }
.notif-msg { font-size: 0.87rem; line-height: 1.4; color: #f1f5f9; word-break: break-word; }
.notif-time { font-size: 0.74rem; margin-top: 3px; }

.notif-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

/* ================= COMPARTIR NOTICIAS ================= */
.news-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: 0.18s ease;
}

.share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.share-wa { background: rgba(37, 211, 102, 0.22); border-color: rgba(37, 211, 102, 0.5); color: #86efac; }
.share-tg { background: rgba(56, 189, 248, 0.22); border-color: rgba(56, 189, 248, 0.5); color: #7dd3fc; }
.share-fb { background: rgba(59, 130, 246, 0.22); border-color: rgba(59, 130, 246, 0.5); color: #93c5fd; }
.share-x  { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); color: #f8fafc; }

.share-copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ================= NOTICIAS, WEBSOCKET STATUS, REACCIONES Y COMENTARIOS ================= */
.news-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  border: 1px solid var(--border);
}

.ws-online {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.ws-connecting {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.ws-offline {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-card { padding: 22px; }

.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.news-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.news-date { font-size: 0.8rem; }

.news-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  margin-bottom: 12px;
  line-height: 1.3;
}

.news-image-wrap {
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  max-height: 420px;
}

.news-image-wrap img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.news-content {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.65;
  word-break: break-word;
}

.news-actions-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reactions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.86rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.reaction-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
}

.reaction-btn.active {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.22);
}

.reaction-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
}

/* Comentarios, Respuestas y Reacciones en Comentarios */
.comments-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.comment-reply {
  margin-left: 34px;
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid rgba(0, 229, 255, 0.45);
}

.flash-highlight {
  animation: flashHighlight 2.1s ease;
}

@keyframes flashHighlight {
  0%, 25% {
    border-color: var(--accent);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.45);
    background: rgba(0, 229, 255, 0.14);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.comment-author {
  background: none;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.comment-author:hover { color: var(--accent); text-decoration: underline; }

.reply-badge {
  font-size: 0.74rem;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
  padding: 2px 7px;
  border-radius: 6px;
}

.comment-time { font-size: 0.74rem; }

.comment-text {
  font-size: 0.9rem;
  color: #e2e8f0;
  word-break: break-word;
  line-height: 1.5;
}

.comment-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.comment-reactions-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.comment-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
  opacity: 0.75;
  transition: 0.15s ease;
}

.comment-react-btn:hover,
.comment-react-btn.has-count {
  opacity: 1;
  border-color: rgba(0, 229, 255, 0.35);
}

.comment-react-btn.active {
  opacity: 1;
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.2);
}

.comment-react-count {
  font-size: 0.73rem;
  font-weight: 700;
  color: #e2e8f0;
}

.comment-actions {
  display: flex;
  gap: 12px;
}

.text-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.text-btn:hover { color: var(--accent); }
.text-danger:hover { color: #f87171; }

.mention-chip {
  display: inline-block;
  background: rgba(0, 229, 255, 0.16);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: 6px;
  padding: 0 5px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.mention-chip:hover { background: rgba(0, 229, 255, 0.28); }

/* Caja para escribir comentarios y autocompletado @ */
.comment-composer {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.reply-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-size: 0.8rem;
}

.mention-wrap { position: relative; }

.mention-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  background: rgba(9, 14, 28, 0.98);
  border: 1px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.mention-dropdown.open { display: block; }

.mention-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.mention-option:last-child { border-bottom: none; }
.mention-option:hover { background: rgba(0, 229, 255, 0.15); }

.comment-login-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

/* ================= BOTÓN FLOTANTE Y CHAT DE SOPORTE IA ================= */
.support-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.55);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #030712;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 229, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-fab:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 34px rgba(0, 229, 255, 0.5);
}

.support-fab.active {
  background: rgba(13, 19, 34, 0.95);
  color: var(--accent);
  border-color: var(--accent);
}

.support-fab-icon { font-size: 1.15rem; line-height: 1; }

.support-widget {
  position: fixed;
  right: 20px;
  bottom: 82px;
  z-index: 85;
  width: min(370px, calc(100vw - 24px));
  height: min(510px, calc(100vh - 115px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(0, 229, 255, 0.45);
  background: rgba(9, 14, 28, 0.95);
}

.support-widget.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.16), rgba(124, 58, 237, 0.22));
  border-bottom: 1px solid var(--border);
}

.support-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 18, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.5);
  font-size: 1.1rem;
}

.support-status {
  font-size: 0.72rem;
  color: #34d399;
  font-weight: 600;
}

.support-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 9, 18, 0.65);
  color: #fff;
  cursor: pointer;
}

.support-quick-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}

.support-quick-btn {
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(0, 229, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}

.support-quick-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent);
}

.support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-msg {
  display: flex;
}

.support-msg-user { justify-content: flex-end; }
.support-msg-bot  { justify-content: flex-start; }

.support-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 13px;
  font-size: 0.85rem;
  line-height: 1.45;
  word-break: break-word;
}

.support-msg-bot .support-bubble {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.support-msg-user .support-bubble {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(124, 58, 237, 0.35));
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.support-typing {
  color: var(--muted) !important;
  font-style: italic;
}

.support-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

.support-input-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: rgba(6, 9, 18, 0.88);
}

.support-input-form .input {
  padding: 9px 11px;
  font-size: 0.86rem;
}

/* Toasts (por encima del botón flotante de soporte) */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, 90vw);
}

.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; }
  .profile-card { padding: 18px; }
  .profile-top { flex-direction: column; align-items: stretch; }
  .profile-avatar-col { min-width: 0; }
  .news-card { padding: 16px; }
  .comment-reply { margin-left: 16px; }
  .notif-modal { padding: 18px; }
  .crop-stage, #crop-canvas { width: 250px; height: 250px; }
  .levels-roadmap { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .support-fab { right: 14px; bottom: 14px; padding: 11px 15px; }
  .support-widget { right: 12px; bottom: 72px; }
  .toast-container { right: 12px; bottom: 74px; }
}
