.public-sorteo-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top, rgba(217, 70, 239, .2), transparent 34rem),
    rgba(10, 6, 23, .86);
  backdrop-filter: blur(5px);
}

.public-sorteo-overlay.show {
  display: grid;
}

.public-sorteo-overlay .sorteo-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1200px, calc(100vw - 28px));
  height: min(900px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
  padding: 20px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 12% -8%, rgba(251, 191, 36, .3), transparent 42%),
    radial-gradient(circle at 100% 105%, rgba(236, 72, 153, .32), transparent 48%),
    linear-gradient(135deg, #3b0764, #5b21b6 45%, #7e22ce 75%, #9d174d 100%);
  border: 1px solid rgba(232, 121, 249, .4);
  border-radius: 14px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .5), inset 0 0 50px rgba(217, 70, 239, .12);
  animation: publicSorteoPanelIn .22s ease-out both;
}

.public-sorteo-overlay .sorteo-header {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: .85rem 1rem .85rem .85rem;
  padding-right: 3.4rem;
  border: 1px solid rgba(56, 189, 248, .32);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(15, 23, 42, .85), rgba(8, 47, 73, .5));
  box-shadow: inset 0 0 24px rgba(14, 165, 233, .1);
}

.public-sorteo-overlay .sorteo-prize-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #1e293b, #0f172a);
  border: 2px solid rgba(251, 191, 36, .55);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .1), 0 8px 18px rgba(0, 0, 0, .35);
}

.public-sorteo-overlay .sorteo-prize-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-sorteo-overlay .sorteo-prize-thumb i {
  font-size: 1.7rem;
  color: #fbbf24;
}

.public-sorteo-overlay .sorteo-header-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.public-sorteo-overlay .sorteo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: fit-content;
  color: #7dd3fc;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.public-sorteo-overlay .sorteo-eyebrow i {
  color: #f87171;
  animation: publicSorteoLivePulse 1.4s ease-in-out infinite;
}

.public-sorteo-overlay .sorteo-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #f8fafc;
  font-size: clamp(1.1rem, 2.4vw, 1.65rem);
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(56, 189, 248, .2);
}

.public-sorteo-overlay .sorteo-header-stats {
  flex: 0 0 auto;
  display: flex;
  gap: .6rem;
}

.public-sorteo-overlay .sorteo-pill {
  min-width: 92px;
  padding: .5rem .7rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, .78);
  border: 1px solid rgba(56, 189, 248, .28);
  text-align: center;
}

.public-sorteo-overlay .sorteo-pill span {
  display: block;
  color: #94a3b8;
  font-size: .64rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.public-sorteo-overlay .sorteo-pill strong {
  display: block;
  margin-top: .2rem;
  color: #38bdf8;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 950;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(56, 189, 248, .5);
}

.public-sorteo-overlay .sorteo-pill-accent {
  border-color: rgba(251, 191, 36, .4);
}

.public-sorteo-overlay .sorteo-pill-accent strong {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, .55);
}

.public-sorteo-overlay .sorteo-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, .35);
  border-radius: 8px;
  background: rgba(15, 23, 42, .9);
  color: #bae6fd;
  cursor: pointer;
}

.public-sorteo-overlay .sorteo-close:hover,
.public-sorteo-overlay .sorteo-close:focus-visible {
  background: #7f1d1d;
  border-color: #fecaca;
  color: #fff;
}

.public-sorteo-overlay .sorteo-board-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: .9rem;
  border: 1px solid rgba(56, 189, 248, .45);
  background:
    linear-gradient(180deg, rgba(14, 165, 233, .12), transparent),
    rgba(8, 47, 73, .45);
  box-shadow: inset 0 0 30px rgba(56, 189, 248, .12), 0 0 34px rgba(14, 165, 233, .12);
}

.public-sorteo-overlay .sorteo-board {
  --sorteo-cols: 10;
  --sorteo-gap: .62rem;
  --sorteo-cell-h: 58px;
  --sorteo-ticket-font: .96rem;
  display: grid;
  grid-template-columns: repeat(var(--sorteo-cols), 1fr);
  grid-auto-rows: var(--sorteo-cell-h);
  align-content: center;
  gap: var(--sorteo-gap);
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: .15rem;
  scroll-behavior: smooth;
}

.public-sorteo-overlay .sorteo-board-ticket {
  height: var(--sorteo-cell-h);
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid #0f172a;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, .12) 0 7px, transparent 7px calc(100% - 7px), rgba(2, 6, 23, .12) calc(100% - 7px)),
    linear-gradient(180deg, #fff7ed, #e0f2fe);
  color: #0f172a;
  font-family: Consolas, 'Courier New', monospace;
  font-size: var(--sorteo-ticket-font);
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;
}

.public-sorteo-overlay .sorteo-board-ticket span {
  position: relative;
  z-index: 1;
}

.public-sorteo-overlay .sorteo-board-ticket::before,
.public-sorteo-overlay .sorteo-board-ticket::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: radial-gradient(circle, #0f172a 1.5px, transparent 2px) center/8px 10px;
  opacity: .42;
}

.public-sorteo-overlay .sorteo-board-ticket::before {
  left: 0;
}

.public-sorteo-overlay .sorteo-board-ticket::after {
  right: 0;
}

.public-sorteo-overlay .sorteo-board-ticket.is-active {
  z-index: 2;
  border-color: #38bdf8;
  filter: brightness(1.08);
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .22), 0 0 22px rgba(56, 189, 248, .75);
}

