@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,400;0,500;0,600;0,700;0,800;1,700;1,800&display=swap');

/* =====================================================================
   POBRETIENDA — tema espacial cinematográfico (Destiny 2)
   Negro azulado · bruma violeta · destellos lima · superficies translúcidas
   ===================================================================== */
:root {
  --bg: #070916;
  --bg-deep: #04050d;
  --surface: rgba(13, 15, 34, 0.80);
  --surface-2: rgba(26, 29, 60, 0.84);
  --border: rgba(160, 150, 235, 0.22);
  --border-strong: rgba(196, 180, 255, 0.46);
  --text: #b6c2d9;
  --text-bright: #eef1fa;
  --accent: #a98bff;      /* violeta: estructura, bordes, foco */
  --accent-2: #dbff76;    /* lima: acción, precios, destellos */
  --danger: #ff6b7a;
  --radius: 4px;
  --cut: 16px;            /* esquina cortada HUD */
  --font: 'Exo 2', Futura, 'Century Gothic', sans-serif;
  --glow-accent: 0 0 26px rgba(169, 139, 255, 0.38);
  --glow-lime: 0 0 24px rgba(219, 255, 118, 0.30);
  --shadow-card: 0 14px 30px -14px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }
html { background: var(--bg-deep); scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: transparent;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
::selection { background: var(--accent-2); color: #0a0c1c; }
* { scrollbar-width: thin; scrollbar-color: rgba(169,139,255,.4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(169,139,255,.35); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(219,255,118,.5); background-clip: padding-box; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   FONDO ESPACIAL (capas inyectadas por bg.js)
   --------------------------------------------------------------------- */
.space-bg {
  --tv: clamp(190px, 24vw, 380px);   /* tamaño del Viajero */
  --tr: 2%;                          /* separación derecha */
  --tt: 10%;                         /* separación superior */
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 115%, #15133b 0%, transparent 60%),
    linear-gradient(180deg, #03040a 0%, #060918 50%, #0a0b22 100%);
}
.space-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.nebula, .nebula-a {
  position: absolute;
  inset: -12%;
  background-position: center;
  background-size: cover;
  will-change: transform;
}
.nebula {
  /* azul noche con velo dorado (base) */
  background-image: url('/img/neb-b.webp');
  opacity: 0.85;
  animation: nebula-drift 70s ease-in-out infinite alternate;
}
.nebula-a {
  /* toque de nebulosa violeta y turquesa, en sentido contrario */
  background-image: url('/img/neb-a.webp');
  opacity: 0.30;
  mix-blend-mode: screen;
  animation: nebula-drift-b 95s ease-in-out infinite alternate;
}
@keyframes nebula-drift   { from { transform: translate3d(-3%, -1.5%, 0) scale(1.02); } to { transform: translate3d(3%, 2%, 0) scale(1.08); } }
@keyframes nebula-drift-b { from { transform: translate3d(3%, 2%, 0) scale(1.08); } to { transform: translate3d(-3%, -1.5%, 0) scale(1.02); } }

.mist {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(55% 22% at 30% 70%, rgba(150, 120, 255, 0.22), transparent 70%),
    radial-gradient(40% 16% at 55% 90%, rgba(255, 226, 150, 0.07), transparent 70%);
  mix-blend-mode: screen;
  animation: mist-drift 55s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes mist-drift {
  from { transform: translate3d(5%, 2%, 0) scale(1.08); }
  to   { transform: translate3d(-5%, -3%, 0) scale(1); }
}

/* Rayos de luz dorada que salen del Viajero */
.rays {
  --rs: calc(var(--tv) * 4.2);
  position: absolute;
  width: var(--rs);
  height: var(--rs);
  right: calc(var(--tr) + var(--tv) / 2 - var(--rs) / 2);
  top: calc(var(--tt) + var(--tv) * 0.564 - var(--rs) / 2);
  background:
    repeating-conic-gradient(from 3deg at 50% 50%, rgba(255, 226, 160, 0.13) 0 2.2deg, transparent 2.2deg 5.3deg),
    repeating-conic-gradient(from 17deg at 50% 50%, rgba(255, 236, 190, 0.10) 0 3.4deg, transparent 3.4deg 9.1deg),
    radial-gradient(circle, rgba(255, 232, 170, 0.30) 0, rgba(255, 232, 170, 0.08) 22%, transparent 55%);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.55) 28%, transparent 60%);
          mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.55) 28%, transparent 60%);
  mix-blend-mode: screen;
  filter: blur(7px);
  animation: rays-turn 240s linear infinite, rays-breathe 9s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes rays-turn { to { transform: rotate(360deg); } }
@keyframes rays-breathe { from { opacity: 0.7; } to { opacity: 1; } }

.planet { position: absolute; border-radius: 50%; }
.planet-a {
  --pa: clamp(480px, 70vw, 960px);
  width: var(--pa);
  left: calc(var(--pa) * -0.30);
  bottom: calc(var(--pa) * -0.64);
  opacity: 0.9;
  filter: brightness(0.62) saturate(0.92) drop-shadow(0 0 60px rgba(120, 95, 220, 0.28));
}
.planet-a img { display: block; width: 100%; height: auto; user-select: none; }

/* El Viajero (imagen) */
.traveler {
  position: absolute;
  width: var(--tv);
  right: var(--tr);
  top: var(--tt);
  opacity: 0.96;
  filter: drop-shadow(0 0 46px rgba(210, 205, 255, 0.35));
}
.traveler::before {
  /* halo suave detrás */
  content: '';
  position: absolute;
  inset: -25%;
  background: radial-gradient(circle, rgba(225, 220, 255, 0.22) 0%, transparent 62%);
  z-index: -1;
}
.traveler img { display: block; width: 100%; height: auto; user-select: none; animation: traveler-float 12s ease-in-out infinite alternate; }
@keyframes traveler-float { from { transform: translateY(0); } to { transform: translateY(-14px); } }

.glint {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  opacity: 0;
  background: radial-gradient(circle, rgba(219,255,118,.95) 0 1.5px, rgba(219,255,118,.25) 2px, transparent 7px);
  animation: twinkle 5s ease-in-out infinite;
}
.glint::before, .glint::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.glint::before { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); }
.glint::after  { width: 1px; height: 100%; background: linear-gradient(180deg, transparent, var(--accent-2), transparent); }
@keyframes twinkle {
  0%, 25%, 100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.15); }
  72% { opacity: 0.25; transform: scale(0.85); }
}

