:root {
  --vino: #4d0509; --vino-2: #7a0c12; --rojo: #c8141c; --oro: #d9a93a; --oro-claro: #f6dc8a;
  --amarillo: #ffe600; --crema: #f4f1ea; --tinta: #111; --gris: #6b6660; --verde: #1faa59;
  --borde: #e2dcd0; --sombra: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: #fff; font-family: Poppins, system-ui, sans-serif; line-height: 1.5;
  background: var(--vino) radial-gradient(ellipse at top, var(--vino-2), var(--vino) 70%) fixed;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.boton {
  display: inline-block; border: 0; border-radius: 12px; padding: 13px 22px; cursor: pointer; text-decoration: none; text-align: center;
  font-weight: 800; color: var(--tinta); background: var(--amarillo);
}
.boton:hover { filter: brightness(1.06); }
.boton:disabled { opacity: .55; cursor: default; }
.boton.verde { background: var(--verde); color: #fff; }
.boton.claro { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; }

.marca { text-align: center; padding: 34px 16px 18px; position: relative; }
.marca img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid var(--oro); box-shadow: var(--sombra); }
.corona { display: block; width: 46px; margin: 10px auto 2px; color: var(--oro); }
.marca h1 { font: 800 clamp(34px, 8vw, 52px)/1.05 Cinzel, serif; color: var(--oro-claro); letter-spacing: .02em; }
.sub { font: 600 13px Cinzel, serif; letter-spacing: .42em; text-transform: uppercase; color: var(--oro); margin-left: .42em; }
.lema { max-width: 460px; margin: 12px auto 0; color: #f3dfd6; }
.enlaces { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.enlaces a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--oro); color: var(--oro-claro); }

.en-rifa .marca { padding: 14px 16px 4px; }
.en-rifa .marca img, .en-rifa .corona, .en-rifa .lema, .en-rifa .enlaces { display: none; }
.en-rifa .marca h1 { font-size: 26px; }
.en-rifa .sub { font-size: 10px; }
.en-rifa .cartel.grande { padding: 12px; }
.en-rifa .total { margin: 8px 0; font-size: 38px; }
.en-rifa .cuando { font-size: 16px; }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }
.titulo-sec { font: 800 22px Cinzel, serif; color: var(--oro-claro); text-align: center; margin: 24px 0 16px; }
.nota-sec { text-align: center; color: #f3dfd6; margin: -10px 0 16px; font-size: 14px; }
.cartel.final { padding: 12px; }
.cartel.final .loteria { margin-top: 0; }
.vacio { text-align: center; color: #f3dfd6; padding: 24px; }
.rifas { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; justify-items: center; }

.cartel {
  width: 100%; max-width: 440px; background: linear-gradient(170deg, #2a0204, var(--vino-2) 45%, #2a0204);
  border: 2px solid var(--oro); border-radius: 18px; padding: 18px 16px; text-align: center; box-shadow: var(--sombra);
}
.cartel.grande { max-width: 620px; margin: 0 auto; }
.foto { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.info { white-space: pre-wrap; margin-top: 8px; font-size: 14px; color: #f3dfd6; overflow-wrap: anywhere; }
.total.texto { font-size: clamp(26px, 7vw, 36px); line-height: 1.2; padding: 10px; overflow-wrap: anywhere; }
.progreso { margin-top: 12px; }
.progreso div { height: 10px; border-radius: 6px; background: var(--crema); overflow: hidden; }
.progreso i { display: block; height: 100%; background: var(--amarillo); }
.progreso span { font-size: 13px; color: #f3dfd6; }
.premios { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.premio { background: var(--amarillo); color: var(--tinta); border-radius: 10px; padding: 4px 11px; font-size: 12px; font-weight: 800; line-height: 1.25; }
.premio b { display: block; font-size: 15px; font-weight: 800; }
.total { margin: 12px 0; background: var(--amarillo); color: var(--tinta); border-radius: 18px; padding: 6px 10px; font: 400 clamp(40px, 11vw, 58px)/1.15 Anton, Impact, sans-serif; }
.cuando { font: 800 19px Cinzel, serif; color: var(--oro-claro); }
.loteria { background: #fff; color: var(--tinta); border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 14px; line-height: 1.35; }
.loteria b { display: block; font-size: 17px; font-weight: 800; text-transform: uppercase; }
.cartel .boton { width: 100%; margin-top: 12px; }
.resultado { margin-top: 12px; background: #fff; color: var(--tinta); border-radius: 12px; padding: 12px; }
.resultado .cifra { font: 400 42px/1.1 Anton, Impact, sans-serif; letter-spacing: .05em; }
.resultado .serie { font-size: 13px; color: var(--gris); }
.ganadores { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.ganadores li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--borde); text-align: left; }

.metodo { margin-top: 8px; background: #fff8d6; color: var(--tinta); border-radius: 8px; padding: 7px 10px; font-size: 14px; overflow-wrap: anywhere; }
.metodo > span, .pago > span { display: block; font-size: 12px; color: var(--gris); text-align: left; }
.pago-linea { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 2px 0; }
.copiar { flex: none; border: 0; border-radius: 8px; padding: 7px 12px; min-height: 34px; background: var(--tinta); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.copiar.hecho { background: var(--verde); }
.elegidos { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.elegidos button { border: 0; border-radius: 8px; padding: 6px 10px; min-height: 34px; background: var(--rojo); color: #fff; font-weight: 800; cursor: pointer; }
.elegidos span { font-weight: 400; margin-left: 2px; }
.agregar { width: 100%; padding: 10px; }
.previa { display: grid; grid-template-columns: repeat(10, 1fr); gap: 1px; width: 100%; margin-top: 12px; padding: 6px; border: 0; border-radius: 10px; background: var(--crema); cursor: pointer; }
.previa span { aspect-ratio: 1; display: grid; place-items: center; background: #fff; color: #555; font: 600 9px/1 Poppins, sans-serif; border-radius: 2px; }
.previa .ocu { background: #111; color: #777; }
.previa .pagado { background: #1a9c52; color: #fff; }
.previa .debe { background: #e24b4b; color: #fff; }

.volver { background: none; border: 0; color: var(--oro-claro); padding: 8px 0 14px; cursor: pointer; font-weight: 600; }
.tablero-caja { max-width: 620px; margin: 16px auto 0; background: var(--crema); border-radius: 18px; padding: 12px; }
.leyenda { display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--tinta); padding-bottom: 10px; }
.leyenda i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid #bbb; background: #fff; }
.leyenda .i-ocu { background: linear-gradient(90deg, #000, #777); }
.leyenda .i-sel { background: var(--rojo); }
.tablero { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.num {
  aspect-ratio: 1; border: 1px solid #c9c4b9; background: #fff; color: var(--tinta); border-radius: 3px; padding: 0; cursor: pointer;
  font: 800 clamp(13px, 3.6vw, 20px) Poppins, sans-serif;
}
.num:hover:not(:disabled) { background: var(--oro-claro); }
.num:disabled { background: linear-gradient(90deg, #000, #777); color: #555; cursor: not-allowed; border-color: #444; }
.num.sel { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.num.gana { outline: 3px solid var(--amarillo); outline-offset: -3px; }

.como { max-width: 620px; margin: 34px auto 0; background: rgba(0,0,0,.25); border: 1px solid rgba(217,169,58,.5); border-radius: 16px; padding: 18px 20px; }
.como h2 { font: 800 19px Cinzel, serif; color: var(--oro-claro); margin-bottom: 8px; }
.como ol { margin: 0; padding-left: 20px; }
.aviso { font-size: 13px; color: #f3dfd6; margin-top: 10px; }
.grupo { background: #123d27; text-align: center; padding: 32px 16px; }
.grupo h2 { font: 800 clamp(20px, 5vw, 26px) Cinzel, serif; }
.grupo p { margin: 6px 0 16px; }
.pie { text-align: center; padding: 20px 16px 96px; font-size: 13px; color: #e9cfc6; }
.barra {
  position: fixed; inset: auto 0 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #190102; border-top: 2px solid var(--oro); padding: 11px 16px; z-index: 5;
}
.barra[hidden] { display: none; }
.barra strong { display: block; font-size: 15px; }
.barra span { color: var(--amarillo); font-weight: 800; }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); color: var(--tinta); }
dialog::backdrop { background: rgba(0,0,0,.65); }
#dialogo-cuerpo { padding: 20px; }
dialog h2 { font: 800 21px Cinzel, serif; color: var(--vino-2); margin-bottom: 4px; }
.resumen { background: var(--crema); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
label { display: block; font-size: 14px; font-weight: 600; margin-top: 10px; }
input, select, textarea { width: 100%; padding: 10px 11px; margin-top: 3px; border: 1px solid #bdb6a8; border-radius: 9px; background: #fff; color: var(--tinta); font-weight: 400; }
.tel { display: grid; grid-template-columns: 142px 1fr; gap: 8px; }
.check { display: flex; gap: 8px; font-weight: 400; font-size: 13px; align-items: flex-start; }
.check input { width: auto; margin-top: 3px; }
.trampa { position: absolute; left: -9999px; }
.error { color: #b00; font-size: 14px; font-weight: 600; margin-top: 8px; }
.acciones { display: flex; gap: 8px; margin-top: 14px; }
.acciones .boton { flex: 1; padding-inline: 10px; }
.pago { background: #fff8d6; border: 1px solid #e8d36a; border-radius: 10px; padding: 11px 12px; margin: 10px 0; font-size: 14px; overflow-wrap: anywhere; }
.legal { max-width: 620px; padding-top: 34px; }
.legal h1 { font: 800 26px Cinzel, serif; color: var(--oro-claro); margin-bottom: 14px; }
.legal p { margin-bottom: 12px; }
