.jewel-giveaway-dialog {
  box-sizing: border-box;
  width: min(760px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid #b78b497d;
  border-radius: 22px;
  overflow: auto;
  isolation: isolate;
  color: #f7ead3;
  background:
    linear-gradient(90deg, #081810 2%, #081810f7 33%, #081810a8 56%, #0818100a 85%),
    url("assets/giveaway-winter-cake.jpg") right -36px center / cover no-repeat,
    #081810;
  box-shadow: 0 26px 100px #000a, 0 0 38px #c69a3f1c;
  color-scheme: dark;
  text-align: left;
}

.jewel-giveaway-dialog::backdrop {
  background: #06100bc4;
  backdrop-filter: blur(4px);
}

html:has(.jewel-giveaway-dialog[open]) { overflow: hidden; }

#jewel-giveaway-invite,
#jewel-giveaway-confirmation > form {
  box-sizing: border-box;
  padding: clamp(30px, 6.2vw, 64px);
}

#jewel-giveaway-confirmation > form {
  display: block;
  margin: 0;
}

.jewel-giveaway-dialog h2 {
  max-width: 8.5em;
  margin: 0 0 13px;
  padding: 0;
  color: #f3d190;
  font: 600 clamp(48px, 8vw, 73px)/.94 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.035em;
  text-wrap: balance;
}

