/* ============================================================================
 * styles.css — Tema EmmaFest (mobile-first, EDM · crypto wallet · gamer)
 * ----------------------------------------------------------------------------
 * Sistema visual:
 *   Fondo    : violeta casi-negro con auras neón
 *   Acentos  : magenta → violeta → cian  (gradiente de marca)
 *   Monedas  : oro cálido
 *   Tipos    : Space Grotesk (display) · Manrope (texto) · números tabulares
 * ========================================================================== */

/* ------------------------------- Tokens ---------------------------------- */
:root {
  --bg-0: #08060f;
  --bg-1: #0d0a1c;
  --bg-2: #14102a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-strong: rgba(255, 255, 255, 0.18);

  --text: #f3f0ff;
  --text-dim: #a79fce;
  --text-faint: #6f6893;

  --magenta: #ff2e97;
  --violet: #8b2fff;
  --cyan: #00e5ff;
  --gold: #ffcf3f;
  --gold-deep: #ff9d2f;
  --green: #2fe6a8;
  --red: #ff5470;

  --brand: linear-gradient(120deg, #ff2e97 0%, #8b2fff 52%, #00e5ff 100%);
  --gold-grad: linear-gradient(135deg, #ffe27a 0%, #ffcf3f 40%, #ff9d2f 100%);

  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.85);
  --glow-brand: 0 0 40px -6px rgba(139, 47, 255, 0.55);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

/* ------------------------------- Reset ----------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100dvh;
}
/* Auras neón de fondo (ligeras, no animadas → sin costo continuo) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 15% 8%, rgba(255, 46, 151, 0.18), transparent 70%),
    radial-gradient(55% 45% at 92% 12%, rgba(0, 229, 255, 0.16), transparent 70%),
    radial-gradient(70% 55% at 50% 108%, rgba(139, 47, 255, 0.22), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.tabnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ------------------------------ Layout ----------------------------------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px 120px;
  min-height: 100dvh;
}
.hidden {
  display: none !important;
}

/* ------------------------------ Topbar ----------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--glow-brand);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.chip--rank {
  color: var(--gold);
  border-color: rgba(255, 207, 63, 0.3);
  background: rgba(255, 207, 63, 0.08);
}

/* --------------------------- Wallet card --------------------------------- */
.wallet {
  position: relative;
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  background: linear-gradient(155deg, rgba(139, 47, 255, 0.32), rgba(255, 46, 151, 0.18) 55%, rgba(0, 229, 255, 0.16));
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow), var(--glow-brand);
  overflow: hidden;
  isolation: isolate;
}
.wallet::after {
  /* brillo diagonal sutil, estático */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  z-index: -1;
}
.wallet__label {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}
.wallet__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
}
.wallet__balance {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 58px;
  line-height: 1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}
.wallet__coin {
  font-size: 40px;
  filter: drop-shadow(0 3px 8px rgba(255, 157, 47, 0.6));
}
.wallet__unit {
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 14px;
  font-weight: 700;
}
.wallet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.wallet__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #fff;
}
.wallet__edit {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------ Sections --------------------------------- */
.section {
  margin-top: 26px;
}
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section__hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* ------------------------------- Feed ------------------------------------ */
.feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--stroke);
  animation: slideIn 0.35s ease both;
}
.feed__emoji {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 19px;
  border-radius: 11px;
  background: var(--surface-2);
}
.feed__text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}
.feed__text small {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  margin-top: 2px;
}
.feed__delta {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}
.feed__delta--up {
  color: var(--green);
}
.feed__delta--down {
  color: var(--red);
}

/* --------------------------- Empty states -------------------------------- */
.empty {
  text-align: center;
  padding: 34px 18px;
  color: var(--text-faint);
  border: 1px dashed var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}
.empty__emoji {
  font-size: 30px;
  opacity: 0.7;
}
.empty p {
  margin-top: 8px;
  font-size: 14px;
}

