/* ══════════════════════════════════════════════════════════════
   Sorteo Ganadores — Tómbola digital
   Paleta heredada del plugin de venta: azul lasallista + dorado.
   ══════════════════════════════════════════════════════════════ */

.sg-app {
  --sg-azul:     #002570;
  --sg-azul-c:   #001443;
  --sg-azul-mid: #0038a8;
  --sg-oro:      #C8A951;
  --sg-oro-cl:   #f5e6b8;
  --sg-verde:    #059669;
  --sg-rojo:     #dc2626;
  --sg-txt:      #0d1b3e;
  --sg-txt-sub:  #4a5578;
  --sg-linea:    rgba(200,169,81,.28);
  --sg-r:        14px;
  --sg-dh:       96px;   /* alto de un dígito */

  position: relative;
  margin: 0 auto 2rem;
  max-width: 980px;
  color: var(--sg-txt);
  font-family: inherit;
}

.sg-app *,
.sg-app *::before,
.sg-app *::after { box-sizing: border-box; }

/* ── Marco ───────────────────────────────────────────────── */

.sg-marco {
  position: relative;
  z-index: 1;
  padding: 2.4rem 1.6rem 2rem;
  border-radius: var(--sg-r);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(0,56,168,.55) 0%, transparent 60%),
    linear-gradient(160deg, var(--sg-azul) 0%, var(--sg-azul-c) 100%);
  box-shadow: 0 18px 50px rgba(0,20,67,.28);
  overflow: hidden;
}

.sg-marco::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--sg-linea);
  border-radius: calc(var(--sg-r) - 4px);
  pointer-events: none;
}

/* ── Cabecera ────────────────────────────────────────────── */

.sg-head { text-align: center; margin-bottom: 1.8rem; }

/* Logotipos: ULSA 35 años arriba, Sorteo Lasallista como lockup principal. */

.sg-logo {
  display: block;
  margin: 0 auto;
  height: auto;
  max-width: 100%;
}

.sg-logo--ulsa {
  width: clamp(190px, 30%, 300px);
  margin-bottom: 1.25rem;
}

.sg-logo--sorteo {
  width: clamp(200px, 42%, 340px);
  margin-bottom: .7rem;
}

.sg-titulo--oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sg-eyebrow {
  margin: 0 0 .35rem;
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sg-oro);
}

.sg-titulo {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.sg-sub {
  margin: .5rem 0 0;
  color: rgba(255,255,255,.72);
  font-size: .92rem;
}

.sg-sub #sg-participantes { color: var(--sg-oro-cl); font-weight: 700; }

/* ── Escena: el premio y la cinta de dígitos ─────────────── */

.sg-escena { text-align: center; }

.sg-premio-actual {
  margin: 0 0 .9rem;
  min-height: 1.6em;
  color: var(--sg-oro);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sg-reel {
  display: inline-flex;
  gap: .4rem;
  padding: .55rem;
  border-radius: 12px;
  background: rgba(0,0,0,.28);
  box-shadow: inset 0 2px 14px rgba(0,0,0,.5);
}

.sg-digito {
  position: relative;
  width: calc(var(--sg-dh) * .68);
  height: var(--sg-dh);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf6 0%, #efe6cc 100%);
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.18), inset 0 6px 10px rgba(255,255,255,.9);
}

/* Sombra superior e inferior: da sensación de tambor girando */
.sg-digito::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,20,67,.32) 0%, transparent 26%, transparent 74%, rgba(0,20,67,.32) 100%);
}

.sg-cinta {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.sg-cinta span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--sg-dh);
  flex: 0 0 var(--sg-dh);
  font-family: ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: calc(var(--sg-dh) * .62);
  font-weight: 700;
  color: var(--sg-azul);
  font-variant-numeric: tabular-nums;
}

.sg-app.is-girando .sg-digito { box-shadow: inset 0 -6px 12px rgba(0,0,0,.28), 0 0 0 1px var(--sg-linea); }

.sg-app.is-revelado .sg-cinta span { color: var(--sg-azul-c); }

