:root {
  color-scheme: dark;
  --ink: #180d13;
  --mulberry: #30131e;
  --cream: #f6e7ca;
  --gold: #e7bb70;
  --muted: #d0aaa0;
  --line: #c7915459;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background: radial-gradient(ellipse at 50% 0, #331722 0, var(--ink) 48rem);
  font-family: var(--sans);
}

button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #ffe9ab; outline-offset: 4px; }
.shell { width: min(91%, 76rem); margin-inline: auto; }

.masthead {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  background: #23101aef;
  box-shadow: 0 -0.5rem #23101a;
}

.wordmark { font: 1.12rem var(--serif); }
.wordmark span { color: var(--gold); margin-right: 0.4rem; }
.wordmark i { color: var(--gold); }

.audio-toggle {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  color: var(--cream);
  background: #180e15;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-size: 0.875rem;
}

.audio-mark, .audio-state { color: var(--gold); }
.audio-state { font-size: 0.72rem; min-width: 1.6rem; }
.audio-toggle[aria-pressed="false"] .audio-state { color: var(--muted); }

.invitation, .stage {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  isolation: isolate;
  margin-block: 1.6rem 2.5rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 68% 54%, #62283685, transparent 58%),
    repeating-linear-gradient(99deg, #170d151a 0 7%, #140a1238 13%, transparent 18%),
    linear-gradient(130deg, #2c1720, #28121e 47%, #170e15);
}

.invitation {
  min-height: min(38rem, 74svh);
  padding: clamp(2rem, 7vw, 6.2rem);
  gap: 2.5rem;
}

.invitation::before, .stage::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0.55rem;
  border: 1px solid #ce986d2b;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.invite-copy h1 {
  margin: 0;
  font: normal clamp(3rem, 7.1vw, 6.8rem)/0.94 var(--serif);
  letter-spacing: -0.07em;
}

.invite-copy h1 em { display: block; color: var(--gold); }
.invite-note { margin: 1.6rem 0 1.7rem; color: #e8c9bb; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  font-size: 0.91rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  touch-action: manipulation;
}

.button-gold {
  color: #2a1415;
  border-color: #f4cb83;
  background: linear-gradient(115deg, #f3d292, #d49a53);
  box-shadow: inset 0 0 0 2px #734c2b65, 0 0.4rem 1.1rem #09040a4d;
}

.button-gold:hover { background: #ffdc94; }
.button-outline { color: var(--cream); border-color: #c791548f; background: #210f19; }
.button-outline:hover { color: #1c0d14; background: var(--gold); }

.envelope-scene { position: relative; display: grid; place-items: center; padding: 1.3rem 0.6rem; }
.envelope-star { position: absolute; color: #e8b46b; font-family: var(--serif); }
.star-top { top: -0.55rem; right: 8%; font-size: 3rem; }
.star-bottom { bottom: -0.3rem; left: 9%; font-size: 1.5rem; }

.envelope {
  position: relative;
  width: 100%;
  max-width: 28rem;
  aspect-ratio: 1.49;
  isolation: isolate;
  transform: rotate(-9deg);
  border: 1px solid #d19e5a;
  background: linear-gradient(135deg, #e1ac6a, #c18851 45%, #81502c);
  box-shadow: 0 1.4rem 3rem #0d040aaa;
}

.envelope-inner, .envelope-flap { position: absolute; inset: 0; }
.envelope-inner {
  background: linear-gradient(133deg, #c28f52, #e7be82 56%, #b07b49);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
}
.envelope-flap {
  background: linear-gradient(168deg, #f3cc8d, #c38751 55%, #996137);
  clip-path: polygon(0 0, 100% 0, 52% 63%, 48% 63%);
}
.wax-seal {
  position: absolute;
  top: 53%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 21%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid #97374b;
  border-radius: 47% 44% 52% 45%;
  color: #f3b898;
  background: radial-gradient(circle at 40% 35%, #a34557 0, #691e35 62%, #440f24);
  box-shadow: inset 0 0 0 0.22rem #63152b, 0 0.2rem 0.45rem #6032189e;
}
.wax-seal span { font: italic clamp(1.2rem, 3.5vw, 2.55rem) var(--serif); text-shadow: 0 1px #310b1b; }

.stage {
  min-height: min(41rem, 83svh);
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(1.2rem, 4.4vw, 3.8rem);
}

.stage h1 {
  margin: 0;
  font: normal clamp(2.35rem, 5.4vw, 5.35rem)/0.91 var(--serif);
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
}

.stage h1 strong {
  display: block;
  color: var(--gold);
  font-weight: normal;
  font-size: 1.5em;
  text-shadow: 0 0.08em #60283b, 0 0.18em 0.52em #16090d99;
}

.award-name { margin: 1.35rem 0 0.6rem; color: #ffca91; font: italic clamp(1.6rem, 3.1vw, 2.5rem) var(--serif); }
.verdict { max-width: 32rem; margin: 0 0 1.2rem; color: #e8c9bb; line-height: 1.6; }
.verdict em { color: #ffca91; }
.escape-arena { position: relative; width: min(100%, 20rem); height: 5rem; }
.claim { position: absolute; top: 0; left: 0; transition: transform 140ms ease-out; }
.claim-result { min-height: 1.35em; margin: 0.15rem 0 0; color: #ffd489; font-weight: 800; }

.trophy {
  position: relative;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--line);
  background: #08060a99;
}
.trophy-button { display: block; width: 100%; padding: 0; border: 0; color: var(--gold); background: #210e1a; }
.trophy-button img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.trophy-caption { display: block; padding: 0.8rem; font: italic 1.1rem var(--serif); }
.trophy-button:hover .trophy-caption { color: #ffe5ae; }

.program { margin-block: 3rem; }
.section-heading { display: flex; align-items: center; justify-content: center; text-align: center; gap: 0.9rem; color: var(--gold); margin-bottom: 1.25rem; }
h2 { margin: 0; color: var(--cream); font: normal clamp(1.75rem, 4.5vw, 3rem)/1.06 var(--serif); }
.program-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.program-card { display: flex; flex-direction: column; align-items: start; padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--line); background: #2b1420; }
.card-icon { color: var(--gold); font-size: 1.6rem; }
.program-card h3 { margin: 0.75rem 0 0; font: normal 1.65rem var(--serif); }
.program-card p { margin: 0.55rem 0 1rem; color: var(--muted); line-height: 1.5; }
.program-card .button { margin-top: auto; }

.water-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-block: 0 1.8rem;
  padding: 1rem clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  background: #24121c;
}
.water-notice h2 { font-size: 1.45rem; }

.rating { display: grid; justify-items: center; gap: 0.55rem; padding: 2.1rem 0.7rem 1.2rem; border-block: 1px solid var(--line); }
.stars { display: flex; flex-wrap: wrap; justify-content: center; }
.stars button { width: 2.75rem; height: 2.75rem; padding: 0; color: var(--gold); background: transparent; border: 0; font-size: 1.9rem; }
.stars button:hover { color: #fff0b7; background: #642c3f5c; }
.stars.zero button { color: #c093a2; }
#rating-result { min-height: 1.5em; margin: 0; color: var(--gold); }
.postscript { margin: 2.1rem 0 0; color: var(--gold); text-align: center; font: italic clamp(1.35rem, 4.2vw, 2.25rem) var(--serif); }
.footer { margin-block: 2rem; color: var(--muted); text-align: center; font: italic 1.05rem var(--serif); }
.footer span { color: var(--gold); margin-right: 0.35rem; }

body:has(dialog[open]) { overflow: hidden; }
.dialog {
  position: fixed;
  max-height: calc(100dvh - 1rem);
  width: min(92vw, 40rem);
  padding: clamp(1.35rem, 5vw, 3rem);
  text-align: center;
  color: var(--cream);
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0, #391726, #210f18 72%);
  box-shadow: 0 1rem 4rem #070308a6;
}
.dialog::backdrop { background: #0a050bdd; }
.dialog form { display: flex; justify-content: space-between; gap: 0.65rem; margin: -0.65rem -0.65rem 0.5rem; }
.close-dialog { flex: none; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); background: #1f0e18; font-size: 1.5rem; line-height: 1; }
.close-dialog:hover { color: #1f0e18; background: var(--gold); }
.dialog p:not(.eyebrow) { line-height: 1.5; }

.trailer { width: min(94vw, 58rem); min-height: min(29rem, 76vh); background: radial-gradient(ellipse at center, #28141c, #080608 64%); }
.trailer h2 { color: var(--gold); font-weight: bold; }
.trailer h2 span { display: block; margin-top: 0.25em; font-size: 0.7em; font-style: italic; }
.trailer .countdown { margin: 0.3em 0 0; font: normal clamp(3rem, 10vw, 6rem)/1 var(--serif); color: var(--gold); }
.trailer .countdown:empty { display: none; }
#trailer-result strong, .stamp {
  display: inline-block;
  color: #ff8c91;
  border: 2px solid currentColor;
  padding: 0.2em 0.4em;
  font-weight: 850;
  transform: rotate(-5deg);
}
#trailer-result { margin-top: 1.35rem; }
#trailer-result strong { font-size: clamp(1.05rem, 3.7vw, 1.8rem); }

.announcement {
  position: fixed;
  z-index: 5;
  bottom: clamp(0.7rem, 3vw, 1.75rem);
  right: clamp(0.7rem, 3vw, 1.75rem);
  max-width: min(27rem, 88vw);
  padding: 0.75rem 1rem;
  color: var(--cream);
  background: #291520;
  border: 1px solid #d4a568;
  box-shadow: 0 0.35rem 1.5rem #0704088c;
  pointer-events: none;
}
.announcement:empty { padding: 0; border: 0; }
.flood-lock {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: 0;
  overflow: auto;
  color: var(--cream);
  background: transparent;
}
.flood-lock[open] { display: grid; place-items: start center; }
.flood-lock::backdrop { background: #10273326; }
.flood {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.flood.fallback { background: linear-gradient(transparent 19%, #86deefd9 20%, #126b92d9 57%, #073b5eea); }
.faucet-controls {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  width: min(10.5rem, 70vw);
  margin-top: clamp(0.4rem, 2.6vh, 1.5rem);
}
.faucet-valve {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.65rem;
  aspect-ratio: 1;
  padding: 0.3rem;
  border: 1px solid #e7bb7060;
  border-radius: 50%;
  background: #162b36ee;
  box-shadow: 0 0.3rem 1rem #0b2039a0;
  cursor: grab;
  touch-action: none;
}
.faucet-valve[data-turning] { cursor: grabbing; }
.faucet-valve[aria-disabled="true"] { cursor: default; }
.faucet-valve::after {
  position: absolute;
  top: -0.21rem;
  right: -0.46rem;
  width: 1.48rem;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #162b36;
  background: #ffe1a2;
  content: '↻';
  font: 800 1.12rem/1.47rem var(--sans);
  text-align: center;
  pointer-events: none;
}
.faucet-valve[data-waiting]::after { opacity: 0.6; }
.faucet-handle {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 0.27rem solid #eab272;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 14%, #fff0be 0 4%, transparent 5%),
    radial-gradient(circle, #ffe1a2 0 12%, #966643 13% 25%, transparent 26%),
    linear-gradient(0deg, transparent 41%, #c18b59 42% 57%, transparent 58%),
    linear-gradient(90deg, transparent 42%, #e8b582 43% 56%, transparent 57%);
  box-shadow: inset 0 0 0 1px #895337, 0 2px 0 1px #784d34, 0 4px 7px #0c151eae;
  transform: rotate(var(--turn, 0rad));
  transition: transform 0.24s ease;
  pointer-events: none;
}
.faucet-valve[data-turning]:not([aria-disabled="true"]) .faucet-handle { transition: none; }
.flood-lock[data-broken] .faucet-valve::after { display: none; }
.flood-lock[data-broken] .faucet-valve::before {
  position: absolute;
  width: 1.1rem;
  height: 1.4rem;
  background: linear-gradient(90deg, #91603d, #f6ce8c 38%, #ac7849);
  clip-path: polygon(0 25%, 22% 0, 44% 40%, 61% 9%, 76% 35%, 100% 15%, 100% 100%, 0 100%);
  content: '';
}
.flood-lock[data-broken] .faucet-handle {
  transform: translate(-104%, 21%) rotate(-102deg);
}
.faucet-progress {
  width: 100%;
  height: 0.7rem;
  overflow: hidden;
  appearance: none;
  border: 1px solid #7ba8b4;
  border-radius: 1rem;
  background: #091b26;
}
.faucet-progress::-webkit-progress-bar { background: #091b26; }
.faucet-progress::-webkit-progress-value { background: #8edee5; }
.faucet-progress::-moz-progress-bar { background: #8edee5; }
.flood-message {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.flood-opening {
  position: fixed;
  z-index: 4;
  inset-inline: 0;
  bottom: clamp(0.8rem, 4vh, 2rem);
  width: min(91%, 39rem);
  margin: 0 auto;
  padding: 0.7rem 0.95rem;
  border: 1px solid #bdebf0;
  border-radius: 0.5rem;
  color: #f4fdff;
  background: #0c3042ed;
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}
.flood-choice {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(92vw, 25rem);
  padding: 1rem;
  transform: translate(-50%, -50%);
  border: 1px solid #bdebf0;
  border-radius: 0.5rem;
  color: #f4fdff;
  background: #0c3042f5;
  box-shadow: 0 0.55rem 1.7rem #0b2039a0;
  text-align: center;
}
.flood-choice h2 { margin: 0; font: 700 clamp(1.45rem, 6vw, 2rem)/1.2 var(--serif); }
.flood-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.95rem;
}
.flood-options .button { padding-inline: 0.45rem; }
.confetti { position: fixed; inset: 0; z-index: 6; overflow: hidden; pointer-events: none; }
.confetti span {
  position: absolute;
  top: -1rem;
  left: var(--x);
  width: 0.55rem;
  height: 0.9rem;
  background: var(--color);
  animation: fall var(--duration) var(--delay) linear both;
}
@keyframes fall {
  to { transform: translate(var(--drift), 105vh) rotate(610deg); opacity: 0.1; }
}

@media (max-width: 53rem) {
  .invitation { padding-inline: 2.4rem; }
  .program-card h3 { font-size: 1.4rem; }
}

@media (max-width: 39rem) {
  .masthead { padding-block: 0.65rem; }
  .wordmark { font-size: 1rem; }
  .invitation, .stage { grid-template-columns: 1fr; margin-top: 0.8rem; }
  .invitation { gap: 1.1rem; padding: 2.4rem 1.25rem 1.45rem; text-align: center; }
  .invitation h1 { font-size: clamp(2.55rem, 11.7vw, 4.5rem); }
  .invite-note { margin-block: 1rem; }
  .envelope-scene { width: min(85%, 16rem); margin-inline: auto; }
  .star-top { top: 0; }
  .stage { padding: 1.8rem 1.15rem 1.15rem; }
  .stage h1 { font-size: clamp(2rem, 8.5vw, 3.4rem); }
  .trophy { max-width: 22rem; width: 100%; margin-inline: auto; }
  .program-grid { grid-template-columns: 1fr; }
  .program { margin-block: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .claim { transition: none; }
  .confetti { display: none; }
  .faucet-handle { transition: none; }
}