.veil {
  /* capa oscura + degradado: garantiza legibilidad del contenido */
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 38%, transparent 34%, rgba(3, 4, 10, 0.42) 100%),
    linear-gradient(180deg, rgba(3, 4, 10, 0.38) 0%, rgba(3, 4, 10, 0.12) 40%, rgba(3, 4, 10, 0.46) 100%);
}

/* ---------------------------------------------------------------------
   CABECERA
   --------------------------------------------------------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(6, 8, 20, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 35%, transparent 85%);
}
.topbar h1 {
  font-size: 1.05rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-bright);
  white-space: nowrap;
  flex: none;
}
.topbar h1 img { width: 30px; height: 30px; filter: drop-shadow(0 0 8px rgba(219, 255, 118, 0.55)); }

.userbox { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; flex-wrap: wrap; justify-content: flex-end; }
#userbox-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.userbox .points {
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(219, 255, 118, 0.08);
  box-shadow: inset 0 0 0 1px rgba(219, 255, 118, 0.28);
  padding: 5px 12px;
}
.userbox img { width: 30px; height: 30px; border: 1px solid var(--border); }
.userbox .btn-logout {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.userbox .btn-logout:hover { background: rgba(169, 139, 255, 0.16); border-color: var(--border-strong); color: var(--text-bright); }
#lang-select { cursor: pointer; font-weight: 700; letter-spacing: 0.05em; padding: 6px 8px; }

.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px 90px; }
.loading { text-align: center; margin-top: 60px; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.85rem; }

/* ---------------------------------------------------------------------
   SUPERFICIES UNIFICADAS (tarjetas, paneles, modal, landing)
   --------------------------------------------------------------------- */
.card, .login-card, .modal, .landing-card, .hero {
  position: relative;
  background: linear-gradient(180deg, rgba(30, 33, 68, 0.84) 0%, rgba(11, 13, 30, 0.86) 70%);
  border: 1px solid var(--border);
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.card::before, .login-card::before, .modal::before, .landing-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 70%, transparent);
  pointer-events: none;
}