.sg-app.is-revelado .sg-digito {
  background: linear-gradient(180deg, #fff7dd 0%, var(--sg-oro-cl) 100%);
  box-shadow: 0 0 0 2px var(--sg-oro), 0 8px 26px rgba(200,169,81,.35);
}

.sg-ganador-datos {
  margin: 1rem 0 0;
  min-height: 1.4em;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 600;
}

.sg-ganador-datos small {
  display: block;
  margin-top: .15rem;
  font-weight: 400;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
}

/* ── Panel de control (solo administradores) ─────────────── */

.sg-panel {
  margin-top: 1.8rem;
  padding: 1.1rem;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

.sg-panel__fila {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-bottom: .8rem;
}

.sg-panel__fila--acciones {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.sg-campo { display: flex; flex-direction: column; gap: .28rem; flex: 0 1 auto; }
.sg-campo--ancho { flex: 1 1 240px; }

.sg-campo > span {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
}

.sg-campo input,
.sg-campo select {
  padding: .5rem .6rem;
  min-width: 90px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 7px;
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: .92rem;
}

.sg-campo input:focus,
.sg-campo select:focus {
  outline: 2px solid var(--sg-oro);
  outline-offset: 1px;
}

.sg-campo select option { color: #111; }

.sg-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: rgba(255,255,255,.75);
  font-size: .85rem;
}

.sg-botones { display: flex; flex-wrap: wrap; gap: .5rem; }

.sg-btn {
  padding: .62rem 1.15rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.sg-btn:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.sg-btn:disabled { opacity: .5; cursor: not-allowed; }

.sg-btn--primario {
  border-color: transparent;
  background: linear-gradient(135deg, var(--sg-oro) 0%, #b8933f 100%);
  color: var(--sg-azul-c);
  box-shadow: 0 6px 18px rgba(200,169,81,.34);
}

.sg-btn--primario:hover:not(:disabled) {
  background: linear-gradient(135deg, #d9bb63 0%, var(--sg-oro) 100%);
  transform: translateY(-1px);
}

.sg-mensaje {
  margin: 1rem 0 0;
  min-height: 1.2em;
  text-align: center;
  font-size: .9rem;
  color: #ffd9d9;
}

.sg-mensaje.is-ok { color: var(--sg-oro-cl); }

/* ── Lista de ganadores ──────────────────────────────────── */

.sg-lista {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}

.sg-lista:empty { margin: 0; }

.sg-item {
  padding: .85rem 1.1rem;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border-left: 3px solid var(--sg-oro);
  animation: sg-entra .45s cubic-bezier(.2,.8,.3,1) both;
}

@keyframes sg-entra {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.sg-item__etiqueta {
  margin: 0 0 .2rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.sg-item__fila {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
}

.sg-item__folio {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
}

/* Separador vertical entre folio, lugar y premio */
.sg-item__lugar,
.sg-item__premio { position: relative; padding-left: .9rem; }

.sg-item__lugar::before,
.sg-item__premio::before {
  content: "";
  position: absolute;
  left: 0;
  top: .1em;
  bottom: .1em;
  width: 1px;
  background: rgba(255,255,255,.22);
}

.sg-item__lugar {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sg-oro);
}

.sg-item__premio {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.sg-item__persona {
  margin: .35rem 0 0;
  font-size: .9rem;
  color: rgba(255,255,255,.8);
}

.sg-item__persona small {
  display: block;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
}

.sg-lista-titulo {
  margin: 1.8rem 0 .2rem;
  color: rgba(255,255,255,.9);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: center;
}

.sg-progreso {
  margin: 0;
  flex: 1 1 200px;
  color: var(--sg-oro-cl);
  font-size: .88rem;
  font-weight: 600;
}

/* ── Pie con el certificado ──────────────────────────────── */

.sg-cert {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.14);
  text-align: center;
}

.sg-cert__linea { margin: 0; color: rgba(255,255,255,.78); font-size: .85rem; }
.sg-cert__linea a { color: var(--sg-oro-cl); }

.sg-cert__hash {
  margin: .35rem 0 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .68rem;
  color: rgba(255,255,255,.4);
  word-break: break-all;
}

/* ── Confeti ─────────────────────────────────────────────── */

.sg-confeti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* ══ Bloques fuera del marco: tablas y certificado ═══════════ */

.sg-tabla {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: .95rem;
}

.sg-tabla th,
.sg-tabla td {
  padding: .7rem .8rem;
  text-align: left;
  border-bottom: 1px solid #e4e9f4;
  vertical-align: top;
}

.sg-tabla thead th {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a5578;
  background: #f3f6fc;
}

.sg-tabla .sg-detalle {
  display: block;
  margin-top: .15rem;
  font-size: .8rem;
  color: #6b7694;
}

.sg-folio-celda {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  color: #002570;
}

.sg-fila-suplente { color: #6b7694; }

.sg-tabla--datos th { width: 32%; background: #f8fafd; font-weight: 600; }
.sg-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; word-break: break-all; }

/* ── Certificado público ─────────────────────────────────── */

.sg-certificado { max-width: 820px; margin: 0 auto 2rem; }

.sg-buscador { margin-bottom: 1.4rem; }
.sg-buscador label { display: block; margin-bottom: .35rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #4a5578; }
.sg-buscador__fila { display: flex; gap: .5rem; flex-wrap: wrap; }

.sg-buscador input {
  flex: 1 1 220px;
  padding: .65rem .8rem;
  border: 1px solid #ccd6ea;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sg-buscador .sg-btn--primario { color: #001443; }

.sg-veredicto {
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.4rem;
  border-radius: 12px;
  border-left: 4px solid #ccd6ea;
  background: #f3f6fc;
}

.sg-veredicto h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.sg-veredicto p, .sg-veredicto ul { margin: 0; font-size: .92rem; color: #3d4867; }
.sg-veredicto ul { padding-left: 1.1rem; }

.sg-veredicto--bien { border-left-color: #059669; background: #ecfdf5; }
.sg-veredicto--bien h3 { color: #046c50; }
.sg-veredicto--mal { border-left-color: #dc2626; background: #fef2f2; }
.sg-veredicto--mal h3 { color: #b21c1c; }

.sg-cert-h { margin: 1.6rem 0 .4rem; font-size: 1.05rem; color: #002570; }
.sg-cert-ayuda { color: #4a5578; font-size: .92rem; }

.sg-detalles { margin-top: 1.2rem; font-size: .9rem; color: #4a5578; }
.sg-detalles summary { cursor: pointer; font-weight: 600; color: #002570; }
.sg-detalles p { margin-top: .5rem; }

.sg-aviso-vacio {
  padding: 1.2rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: #f3f6fc;
  border: 1px dashed #ccd6ea;
  text-align: center;
  color: #4a5578;
}

.sg-aviso-vacio p { margin: .2rem 0; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 720px) {
  .sg-app { --sg-dh: 64px; }
  .sg-marco { padding: 1.8rem 1rem 1.5rem; }
  .sg-logo--ulsa   { width: min(72%, 240px); margin-bottom: .9rem; }
  .sg-logo--sorteo { width: min(78%, 260px); }
  .sg-reel { gap: .28rem; padding: .4rem; }
  .sg-panel__fila--acciones { flex-direction: column; align-items: stretch; gap: .7rem; }
  .sg-botones { justify-content: stretch; }
  .sg-botones .sg-btn { flex: 1 1 auto; }
  .sg-item__folio { font-size: 1.25rem; }
  .sg-item__lugar,
  .sg-item__premio { padding-left: 0; }
  .sg-item__lugar::before,
  .sg-item__premio::before { display: none; }
  .sg-item__fila { gap: .2rem .8rem; }
}

@media (max-width: 420px) {
  .sg-app { --sg-dh: 52px; }
}

/* ── Accesibilidad ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .sg-cinta { transition: none !important; }
  .sg-item { animation: none; }
  .sg-confeti { display: none; }
}

.sg-app :focus-visible { outline: 2px solid var(--sg-oro); outline-offset: 2px; }