@supports (background-clip: text) {
  .jewel-giveaway-dialog h2 {
    background: linear-gradient(174deg, #fff3cd 12%, #f6d58e 43%, #dbaa5c 68%, #fae3ac 93%);
    background-clip: text;
    color: transparent;
  }
}

#jewel-giveaway-invite h2::before {
  content: "";
  display: block;
  width: 76px;
  height: 10px;
  margin-bottom: 14px;
  background:
    linear-gradient(45deg, transparent 50%, #f1cd84 50%) center left 0 / 5px 5px no-repeat,
    linear-gradient(135deg, #f1cd84 50%, transparent 50%) center left 5px / 5px 5px no-repeat,
    linear-gradient(90deg, #f1cd84, #ba8d4b00) center left 12px / 64px 1px no-repeat;
}

#jewel-giveaway-confirmation h2 {
  font-size: clamp(44px, 6.5vw, 55px);
  max-width: 8.1em;
}

.jewel-giveaway-dialog h2[autofocus]:focus { outline: none; }

.jewel-giveaway-dialog p {
  max-width: 29ch;
  margin: 0 0 25px;
  color: #f0e3cd;
  font: 500 16px/1.55 Manrope, Arial, sans-serif;
  text-wrap: pretty;
}

.jewel-giveaway-dialog .jewel-giveaway-action {
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 50px;
  padding: 11px 20px;
  overflow: hidden;
  border: 1px solid #d47666;
  border-radius: 9px;
  background: linear-gradient(180deg, #9c2c39, #6d1928);
  color: #fff9ed;
  box-shadow: 0 10px 26px #29040755, inset 0 1px #f5c89138;
  font: 700 15px/1.35 Manrope, Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

#jewel-giveaway-confirmation .jewel-giveaway-action {
  color: #211a0b;
  border-color: #f5d99e;
  background: linear-gradient(180deg, #f5d99e, #d7a752);
  box-shadow: 0 10px 26px #140d0359, inset 0 1px #fff5d7;
}

.jewel-giveaway-dialog .jewel-giveaway-action:hover { filter: brightness(1.13); }

.jewel-giveaway-dialog .jewel-giveaway-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #edc78685;
  border-radius: 50%;
  color: #ffe8b7;
  background: #091810e8;
  font: 400 25px/1 Arial, sans-serif;
  cursor: pointer;
}

.jewel-giveaway-dialog .jewel-giveaway-close:hover { background: #243525; }

.jewel-giveaway-dialog :is(a, button):focus-visible {
  outline: 2px solid #ffe09e;
  outline-offset: 3px;
}

.jewel-giveaway-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border: 1px solid #e7bf74;
  border-radius: 50%;
  color: #f7d794;
  background: radial-gradient(circle, #ba8c464e, #674d1e47 55%, #33291766);
  box-shadow: inset 0 0 0 3px #101c13, 0 0 24px #e6b34c29;
}

.jewel-giveaway-seal::before {
  content: "";
  width: 16px;
  height: 8px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.jewel-giveaway-light {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.jewel-giveaway-aura {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 82% 58%, #f2b84c32, transparent 56%);
}

.jewel-giveaway-rim {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 2.5px;
  border-radius: inherit;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.jewel-giveaway-rim::before {
  content: "";
  position: absolute;
  inset: -65%;
  background: conic-gradient(from -90deg, transparent 4%, #b5753533 15%, #e7b967 21%, #fff0bb 24%, #e5b55f73 31%, transparent 43%);
}

.jewel-giveaway-curl {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 81px;
  height: 53px;
  border: solid #edc5789c;
  border-width: 1px 0 0 1px;
  border-radius: 24px 0 0;
  color: #f9d58c;
  text-shadow: 0 0 9px #faad48a6;
}

.jewel-giveaway-curl::before {
  content: "";
  position: absolute;
  inset: 4px 18px 9px 4px;
  border: solid #f1d19582;
  border-width: 1px 0 0 1px;
  border-radius: 21px 0 0;
}

.jewel-giveaway-curl::after {
  content: "❧";
  position: absolute;
  top: 5px;
  left: 15px;
  font: 400 29px/1 "Segoe UI Symbol", Georgia, serif;
  transform: rotate(-13deg);
}

.jewel-giveaway-curl--end {
  inset: auto 15px 15px auto;
  transform: rotate(180deg);
}

.jewel-giveaway-confetti {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size, 4px);
  height: calc(var(--size, 4px) * 1.7);
  border-radius: 1px;
  background: var(--color, #f1c878);
  box-shadow: 0 0 9px #f7bd5959;
  opacity: .55;
  transform: rotate(var(--angle, 25deg));
}

.jewel-giveaway-confetti:nth-of-type(3n) {
  height: var(--size, 4px);
  border-radius: 50%;
}

.jewel-giveaway-spark {
  position: absolute;
  top: var(--spark-y);
  left: var(--spark-x);
  width: var(--spark-size);
  height: var(--spark-size);
  background: linear-gradient(140deg, #fff4cb, #e6b75e 65%, #a56a2d);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: .24;
}

.jewel-giveaway-dialog .jewel-giveaway-action::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(115deg, transparent 26%, #ffe7ab70 50%, transparent 72%);
  pointer-events: none;
}

@media (max-width: 600px) {
  .jewel-giveaway-dialog {
    border-radius: 18px;
    background:
      linear-gradient(180deg, #08181010 0, #08181024 90px, #081810e8 146px, #081810 170px),
      url("assets/giveaway-winter-cake.jpg") right -42px / auto 276px no-repeat,
      #081810;
  }

  #jewel-giveaway-invite,
  #jewel-giveaway-confirmation > form {
    padding: clamp(142px, 42vw, 168px) clamp(20px, 6vw, 30px) 28px;
  }

  .jewel-giveaway-dialog h2 { font-size: clamp(43px, 11vw, 59px); }
  #jewel-giveaway-confirmation h2 { font-size: clamp(40px, 10vw, 52px); }
  .jewel-giveaway-dialog p { font-size: 15px; }
  .jewel-giveaway-curl { top: 12px; left: 12px; width: 64px; height: 42px; }
  .jewel-giveaway-curl::after { left: 12px; font-size: 24px; }
  .jewel-giveaway-curl--end { inset: auto 12px 12px auto; }
  .jewel-giveaway-confetti { opacity: .38; }
}

@media (prefers-reduced-motion: no-preference) {
  body:not([data-motion-paused]) .jewel-giveaway-dialog[open] {
    animation: jewel-giveaway-enter 480ms cubic-bezier(.22,.72,.23,1) backwards;
  }

  body:not([data-motion-paused]) .jewel-giveaway-dialog[open]::backdrop {
    animation: jewel-giveaway-dim 400ms ease-out backwards;
  }

  body:not([data-motion-paused]) .jewel-giveaway-dialog[open] .jewel-giveaway-aura {
    animation: jewel-giveaway-aura 6s ease-in-out 450ms infinite alternate;
  }

  body:not([data-motion-paused]) .jewel-giveaway-dialog[open] .jewel-giveaway-rim::before {
    animation: jewel-giveaway-rim 6.5s linear 450ms infinite;
  }

  body:not([data-motion-paused]) .jewel-giveaway-dialog[open] .jewel-giveaway-spark {
    animation: jewel-giveaway-spark 5.4s ease-in-out var(--spark-delay) infinite;
  }

  body:not([data-motion-paused]) .jewel-giveaway-dialog[open] .jewel-giveaway-confetti {
    animation: jewel-giveaway-confetti 5.2s ease-in-out var(--delay, 0s) infinite;
  }

  body:not([data-motion-paused]) .jewel-giveaway-dialog[open] .jewel-giveaway-action::before {
    animation: jewel-giveaway-glint 550ms ease-in-out 520ms;
  }
}

@keyframes jewel-giveaway-enter {
  from { opacity: 0; transform: translateY(20px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes jewel-giveaway-dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes jewel-giveaway-aura { from { opacity: .3; } to { opacity: .88; } }
@keyframes jewel-giveaway-rim { from { transform: rotate(0turn); } to { transform: rotate(1turn); } }

@keyframes jewel-giveaway-spark {
  0%, 100% { opacity: .24; transform: translateY(0) scale(.72); }
  26% { opacity: .9; transform: translateY(-5px) scale(1.16); }
  52% { opacity: .35; transform: translateY(-3px) scale(.85); }
}

@keyframes jewel-giveaway-confetti {
  0%, 100% { opacity: .18; transform: translateY(-7px) rotate(var(--angle, 25deg)); }
  35% { opacity: .88; }
  73% { opacity: .38; transform: translate(5px, 9px) rotate(calc(var(--angle, 25deg) + 78deg)); }
}

@media (forced-colors: active) {
  .jewel-giveaway-dialog h2 { color: CanvasText; }
}

@keyframes jewel-giveaway-glint {
  0% { opacity: 0; transform: translateX(-110%); }
  25%, 65% { opacity: .8; }
  100% { opacity: 0; transform: translateX(110%); }
}

.jewel-giveaway-entry[hidden] { display: none; }

.jewel-giveaway-entry {
  flex: none;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid #cbb8e4;
  border-radius: 8px;
  background: #f7f1ff;
  color: #533581;
  font: 700 12px/1.3 Manrope, Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.jewel-giveaway-entry:hover { background: #e9ddf7; }

.jewel-giveaway-entry:focus-visible {
  outline: 2px solid #6848a3;
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .announcement:has(.jewel-giveaway-entry:not([hidden])) { gap: 10px; }
  .announcement:has(.jewel-giveaway-entry:not([hidden])) > span { display: none; }
}
