:root {
  --ink: #0b1020;
  --ink-2: #141a2e;
  --card: #1b2340;
  --line: #2a3358;
  --text: #eef1fb;
  --muted: #97a0c4;
  --pink: #e08904;     /* acento de marca (naranja) */
  --teal: #00b4a0;
  --gold: #f6c945;
  --ghost: #2c3357;    /* slot vacio */
  --radius: 14px;
  --maxw: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 84px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- splash (arranque) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  background: #000;
  opacity: 1; transition: opacity .5s ease;
}
.splash.splash-hide { opacity: 0; pointer-events: none; }
.splash-logo {
  width: clamp(240px, 72vw, 360px); height: auto;
}
.splash-loading {
  font-family: 'Archivo', sans-serif; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; font-size: 13px; color: rgba(255,255,255,.78);
  animation: loadingPulse 1.4s ease-in-out infinite;
}
@keyframes loadingPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
/* Logo en la pantalla de login / crear cuenta */
.auth-logo {
  display: block; width: 96px; height: auto; margin: 4px auto 10px;
  border-radius: 22%; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.brand.center { text-align: center; }
.splash-mark {
  font-family: 'Archivo', sans-serif; font-weight: 900; letter-spacing: -.02em;
  font-size: clamp(30px, 9vw, 56px); line-height: 1; color: var(--pink);
}
.splash-mark b { color: var(--text); }
.splash-sub { color: var(--muted); font-size: 15px; letter-spacing: .01em; }

/* Encabezado de Grupo (A-L) en el grid del album */
.group-title {
  font-family: 'Archivo', sans-serif; font-weight: 900; letter-spacing: .02em;
  font-size: 13px; text-transform: uppercase; color: var(--pink);
  margin: 22px 2px 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: .9; }
}
/* Respeta a quien prefiere menos movimiento: sin pulso ni fade. */
@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; }
  .splash-loading { animation: none; opacity: .78; }
}

/* ---------- shell ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 16px; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, var(--ink), rgba(11,16,32,.92));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.brand {
  font-family: 'Archivo', sans-serif; font-weight: 900; letter-spacing: -.02em;
  font-size: 20px; line-height: 1;
}
.brand b { color: var(--pink); }
.spacer { flex: 1; }
.linklike { background: none; border: 0; color: var(--muted); font-size: 14px; }

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(20,26,46,.96); border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; max-width: 140px; background: none; border: 0; color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 6px 4px; border-radius: 10px;
}
.tab .ico { display: block; font-size: 18px; margin-bottom: 2px; }
.tab.active { color: var(--text); background: var(--card); }

/* ---------- cards / generic ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
h1 { font-family: 'Archivo'; font-weight: 900; letter-spacing: -.02em; font-size: 26px; margin: 4px 0 14px; }
h2 { font-family: 'Archivo'; font-weight: 800; font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }

input {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 16px; margin: 6px 0;
}
input:focus { outline: 2px solid var(--pink); border-color: transparent; }
.btn {
  background: var(--pink); color: #fff; border: 0; padding: 13px 16px;
  border-radius: 11px; font-weight: 700; font-size: 15px; width: 100%;
}
.btn.secondary { background: var(--ink-2); color: var(--text); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 9px 14px; font-size: 13px; }
.err { color: #ff7a9c; font-size: 14px; margin: 8px 0; min-height: 18px; }
.ok { color: var(--teal); font-size: 14px; margin: 8px 0; }
.center { text-align: center; }
a.inlink { color: var(--pink); }

/* ---------- auth ---------- */
.auth { max-width: 420px; margin: 8vh auto; }
.auth .brand { font-size: 30px; text-align: center; margin-bottom: 6px; }
.switcher { display: flex; gap: 8px; margin: 14px 0; }
.switcher button { flex: 1; background: var(--ink-2); border: 1px solid var(--line); color: var(--muted); padding: 10px; border-radius: 10px; font-weight: 600; }
.switcher button.active { color: var(--text); border-color: var(--pink); }