/* ------------------------------ Buttons ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.12s ease, filter 0.2s ease, opacity 0.2s;
  border: 1px solid transparent;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled,
.btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--glow-brand);
}
.btn--gold {
  background: var(--gold-grad);
  color: #2a1600;
}
.btn--ghost {
  background: var(--surface);
  border-color: var(--stroke-strong);
  color: var(--text);
}
.btn--danger {
  background: linear-gradient(135deg, #ff5470, #c81e46);
  color: #fff;
}
.btn--block {
  width: 100%;
}

/* ------------------------------- Inputs ---------------------------------- */
.field {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  font-size: 16px; /* evita zoom en iOS */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 47, 255, 0.25);
}
.field::placeholder {
  color: var(--text-faint);
}

/* --------------------------- Onboarding ---------------------------------- */
.onboard {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  max-width: 400px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}
.onboard__logo {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 22px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-size: 40px;
  box-shadow: var(--glow-brand);
  animation: floaty 4s ease-in-out infinite;
}
.onboard__title {
  font-size: 30px;
  font-weight: 700;
}
.onboard__title span {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.onboard__sub {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}
.onboard__gift {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 207, 63, 0.1);
  border: 1px solid rgba(255, 207, 63, 0.3);
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
}
.gbtn {
  gap: 12px;
  background: #fff;
  color: #1f2333;
  border-color: #fff;
  font-weight: 700;
}
.gbtn:active {
  filter: brightness(0.95);
}
.gbtn__icon {
  flex: none;
}
.onboard__fine {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

/* ------------------------------- Toasts ---------------------------------- */
.toast-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  width: max-content;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(20, 16, 42, 0.92);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s;
}
.toast--in {
  transform: translateY(0);
  opacity: 1;
}
.toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--cyan);
}
.toast--success .toast__dot {
  background: var(--green);
}
.toast--error .toast__dot {
  background: var(--red);
}
.toast--coin .toast__dot {
  background: var(--gold);
}

/* ---------------------------- Loading ------------------------------------ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(8, 6, 15, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.loading-overlay--on {
  opacity: 1;
  pointer-events: auto;
}
.loading-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--magenta);
  border-right-color: var(--violet);
  animation: spin 0.8s linear infinite;
}
.loading-label {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
}

/* ----------------------------- Modal ------------------------------------- */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 6, 15, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-back--in {
  opacity: 1;
}
.modal {
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius);
  padding: 24px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  transform: scale(0.94);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-back--in .modal {
  transform: scale(1);
}
.modal__title {
  font-size: 19px;
  font-weight: 700;
}
.modal__body {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 10px;
}
.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.modal__actions .btn {
  flex: 1;
}

/* --------------------------- Coin particles ------------------------------ */
.coin-particle {
  position: fixed;
  z-index: 9800;
  font-size: 22px;
  pointer-events: none;
  animation: coinfly 1s ease-out forwards;
}
@keyframes coinfly {
  0% {
    transform: translate(-50%, -50%) scale(0.6) rotate(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--rot));
    opacity: 0;
  }
}

/* ----------------------------- Animations -------------------------------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.pulse-up {
  animation: pulseUp 0.6s ease;
}
@keyframes pulseUp {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
    filter: brightness(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* ------------------------- Reduce motion --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ========================================================================== */
/* FASE 2 · Navegación por tabs, Leaderboard, Dashboard global, Admin         */
/* ========================================================================== */

/* ------------------------------- Tab pages ------------------------------- */
.page {
  animation: fadeUp 0.3s ease both;
}
.page.hidden {
  display: none !important;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.page__lead {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
}

/* ------------------------------ Bottom nav ------------------------------- */
.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 800;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 12, 34, 0.86);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  width: calc(100% - 32px);
  max-width: 448px;
  justify-content: space-between;
}
.nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.2s, background 0.2s;
}
.nav__btn span {
  font-size: 19px;
  line-height: 1;
}
.nav__btn.is-active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 18px -6px rgba(139, 47, 255, 0.7);
}