.login-card { max-width: 440px; margin: 90px auto; padding: 40px; text-align: center; }
.login-card h2 { color: var(--text-bright); font-size: 1.1rem; letter-spacing: 0.06em; }

/* ---------------------------------------------------------------------
   BOTONES — rectangulares, con marcas de esquina que se abren al hover
   y un barrido de luz (sin esquinas recortadas)
   --------------------------------------------------------------------- */
.btn, #history-fab {
  --tick: var(--accent-2);
  position: relative;
  display: inline-block;
  padding: 13px 28px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--accent-2);
  border: 1px solid rgba(219, 255, 118, 0.55);
  border-radius: 0;
  background-color: rgba(219, 255, 118, 0.10);
  background-image: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.38) 50%, transparent 65%);
  background-repeat: no-repeat;
  background-size: 260% 100%;
  background-position: -160% 0;
  transition: background-position 0.6s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.btn::before, .btn::after, #history-fab::before, #history-fab::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--tick);
  pointer-events: none;
  transition: transform 0.18s ease;
}
.btn::before, #history-fab::before { left: -5px; top: -5px; border-right: 0; border-bottom: 0; }
.btn::after,  #history-fab::after  { right: -5px; bottom: -5px; border-left: 0; border-top: 0; }
.btn:hover:not(:disabled), #history-fab:hover { background-position: 160% 0; }
.btn:hover:not(:disabled)::before, #history-fab:hover::before { transform: translate(-3px, -3px); }
.btn:hover:not(:disabled)::after,  #history-fab:hover::after  { transform: translate(3px, 3px); }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Primario: lima macizo */
.btn-discord, .card .btn-redeem, #history-fab {
  background-color: var(--accent-2);
  border-color: #f3ffbf;
  color: #0a0c1c;
}
.btn-discord { margin-top: 16px; }
.btn-discord:hover:not(:disabled), .card .btn-redeem:hover:not(:disabled), #history-fab:hover {
  background-color: #ecffa8;
  box-shadow: 0 0 24px rgba(219, 255, 118, 0.38);
}

/* Secundario: violeta translúcido */
.btn-redeem {
  --tick: var(--accent);
  color: var(--text-bright);
  border-color: var(--border-strong);
  background-color: rgba(169, 139, 255, 0.14);
}
.btn-redeem:hover:not(:disabled) { background-color: rgba(169, 139, 255, 0.28); box-shadow: 0 0 20px rgba(169, 139, 255, 0.28); }

/* Desactivado */
.btn:disabled, .btn-discord:disabled, .card .btn-redeem:disabled {
  --tick: transparent;
  color: var(--text);
  background-color: rgba(120, 125, 175, 0.10);
  background-image: none;
  border-color: var(--border);
  opacity: 0.7;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------
   TIENDA
   --------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 18px 18px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card::before { background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), var(--accent), transparent); }