/* ---------- dashboard ---------- */
.hero {
  background: radial-gradient(120% 120% at 100% 0%, rgba(229,0,125,.25), transparent 55%), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.bignum { font-family: 'Archivo'; font-weight: 900; font-size: 56px; line-height: .9; letter-spacing: -.03em; }
.bignum span { font-size: 22px; color: var(--muted); }
.pcts { display: flex; gap: 10px; margin-top: 14px; }
.pct { flex: 1; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.pct .k { font-size: 12px; color: var(--muted); }
.pct .v { font-family: 'Archivo'; font-weight: 800; font-size: 22px; }
.pct.crack .v { color: var(--gold); }
.pct.esp .v { color: var(--teal); }

.bar { height: 8px; background: var(--ink-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--pink); border-radius: 999px; }
.teamrow { padding: 10px 0; border-bottom: 1px solid var(--line); }
.teamrow:last-child { border-bottom: 0; }
.teamrow .top { display: flex; justify-content: space-between; font-size: 14px; }
.teamrow .top b { font-weight: 600; }
.teamrow .top .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; color: var(--muted); background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- album grid (signature) ---------- */
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 18px 2px 8px; }
.section-title h2 { margin: 0; }
.section-title .n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.slot {
  position: relative; aspect-ratio: 3/4; border-radius: 12px;
  border: 1px dashed var(--ghost); background: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px; text-align: center; user-select: none; overflow: hidden;
  transition: transform .12s ease;
}
.slot .num { font-family: 'Archivo'; font-weight: 900; font-size: 26px; line-height: 1; color: var(--ghost); }
.slot .nm { font-size: 10px; color: var(--muted); margin-top: 4px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .code { position: absolute; top: 5px; left: 7px; font-size: 9px; color: var(--ghost); font-weight: 600; }

/* obtenido: se enciende con el color de la seleccion (--c via inline style) */
.slot.owned {
  border-style: solid; border-color: transparent;
  background: linear-gradient(160deg, var(--c, var(--pink)), color-mix(in srgb, var(--c, var(--pink)) 55%, #000));
}
.slot.owned .num { color: #fff; }
.slot.owned .nm { color: rgba(255,255,255,.92); }
.slot.owned .code { color: rgba(255,255,255,.7); }
.slot.pop { transform: scale(1.06); }

/* especial / crack: brillo holografico (la firma del diseno) */
.slot.shine::after {
  content: ''; position: absolute; inset: 0; mix-blend-mode: overlay; opacity: .55;
  background: conic-gradient(from 0deg, #ff5adb, #5ad1ff, #ffe45a, #7dff9b, #ff5adb);
}
.slot .badge {
  position: absolute; bottom: 5px; right: 6px; font-size: 11px; font-weight: 800;
  background: rgba(0,0,0,.45); color: #fff; border-radius: 999px; padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}

/* ---------- listas ---------- */
.list .item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .pill { font-family: 'Archivo'; font-weight: 800; font-size: 13px; min-width: 52px; text-align: center;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 0; }
.list .item .nm { flex: 1; font-size: 14px; }
.list .item .team { font-size: 12px; color: var(--muted); }
.list .item .rep { font-family: 'Archivo'; font-weight: 800; color: var(--gold); }

/* ---------- scan ---------- */
.scanbox { aspect-ratio: 4/3; background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- album list / create ---------- */
.album-card { display: flex; align-items: center; gap: 12px; }
.album-card .glyph { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-family: 'Archivo'; font-weight: 900; background: var(--ink-2); border: 1px solid var(--line); }
.album-card .meta { flex: 1; }
.album-card .meta .nm { font-weight: 700; }
.album-card .meta .sub { font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; color: var(--teal); border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent); border-radius: 999px; padding: 2px 8px; }

/* ---------- sheet / toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.sheet-card { background: var(--card); border-top-left-radius: 18px; border-top-right-radius: 18px;
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 14px; }
.sheet-title { font-weight: 700; margin: 6px 4px 12px; }
.sheet-btn { width: 100%; text-align: left; background: var(--ink-2); border: 1px solid var(--line); color: var(--text);
  padding: 14px; border-radius: 12px; font-size: 15px; margin-bottom: 8px; }
.sheet-btn.danger { color: #ff7a9c; }
.sheet-btn.ghost { background: none; border: 0; color: var(--muted); text-align: center; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--teal); color: #042; font-weight: 700; padding: 10px 16px; border-radius: 999px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { .slot { transition: none; } .slot.pop { transform: none; } }

/* ---------- banner de permisos (notificaciones) ---------- */
.banner { display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--pink);
  border-radius: 12px; padding: 12px 14px; }
.banner .bt { flex: 1; }
.banner .bt .t { font-weight: 700; font-size: 14px; }
.banner .bt .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.banner .x { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