/* ------------------------------ Leaderboard ------------------------------ */
.lb {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb__row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1), background 0.3s, border-color 0.3s;
}
.lb__pos {
  width: 30px;
  flex: none;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-faint);
}
.lb__medal {
  font-size: 22px;
}
.lb__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb__name small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}
.lb__coins {
  font-weight: 800;
  font-size: 15px;
  color: var(--gold);
  white-space: nowrap;
}
.lb__coins small {
  color: var(--text-faint);
  font-weight: 600;
}
/* Podio */
.lb__row--1 {
  background: linear-gradient(100deg, rgba(255, 207, 63, 0.18), rgba(255, 157, 47, 0.06));
  border-color: rgba(255, 207, 63, 0.4);
  box-shadow: 0 0 30px -10px rgba(255, 207, 63, 0.55);
}
.lb__row--2 {
  background: linear-gradient(100deg, rgba(210, 220, 255, 0.14), transparent);
  border-color: rgba(210, 220, 255, 0.3);
}
.lb__row--3 {
  background: linear-gradient(100deg, rgba(255, 157, 47, 0.14), transparent);
  border-color: rgba(255, 157, 47, 0.28);
}
.lb__row--me {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}
/* Glow al ser nuevo líder */
.lb__row--newleader {
  animation: leaderGlow 1.6s ease;
}
@keyframes leaderGlow {
  0%,
  100% {
    box-shadow: 0 0 30px -10px rgba(255, 207, 63, 0.55);
  }
  40% {
    box-shadow: 0 0 46px 2px rgba(255, 207, 63, 0.9);
    transform: scale(1.02);
  }
}
/* Variación reciente */
.lb__var {
  font-size: 11px;
  font-weight: 800;
  margin-left: 8px;
}
.lb__var--up {
  color: var(--green);
}
.lb__var--down {
  color: var(--red);
}

/* --------------------------- Stat cards (dashboard) ---------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--stroke);
}
.stat--wide {
  grid-column: 1 / -1;
}
.stat__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  margin-top: 8px;
  line-height: 1;
}
.stat__value small {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 600;
}
.stat__sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
  font-weight: 600;
}
/* Barra de supply */
.supply-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 12px;
}
.supply-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gold-grad);
  transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.supply-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  font-weight: 600;
}

/* ------------------------------- Admin ----------------------------------- */
.admin-card {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  margin-bottom: 16px;
}
.admin-card__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
}
.admin-user__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user__name small {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}
.admin-user__badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  transition: transform 0.12s, background 0.2s;
}
.icon-btn:active {
  transform: scale(0.9);
}
.icon-btn--danger {
  color: var(--red);
}

/* Segmented control */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  margin-bottom: 12px;
}
.seg button {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
}
.seg button.is-active {
  background: var(--brand);
  color: #fff;
}
.form-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.form-row .field {
  flex: 1;
}
.label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 12px 0 6px;
  display: block;
}

/* Scroll suave y estable en listas largas */
.admin-list::-webkit-scrollbar {
  width: 6px;
}
.admin-list::-webkit-scrollbar-thumb {
  background: var(--stroke-strong);
  border-radius: 3px;
}

/* ========================================================================== */
/* FASE 3 · Juegos, EmmaShop, Apuestas                                        */
/* ========================================================================== */

/* Sub-tabs (dentro de una página) */
.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.subtabs button {
  flex: 1;
  padding: 11px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: background 0.2s, color 0.2s;
}
.subtabs button.is-active {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

/* --------------------------- Cards juego --------------------------------- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gcard {
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(155deg, rgba(139, 47, 255, 0.12), rgba(255, 46, 151, 0.06));
  overflow: hidden;
}
.gcard__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
}
.gcard__emoji {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 14px;
  background: var(--surface-2);
}
.gcard__title {
  flex: 1;
  min-width: 0;
}
.gcard__name {
  font-weight: 700;
  font-size: 16px;
}
.gcard__reward {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
}
.gcard__chev {
  color: var(--text-faint);
  transition: transform 0.3s;
  font-size: 14px;
}
.gcard.is-open .gcard__chev {
  transform: rotate(180deg);
}
.gcard__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.gcard.is-open .gcard__body {
  max-height: 320px;
}
.gcard__inner {
  padding: 0 16px 16px;
  border-top: 1px solid var(--stroke);
  margin-top: 0;
  padding-top: 14px;
}
.gcard__desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}
.gcard__rules {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.5;
}
.gcard__rules b {
  color: var(--text-dim);
}

/* --------------------------- Cards tienda -------------------------------- */
.shop {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.item {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.item--sold {
  opacity: 0.55;
}
.item__emoji {
  font-size: 34px;
  line-height: 1;
}
.item__name {
  font-weight: 700;
  font-size: 15px;
  margin-top: 10px;
}
.item__desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 3px;
  line-height: 1.4;
  flex: 1;
}
.item__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
}
.item__price {
  font-weight: 800;
  font-size: 16px;
  color: var(--gold);
  white-space: nowrap;
}
.item__stock {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}
.item__buy {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  background: var(--gold-grad);
  color: #2a1600;
  transition: transform 0.12s, opacity 0.2s;
}
.item__buy:active {
  transform: scale(0.96);
}
.item__buy:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-faint);
  cursor: not-allowed;
}
.item__sold {
  position: absolute;
  top: 12px;
  right: -30px;
  transform: rotate(38deg);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 34px;
}

