/* TapStars — estilo de marca: blanco, negro y amarillo, como el Instagram */
/* Tipografías alojadas en el sitio: Anton (títulos), Outfit (marca y botones), Inter (texto) */
@font-face { font-family: Anton; font-weight: 400; font-display: swap; src: url("fonts/anton-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Outfit; font-weight: 500; font-display: swap; src: url("fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Outfit; font-weight: 600; font-display: swap; src: url("fonts/outfit-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Outfit; font-weight: 700; font-display: swap; src: url("fonts/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: Outfit; font-weight: 800; font-display: swap; src: url("fonts/outfit-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  /* Marca TapStars: blanco, negro y amarillo (siempre modo claro) */
  color-scheme: light;
  --negro: #111111;
  --amarillo: #FBBC05;
  --amarillo-2: #FFD54A;
  --amarillo-suave: #FFF6D6;
  --blanco: #FFFFFF;
  --ok: #129b5f;
  --err: #d93a2f;
  --radio: 16px;

  --fondo: #FFFFFF;
  --campo: #F6F6F3;
  --texto: #111111;
  --tarjeta: #FFFFFF;
  --linea: #E6E6E1;
  --gris: #66665f;
  --borde: #111111;
  --sombra: #111111;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, .outfit { font-family: Outfit, Inter, sans-serif; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 .25rem; line-height: 1.1; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .75rem; }
p { line-height: 1.5; }
a { color: inherit; }

/* Títulos grandes estilo posteo: mayúscula, condensada, con bloque amarillo */
.titular {
  font-family: Anton, Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.14;
  font-size: 2.6rem;
  margin: 0;
}
.resaltar {
  background: var(--amarillo);
  color: var(--negro);
  padding: .02em .18em 0;
  line-height: 1.1;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.contenedor { max-width: 480px; margin: 0 auto; padding: 20px 16px 48px; }
.contenedor.ancho { max-width: 1040px; }

.caja {
  background: var(--tarjeta);
  border: 2px solid var(--borde);
  border-radius: var(--radio);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 4px 4px 0 var(--sombra);
}

label { display: block; font-size: .95rem; font-weight: 600; margin: 14px 0 6px; }
input, select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* evita zoom en iPhone */
  padding: 13px 14px;
  border-radius: 12px;
  border: 2px solid var(--linea);
  background: var(--campo);
  color: var(--texto);
  outline: none;
}
input:focus, select:focus { border-color: var(--amarillo); background: var(--tarjeta); }
input[type="color"] { padding: 4px; height: 48px; }
.ayuda { font-size: .9rem; color: var(--gris); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  font-family: Outfit, Inter, sans-serif; font-weight: 700; font-size: 1.12rem;
  padding: 15px 18px;
  border-radius: 14px;
  border: 2px solid var(--negro);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--negro);
  transition: transform .08s ease, box-shadow .08s ease, opacity .15s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--negro); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-amarillo { background: var(--amarillo); color: var(--negro); }
.btn-negro { background: var(--negro); color: var(--blanco); box-shadow: 3px 3px 0 var(--amarillo); }
.btn-negro:active { box-shadow: 0 0 0 var(--amarillo); }
.btn-linea { background: var(--tarjeta); color: var(--texto); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-chico { width: auto; padding: 9px 14px; font-size: .95rem; border-radius: 10px; box-shadow: 2px 2px 0 var(--negro); }
.fila { display: flex; gap: 10px; }
.fila > * { flex: 1; }
.pila > * + * { margin-top: 12px; }

.error { color: var(--err); font-size: .98rem; margin-top: 10px; min-height: 1.2em; }
.oculto { display: none !important; }
.centro { text-align: center; }
.gris { color: var(--gris); }
.chico { font-size: .93rem; }

/* ───── Logo ───── */
.ts-icono { display: inline-block; width: 1em; height: 1em; line-height: 0; }
.ts-icono svg { width: 100%; height: 100%; display: block; }
.ts-marca { display: inline-flex; align-items: center; gap: .32em; font-family: Outfit, sans-serif; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.ts-marca em { font-style: normal; color: var(--amarillo); }
.ts-lema { font-family: Outfit, sans-serif; font-size: .74rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--gris); }

/* Sellos */
.sellos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 18px 0; }
.sello {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed currentColor; opacity: .45;
  font-family: Outfit, sans-serif; font-weight: 700; font-size: .9rem;
}
.sello.lleno { opacity: 1; border-style: solid; color: var(--negro); font-size: 1.2rem; animation: pop .35s ease; }
.sello svg { width: 58%; height: 58%; display: block; }
.sello-logo { width: 72%; height: 72%; object-fit: contain; border-radius: 50%; background: #fff; }
.mini-barra { display: inline-block; width: 64px; height: 7px; border-radius: 99px; background: var(--linea); overflow: hidden; vertical-align: middle; }
.mini-barra span { display: block; height: 100%; background: var(--amarillo); }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

.qr { background: #fff; border-radius: 16px; padding: 12px; width: 220px; margin: 0 auto; border: 2px solid var(--negro); }
.qr svg { display: block; width: 100%; height: auto; }

.marca { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: .9rem; color: var(--gris); margin-top: 28px; }
.marca .ts-marca { font-size: 1.1rem; color: var(--texto); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px);
  background: var(--negro); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; transition: all .25s; z-index: 50; max-width: calc(100% - 32px);
  border: 2px solid var(--amarillo);
  /* invisible no puede tapar los botones de abajo (antes, ya oculto, seguía agarrando los toques) */
  pointer-events: none; visibility: hidden;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); visibility: visible; }
.toast.err { background: var(--err); border-color: var(--err); }
.toast.ok { background: var(--negro); }

/* Barra superior negra (panel/admin) */
.barra {
  background: var(--negro); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 4px solid var(--amarillo);
}
.barra .ts-marca { font-size: 1.25rem; color: #fff; }
.barra .sub { font-family: Outfit, sans-serif; font-size: .88rem; color: #bdbdb5; font-weight: 500; margin-left: 4px; }
.barra button { background: transparent; color: #fff; border: 2px solid #3a3a3a; border-radius: 10px; padding: 7px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi { background: var(--tarjeta); border: 2px solid var(--borde); border-radius: 14px; padding: 14px; box-shadow: 3px 3px 0 var(--sombra); }
.kpi .n { font-family: Anton, Impact, sans-serif; font-size: 2rem; line-height: 1; }
.kpi .l { font-size: .86rem; color: var(--gris); margin-top: 6px; font-weight: 500; }
.kpi:first-child { background: var(--amarillo); color: var(--negro); }
.kpi:first-child .l { color: var(--negro); opacity: .75; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--linea); font-size: 1rem; }
.lista li:last-child { border-bottom: none; }
.pill { font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--fondo); color: var(--texto); border: 1.5px solid var(--linea); white-space: nowrap; }
.pill.oro { background: var(--amarillo); color: var(--negro); border-color: var(--amarillo); }

#lector { width: 100%; border-radius: 16px; overflow: hidden; background: #000; min-height: 260px; border: 2px solid var(--negro); }
#lector video { border-radius: 14px; }

.tabla { width: 100%; border-collapse: collapse; font-size: .96rem; }
.tabla th, .tabla td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
.scroll-x { overflow-x: auto; }

dialog { border: 2px solid var(--negro); border-radius: 18px; padding: 0; width: min(560px, calc(100% - 24px)); background: var(--tarjeta); color: var(--texto); box-shadow: 6px 6px 0 var(--amarillo); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }

/* Catálogo de premios (modo puntos) */
.premios-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.premios-lista li { background: rgba(255,255,255,.92); color: #111; border-radius: 14px; padding: 12px 14px; border: 1.5px solid rgba(0,0,0,.08); }
.premios-lista li.listo { border: 2px solid #111; box-shadow: 3px 3px 0 #111; }
.premios-lista .pl-fila { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.premios-lista .pl-pts { font-family: Outfit, sans-serif; font-weight: 800; white-space: nowrap; }
.premios-lista .pl-desc { font-size: .85rem; color: #66665f; margin-top: 2px; }
.premios-lista .pl-barra { height: 9px; border-radius: 99px; background: #ecece6; overflow: hidden; margin-top: 8px; }
.premios-lista .pl-barra span { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.premios-lista .pl-estado { font-size: .82rem; font-weight: 600; margin-top: 6px; color: #3d3d38; }
.premios-lista li.listo .pl-estado { color: #111; }

/* Vista previa de la tarjeta en Wallet (vistaWallet en comun.js) */
.wl { border-radius: 16px; padding: 12px 0 0; max-width: 360px; margin: 10px auto 0; box-shadow: 0 10px 30px rgba(0,0,0,.28); overflow: hidden; font-family: -apple-system, "SF Pro Text", Inter, sans-serif; }
.wl-cab { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; min-height: 30px; }
.wl-cab img { height: 28px; width: auto; max-width: 110px; object-fit: contain; border-radius: 6px; }
.wl-nom { flex: 1; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-cab .der, .wl-campos .der { text-align: right; margin-left: auto; }
.wl small { display: block; font-size: .58rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.wl b { display: block; font-size: .92rem; font-weight: 500; }
.wl-tira svg { display: block; width: 100%; height: auto; }
.wl-campos { display: flex; gap: 10px; padding: 8px 14px 0; }
.wl-qr { background: transparent; text-align: center; padding: 14px 0 16px; }
.wl-qrcaja { display: inline-block; background: #fff; border-radius: 8px; padding: 6px; }
.wl-qrcaja svg { width: 96px; height: 96px; display: block; }
.wl-qr small { margin-top: 4px; font-size: .7rem; letter-spacing: 0; opacity: .8; }
.vista-tira svg { display: block; width: 100%; height: auto; border-radius: 14px; }
