:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #1b3026;
  background: #f1f0e8;
  --forest: #19372c;
  --pine: #0e251d;
  --green: #235740;
  --ivory: #fdfbf4;
  --gold: #e9bc75;
  --muted: #4b6055;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .73; }
:focus-visible { outline: 3px solid #a05126; outline-offset: 4px; }

.page { width: min(1060px, calc(100% - 72px)); margin: 0 auto; }
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 29px 0 24px; }
.wordmark { font-size: clamp(19px, 3.1vw, 24px); font-weight: 900; letter-spacing: -.055em; }
.wordmark > span { color: #397458; }
.brand-caption { font-size: .885rem; font-weight: 600; color: var(--muted); }

.announcement {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 482px;
  margin: 0 0 32px;
  padding: clamp(30px, 6.5vw, 76px);
  border-radius: 24px;
  display: flex;
  align-items: center;
  background: radial-gradient(ellipse at 85% 28%, #315543, transparent 50%), var(--pine);
  color: var(--ivory);
}
.announcement-content { z-index: 1; }
.dates { margin: 0 0 13px; color: var(--gold); font-size: .875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(2.42rem, 7.2vw, 5.35rem); line-height: 1.01; letter-spacing: -.065em; }
.intro { max-width: 28ch; margin: 22px 0 27px; color: #e1eadf; font-size: 1.06rem; line-height: 1.48; }
.announcement :focus-visible { outline-color: var(--ivory); }

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 21px;
  border: 0;
  border-radius: 9px;
  font-weight: 750;
  line-height: 1.3;
  cursor: pointer;
  text-align: center;
  transition: background .14s ease;
}
.button-gold { color: #2f2618; background: var(--gold); }
.button-gold:hover { background: #f4cc8e; }
.button-green { color: #fff; background: var(--green); }
.button-green:hover:not(:disabled) { background: #184832; }

.hero-art { position: absolute; inset: 0 0 0 36%; overflow: hidden; pointer-events: none; }
.hero-ring {
  position: absolute;
  width: min(42vw, 496px);
  aspect-ratio: 1;
  border: 1px solid #e9bc7566;
  border-radius: 50%;
  top: 52%;
  right: 48%;
  transform: translate(50%, -50%);
}
.hero-ring-inner { width: min(34vw, 404px); opacity: .56; }
.hero-gift {
  position: absolute;
  display: block;
  top: 53%;
  right: 48%;
  width: min(23vw, 260px);
  aspect-ratio: 1.19;
  transform: translate(50%, -50%) rotate(15deg);
  border: 1px solid #c9e5cf63;
  border-radius: 14px;
  background: linear-gradient(148deg, #527b61 0, #2c5340 58%, #26493a);
  box-shadow: 20px 25px 60px #03100b85, inset 0 -6px 12px #152f227a;
}
.hero-gift::before, .hero-gift::after {
  content: "";
  position: absolute;
  background: linear-gradient(82deg, #b47b46, #edc989 57%, #cd9b59);
  box-shadow: 0 1px 5px #1c2d2459;
}
.hero-gift::before { width: 16%; height: 100%; left: 42%; }
.hero-gift::after { height: 18%; width: 100%; top: 39%; background: linear-gradient(0deg, #bc854e, #efcb8c 57%, #cc9958); }
.hero-gift > i { position: absolute; z-index: 1; inset: 33% 29% 40%; transform: rotate(-10deg); }
.hero-gift > i::before, .hero-gift > i::after {
  content: "";
  position: absolute;
  width: 51%;
  height: 100%;
  border: clamp(4px, .7vw, 8px) solid #f6d395;
  border-radius: 55% 60% 12% 65%;
  transform: rotate(19deg);
}
.hero-gift > i::after { right: 0; transform: scaleX(-1) rotate(19deg); }
.star { position: absolute; z-index: 1; color: #f2cb89; line-height: 1; }
.star-large { top: 18%; right: 23%; font-size: clamp(2rem, 5.3vw, 4rem); }
.star-small { bottom: 19%; left: 22%; font-size: 1.75rem; opacity: .76; }

body.modal-open { overflow: hidden; }
dialog {
  width: min(650px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid #e1e2d3;
  border-radius: 19px;
  color: #1b3026;
  background: var(--ivory);
  box-shadow: 0 20px 90px #071a1652;
}
dialog::backdrop { background: #102a23a6; }
.dialog-inner { padding: clamp(18px, 4vw, 35px); }
.dialog-head { display: flex; gap: 12px; align-items: start; justify-content: space-between; margin-bottom: 13px; }
.dialog-brand { margin: 0 0 6px; color: #46745b; font-weight: 850; font-size: .75rem; letter-spacing: .095em; }
.dialog-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.9rem, 4.5vw, 2.68rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; }
.dialog-head h2:focus:not(:focus-visible), #winner h3:focus:not(:focus-visible), #pending h3:focus:not(:focus-visible) { outline: none; }
.close-button {
  flex: none;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: #e8ebe1;
  color: var(--forest);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}
.close-button:hover { background: #dce4d7; }

.message { margin: 0 0 19px; color: var(--muted); font-size: .99rem; line-height: 1.55; }
form { display: grid; justify-items: start; gap: 10px; }
label { font-size: .91rem; font-weight: 700; }
input {
  width: min(100%, 410px);
  height: 49px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border: 1px solid #82958a;
  border-radius: 7px;
  background: #fff;
  color: var(--pine);
}
input::placeholder { color: #5e7167; }
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: #205c3e;
  background: transparent;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.embedded-link { margin-top: 12px; }
#pending h3 { margin: 3px 0 8px; font-size: 1.32rem; }
.error { margin: 16px 0 2px; color: #963f25; font-weight: 650; line-height: 1.45; }

.reel {
  --card-width: clamp(95px, 23vw, 127px);
  --reel-gap: 10px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 18px 0;
  padding: 16px 0;
  border: 1px solid #315642;
  border-radius: 12px;
  background: var(--pine);
}
.reel::after { content: ""; z-index: 1; position: absolute; inset: 0; background: linear-gradient(90deg, #10261f9c, transparent 15%, transparent 85%, #10261f9c); pointer-events: none; }
.reel-track { display: flex; gap: var(--reel-gap); width: max-content; min-height: 117px; }
.reel-card {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  flex: 0 0 var(--card-width);
  width: var(--card-width);
  min-height: 117px;
  padding: 9px 7px 11px;
  border: 1px solid #99b6a677;
  border-radius: 9px;
  background: #284a3c;
  color: #fffdf3;
  text-align: center;
}
.reel-card[data-tone="gold"] { background: #645135; border-color: #e2b4769a; }
.reel-card[data-tone="red"] { background: #643f39; border-color: #df9b7f91; }
.reel-card.reel-card-selected { border-color: #ffe1a5; box-shadow: inset 0 0 0 1px #ffe1a5; }
.reel-icon { display: grid; place-items: center; width: 49px; height: 49px; border: 1px solid #f1c58192; border-radius: 50%; color: #f5cb84; font-size: 1.56rem; font-family: Georgia, serif; }
.reel-label { font-size: .75rem; font-weight: 700; line-height: 1.22; }
.reel-pointer { z-index: 2; position: absolute; left: 50%; width: 18px; height: 13px; transform: translateX(-50%); background: #f4c577; }
.reel-pointer-top { top: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.reel-pointer-bottom { bottom: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
#spin { min-width: 136px; }

.winner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px 20px;
  padding: 18px;
  border: 1px solid #c9d6c8;
  border-radius: 12px;
  background: #eaf0e5;
}
.winner-caption { margin: 0 0 7px; color: #3e6b51; font-size: .78rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.winner h3 { margin: 0 0 8px; font-size: clamp(1.25rem, 3.4vw, 1.7rem); line-height: 1.12; }
.winner .message { margin: 0; }
#prize-qr { width: min(164px, 27vw); height: auto; aspect-ratio: 1; padding: 8px; border-radius: 8px; background: #fff; object-fit: contain; }
#qr-message { grid-column: 1 / -1; }

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

@media (max-width: 680px) {
  .page { width: calc(100% - 32px); }
  .brand-bar { padding: 18px 0 15px; }
  .announcement { min-height: 410px; align-items: end; padding: 23px; border-radius: 16px; }
  .hero-art { inset: 0 -16% 31% 12%; opacity: .85; }
  .hero-ring { width: min(64vw, 330px); right: 39%; top: 40%; }
  .hero-ring-inner { width: min(54vw, 280px); }
  .hero-gift { width: min(34vw, 155px); right: 39%; top: 40%; }
  .star-large { top: 14%; right: 23%; font-size: 2.25rem; }
  .star-small { bottom: 31%; left: 32%; font-size: 1.15rem; }
}

@media (max-width: 385px) {
  .brand-caption { font-size: .77rem; }
  .winner { grid-template-columns: 1fr; }
  #prize-qr { width: min(164px, 58vw); }
  .announcement { min-height: 370px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