/* --------------------------- Apuestas ------------------------------------ */
.bet {
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 14px;
}
.bet__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bet__vs {
  font-weight: 700;
  font-size: 14px;
}
.bet__vs b {
  color: var(--text);
}
.bet__amount {
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
  font-size: 15px;
}
.bet__status {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 8px;
}
.bet__status--pending {
  background: rgba(255, 207, 63, 0.14);
  color: var(--gold);
}
.bet__status--accepted {
  background: rgba(0, 229, 255, 0.14);
  color: var(--cyan);
}
.bet__status--resolved {
  background: rgba(47, 230, 168, 0.14);
  color: var(--green);
}
.bet__status--cancelled {
  background: rgba(255, 84, 112, 0.14);
  color: var(--red);
}
.bet__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bet__actions .btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
}
.bet__resolve {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bet__resolve button {
  flex: 1;
  padding: 10px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
}
.bet__resolve button:active {
  transform: scale(0.96);
}

/* ========================================================================== */
/* FASE 4 · Logros / Achievements                                             */
/* ========================================================================== */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.ach {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 16px 14px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.3s;
}
.ach--locked {
  opacity: 0.72;
}
.ach--unlocked {
  border-color: var(--rar, var(--violet));
  box-shadow: 0 0 26px -12px var(--rar, var(--violet));
}
.ach__badge {
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--rar, var(--stroke-strong));
}
.ach--locked .ach__badge {
  filter: grayscale(1) brightness(0.6);
  border-color: var(--stroke);
}
.ach__name {
  font-weight: 700;
  font-size: 14px;
}
.ach__cond {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.35;
  min-height: 28px;
}
.ach__rar {
  display: inline-block;
  margin-top: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--rar, var(--text-faint));
  background: color-mix(in srgb, var(--rar, #888) 14%, transparent);
}
.ach__done {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 14px;
  color: var(--green);
}

/* Resumen de progreso */
.ach-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--stroke);
  margin-bottom: 16px;
}
.ach-progress__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
}
.ach-progress__bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ach-progress__fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ---------------- Overlay de desbloqueo (móvil) ------------------------- */
.ach-overlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 6, 15, 0.82);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.ach-overlay--on {
  opacity: 1;
  pointer-events: auto;
}
.ach-pop {
  text-align: center;
  transform: scale(0.7);
  transition: transform 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
  max-width: 340px;
}
.ach-overlay--on .ach-pop {
  transform: scale(1);
}
.ach-pop__kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.ach-pop__badge {
  width: 130px;
  height: 130px;
  margin: 20px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 66px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.12), transparent 70%);
  border: 3px solid var(--rar, var(--gold));
  box-shadow: 0 0 60px -6px var(--rar, var(--gold));
  animation: achSpin 0.8s ease, achFloat 3s ease-in-out infinite 0.8s;
}
.ach-pop__name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
}
.ach-pop__rar {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--rar, var(--gold));
  background: color-mix(in srgb, var(--rar, #ffcf3f) 16%, transparent);
}
.ach-pop__msg {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-dim);
  font-style: italic;
}
@keyframes achSpin {
  from {
    transform: rotate(-25deg) scale(0.4);
    opacity: 0;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}
@keyframes achFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Confeti / partículas ligeras reutilizables */
.spark {
  position: fixed;
  z-index: 9750;
  pointer-events: none;
  font-size: 18px;
  animation: sparkfly 1.2s ease-out forwards;
}
@keyframes sparkfly {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot));
    opacity: 0;
  }
}
