/* Layout: azul tico (cielo profundo) con el rojo de la bandera, color de cada asociación para acciones,
   amarillo bola solo para lo que el usuario escoge. Tipografía redondeada y grande. */
:root {
  --night: #0b2f66;
  --night-2: #123d7d;
  --night-3: #1b4d97;
  --line: rgba(186, 220, 255, .16);
  --line-strong: rgba(186, 220, 255, .32);
  --ink: #f3f5fc;
  --muted: #aac6ea;
  --red: #e5132f;
  --red-deep: #b30c24;
  --ball: #d7f448;
  --ball-ink: #1b2400;
  --amber: #ffb547;
  --green: #3fd68b;
  --paper: #ffffff;
  --paper-ink: #0b2a5a;

  --f-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --f-body: "Barlow", "Helvetica Neue", Arial, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 18px/1.55 var(--f-body);
  font-stretch: 108%;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ball); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 700px) { .wrap { padding-inline: 28px; } }

/* ── Tipografía ── */
.display {
  font-family: var(--f-display); font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0;
}
.eyebrow {
  font-family: var(--f-display); font-stretch: 125%;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 16px;
  color: #ff8a98;
}
.muted { color: var(--muted); }
.num { font-family: var(--f-display); font-stretch: 125%; font-weight: 700; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand .logo { background: var(--paper); border-radius: 10px; padding: 4px 6px; height: 44px; width: auto; flex: none; }
.brand .logo img { height: 36px; width: auto; }
.brand > span:last-child { min-width: 0; }
.brand b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--f-display); font-stretch: 125%; font-weight: 600; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
@media (max-width: 520px) { .brand b { font-size: 16px; } .brand small { font-size: 13px; } .brand .logo { height: 38px; } .brand .logo img { height: 30px; } }
.brand small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.topbar .spacer { flex: 1; }
.demo-badge {
  font-size: 14px; font-weight: 600; color: var(--ball-ink); background: var(--ball);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--red); display: grid; place-items: center; font-family: var(--f-display); font-stretch: 125%; font-weight: 700; font-size: 20px; color: #fff; flex: none; }

/* ── Cantidad al azar ── */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; height: 44px; overflow: hidden; }
.stepper button { all: unset; cursor: pointer; width: 40px; height: 100%; display: grid; place-items: center; font-size: 20px; font-weight: 600; }
.stepper button:hover { background: rgba(255, 255, 255, .08); }
.stepper button:focus-visible { outline: 2px solid var(--ball); outline-offset: -2px; }
.stepper input { width: 40px; height: 100%; border: 0; background: transparent; text-align: center; font-family: var(--f-display); font-stretch: 115%; font-weight: 700; font-size: 17px; color: var(--ink); padding: 0; }
.stepper input:focus { outline: none; background: rgba(255, 255, 255, .06); }
.rand { display: inline-flex; gap: 8px; align-items: center; }

