:root {
  color-scheme: light;
  --paper: #f6efdf;
  --cream: #fffbef;
  --ink: #243e34;
  --pine: #234338;
  --muted: #645e4e;
  --brick: #8c3d31;
  --brick-hover: #6f2d25;
  --edge: #d8cdb1;
  --gold: #e2ba77;
  --shadow: 0 5px 16px #4a341313;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font: 16px/1.45 var(--sans);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-width: 280px;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0%, #fffbec 0, #f2e9d400 58rem),
    repeating-linear-gradient(45deg, #7d653705 0 1px, transparent 1px 4px),
    var(--paper);
}
button, input, textarea, select { font: inherit; }
button { color: inherit; min-height: 44px; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--pine); }
a, button, input, textarea, select { -webkit-tap-highlight-color: #a94b3330; }
:focus-visible { outline: 3px solid #b05b30; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.035em; }
h1 { font-size: clamp(2.75rem, 8.2vw, 5rem); line-height: .97; }
h2 { font-size: clamp(1.55rem, 4.8vw, 2.4rem); line-height: 1.06; }
h3 { font-size: 1.3rem; line-height: 1.1; }
h1 em, h2 em { color: var(--brick); font-weight: inherit; }
label, .field-label { font-weight: 650; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #afa288;
  border-radius: .65rem;
  padding: .55rem .8rem;
  background: #fffdf6;
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #736956; opacity: 1; }
.error { color: #8b2d25; font-weight: 650; font-size: .9rem; }
.error:empty, .feedback:empty { display: none; }
.feedback, .small { color: var(--muted); font-size: .875rem; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.stack { display: grid; gap: 1rem; }
.card { border: 1px solid var(--edge); border-radius: 1.15rem; background: var(--cream); padding: clamp(.95rem, 3vw, 1.4rem); box-shadow: var(--shadow); }

.primary, .secondary, .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.primary { background: var(--brick); color: #fffbef; }
.primary:enabled:hover { background: var(--brick-hover); }
.primary:disabled { color: #604f40; background: #e7dfcc; border-color: var(--edge); }
.secondary { background: #f9f2de; color: var(--pine); border-color: #cfc2a4; }
.secondary:enabled:hover { background: #eee3c8; }
.quiet { background: transparent; text-decoration: underline; text-underline-offset: 3px; }

.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 10; padding: .7rem 1rem; background: white; clip-path: inset(50%); }
.skip-link:focus { clip-path: none; }
#shell { max-width: 59rem; margin: auto; min-height: 100vh; }
.app { margin: 0 auto; padding: 1.1rem clamp(.875rem, 4vw, 2.8rem) 6.8rem; max-width: 58rem; outline: none; }
.app:focus-visible { outline: none; }
.loading { padding: 4rem 0; text-align: center; }
.topbar {
  min-height: 4.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 clamp(.875rem, 4vw, 2.8rem);
  padding: max(.45rem, env(safe-area-inset-top)) 0 .45rem;
  border-bottom: 1px solid var(--edge);
}
.brand-button { display: block; border: 0; background: none; padding: 0; text-align: left; }
.brand { display: flex; align-items: center; gap: .56rem; font-family: var(--serif); font-size: clamp(1.04rem, 4.5vw, 1.45rem); font-weight: bold; letter-spacing: -.045em; line-height: 1.04; }
.brand em { color: var(--brick); }
.brand-mark { display: grid; place-items: center; border-radius: .42rem; width: 32px; height: 32px; background: var(--pine); color: #f6dfad; outline: 1px dashed #f0d5a4b0; outline-offset: -4px; }
.account { display: flex; align-items: center; gap: .36rem; padding: .15rem .42rem .15rem .2rem; border: 1px solid transparent; border-radius: 1.8rem; background: transparent; font-size: .87rem; font-weight: 700; }
.account:hover, .account[aria-current] { border-color: var(--edge); background: #fff9e7; }
.account-icon { display: block; position: relative; overflow: hidden; width: 38px; height: 38px; border-radius: 50%; background: #dfcba7; }
.account-icon .figure { position: absolute; width: 47px; top: 0; left: -4.5px; }
.tabbar {
  z-index: 4;
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: .35rem .25rem max(.4rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--edge);
  background: #fffaf0;
  box-shadow: 0 -6px 19px #493a2511;
}
.tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: .13rem; justify-self: stretch; min-height: 51px; background: none; border: 0; border-radius: .65rem; padding: .1rem 0; font-size: clamp(.66rem, 2.65vw, .82rem); font-weight: 650; }
.tabbar button[aria-current] { color: var(--brick); }
.tabbar button span { white-space: nowrap; letter-spacing: -.025em; }
.tabbar button[aria-current] svg { background: #f0e0c7; border-radius: .42rem; box-shadow: 0 0 0 4px #f0e0c7; margin-bottom: .1rem; }
.tabbar button:focus-visible { outline-offset: -3px; }
.eyebrow { display: flex; align-items: center; gap: .45rem; font-size: .71rem; letter-spacing: .12em; font-weight: 800; line-height: 1.3; text-transform: uppercase; color: var(--brick); }
.stamp-dot { width: .48rem; height: .48rem; display: inline-block; background: currentColor; transform: rotate(45deg); border-radius: .08rem; }
.page-heading { padding: clamp(.65rem, 3.2vw, 2rem) 0 1rem; }
.page-heading h1 { margin: .32rem 0 .58rem; }
.page-heading > p:last-child:not(.eyebrow) { color: var(--muted); }

.figure { display: block; width: 100%; aspect-ratio: 320/520; background-size: 300% 200%; background-repeat: no-repeat; background-position: var(--pose, 0%) var(--outfit, 0%); transform-origin: 50% 94%; }
.figure-mum { background-image: url('/clay/mum.webp'); }
.figure-dad { background-image: url('/clay/dad.webp'); }
.figure-evie { background-image: url('/clay/evie.webp'); }
.figure-fin { background-image: url('/clay/fin.webp'); }
.figure-isaac { background-image: url('/clay/isaac.webp'); }

.welcome-grid { display: grid; gap: 1rem; max-width: 51rem; margin: 0 auto; }
body[data-screen=welcome] .topbar { justify-content: center; border-bottom: 0; }
body[data-screen=welcome] .app { padding-bottom: 2rem; }
.welcome-card {
  overflow: hidden;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  text-align: center;
  flex-direction: column;
  gap: .8rem;
  padding: 1.5rem .8rem .7rem;
  border: 5px solid #53705b;
  border-radius: 1.35rem;
  color: #fff6e0;
  background: radial-gradient(ellipse at 50% 105%, #567147, transparent 75%), repeating-linear-gradient(48deg, #edebb90b 0 1px, transparent 1px 4px), var(--pine);
  outline: 1px dashed #d1bd8d;
  outline-offset: -10px;
  box-shadow: var(--shadow);
}
.welcome-card h1 { max-width: 11ch; font-size: clamp(2.2rem, 8.5vw, 4rem); }
.welcome-card p { max-width: 24ch; color: #f3e5c5; }
.welcome-seal { display: grid; place-items: center; width: 49px; height: 49px; color: #f9dd9d; border: 1px dashed currentColor; border-radius: 50%; }
.welcome-cast { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; max-width: 25rem; margin: .2rem 0 .25rem; }
.welcome-cast .figure, .welcome-figure .figure { filter: drop-shadow(0 4px 3px #18271690); }
.welcome-figure { width: min(34vw, 9rem); }
.welcome-form, .install-card { display: grid; align-content: start; gap: .72rem; }
.welcome-form p:not(.error), .install-card p:not(.error) { color: var(--muted); }
.install-card ol { margin: 0; padding-left: 1.22rem; color: var(--muted); }
.install-card li + li { margin-top: .4rem; }
.install-card li svg { vertical-align: middle; }

.home-intro { display: grid; grid-template-columns: minmax(0,1fr) min(34%, 12.5rem); align-items: end; gap: .1rem; padding-top: .85rem; }
.home-intro h1 { margin: .4rem 0 .6rem; font-size: clamp(1.8rem, 7.3vw, 4.35rem); }
.intro-subtitle { color: var(--muted); max-width: 22rem; }
.home-figure { margin-bottom: -.3rem; position: relative; z-index: 1; }
.home-figure .figure { filter: drop-shadow(0 5px 5px #422d2454); }
.ticket {
  padding: clamp(.8rem, 3.5vw, 1.45rem);
  margin: .8rem 0 1rem;
  background: var(--cream);
  border: 1px solid var(--edge);
  border-radius: 1.15rem;
  box-shadow: var(--shadow);
}
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.ticket-top h2 { margin-top: .2rem; }
.flight-no { border: 1px dashed #ae9c77; border-radius: .38rem; background: #f8efd5; color: #744630; padding: .32rem .5rem; font-size: .8rem; font-weight: 800; letter-spacing: .07em; }
.flight-countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; padding: .66rem 0; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.flight-countdown span { display: grid; padding: .28rem .15rem; border-right: 1px dashed var(--edge); }
.flight-countdown span:last-child { border: 0; }
.flight-countdown strong { font-size: clamp(1.45rem, 6vw, 2.4rem); line-height: 1.05; font-family: var(--serif); color: var(--pine); }
.flight-countdown small { font-size: .69rem; letter-spacing: .085em; text-transform: uppercase; font-weight: 700; }
.flight-countdown[data-departed] { display: block; text-align: left; font-size: .87rem; font-weight: 650; }
.route-map { position: relative; height: clamp(11.5rem, 50vw, 21rem); border-radius: .74rem; overflow: hidden; background: #2d574e; isolation: isolate; }
.route-map::after { position: absolute; inset: .4rem; content: ''; border: 1px dashed #f1d29176; border-radius: .53rem; pointer-events: none; }
.route-map canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.map-city { border: 0; position: absolute; width: 50px; min-height: 53px; left: var(--x); top: var(--y); transform: translate(-50%, -29%); display: grid; justify-items: center; align-content: start; gap: .18rem; padding: .48rem 0 0; background: transparent; z-index: 1; }
.map-city::before { content: ''; width: 14px; height: 14px; border: 2px solid #fff3c9; border-radius: 50%; background: var(--brick); box-shadow: 0 0 0 2px #3c5240; }
.map-city[aria-pressed=true]::before { background: #ffce7c; border-color: #793e30; box-shadow: 0 0 0 2px #ffe7b2; }
.map-city span { color: #fff7e3; background: #234338; padding: .06rem .22rem; border-radius: .2rem; font-size: .65rem; letter-spacing: .08em; font-weight: 800; }
.ocean-label { position: absolute; pointer-events: none; top: 63%; left: 47%; color: #f8e7b9; opacity: .8; font-family: var(--serif); font-size: clamp(.6rem, 2.3vw, .9rem); letter-spacing: .1em; white-space: nowrap; }
.compass { position: absolute; pointer-events: none; left: 9%; bottom: 9%; border: 1px solid #e8d8ae89; border-radius: 50%; color: #e8d8ae; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; font-size: 1.45rem; }
.route-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin: .53rem 0; }
.route-progress button { display: grid; justify-items: start; gap: .08rem; align-content: center; padding: .35rem .53rem; border: 1px solid var(--edge); border-radius: .6rem; background: #fbf5e6; text-align: left; }
.route-progress button[aria-pressed=true] { border-color: #668475; background: #e3e9d7; }
.route-progress button span { font-weight: 800; line-height: 1.1; font-size: .87rem; letter-spacing: .06em; }
.route-progress button small { color: #4c594b; font-size: clamp(.65rem, 2.5vw, .78rem); line-height: 1.14; }
.stop-detail { display: flex; gap: .55rem; justify-content: space-between; align-items: start; border-top: 1px dashed var(--edge); padding: .48rem .05rem .1rem; min-height: 3.4rem; font-size: .85rem; }
.stop-detail > div > p { color: var(--muted); }
.stop-detail > span { text-align: right; color: var(--brick); flex: 0 0 7.2em; font-weight: 700; }
.home-santa { display: grid; width: 100%; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; text-align: left; }
.home-santa strong { display: block; font-size: 1.1rem; }
.home-santa small { color: var(--muted); }
.gift-icon { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; background: var(--pine); color: #fae7b4; border-radius: .63rem; }
.gift-icon.pale { background: #e9e4cf; color: var(--pine); }

.profile-grid { display: grid; gap: 1rem; }
.profile-stage { display: grid; justify-items: center; position: relative; isolation: isolate; padding: .3rem 1rem .65rem; overflow: hidden; border-radius: 1.15rem; border: 4px solid #d2ba88; background: radial-gradient(ellipse at 50% 84%, #c0a576, transparent 36%), repeating-linear-gradient(135deg, #fff9dd20 0 1px, transparent 1px 4px), #e5d2a7; }
.stage-seam { position: absolute; inset: .35rem; z-index: -1; border: 1px dashed #a88b5f; border-radius: .75rem; }
.profile-figure { width: clamp(8.5rem, 43vw, 14rem); }
.profile-figure .figure { filter: drop-shadow(0 4px 4px #45321c63); }
.portrait-label { position: relative; font-family: var(--serif); padding: .18rem 1.05rem; border-radius: .24rem; box-shadow: 0 2px 4px #4b482944; color: #fff5d9; background: var(--pine); font-size: 1.2rem; font-weight: bold; }
.wardrobe, .wardrobe form { display: grid; gap: .72rem; align-content: center; }
.wardrobe p, .profile-wishlist p { color: var(--muted); }
.wardrobe .error { color: #8b2d25; }
.toggle { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; position: relative; background: #f9f1df; border: 1px solid var(--edge); padding: .65rem .7rem; border-radius: .65rem; cursor: pointer; }
.toggle span:nth-child(2) > * { display: block; }
.toggle small { font-weight: 500; color: var(--muted); }
.toggle-icon { display: grid; place-items: center; color: var(--brick); }
.toggle input { position: absolute; right: .6rem; opacity: 0; width: 2.8rem; height: 2rem; }
.switch { height: 1.4rem; width: 2.45rem; border-radius: 1rem; background: #776e5f; position: relative; }
.switch::after { content: ''; position: absolute; width: 1rem; height: 1rem; background: var(--cream); border-radius: 50%; top: .2rem; left: .2rem; transition: translate .18s; }
.toggle input:checked + .switch { background: var(--brick); }
.toggle input:checked + .switch::after { translate: 1.05rem; }
.toggle input:focus-visible + .switch { outline: 3px solid #b05b30; outline-offset: 3px; }
.profile-wishlist { margin: 1rem 0 0; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }

.santa-heading h1 span { color: var(--brick); }
.lobby {
  position: relative;
  isolation: isolate;
  padding: clamp(.9rem, 3.2vw, 1.5rem) clamp(.45rem, 2.5vw, 1.55rem) .8rem;
  border: 5px solid #526d58;
  border-radius: 1.35rem;
  overflow: hidden;
  outline: 1px dashed #d3bf8d;
  outline-offset: -10px;
  text-align: center;
  color: #fff7e2;
  background: radial-gradient(ellipse at 50% 75%, #42634a, transparent 78%), repeating-linear-gradient(48deg, #edebb90d 0 1px, transparent 1px 4px), #233f35;
  box-shadow: var(--shadow);
}
.lobby-status { padding-top: .15rem; min-height: 5rem; }
.lobby-status h2 { font-size: clamp(2rem, 7vw, 3.35rem); }
.lobby-status p { margin: .28rem 0 0; color: #f3e4c1; font-size: .87rem; line-height: 1.3; }
.lineup { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; gap: .08rem; margin: 1rem auto .72rem; width: 100%; max-width: 42rem; }
.lobby-person { min-width: 0; }
.medallion { display: block; position: relative; isolation: isolate; width: 100%; aspect-ratio: 320/592; max-width: 7.5rem; margin: 0 auto .18rem; }
.medallion .figure { position: absolute; width: 114%; left: -7%; bottom: 0; filter: brightness(0) saturate(0); opacity: .62; }
.ring { position: absolute; left: 0; width: 100%; aspect-ratio: 1; border: 1px dashed #ada881; border-radius: 50%; background: radial-gradient(circle, #6a805f, #455e4b); top: 24%; z-index: -1; }
.present .ring { border-style: solid; border-color: #dfc992; }
.ready .ring { border: 2px solid #a7ed9b; box-shadow: 0 0 0 2px #396742, 0 0 .8rem #63c86a66; }
.joined .figure, .ready .figure { filter: drop-shadow(0 3px 3px #182f2377); opacity: 1; }
.ready-check {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  color: #173e27;
  background: #b0f2a2;
  border: 1px solid #315e39;
  border-radius: 50%;
  position: absolute;
  right: 1%;
  bottom: 0;
  place-items: center;
}
.ready .ready-check { display: grid; }
.member-name { display: block; font-size: clamp(.72rem, 2.7vw, 1rem); font-weight: 750; line-height: 1.15; }
.member-status { display: block; color: #e6d8b4; font-size: clamp(.6rem, 2.1vw, .78rem); line-height: 1.25; margin-top: .12rem; overflow-wrap: anywhere; }
.ready .member-status { color: #bbf1ac; }
.scanning .ring { background: #a99063; box-shadow: 0 0 0 3px #ffdb8b; }
.arrived .ring { animation: ready-ring .52s ease-out; }
@keyframes ready-ring {
  0% { box-shadow: 0 0 0 0 #ceffb9aa; }
  100% { box-shadow: 0 0 0 .6rem #ceffb900; }
}
.celebrate .ready .figure { animation: character-pop .55s ease-out; }
@keyframes character-pop {
  0% { transform: translateY(4%) scale(.92); }
  58% { transform: translateY(-6%) scale(1.025); }
  100% { transform: none; }
}
.lobby-bottom { display: flex; align-items: center; justify-content: center; gap: .55rem; color: #f7e6b8; font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 750; }
.stage-spark { color: var(--gold); }
.santa-actions { display: grid; gap: .5rem; margin: .75rem 0; }
.santa-actions:empty { display: none; }
.santa-actions > .primary { justify-self: center; }
.lobby-wait { color: var(--muted); text-align: center; padding: .2rem .35rem; }
.wishlist-reminder { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; margin-top: .8rem; }
.wishlist-reminder h2 { font-size: 1.28rem; }
.wishlist-reminder p { color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.gift-stage { display: grid; justify-items: center; gap: .45rem; text-align: center; }
.gift-stage p { color: var(--muted); }
.gift-stage button { margin-top: .2rem; }
.gift-illustration { position: relative; width: 96px; height: 76px; margin: .1rem 0 .35rem; }
.gift-bag, .gift-lid { position: absolute; left: 12px; bottom: 0; width: 72px; height: 42px; border-radius: .35rem; background: linear-gradient(90deg, transparent 42%, #e6c67d 42% 58%, transparent 58%), #a85241; box-shadow: inset 0 -4px 9px #5e261b43, 0 2px 5px #492b1041; }
.gift-lid { height: 17px; width: 84px; left: 6px; bottom: 37px; z-index: 1; background-color: #be6a4d; }
.gift-ribbon-left, .gift-ribbon-right { position: absolute; left: 30px; top: 9px; width: 21px; height: 17px; border: 5px solid #c5a455; border-radius: 55% 55% 20% 58%; transform: rotate(25deg); }
.gift-ribbon-right { left: 47px; border-radius: 55% 56% 58% 20%; transform: rotate(-25deg); }
.opening .gift-lid, .opening .gift-ribbon-left, .opening .gift-ribbon-right { animation: gift-pop .45s ease forwards; }
@keyframes gift-pop { 70%, 100% { translate: 8px -30px; rotate: 16deg; opacity: 0; } }
.private-tag { display: grid; grid-template-columns: minmax(0,1fr) min(28%, 6rem); align-items: center; gap: .55rem; background: #fbf0d6; border: 1px dashed #bca268; }
.private-tag h2 { margin: .24rem 0 .7rem; }
.private-tag .figure { filter: drop-shadow(0 4px 4px #392e2147); }
.rehearsal-reset { justify-self: center; }
.rehearsal-guests { display: grid; gap: .35rem; justify-items: center; max-width: 28rem; margin: 0 auto; text-align: center; }
.rehearsal-guests p { color: var(--muted); font-size: .85rem; }
.social-view { min-width: 0; }

@media (max-width: 460px) {
  .wishlist-reminder { grid-template-columns: auto minmax(0, 1fr); }
  .wishlist-reminder button { grid-column: 2; justify-self: start; }
  .map-city { transform: translate(-50%, -29%); }
}
@media (min-width: 640px) {
  .tabbar { inset-inline: max(calc((100% - 57rem) / 2), 1rem); bottom: .55rem; border: 1px solid var(--edge); border-radius: .85rem; padding: .25rem .6rem; }
  .welcome-grid, .profile-grid { grid-template-columns: .85fr 1.15fr; align-items: start; }
  .welcome-card { min-height: 23rem; justify-content: center; }
  .profile-grid { align-items: stretch; }
  .home-figure { width: 100%; justify-self: end; }
  .lineup { gap: .45rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .scanning .ring { box-shadow: none; background: radial-gradient(circle, #6a805f, #455e4b); }
}

.offline-panel { display: grid; gap: .75rem; justify-items: start; }
.offline-panel h1 { font-size: clamp(2rem, 6vw, 3rem); }

html { scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
.toggle input { inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.switch { pointer-events: none; }
.welcome-copy { display: grid; justify-items: center; gap: .62rem; }
.welcome-cast .figure { filter: brightness(0) saturate(0); opacity: .64; }
@media (max-width: 639px) {
  .welcome-card.is-invited {
    display: grid;
    grid-template-columns: minmax(0,1fr) min(38%,8rem);
    text-align: left;
    padding: .95rem .85rem .72rem 1rem;
    gap: 0;
  }
  .is-invited .welcome-copy { justify-items: start; margin-right: -.2rem; }
  .is-invited .welcome-copy h1 { font-size: clamp(1.9rem, 8.3vw, 3rem); }
  .is-invited .welcome-figure { width: 100%; }
  .is-invited .welcome-seal { width: 32px; height: 32px; }
  .is-invited .welcome-seal svg { width: 22px; height: 22px; }
}

/* The dialog occupies the screen and leaves the app inert until the draw closes. */
html:has(.draw-theatre[open]) { overflow: hidden; }
body:has(.draw-theatre[open]) :is(#tabs, .skip-link) { visibility: hidden; }
.draw-theatre {
  --draw-gold: #e9c681;
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 0;
  color: #f9ecd3;
  background: radial-gradient(ellipse at 50% 51%, #262117 0%, #100f0c 51%, #070706 84%);
}
.draw-theatre::backdrop { background: #070706; }
.draw-layout {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  justify-content: stretch;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.draw-kicker {
  display: flex;
  gap: .56rem;
  justify-content: center;
  align-items: center;
  align-self: start;
  color: var(--draw-gold);
  font-weight: 800;
  font-size: .73rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.draw-scene { width: min(100%, 34rem); }
.draw-scene h1 { font-size: clamp(1.95rem, 7vw, 3.65rem); outline: none; }
.draw-spin, .draw-finish { display: grid; justify-items: center; gap: clamp(.75rem, 3vh, 1.55rem); }
.draw-wheel {
  --rotation: 0deg;
  --pointer-opacity: 1;
  position: relative;
  isolation: isolate;
  width: min(85vw, 56svh, 30rem);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #926b41;
  box-shadow: 0 0 0 .35rem #110e0b, 0 0 0 .43rem #936b49, 0 0 4rem #d19a4a27;
  margin: .65rem 0 .25rem;
  background: #201a15;
}
.wheel-rotor {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: rotate(var(--rotation));
  background:
    radial-gradient(circle, #0b0b09 0 12%, #201a15 13% 16%, transparent 17% 73%, #6b4730 74%, #251a13 75%),
    repeating-conic-gradient(from 18deg, #806447 0 1deg, transparent 1deg 72deg),
    conic-gradient(from -36deg, #543027 0 72deg, #28352b 72deg 144deg, #4b3928 144deg 216deg, #4b2e28 216deg 288deg, #2c3b30 288deg 360deg);
}
.wheel-rotor::before {
  content: '';
  position: absolute;
  inset: 1.2%;
  border-radius: 50%;
  background: repeating-conic-gradient(from -1deg, #f8d899 0deg 1.8deg, transparent 2deg 12deg);
  mask: radial-gradient(closest-side, transparent 94%, black 95%);
}
.wheel-rotor::after {
  position: absolute;
  inset: 2.6%;
  border: 1px dashed #dfac688f;
  border-radius: 50%;
  content: '';
}
.wheel-seat {
  z-index: 1;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 20%;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--rotation)));
  color: #fff4d8;
}
.wheel-seat strong {
  position: relative;
  margin-top: -.03rem;
  padding: .05rem .26rem;
  border-radius: .3rem;
  background: #140e0df2;
  font-size: clamp(.58rem, 2.65vw, .83rem);
}
.wheel-portrait {
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(circle at 45% 32%, #b48a56, #564532 82%);
  border: 2px solid #d1a371;
  box-shadow: 0 .15rem .38rem #100d0999;
}
.wheel-portrait .figure { position: absolute; top: -4%; left: -12%; width: 124%; filter: drop-shadow(0 2px 2px #0009); }
.draw-pointer {
  z-index: 2;
  position: absolute;
  left: 50%;
  top: -.75rem;
  width: clamp(1.2rem, 4vw, 1.75rem);
  height: clamp(1.55rem, 5vw, 2.15rem);
  translate: -50%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(100deg, #83561c, #fff1ae 45%, #c79042 75%);
  transform-origin: 50% 12%;
  transform: rotate(var(--tick, 0deg));
}
.wheel-clock {
  z-index: 3;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 27%;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: 50%;
  border: 1px solid #b98751;
  outline: 1px dashed #765432;
  outline-offset: -.28rem;
  box-shadow: 0 0 1.2rem #15100b;
  background: #15120e;
}
.draw-count { min-height: 1em; font: bold clamp(1.65rem, 6.8vw, 3.5rem)/1 var(--serif); color: #fae1a6; font-variant-numeric: tabular-nums; }
.wheel-clock-label { font-size: clamp(.46rem, 2.1vw, .7rem); color: #ead0a4; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.draw-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.draw-celebration { width: min(100%, 24rem); display: grid; grid-template-columns: repeat(5, 1fr); }
.draw-celebration .figure { filter: drop-shadow(0 .4rem .55rem #0007); animation: character-pop .55s ease-out both; }
.draw-gift { margin: 0 auto; width: min(100%, 18rem); background: #292018; border: 1px solid #87633f; border-radius: 1.05rem; padding: .85rem .7rem .9rem; }
.draw-gift p { color: #e6d2ac; }
.draw-gift .primary { min-width: 9rem; }
.draw-close { margin-top: .35rem; color: #f5dfb7; }
.draw-theatre .private-tag { min-height: 13rem; text-align: left; grid-template-columns: minmax(0,1fr) min(41%,11rem); }
.draw-theatre .private-tag h1 { margin: .35rem 0 .7rem; color: var(--pine); font-size: clamp(1.8rem, 6vw, 3rem); }
.draw-theatre .private-tag .figure { align-self: center; }
.draw-repeat { color: #e6cb9c; }
.unwrapping { gap: .8rem; }
.parcel-scene {
  position: relative;
  width: min(80vw, 20rem, 54svh);
  aspect-ratio: 1 / 1.14;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 79%, #e9bf521a, transparent 58%);
}
.parcel-box, .parcel-lid {
  position: absolute;
  left: 20%; bottom: 3%; width: 60%; height: 24%;
  border-radius: .45rem;
  border: 1px solid #e5a26199;
  background:
    linear-gradient(90deg, transparent 41%, #b98b49 41.5%, #f1d697 48%, #ccac6f 57%, transparent 57.5%),
    repeating-linear-gradient(35deg, #edc6a309 0 1px, transparent 1px 4px),
    linear-gradient(110deg, #a34f3e, #81362e 75%, #642820);
  box-shadow: inset .18rem .16rem .25rem #ffc9a44a, 0 .6rem 1.1rem #0008;
}
.parcel-lid { left: 17%; bottom: 24%; width: 66%; height: 10%; animation: throw-lid .86s cubic-bezier(.18,.65,.48,1) .08s both; }
.parcel-lid i::before, .parcel-lid i::after {
  content: ''; position: absolute; width: 17%; height: 62%; border: .38rem solid #e7c789;
  border-radius: 55% 65% 20% 50%; left: 32%; bottom: 94%; transform: rotate(17deg);
}
.parcel-lid i::after { left: 49%; transform: scaleX(-1) rotate(17deg); }
.parcel-mouth { position: absolute; inset: 0 0 24%; overflow: hidden; }
.parcel-puppet {
  position: absolute; width: 41%; left: 29.5%; bottom: -3%; transform-origin: 50% 100%;
  animation: spring-from-parcel 1.1s cubic-bezier(.24,.68,.31,1) .18s both;
  filter: drop-shadow(0 .22rem .22rem #0004);
}
.parcel-sparks { position: absolute; top: 71%; left: 50%; }
.parcel-sparks i {
  position: absolute; width: .5rem; height: .76rem; background: #edcc86; border-radius: .1rem;
  animation: scatter-ribbon .97s ease-out .27s both;
}
.parcel-sparks i:nth-child(3n) { background: #d3594b; }
.parcel-sparks i:nth-child(3n + 1) { background: #87bd91; }
@keyframes spring-from-parcel {
  0% { transform: translateY(108%) scale(.63,.8); }
  51% { transform: translateY(-11%) scale(.97,1.045) rotate(-4deg); }
  75% { transform: translateY(1%) scale(1.03,.975) rotate(1.5deg); }
  100% { transform: none; }
}
@keyframes throw-lid {
  0% { transform: none; }
  25% { transform: translate(-6%, -106%) rotate(-9deg); }
  85%, 100% { transform: translate(-57%, -190%) rotate(-46deg); opacity: 0; }
}
@keyframes scatter-ribbon {
  0% { opacity: 0; transform: scale(.2); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)) scale(.7); }
}
@media (prefers-reduced-motion: reduce) {
  .draw-pointer { display: none; }
  .wheel-rotor, .wheel-seat { --rotation: 0deg !important; }
}

.welcome-stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(.25rem, 2.75vw, .75rem); padding: .4rem 0 .7rem; }
.welcome-stamps span { display: grid; place-items: center; width: clamp(2rem, 9vw, 3rem); aspect-ratio: 1; color: #f0d29b; border: 1px dashed #d1bd8d; border-radius: .45rem; background: #151b1445; transform: rotate(-5deg); }
.welcome-stamps span:nth-child(even) { transform: rotate(5deg); }
.welcome-card.is-invited .welcome-stamps { grid-template-columns: repeat(2, 1fr); justify-items: center; }
.welcome-card.is-invited .welcome-stamps span:last-child { grid-column: 1 / -1; }

.plan-control { margin-top:1rem; display:grid; gap:.65rem; justify-items:start; }
.plan-calendar,.plan-calendar #plan-stops { display:grid; gap:.7rem; }
.plan-days { display:flex; flex-wrap:wrap; gap:.35rem; }
.plan-days button { min-height:44px; padding:.4rem .65rem; font-size:.82rem; }
.plan-days button[aria-pressed=true] { background:var(--pine); color:var(--cream); }
.plan-stop { min-height:52px; display:flex; align-items:center; justify-content:space-between; gap:.5rem; background:var(--paper); border:1px solid var(--edge); border-radius:.65rem; padding:.65rem; text-align:left; }
.plan-stop small { display:block; margin-top:.15rem; color:var(--muted); }
.plan-calendar > .quiet { justify-self:start; }