.card:not(.sold-out):hover {
  border-color: var(--border-strong);
  box-shadow: inset 0 0 40px rgba(169, 139, 255, 0.14);
  transform: translateY(-3px);
}
.card .halo {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 260px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(169, 139, 255, 0.45) 0, transparent 62%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.card:not(.sold-out):hover .halo { opacity: 1; filter: brightness(1.25); }

/* marco en rombo con el icono entero dentro */
.card .emblem-frame {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
  transform: rotate(45deg);
  margin: 20px 0 50px;
  overflow: hidden;
  background: rgba(4, 5, 13, 0.6);
  box-shadow:
    0 0 0 1px rgba(219, 255, 118, 0.55),
    0 0 0 7px rgba(8, 10, 27, 0.7),
    0 0 0 8px rgba(169, 139, 255, 0.45),
    0 0 34px rgba(169, 139, 255, 0.5);
}
.card .emblem-frame .emblem-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 142%;
  height: 142%;
  transform: translate(-50%, -50%) rotate(-45deg);
  object-fit: cover;
  border: 0;
  aspect-ratio: auto;
  background: none;
  transition: transform 0.4s ease, filter 0.2s ease;
}
.card:not(.sold-out):hover .emblem-frame .emblem-img { transform: translate(-50%, -50%) rotate(-45deg) scale(1.06); }
.card .emblem-frame .emblem-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
}
.card .card-type {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #b9c3dd;
  font-weight: 700;
}
.card .card-type::before, .card .card-type::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(169, 139, 255, 0.7));
}
.card .card-type::after { transform: scaleX(-1); }
.card h3 {
  position: relative;
  margin: 8px 0 0;
  min-height: 2.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-bright);
}
.card .price {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  color: var(--accent-2);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 14px rgba(219, 255, 118, 0.25);
}
.card .price::before, .card .price::after {
  content: '';
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}
.card .stock { position: relative; margin: 0 0 14px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; opacity: 0.8; }
.card .btn-redeem {
  --tick: var(--accent-2);
  align-self: stretch;
  margin: auto 0 0;
  min-height: 3.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  line-height: 1.25;
}
.card.sold-out { filter: saturate(0.5); }
.card.sold-out::before { background: var(--border); }
.card.sold-out .halo { opacity: 0.25; }
.card.sold-out .emblem-frame .emblem-img { filter: grayscale(1) brightness(0.6); }
.card.sold-out .price { color: #7e8663; text-shadow: none; }
.card.sold-out .price::before, .card.sold-out .price::after { background: #6b6d88; box-shadow: none; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 44px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 800;
}
.section-title::before {
  content: '';
  width: 10px;
  height: 22px;
  flex: none;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  clip-path: polygon(0 0, 100% 0, 60% 100%, 0 100%);
}
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

details { margin: 0; }
details > summary.section-title { cursor: pointer; list-style: none; user-select: none; }
details > summary.section-title::-webkit-details-marker { display: none; }
details > summary.section-title::after {
  content: '▸';
  flex: none;
  height: auto;
  background: none;
  margin-left: auto;
  color: var(--accent);
  transition: transform 0.15s ease;
}
details[open] > summary.section-title::after { transform: rotate(90deg); }
details > summary.section-title:hover { color: var(--text-bright); }
details > *:not(summary) { margin-top: 16px; }

/* ---------------------------------------------------------------------
   TABLAS Y FORMULARIOS
   --------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.85rem; background: rgba(8, 10, 26, 0.62); border: 1px solid var(--border); }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--accent-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; background: rgba(169, 139, 255, 0.08); }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(169, 139, 255, 0.07); }

input, select {
  background: rgba(4, 5, 13, 0.6);
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(169, 139, 255, 0.28); }
input::placeholder { color: rgba(182, 194, 217, 0.5); }
.row { display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------------
   FLOTANTES: historial, arma actual, toast, modal
   --------------------------------------------------------------------- */
#history-fab {
  display: none;
  position: fixed;
  bottom: 26px;
  right: 26px;
  height: auto;
  width: auto;
  padding: 12px 20px;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

.weapon-banner {
  display: none;
  position: fixed;
  top: 118px;
  right: 26px;
  background: rgba(8, 10, 26, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  padding: 12px 20px;
  z-index: 60;
  flex-direction: column;
  gap: 2px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.weapon-banner.show { display: flex; animation: banner-in 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes banner-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.weapon-banner-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text); }
#weapon-banner-value { font-size: 1.05rem; font-weight: 800; color: var(--accent-2); letter-spacing: 0.02em; }
#weapon-banner-weapon.secret { background: rgba(201, 162, 39, 0.14); margin: -4px -8px; padding: 4px 8px; }
#weapon-banner-weapon.secret .weapon-banner-label,
#weapon-banner-weapon.secret #weapon-banner-value { color: #C9A227; }
#weapon-banner-teams { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.weapon-banner-teams-row { display: flex; align-items: baseline; gap: 8px; font-size: 0.85rem; color: var(--text-bright); }
.weapon-banner-teams-row .weapon-banner-label { min-width: 70px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 10, 26, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 14px 22px;
  font-size: 0.85rem;
  z-index: 100;
  color: var(--text-bright);
  animation: toast-in 0.3s ease;
}
.toast.success { border-left-color: var(--accent-2); }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 10, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fade-in 0.2s ease; }
.modal-overlay.open .modal { animation: modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal { max-width: 560px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 32px; background: linear-gradient(180deg, rgba(30,33,68,.96), rgba(11,13,30,.97)); }
.modal h2 { margin-top: 0; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-bright); font-size: 1.1rem; }
.modal-body p { margin: 0 0 10px; line-height: 1.65; max-width: 62ch; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.modal-close:hover { color: var(--accent-2); }

/* ---------------------------------------------------------------------
   PORTADA
   --------------------------------------------------------------------- */
.landing-wrap { max-width: 960px; margin: 0 auto; padding: 56px 20px 120px; }
.hero {
  --cut: 44px;
  padding: 48px 44px 44px;
  margin-bottom: 36px;
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(120, 80, 230, 0.34), transparent 65%),
    linear-gradient(180deg, rgba(30, 33, 68, 0.80), rgba(11, 13, 30, 0.84));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  overflow: hidden;
}
.hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.hero h2 {
  margin: 0;
  font-size: clamp(2.5rem, 7.5vw, 4.6rem);
  font-weight: 800;
  font-style: italic;
  line-height: 0.95;
  color: var(--text-bright);
  text-shadow: 0 0 40px rgba(169, 139, 255, 0.55), 3px 3px 0 rgba(169, 139, 255, 0.35);
}
.hero p { margin: 16px 0 0; max-width: 46ch; font-size: 1.05rem; line-height: 1.6; }

.landing-wrap--buttons { max-width: 1320px; }
.landing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.landing-card { padding: 28px 22px 24px; }
.landing-card {
  padding: 34px 28px 28px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.landing-card:hover { border-color: var(--border-strong); box-shadow: inset 0 0 50px rgba(169, 139, 255, 0.16); transform: translateY(-3px); }
.landing-card h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-bright); }
.landing-card p { margin: 0; color: var(--text); font-size: 0.95rem; line-height: 1.55; flex-grow: 1; }
.landing-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
  background: rgba(219, 255, 118, 0.08);
  box-shadow: inset 0 0 0 1px rgba(219, 255, 118, 0.26);
  padding: 5px 10px;
}
.landing-follow {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  white-space: nowrap;
  margin-top: 0;
  --tick: #e0ccff;
  background-color: #9146ff;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.btn.landing-follow:hover:not(:disabled) { background-color: #a463ff; box-shadow: 0 6px 24px rgba(145, 70, 255, 0.55); }

/* ---------------------------------------------------------------------
   MÓVIL
   --------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .landing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .topbar { position: static; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; }
  .topbar h1 { white-space: normal; font-size: 0.9rem; }
  .topbar h1 img { width: 24px; height: 24px; }
  .userbox { width: 100%; justify-content: flex-start; gap: 6px; font-size: 0.75rem; }
  #userbox-inner { gap: 6px; }
  .userbox .btn-logout { padding: 6px 9px; font-size: 0.64rem; letter-spacing: 0.05em; }
  .container { padding: 22px 14px 90px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { --cut: 12px; padding: 18px 10px 12px; }
  .card .emblem-frame { width: 100px; height: 100px; margin: 14px 0 38px; }
  .card h3 { font-size: 0.82rem; }
  .card .price { font-size: 1.1rem; gap: 7px; }
  .card .stock { font-size: 0.62rem; letter-spacing: 0.1em; }
  .card .btn-redeem { padding: 10px 6px; font-size: 0.68rem; letter-spacing: 0.1em; }
  .login-card { margin: 50px auto; padding: 28px 22px; }
  .weapon-banner { top: auto; bottom: 90px; right: 16px; left: 16px; }
  #history-fab { padding: 10px 14px; font-size: 0.68rem; bottom: 16px; right: 16px; }
  table { font-size: 0.78rem; display: block; overflow-x: auto; }
  .hero { --cut: 28px; padding: 34px 22px 30px; }
  .space-bg { --tv: 150px; --tr: -20px; --tt: 3%; }
  .traveler { opacity: 0.6; }
  .rays { filter: blur(5px); }
  .glint:nth-child(n+4) { display: none; }
}

/* ---------------------------------------------------------------------
   MOVIMIENTO REDUCIDO
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