/* ── Montos ── */
.money { color: var(--ball); font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.money .cur { font-family: "Helvetica Neue", Arial, sans-serif; font-stretch: normal; font-weight: 700; margin-right: .08em; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn { text-transform: uppercase; letter-spacing: .07em; font-family: var(--f-display); font-stretch: 115%; font-weight: 700; font-size: 15px; }
.btn:hover { background: var(--night-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn-ball { background: var(--ball); border-color: var(--ball); color: var(--ball-ink); }
.btn-ball:hover { background: #c6e33a; }
.btn-ghost { border-color: transparent; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 13px; }
.btn-block { width: 100%; }
.icon { width: 20px; height: 20px; flex: none; }

/* ── Campos ── */
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.field .hint { font-size: 15px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 54px; padding: 12px 16px;
  background: var(--night); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 18px;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ball); box-shadow: 0 0 0 3px rgba(215, 244, 72, .18); }
.input.invalid { border-color: var(--red); }
.err { color: #ff7d8f; font-size: 15px; }

/* ── Pills de estado ── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pagado { color: var(--green); background: rgba(63, 214, 139, .12); }
.pill.revision { color: var(--amber); background: rgba(255, 181, 71, .12); }
.pill.apartado { color: #ff8a98; background: rgba(255, 107, 125, .14); }
.pill.activa { color: var(--ball); background: rgba(215, 244, 72, .12); }
.pill.borrador { color: var(--muted); background: rgba(154, 168, 204, .12); }
.pill.cerrada { color: var(--amber); background: rgba(255, 181, 71, .12); }
.pill.finalizada { color: #ff8b9b; background: rgba(229, 19, 47, .14); }

/* ── Grilla de números ── */
.grid-nums {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
}
.n {
  position: relative; aspect-ratio: 1; min-height: 48px;
  display: grid; place-items: center;
  border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .07);
  font-family: var(--f-display); font-stretch: 125%; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none;
  transition: transform .12s, background .12s, border-color .12s;
}
.n:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.n:disabled { cursor: not-allowed; }
.n.taken { background: transparent; color: rgba(170, 198, 234, .32); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(154, 168, 204, .3); }
.n.sel, .n.sel:hover:not(:disabled) {
  background: var(--ball); color: var(--ball-ink); border-color: var(--ball);
  transform: scale(1.04);
  box-shadow: 0 6px 18px -6px rgba(215, 244, 72, .7);
}
.n.mine { box-shadow: inset 0 0 0 2px var(--ball); color: var(--ball); background: transparent; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .n, .btn { transition: none; } .n.sel { transform: none; } }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 15px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); display: inline-block; }
.legend i.sel { background: var(--ball); border-color: var(--ball); }
.legend i.taken { background: transparent; box-shadow: inset 0 0 0 1px rgba(170, 198, 234, .4); }
.legend i.mine { background: transparent; box-shadow: inset 0 0 0 2px var(--ball); }

/* ── Diálogos ── */
dialog.sheet {
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--night-2); color: var(--ink);
  padding: 0; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px);
}
dialog.sheet::backdrop { background: rgba(4, 18, 44, .7); backdrop-filter: blur(3px); }
@media (max-width: 600px) {
  dialog.sheet { width: 100%; max-width: 100%; position: fixed; inset: auto 0 0 0; margin: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92%; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.sheet-head h2 { flex: 1; font-size: 30px; }
.sheet-body { padding: 8px 20px 20px; display: grid; gap: 16px; }
.sheet-foot { padding: 14px 20px 20px; display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
.x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--paper); color: var(--paper-ink); font-weight: 600;
  padding: 12px 18px; border-radius: 999px; z-index: 100; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  max-width: calc(100% - 32px); text-align: center;
}

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--f-display); font-stretch: 125%; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums;
  padding: 6px 12px; border-radius: 999px; background: var(--ball); color: var(--ball-ink);
}
.chip.outline { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Etiquetas en mayúscula, estilo marcador deportivo */
.label-caps, .kpi small, .tab, .fact small, .prize small, .pill, .sinpe .lbl, .ticket .lbl, .field > label, .field > span:first-child, .org-title + .rifa-list .pill {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 12px;
}
.tab { font-size: 13px; }
body:has(.cart.show) .toast, body:has(.assign-bar:not([hidden])) .toast { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }


/* ── Tipografía deportiva: Big Shoulders para todo lo que se destaca, Barlow para leer ── */
.display { text-transform: uppercase; font-weight: 900; line-height: .92; letter-spacing: .005em; }
.hero h1 { font-size: clamp(54px, 13vw, 104px); }
.home-hero h1 { font-size: clamp(60px, 15vw, 124px); }
.block-head h2 { font-size: clamp(40px, 7vw, 60px); }
.sheet-head h2 { font-size: 36px; }
.brand b { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.mark { font-size: 28px; font-weight: 900; }
.fact strong { font-size: 32px; font-weight: 800; line-height: 1; }
.fact strong.price { font-size: 46px; }
.prize b { font-size: 26px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.prize .place { font-size: 54px; font-weight: 900; }
.n { font-size: 28px; font-weight: 900; }
.grid-nums.admin .n { font-size: 24px; }
.chip { font-size: 22px; font-weight: 800; }
.btn { font-size: 19px; font-weight: 800; letter-spacing: .06em; }
.btn-sm { font-size: 16px; }
.money { font-weight: 900; letter-spacing: 0; }
.label-caps, .kpi small, .tab, .fact small, .prize small, .pill, .sinpe .lbl, .ticket .lbl, .field > label, .field > span:first-child, .sol-btn, .sol-sub, footer .foot-links { font-size: 15px; font-weight: 800; letter-spacing: .08em; }
.legend { font-size: 16px; }
.stepper input { font-size: 22px; font-weight: 900; }
.toast { font-family: var(--f-display); font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