.public-sorteo-overlay .sorteo-board-ticket.is-final {
  z-index: 3;
  border-color: #fbbf24;
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  color: #78350f;
  transform: scale(1.14);
  box-shadow: 0 0 0 5px rgba(251, 191, 36, .28), 0 0 28px rgba(251, 191, 36, .9);
}

.public-sorteo-overlay .sorteo-board-ticket.is-winner {
  border-color: #fbbf24;
}

.public-sorteo-overlay .sorteo-result-card {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 1rem auto 0;
  padding: 1.2rem 1.8rem;
  width: min(780px, 100%);
  overflow: hidden;
  background: linear-gradient(180deg, #fef3c7, #fff7ed);
  border: 2px solid #fbbf24;
  border-radius: 18px;
  color: #78350f;
  box-shadow: 0 0 44px rgba(251, 191, 36, .5);
  animation: publicSorteoWinnerIn .45s cubic-bezier(.34, 1.56, .64, 1) both;
}

.public-sorteo-overlay .sorteo-result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  background-size: 220% 220%;
  background-position: 120% 0;
  animation: publicSorteoShine 2.6s ease-in-out .3s 2;
  pointer-events: none;
}

.public-sorteo-overlay .sorteo-result-card[hidden] {
  display: none;
}

.public-sorteo-overlay .sorteo-result-media {
  position: relative;
  flex: 0 0 auto;
  width: 230px;
  height: 230px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #fde68a, #fbbf24);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px #fbbf24, 0 14px 28px rgba(120, 53, 15, .35);
}

.public-sorteo-overlay .sorteo-result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-sorteo-overlay .sorteo-result-media i {
  font-size: 4rem;
  color: #78350f;
}

.public-sorteo-overlay .sorteo-result-info {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.public-sorteo-overlay .sorteo-result-number {
  color: #78350f;
  font-family: Consolas, 'Courier New', monospace;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
}

.public-sorteo-overlay .sorteo-result-congrats {
  font-size: 1rem;
  font-weight: 800;
  animation: publicSorteoCongratsPulse 1.1s ease-in-out infinite;
}

.public-sorteo-overlay .sorteo-result-client {
  margin-top: .1rem;
  color: #7c2d12;
  font-size: 1.35rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.public-sorteo-overlay .sorteo-result-prize {
  margin-top: .15rem;
  color: #92400e;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  opacity: .85;
}

.public-sorteo-overlay .sorteo-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .9rem;
}

.public-sorteo-overlay .sorteo-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .95rem;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.public-sorteo-overlay .sorteo-share-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.public-sorteo-overlay .sorteo-share-btn:active {
  transform: translateY(0);
}

.public-sorteo-overlay .sorteo-share-btn i {
  font-size: 1rem;
}

.public-sorteo-overlay .sorteo-share-fb {
  background: linear-gradient(135deg, #1877f2, #0f5cc4);
}

.public-sorteo-overlay .sorteo-share-ig {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4);
}

.public-sorteo-overlay .sorteo-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 1rem;
  padding: 8px 14px;
  background: rgba(15, 23, 42, .78);
  border: 1px solid rgba(56, 189, 248, .26);
  color: #bae6fd;
  font-size: .9rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.public-sorteo-overlay.success .sorteo-status {
  background: rgba(20, 83, 45, .8);
  border-color: rgba(34, 197, 94, .5);
  color: #bbf7d0;
}

.public-sorteo-overlay.error .sorteo-status {
  background: rgba(127, 29, 29, .8);
  border-color: rgba(248, 113, 113, .5);
  color: #fecaca;
}

.public-sorteo-confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 10001;
  pointer-events: none;
  overflow: hidden;
}

.public-sorteo-confetti-piece {
  position: absolute;
  top: -20px;
  left: 0;
  border-radius: 1px;
  opacity: 0;
  animation-name: publicSorteoConfettiFall;
  animation-timing-function: cubic-bezier(.35, .55, .4, 1);
  animation-fill-mode: forwards;
}

@keyframes publicSorteoConfettiFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate(var(--drift, 0px), 108vh) rotate(var(--rot, 360deg)); opacity: 0; }
}

@keyframes publicSorteoPanelIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes publicSorteoWinnerIn {
  0% { opacity: 0; transform: translateY(12px) scale(.7); }
  60% { opacity: 1; transform: translateY(0) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes publicSorteoCongratsPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes publicSorteoShine {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

@keyframes publicSorteoLivePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@media (max-width: 760px) {
  .public-sorteo-overlay .sorteo-panel {
    padding: 16px;
  }

  .public-sorteo-overlay .sorteo-header {
    flex-wrap: wrap;
    padding-right: 3rem;
  }

  .public-sorteo-overlay .sorteo-prize-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
  }

  .public-sorteo-overlay .sorteo-header-stats {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .public-sorteo-overlay .sorteo-pill {
    min-width: 0;
    flex: 1 1 0;
  }

  .public-sorteo-overlay .sorteo-close {
    top: .5rem;
    right: .5rem;
  }

  .public-sorteo-overlay .sorteo-result-card {
    flex-direction: column;
    text-align: center;
    padding: 1.2rem 1rem;
  }

  .public-sorteo-overlay .sorteo-result-info {
    text-align: center;
  }

  .public-sorteo-overlay .sorteo-result-media {
    width: 150px;
    height: 150px;
  }

  .public-sorteo-overlay .sorteo-share-row {
    justify-content: center;
  }
}
