.page-lottery {
  min-width: 20rem;
  color: #fff7df;
  background: #260009;
}

.page-lottery .nav {
  border-bottom: 1px solid #d9a91d;
}

.page-lottery .nav__link[aria-current="page"],
.page-lottery .mobile-menu a[aria-current="page"] {
  color: #b78b12;
}

.lottery-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100svh - 6.5rem);
  padding: 2.5rem 1rem 4rem;
  background:
    radial-gradient(circle at 50% 34%, #ff3240 0 3%, transparent 24%),
    radial-gradient(circle at 50% 62%, #f20b25 0, #bc001d 38%, #53000d 76%, #250007 100%);
}

.lottery-hero::before,
.lottery-hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.lottery-hero::before {
  width: 38rem;
  height: 38rem;
  top: 8rem;
  left: -18rem;
  background: radial-gradient(circle, #ffcc4380, transparent 68%);
}

.lottery-hero::after {
  width: 42rem;
  height: 42rem;
  right: -22rem;
  bottom: -12rem;
  background: radial-gradient(circle, #ff6f4b66, transparent 70%);
}

.lottery-heading {
  position: relative;
  z-index: 4;
  width: min(100%, 52rem);
  margin: 0 auto 1.25rem;
  text-align: center;
}

.lottery-heading h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(2.3rem, 6vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -.04em;
  text-shadow: 0 .15rem 0 #8c0018, 0 .5rem 1.5rem #2a000c99;
}

.lottery-heading > p:last-child {
  max-width: none;
  margin: .75rem 0 0;
  color: #ffeab1;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.lottery-kicker {
  max-width: none;
  margin: 0 0 .4rem;
  color: #ffd35c;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.lottery-sparkles,
.lottery-sparkles span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lottery-sparkles span::before {
  content: "";
  position: absolute;
  width: .4rem;
  height: 2.5rem;
  border-radius: 999px;
  background: linear-gradient(#fff0, #fffbd1, #fff0);
  box-shadow: 0 0 1.2rem #fff7af;
  transform: rotate(45deg);
}

.lottery-sparkles span::after {
  content: "";
  position: absolute;
  width: 2.5rem;
  height: .4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff0, #fffbd1, #fff0);
  box-shadow: 0 0 1.2rem #fff7af;
  transform: rotate(45deg);
}

.lottery-sparkles span:nth-child(1)::before,
.lottery-sparkles span:nth-child(1)::after { left: 8%; top: 16%; }
.lottery-sparkles span:nth-child(2)::before,
.lottery-sparkles span:nth-child(2)::after { left: 18%; top: 49%; }
.lottery-sparkles span:nth-child(3)::before,
.lottery-sparkles span:nth-child(3)::after { left: 31%; top: 24%; }
.lottery-sparkles span:nth-child(4)::before,
.lottery-sparkles span:nth-child(4)::after { left: 43%; top: 72%; }
.lottery-sparkles span:nth-child(5)::before,
.lottery-sparkles span:nth-child(5)::after { left: 59%; top: 18%; }
.lottery-sparkles span:nth-child(6)::before,
.lottery-sparkles span:nth-child(6)::after { left: 72%; top: 58%; }
.lottery-sparkles span:nth-child(7)::before,
.lottery-sparkles span:nth-child(7)::after { left: 86%; top: 28%; }
.lottery-sparkles span:nth-child(8)::before,
.lottery-sparkles span:nth-child(8)::after { left: 93%; top: 67%; }
.lottery-sparkles span:nth-child(9)::before,
.lottery-sparkles span:nth-child(9)::after { left: 13%; top: 80%; }
.lottery-sparkles span:nth-child(10)::before,
.lottery-sparkles span:nth-child(10)::after { left: 52%; top: 45%; }
.lottery-sparkles span:nth-child(11)::before,
.lottery-sparkles span:nth-child(11)::after { left: 78%; top: 84%; }
.lottery-sparkles span:nth-child(12)::before,
.lottery-sparkles span:nth-child(12)::after { left: 36%; top: 91%; }

.lottery-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 68rem);
  min-height: 39rem;
  margin: 0 auto;
  padding: 4.5rem 1rem 7rem;
}

.lottery-arch {
  position: absolute;
  z-index: -1;
  top: 1rem;
  width: min(86%, 48rem);
  height: 31rem;
  border: clamp(2rem, 5vw, 4rem) solid #920015;
  border-bottom: 0;
  border-radius: 28rem 28rem 0 0;
  background: linear-gradient(90deg, #6d0010, #bd001d 50%, #6d0010);
  box-shadow:
    inset 0 0 0 1rem #d40824,
    0 0 0 .55rem #65000e,
    0 0 3rem #ffba22aa;
}

.lottery-arch::before {
  content: "";
  position: absolute;
  inset: -2.3rem;
  border-radius: inherit;
  background: radial-gradient(circle, #fffbd7 0 .35rem, #ffb000 .42rem .7rem, transparent .75rem) 0 0 / 5.4rem 5.4rem;
  filter: drop-shadow(0 0 .55rem #ffdb37);
}

.lottery-board-frame {
  position: relative;
  z-index: 3;
  padding: 1.1rem;
  border: .4rem solid #7e2e00;
  border-radius: 1rem;
  background:
    radial-gradient(circle, #fff 0 .25rem, #fff66a .31rem .52rem, transparent .58rem) 0 0 / 2.6rem 2.6rem,
    linear-gradient(135deg, #fff4c5, #f1ab20 48%, #fff3b8);
  box-shadow:
    0 .8rem 2.2rem #3b000a99,
    inset 0 0 1.5rem #ffef93;
}

.lottery-board {
  --cell: clamp(5.55rem, 15vw, 9.1rem);
  display: grid;
  grid-template-columns: repeat(3, var(--cell));
  grid-template-rows: repeat(3, var(--cell));
  gap: .42rem;
  padding: .5rem;
  border: .35rem solid #72030f;
  border-radius: .85rem;
  background: #a9001e;
}

.lottery-prize {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: .45rem;
  overflow: hidden;
  color: #4c2500;
  text-align: center;
  border: 2px solid transparent;
  border-radius: .6rem;
  background: linear-gradient(145deg, #ffd858, #f2b512);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.lottery-prize[data-index="1"],
.lottery-prize[data-index="3"],
.lottery-prize[data-index="5"],
.lottery-prize[data-index="7"] {
  color: #fff;
  background: linear-gradient(145deg, #e84465, #c81a3b);
}

.lottery-prize[data-index="0"] { grid-area: 1 / 1; }
.lottery-prize[data-index="1"] { grid-area: 1 / 2; }
.lottery-prize[data-index="2"] { grid-area: 1 / 3; }
.lottery-prize[data-index="3"] { grid-area: 2 / 3; }
.lottery-prize[data-index="4"] { grid-area: 3 / 3; }
.lottery-prize[data-index="5"] { grid-area: 3 / 2; }
.lottery-prize[data-index="6"] { grid-area: 3 / 1; }
.lottery-prize[data-index="7"] { grid-area: 2 / 1; }

.lottery-prize.is-active {
  z-index: 2;
  border-color: #fffce0;
  filter: saturate(1.35) brightness(1.2);
  transform: scale(1.055);
  box-shadow: 0 0 0 .2rem #ffdf36, 0 0 1.35rem .5rem #fff59b;
}

.lottery-prize__icon {
  display: grid;
  place-items: center;
  width: clamp(2.2rem, 5vw, 3.75rem);
  height: clamp(2.2rem, 5vw, 3.75rem);
  margin-bottom: .35rem;
  font-size: clamp(1.65rem, 4vw, 2.75rem);
  line-height: 1;
  border-radius: .55rem;
  background: #ffffffd9;
  box-shadow: 0 .25rem .75rem #53000d22;
}

.lottery-prize__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.lottery-prize strong,
.lottery-prize small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.lottery-prize strong {
  font-family: var(--font-sans);
  font-size: clamp(.69rem, 1.7vw, 1rem);
  line-height: 1.1;
}

.lottery-prize small {
  margin-top: .2rem;
  font-size: clamp(.54rem, 1.15vw, .73rem);
  line-height: 1.15;
  opacity: .84;
}

.lottery-trigger {
  grid-area: 2 / 2;
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  margin: .35rem;
  color: #fff;
  border: .45rem solid #f6c851;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, #ff6672, #e00d2c 46%, #8d0018 73%);
  box-shadow:
    inset 0 .5rem .8rem #ffffff5c,
    inset 0 -.65rem .9rem #65000c99,
    0 .5rem 1rem #3a000b99;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}

.lottery-trigger:hover { filter: brightness(1.08); transform: scale(1.035); }
.lottery-trigger:active { transform: scale(.96); }
.lottery-trigger:focus-visible { outline: .25rem solid #fff; outline-offset: .25rem; }
.lottery-trigger:disabled { cursor: wait; filter: saturate(.7); }

.lottery-trigger__go {
  font-family: var(--font-sans);
  font-size: clamp(1.7rem, 5vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: .92;
  text-shadow: 0 .2rem .15rem #65000f;
}

.lottery-trigger__label {
  font-family: var(--font-sans);
  font-size: clamp(.55rem, 1.35vw, .75rem);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lottery-platform {
  position: absolute;
  z-index: 2;
  bottom: 1.5rem;
  width: min(92%, 48rem);
  height: 5.2rem;
  border: .3rem solid #ff334c;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #ff6572, #f30026 54%, #9e0018 80%);
  box-shadow: 0 2.5rem 0 -.35rem #9d0017, 0 3rem 2rem #3b000a99;
}

.lottery-gift {
  position: absolute;
  z-index: 2;
  width: 5.2rem;
  height: 4.6rem;
  border-radius: .45rem;
  background: linear-gradient(135deg, #ff5a5a, #a70018);
  box-shadow: 0 .8rem 1.4rem #38000a77;
  transform: rotate(-9deg);
}

.lottery-gift::before,
.lottery-gift::after {
  content: "";
  position: absolute;
  background: linear-gradient(#fff5a9, #d69b18);
}

.lottery-gift::before { width: 1rem; height: 100%; left: calc(50% - .5rem); }
.lottery-gift::after { width: 100%; height: .9rem; top: 1.1rem; left: 0; }
.lottery-gift span::before,
.lottery-gift span::after {
  content: "";
  position: absolute;
  top: -1.15rem;
  width: 2.5rem;
  height: 1.5rem;
  border: .55rem solid #e5ae2d;
  border-radius: 50%;
}
.lottery-gift span::before { left: .4rem; transform: rotate(20deg); }
.lottery-gift span::after { right: .4rem; transform: rotate(-20deg); }
.lottery-gift--left { left: 2%; bottom: 6rem; }
.lottery-gift--right { right: 2%; top: 6.5rem; transform: rotate(11deg); background: linear-gradient(135deg, #54aaff, #0755ad); }

.lottery-instructions {
  position: relative;
  z-index: 4;
  width: min(100%, 44rem);
  margin: -1.25rem auto 0;
  text-align: center;
}

.lottery-entry {
  display: flex;
  justify-content: center;
  margin-bottom: .75rem;
}

.lottery-entry__field {
  display: grid;
  gap: .35rem;
  width: min(100%, 24rem);
  color: #fff;
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 700;
  text-align: left;
}

.lottery-entry__field[hidden] { display: none; }

.lottery-entry__field input {
  width: 100%;
  min-height: 2.75rem;
  padding: .65rem .85rem;
  color: #2e1115;
  border: .12rem solid #f6c851;
  border-radius: .55rem;
  background: #fffaf0;
  box-shadow: 0 .45rem 1rem #4a000b55;
}

.lottery-entry__field input:focus-visible {
  outline: .2rem solid #fff;
  outline-offset: .15rem;
}

.lottery-instructions .lottery-service-state {
  color: #ffeaa8;
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.lottery-instructions .lottery-service-state[data-mode="error"] { color: #fff; }

.lottery-instructions p {
  max-width: none;
  margin: .35rem 0 0;
  color: #ffdca3;
  font-size: .9rem;
}

.lottery-instructions .lottery-status {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
}

.lottery-records {
  padding: 3.5rem 1rem;
  color: var(--color-ink);
  background: #fff9ea;
}

.lottery-records .container {
  display: grid;
  gap: 2rem;
}

.lottery-records h2 { margin-bottom: .75rem; }
.lottery-records p { max-width: 46rem; margin-bottom: 0; }

.lottery-history {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lottery-history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-left: .3rem solid #d0a521;
  background: #fff;
  box-shadow: 0 .25rem .8rem #4c250012;
}

.lottery-history time { color: var(--color-gray-500); font-size: .85rem; }
.lottery-history__empty { color: var(--color-gray-500); font-style: italic; }

.lottery-dialog {
  position: fixed;
  inset: 0;
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 2.25rem;
  overflow-y: auto;
  color: #fff;
  text-align: center;
  border: .2rem solid #f3c744;
  border-radius: 1.25rem;
  background: radial-gradient(circle at 50% 0, #df2343, #930018 68%, #54000d);
  box-shadow: 0 2rem 5rem #180005aa;
}

.lottery-dialog::backdrop { background: #170006c7; backdrop-filter: blur(.3rem); }
.lottery-dialog__close { position: absolute; top: .75rem; right: .8rem; padding: .25rem .55rem; color: #fff; font-size: 1.7rem; line-height: 1; border: 0; background: transparent; cursor: pointer; }
.lottery-dialog__eyebrow { color: #ffdc68; font-family: var(--font-sans); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.lottery-dialog__icon { margin: .7rem 0 .25rem; font-size: 4rem; }
.lottery-dialog h2 { margin-bottom: .5rem; color: #fff; font-family: var(--font-sans); }
.lottery-dialog__prize { max-width: none; margin: 0 0 .75rem; color: #ffe37c; font-size: 1.35rem; font-weight: 700; }
.lottery-dialog__note { max-width: 26rem; margin: 0 auto 1.25rem; font-size: .95rem; }
.lottery-dialog .btn { margin: 0 auto; }

@media (min-width: 768px) {
  .lottery-records { padding: 4rem 2rem; }
  .lottery-records .container { grid-template-columns: minmax(0, 1fr) minmax(20rem, .85fr); align-items: start; }
}

@media (max-width: 767px) {
  .lottery-hero { padding: 2rem .5rem 3rem; }
  .lottery-stage { min-height: 31rem; padding: 3.5rem 0 5rem; }
  .lottery-arch { top: 1.75rem; height: 24rem; width: 93%; border-width: 2rem; }
  .lottery-arch::before { inset: -1.25rem; background-size: 3.4rem 3.4rem; }
  .lottery-board-frame { padding: .75rem; border-width: .3rem; }
  .lottery-board { --cell: clamp(5.3rem, 26vw, 7.4rem); gap: .28rem; padding: .35rem; border-width: .25rem; }
  .lottery-prize { padding: .25rem; border-radius: .42rem; }
  .lottery-prize__icon { margin-bottom: .2rem; }
  .lottery-prize small { display: none; }
  .lottery-platform { bottom: 1rem; height: 3.7rem; box-shadow: 0 1.7rem 0 -.25rem #9d0017, 0 2rem 1.5rem #3b000a99; }
  .lottery-gift { display: none; }
  .lottery-instructions { margin-top: -.5rem; padding: 0 .75rem; }
  .lottery-history li { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .lottery-dialog { padding: 2rem 1.25rem 1.5rem; }
}

@media (max-width: 380px) {
  .lottery-board { --cell: 5.25rem; }
  .lottery-board-frame { padding: .55rem; }
  .lottery-prize strong { font-size: .64rem; }
  .lottery-trigger__go { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lottery-prize,
  .lottery-trigger { transition: none; }
  .lottery-trigger:hover { transform: none; }
}
