@font-face {
  font-family: Golos;
  src: url("./assets/golos-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Golos;
  src: url("./assets/golos-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20A0-20AB,U+20AD-20C0,U+20BD,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --unit: calc(min(100vw, 430px) / 390);
  --pine: #051e17;
  --base: #041c15;
  --gold: #fce09a;
  --light: #f5ebd7;
  --muted: #d1c7ad;
  --line: #dcddb340;
  --horizontal: clamp(16px, 5.6vw, 24px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --vertical-cut: clamp(0px, calc((844px - 100svh) * .64), 136px);
  color: var(--light);
  background: var(--base);
  font-family: Golos, system-ui, sans-serif;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, p, h1, h2, ul { margin: 0; }
html, body {
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}
body { isolation: isolate; }
.app, .sheet, .reveal-dialog, textarea { touch-action: pan-y; }
ul { list-style: none; padding: 0; }
img { display: block; max-width: 100%; }
button, select, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; padding: 0; background: none; border: 0; text-align: inherit; }
button:disabled { cursor: default; }
button, select { -webkit-touch-callout: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.icon { display: inline-block; width: 24px; height: 24px; flex: none; vertical-align: middle; }
.sr-only { position: absolute; clip-path: inset(50%); padding: 0; margin: -1px; border: 0; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.app {
  width: min(100%, 430px);
  min-height: 100svh;
  margin: auto;
  isolation: isolate;
}
body::before, .sheet::before, .reveal-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("./assets/grain.webp") center top / 420px auto repeat;
  opacity: .23;
}
body::before { position: fixed; }
.app { position: relative; }
#screen { min-height: inherit; }
.page { position: relative; min-height: 100svh; padding-bottom: calc(93px + var(--safe-bottom)); }
.page-arrival { animation: page-arrival 260ms var(--ease) both; }
@keyframes page-arrival {
  from { opacity: .72; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.page > .close { top: max(38px, calc(var(--safe-top) + 6px)); right: 10px; }
.hit {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 100px;
  flex: none;
}
.close { position: absolute; right: 10px; top: 17px; z-index: 5; }
.close .icon { width: 29px; height: 29px; }

.solid {
  --gold-cap: clamp(37px, 11vw, 46px);
  position: relative;
  isolation: isolate;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  border-radius: 15px;
  padding: 8px clamp(32px, 10vw, 41px);
  font-size: clamp(16px, 4.85vw, 19px);
  font-weight: 730;
  text-align: center;
  color: #241707;
  transition: transform 100ms var(--ease);
}
.solid::before, .solid::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.solid::before {
  inset: 0;
  /* Keep the engraved ends intact as the center scales to the button width. */
  border-image: url("./assets/gold-button.webp") 0 88 fill / 0 var(--gold-cap) / 0 stretch;
  filter: drop-shadow(0 3px 1px #4e2f14bf) drop-shadow(0 6px 9px #080a05a6);
  transition: filter 140ms;
}
.solid::after {
  inset: 4px 5px;
  border-radius: 11px;
  background: linear-gradient(113deg, transparent 39%, #ffeed41f 46%, #fff5ce93 50%, #ffeed430 54%, transparent 61%)
    100% 50% / 265% 100% no-repeat;
  opacity: 0;
}
.game .solid:not(:disabled)::after { animation: gold-sheen-idle 10.2s ease-in-out 1.5s infinite; }
body:has(dialog[open]) .game .solid::after, .motion-asleep .game .solid::after { animation-play-state: paused; }
@keyframes gold-sheen-idle {
  0% { background-position: 100% 50%; opacity: 0; }
  2% { opacity: .75; }
  9%, 100% { background-position: 0 50%; opacity: 0; }
}
@keyframes gold-sheen {
  0% { background-position: 100% 50%; opacity: 0; }
  24% { opacity: 1; }
  to { background-position: 0 50%; opacity: 0; }
}
.solid:focus-visible {
  outline-color: #ffe6a7;
  outline-offset: 5px;
}
.solid:focus-visible:not(:disabled)::after { animation: gold-sheen 550ms ease-out both; }
@media (hover: hover) {
  .solid:hover:not(:disabled)::before {
    filter: brightness(1.04) drop-shadow(0 3px 1px #4e2f14bf) drop-shadow(0 0 10px #e3aa4654);
  }
  .solid:hover:not(:disabled)::after { animation: gold-sheen 610ms ease-out both; }
}
.solid:active:not(:disabled) { transform: translateY(2px) scale(.988); }
.solid:active:not(:disabled)::before {
  filter: brightness(.95) drop-shadow(0 1px 1px #4e2f14bf) drop-shadow(0 2px 5px #0a0d0680);
}
.solid:active:not(:disabled)::after {
  animation: none;
  opacity: .58;
  background-position: 56% 50%;
}
.solid:disabled { color: #2d2419; }
.solid:disabled::before { filter: saturate(.38) brightness(.83); }
.quiet { min-height: 44px; text-align: center; }
.outline {
  min-height: 40px;
  border: 1px solid #d6d7ac65;
  border-radius: 11px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 540;
}
.outline .icon { width: 20px; height: 20px; color: var(--gold); }

#tabs {
  position: fixed;
  z-index: 3;
  inset: auto 0 0;
  width: min(100%, 430px);
  height: calc(79px + var(--safe-bottom));
  margin: auto;
  padding: 0 7px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  background: linear-gradient(0deg, #041b14 72%, #041b1400);
}
#tabs button {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #dfd9c4;
  font-size: 12px;
  line-height: 1;
  border-radius: 12px;
}
#tabs button[aria-current] { color: var(--gold); font-weight: 670; }
.typing #tabs { display: none; }

.entry {
  padding: max(calc(50px - var(--vertical-cut) * .28), calc(var(--safe-top) + 19px)) var(--horizontal) calc(21px + var(--safe-bottom));
}
.entry-seal {
  width: 48px;
  height: 48px;
  margin-left: 4px;
  animation: seal-arrival 420ms ease-out both;
}
@keyframes seal-arrival {
  from { opacity: .22; filter: brightness(.86); }
  47% { opacity: 1; filter: brightness(1.15); }
  to { opacity: 1; filter: brightness(1); }
}
.entry h1 { font-size: 46px; line-height: 1.05; font-weight: 730; letter-spacing: -.025em; margin-top: 15px; }
.entry > p { margin-top: 6px; font-size: 20px; line-height: 1.25; }
.profile-options { margin: 29px -8px 0; }
.profile-option { position: relative; display: block; cursor: pointer; }
.profile-option input { position: absolute; left: 9px; top: 50%; opacity: 0; width: 1px; height: 1px; }
.profile-option span {
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-height: calc(50px - var(--vertical-cut) * .12);
  padding: 8px 17px 8px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.022em;
  transition: background-color 120ms;
}
.profile-option input:checked + span::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 54% 155% at var(--press-x, 24%) var(--press-y, 50%),
    #ffe3a454, #f7c87526 38%, transparent 77%);
  transform-origin: var(--press-x, 24%) var(--press-y, 50%);
  animation: profile-warmth 150ms var(--ease) both;
}
@keyframes profile-warmth {
  from { transform: scale(.38); opacity: .45; }
  58% { opacity: 1; }
  to { transform: scale(1.24); opacity: .39; }
}
.profile-option:not(:last-child) span::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 0;
  border-bottom: 1px solid var(--line);
}
.profile-option input:checked + span { background: #1c392c; border-radius: 14px; }
.profile-option input:checked + span::after, .profile-option:has(+ .profile-option input:checked) span::after { opacity: 0; }
.profile-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }
.profile-option .icon { opacity: 0; color: var(--gold); transform: translateX(-3px); transition: opacity 100ms, transform 100ms var(--ease); }
.profile-option input:checked + span .icon { opacity: 1; transform: none; transition-delay: 42ms; }
.entry-actions { margin-top: max(16px, calc(50px - var(--vertical-cut) * .42)); }
.join-link {
  display: block;
  margin: 6px auto 0;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: #aa9475;
}

.game {
  --game-art-size: calc(340 * var(--unit) - var(--vertical-cut));
  padding-top: max(43px, calc(var(--safe-top) + 9px));
}
.game:not(.is-drawn) {
  --game-art-size: max(135px, min(
    calc(319 * var(--unit) - var(--vertical-cut)),
    calc(100svh - 511px - var(--safe-top) - var(--safe-bottom))
  ));
}
.game-header { position: relative; padding: 0 var(--horizontal); }
.game-header h1 { font-size: 27px; line-height: 34px; font-weight: 670; letter-spacing: -.02em; }
.profile { position: absolute; top: -3px; right: calc(var(--horizontal) - 5px); }
.profile span {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #d4b184;
  color: #102719;
  font-weight: 750;
  display: grid;
  place-items: center;
}
.profile .icon { width: 18px; height: 18px; }
.meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 14px; line-height: 21px; }
.meta span, .guest-count { display: flex; align-items: center; gap: 7px; }
.meta .icon { width: 18px; height: 18px; color: var(--muted); }
.guest-count { position: relative; border-radius: 4px; }
.guest-count::after { content: ""; position: absolute; inset: -12px 0; }
.game-art {
  position: relative;
  isolation: isolate;
  height: var(--game-art-size);
  margin-top: max(11px, calc(44px - var(--vertical-cut) * .37));
  display: grid;
  justify-items: center;
  align-items: start;
  pointer-events: none;
}
.game:not(.is-drawn) .game-art { margin-top: max(11px, calc(36px - var(--vertical-cut) * .37)); }
.game-artwork {
  position: relative;
  width: min(100%, calc(var(--game-art-size) * 1.2037));
  isolation: isolate;
}
.game-image {
  width: 100%;
  height: auto;
  user-select: none;
}
.personal-floor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
}
.personal-envelope {
  --rise: calc(3.8 * var(--unit));
  position: relative;
  animation: personal-hover 8.4s ease-in-out -2.1s infinite;
}
@keyframes personal-hover {
  0%, 100% { transform: translateY(var(--rise)); }
  50% { transform: translateY(calc(-1 * var(--rise))); }
}
.motion-asleep .personal-envelope,
.game-artwork.is-frozen .personal-envelope { animation-play-state: paused; }
.game-artwork.is-handing-off .personal-envelope { animation: none; }
.stack-stage { position: relative; width: 100%; aspect-ratio: 390 / 322; }
.stack-depth, .stack-paper, .stack-float, .stack-shadow, .stack-image, .stack-seal { position: absolute; inset: 0; }
.stack-paper { transform-origin: 53% 51%; }
.stack-depth, .stack-face, .draw-outgoing .stack-paper { transform-origin: 0 0; }
.stack-image { width: 100%; height: 100%; }
.stack-stage { --front-cycle: 7.8s; --front-phase: -1.45s; }
.stack-rear {
  --settle-y: 9px; --settle-turn: 1.5deg; --settle-delay: 0ms;
  --hover-height: calc(2.1 * var(--unit)); --hover-side: .75px; --hover-tilt: .21deg;
  --hover-cycle: 10.1s; --hover-phase: -5.2s;
}
.stack-middle {
  --settle-y: 7px; --settle-turn: 1deg; --settle-delay: 33ms;
  --hover-height: calc(2.7 * var(--unit)); --hover-side: .85px; --hover-tilt: .24deg;
  --hover-cycle: 8.7s; --hover-phase: -3.7s;
}
.stack-face {
  --settle-y: 5px; --settle-turn: .55deg; --settle-delay: 64ms;
  --hover-height: calc(3.7 * var(--unit)); --hover-side: 1px; --hover-tilt: .29deg;
  --hover-cycle: var(--front-cycle); --hover-phase: var(--front-phase);
}
.game.is-intro .stack-paper { animation: stack-arrival 440ms var(--ease) var(--settle-delay) both; }
.game.is-intro .stack-sparks { animation: opening-label 400ms ease-out both; }
@keyframes stack-arrival {
  from { transform: translateY(var(--settle-y)) rotate(var(--settle-turn)); opacity: .62; }
  to { transform: none; opacity: 1; }
}
.stack-float {
  transform-origin: 52% 47%;
  animation: envelope-hover var(--hover-cycle) ease-in-out var(--hover-phase) infinite;
}
@keyframes envelope-hover {
  0%, 100% {
    transform: translate3d(calc(-1 * var(--hover-side)), var(--hover-height), 0) rotate(calc(-1 * var(--hover-tilt)));
  }
  50% {
    transform: translate3d(var(--hover-side), calc(-1 * var(--hover-height)), 0) rotate(var(--hover-tilt));
  }
}
.stack-shadow { animation: hovering-shadow var(--front-cycle) ease-in-out var(--front-phase) infinite; }
@keyframes hovering-shadow {
  0%, 100% { opacity: .99; transform: scale(.986, .975); }
  50% { opacity: .74; transform: scale(1.026, 1.012); }
}
.motion-asleep :is(.stack-float, .stack-shadow),
body:has(.sheet[open]) :is(.stack-float, .stack-shadow) { animation-play-state: paused; }
.envelope-light {
  --poster: url("./assets/envelope/body-pose.webp");
  --rim-x: 47%;
  --rim-y: 49%;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .33;
}
.envelope-light[data-art="stack"] {
  --poster: url("./assets/stack-layers/front.webp");
  --rim-x: 43%;
  --rim-y: 40%;
}
.envelope-light::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--poster) center / 100% 100% no-repeat;
  filter: brightness(1.67) saturate(1.12);
  mask-image:
    radial-gradient(ellipse 44% 48% at 17% 32%, #000 9%, #000b 31%, transparent 76%),
    radial-gradient(ellipse 15% 21% at var(--rim-x) var(--rim-y), #000c 5%, #0006 40%, transparent 78%);
}
.envelope-light[data-art="stack-seal"]::before {
  background: url("./assets/stack-layers/seal.webp") center / 100% 100% no-repeat;
  filter: brightness(1.42) saturate(1.13);
  mask-image: radial-gradient(ellipse 13% 16% at 40% 37%, #000 5%, #0008 60%, transparent 78%);
}
.game-artwork .envelope-light { animation: envelope-light 11.4s ease-in-out -2.4s infinite; }
@keyframes envelope-light {
  0%, 100% { opacity: .17; }
  46%, 52% { opacity: .91; }
}
.motion-asleep .game-artwork .envelope-light,
.game-artwork.is-frozen .envelope-light,
body:has(.sheet[open], .reveal-dialog[open]) .game-artwork .envelope-light { animation-play-state: paused; }
.draw-outgoing { position: absolute; z-index: 1; pointer-events: none; }
.draw-outgoing :is(.envelope-light, .stack-float, .stack-shadow) { animation: none; }
.game.is-drawn .game-art { align-items: end; }
.game-copy { margin-inline: var(--horizontal); }
.game h2 {
  min-height: 70px;
  height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 27px;
  font-size: clamp(32px, 9.75vw, 40px);
  font-weight: 690;
  line-height: .985;
  letter-spacing: -.025em;
}
.game.is-drawn h2 { font-size: clamp(34px, 11.4vw, 46px); }
.game:not(.is-drawn) h2 { margin-bottom: 15px; }
.wishes-reminder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 3vw, 12px);
  width: 100%;
  min-height: 62px;
  margin-bottom: 12px;
  padding: 8px clamp(9px, 3vw, 13px);
  border: 1px solid #d6be7866;
  border-radius: 14px;
  background: radial-gradient(ellipse at 0 0, #d5ae5327, transparent 75%),
    linear-gradient(115deg, #163629, #0b2b21);
  box-shadow: inset 0 1px #efd69912;
  transition: border-color 220ms ease, transform 220ms var(--ease);
}
.wishes-reminder-icon {
  display: grid;
  place-items: center;
  width: 37px;
  aspect-ratio: 1;
  border-radius: 10px;
  color: var(--gold);
  background: #d8aa3020;
}
.wishes-reminder strong,
.wishes-reminder small { display: block; }
.wishes-reminder strong {
  color: var(--gold);
  font-size: clamp(14px, 4vw, 17px);
  line-height: 1.22;
  font-weight: 690;
}
.wishes-reminder small {
  color: var(--muted);
  font-size: clamp(11px, 3.2vw, 13px);
  line-height: 1.3;
  margin-top: 3px;
}
.wishes-reminder > .icon {
  width: 18px;
  height: 18px;
  color: #e8ca83;
  transition: transform 220ms var(--ease);
}
.wishes-reminder:active { transform: scale(.99); }
@media (hover: hover) {
  .wishes-reminder:hover { border-color: #e5c77dc9; }
  .wishes-reminder:hover > .icon { transform: translateX(2px); }
}
.people { padding: max(49px, calc(var(--safe-top) + 12px)) 16px calc(94px + var(--safe-bottom)); }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.section-header h1 { font-size: 32px; font-weight: 740; line-height: 1.14; letter-spacing: -.033em; }
.section-header p { color: var(--muted); margin-top: 5px; font-size: 15px; line-height: 21px; }
.people .section-header { margin-inline: 7px 3px; }
.manage { margin-top: 9px; min-height: 39px; }
.manage-wrap { position: relative; }
.roster-menu {
  position: absolute;
  z-index: 3;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  display: grid;
  background: #14362a;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 5px;
  box-shadow: 0 5px 18px #001710aa;
}
.roster-menu button { min-height: 42px; padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.roster-menu button:hover { background: #245242; }
.pair-card {
  position: relative;
  margin-top: 28px;
  padding: 16px 17px 8px;
  border-radius: 20px;
  border: 1px solid #c9d29f38;
  background: linear-gradient(148deg, #183d2c, #09281d 67%, #08241a);
  overflow: hidden;
}
.pair-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 62px;
  height: 46px;
  border-radius: 19px 0 0;
  box-shadow: inset 2px 2px 10px #f6c36890;
  mask-image: radial-gradient(ellipse at left top, #000 10%, #0000 77%);
  pointer-events: none;
  animation: card-light 510ms ease-out both;
}
@keyframes card-light { from { opacity: .25; } 45% { opacity: 1; } to { opacity: .77; } }
.pair-card header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 11px; }
.pair-card header > .icon { width: 36px; height: 32px; color: var(--gold); }
.pair-card h2, .singles h2 { font-size: 25px; font-weight: 700; letter-spacing: -.031em; line-height: 1.12; }
.pair-card header p { color: var(--muted); margin-top: 4px; font-size: 13px; line-height: 19px; }
.roster-row {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 50px;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 590;
}
.roster-row + .roster-row, .singles .roster-row { border-top: 1px solid var(--line); }
.roster-row > .icon { color: var(--gold); width: 32px; height: 24px; }
.singles { margin: 26px 7px 0; }
.singles h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.singles h2 .icon { color: var(--gold); }
.singles .roster-row { min-height: 54px; }
.singles .roster-row:first-child { border-top: 0; }
.singles ul { border-bottom: 1px solid var(--line); }
.monogram {
  width: 37px;
  height: 37px;
  background: #234932;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 16px;
  font-weight: 520;
}
.inline-remove { margin-left: auto; color: var(--muted); }
.inline-remove .icon { width: 18px; height: 18px; }
.edit-pair { margin: 10px 0 4px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.wishes { padding: max(49px, calc(var(--safe-top) + 12px)) var(--horizontal) calc(100px + var(--safe-bottom)); }
.wishes .section-header { min-height: 82px; border-bottom: 1px solid var(--line); }
.wishes .section-header h1 { font-size: clamp(26px, 7.7vw, 32px); }
.wishes .section-header p { font-size: 17px; }
#letter-form { display: grid; gap: 18px; padding-top: 21px; }
#letter-form label { display: grid; gap: 9px; font-size: 18px; font-weight: 660; }
textarea, .sheet-field input, .sheet-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--light);
  font-weight: 430;
  font-size: 17px;
}
textarea {
  min-height: 96px;
  resize: vertical;
  display: block;
  border-radius: 13px;
  border: 1px solid #e1e2b765;
  padding: 12px 14px;
  background: #0a291f;
  line-height: 1.36;
  transition: border-color 100ms;
  scroll-margin-bottom: 42px;
}
textarea::placeholder { color: #d7ceba; opacity: 1; }
textarea:focus { border-color: var(--gold); outline: none; }
#letter-form .solid { margin-top: 8px; }
.sheet, .reveal-dialog {
  color: var(--light);
  border: 0;
  margin: auto;
  width: min(100%, 430px);
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet {
  position: fixed;
  inset: auto 0 0;
  max-height: 94dvh;
  border-radius: 28px 28px 0 0;
  padding: 0 var(--horizontal) calc(28px + var(--safe-bottom));
  background: linear-gradient(165deg, #10342a, #08281f 57%, #062018);
  box-shadow: inset 0 1px #87aa7638;
  isolation: isolate;
}
.sheet[open] { animation: sheet-rise 330ms var(--ease) both; }
.sheet::backdrop { background: #0009; animation: scrim 290ms var(--ease) both; }
.sheet[open].is-closing::backdrop { animation: scrim-away 240ms ease-out both; }
@keyframes sheet-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scrim { from { opacity: 0; } to { opacity: .91; } }
@keyframes scrim-away { from { opacity: var(--scrim-start, .91); } to { opacity: 0; } }
.grip-zone { display: grid; place-items: start center; height: 39px; padding-top: 13px; touch-action: none; }
.grip { height: 4px; width: 43px; border-radius: 9px; background: #87ae9b7a; }
.sheet h2 { font-weight: 730; line-height: 1.13; letter-spacing: -.034em; }
.sheet p { color: var(--muted); font-size: 15px; line-height: 1.43; }
.cancel { display: block; margin: 6px auto 0; font-size: 16px; }
.sheet .error { color: #ffc29f; text-align: left; border-left: 1px solid currentColor; padding-left: 9px; margin-block: 8px; }
.sheet-pair { min-height: 417px; }
.sheet-pair h2 { display: flex; align-items: center; gap: 13px; font-size: 25px; }
.sheet-pair h2:focus { outline: none; }
.sheet-pair h2 .icon { color: var(--gold); width: 31px; height: 28px; }
.sheet-pair p { margin-top: 8px; }
.sheet-pair form { margin-top: 23px; }
.sheet-field {
  position: relative;
  display: grid;
  min-height: 61px;
  align-content: center;
  gap: 1px;
  background: #16392e;
  border-radius: 13px;
  padding: 8px 13px;
  font-size: 13px;
  color: #e3dcc4;
}
.sheet-field + .sheet-field { margin-top: 13px; }
.sheet-field select { appearance: none; color: var(--gold); min-height: 28px; padding-right: 24px; cursor: pointer; }
.sheet-field select option { background: #143329; color: var(--light); }
.sheet-field > .icon { position: absolute; right: 13px; top: 23px; width: 16px; height: 16px; pointer-events: none; }
.sheet-pair .solid { margin-top: 26px; }
.sheet-pair .cancel { margin-top: 9px; }
.sheet-draw { min-height: 480px; text-align: center; }
.sheet-draw .grip-zone { height: 54px; }
.sheet-draw h2 { font-size: clamp(33px, 9.6vw, 39px); }
.draw-stats { display: flex; justify-content: center; align-items: center; gap: 8px; color: #eaddba; font-size: 14px; margin: 9px 0 19px; }
.draw-stats .icon { color: var(--gold); width: 24px; height: 21px; }
.sheet-draw form { margin-top: 34px; }
.sheet-draw .cancel { margin-top: 11px; }
.sheet-join h2 { font-size: 27px; margin-bottom: 14px; }
.sheet-join .solid { margin-top: 17px; }
.sheet-login h2 { font-size: clamp(24px, 7.25vw, 30px); max-width: 13ch; margin-bottom: 8px; }
.sheet-login > p { color: var(--gold); }
.sheet-login form { margin-top: 21px; }
.sheet-login .sheet-field:focus-within { box-shadow: 0 0 0 1px var(--gold); }
.sheet-login .sheet-field input { min-height: 29px; outline: none; }
.sheet-login .field-hint { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 9px 0 0; }
.sheet-login .solid { margin-top: 19px; }

.reveal-dialog {
  position: fixed;
  inset: 0;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  background: var(--base);
}
.reveal-dialog::backdrop { background: #021810; }
.reveal-content {
  position: relative;
  min-height: 100%;
  isolation: isolate;
}
.reveal-close { top: max(10px, var(--safe-top)); right: 9px; z-index: 8; }
.scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.opening {
  position: absolute;
  z-index: 4;
  top: min(calc(607 * var(--unit)), 76dvh);
  inset-inline: 16px;
  text-align: center;
  font-size: 22px;
  font-weight: 690;
  line-height: 1.35;
  animation: opening-label 340ms ease-out 100ms both;
}
@keyframes opening-label { from { opacity: 0; } to { opacity: 1; } }
.result {
  position: relative;
  z-index: 1;
  padding: calc(146 * var(--unit)) var(--horizontal) calc(40px + var(--safe-bottom));
  text-align: center;
}
.result-header { animation: reveal-title 170ms var(--ease) both; }
.result-header p {
  color: var(--gold);
  font-size: calc(20 * var(--unit));
  font-weight: 670;
  line-height: calc(25 * var(--unit));
}
.result h1 {
  font-size: clamp(38px, calc(58 * var(--unit)), 64px);
  line-height: calc(64 * var(--unit));
  font-weight: 705;
  letter-spacing: -.026em;
  overflow-wrap: anywhere;
}
@keyframes reveal-title {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.portrait {
  width: calc(220 * var(--unit));
  height: calc(220 * var(--unit));
  margin: calc(22 * var(--unit)) auto 0;
  position: relative;
  border-radius: 50%;
  isolation: isolate;
  animation: opening-label 160ms ease-out both;
}
.portrait-crop, .portrait-rim {
  position: absolute;
  border-radius: inherit;
}
.portrait-crop {
  inset: 2px;
  overflow: hidden;
  background: #102e23;
  display: grid;
  place-items: center;
}
.portrait-rim {
  inset: 0;
  border: 2px solid #cfa25a;
  pointer-events: none;
}
.portrait-initial {
  font-size: calc(68 * var(--unit));
  color: var(--gold);
  opacity: 0;
  font-weight: 580;
  transition: opacity 160ms;
}
.show-photo .portrait-initial { opacity: 1; }
.show-photo.has-photo .portrait-initial { opacity: 0; }
.portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(.97);
}
.has-photo .portrait-image { animation: bring-portrait 170ms var(--ease) both; }
.portrait-reflection {
  position: absolute;
  left: calc(88.18% - 7px);
  top: calc(11.36% - 7px);
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #fff4c5ba 0 10%, #ffce6550 26%, #ffbe4200 71%);
  pointer-events: none;
  opacity: 0;
}
#scene[data-finished] ~ #recipient .portrait-reflection {
  animation: opening-label 190ms ease-out both;
}
@keyframes bring-portrait {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}
.result-tail { margin-top: 26px; visibility: hidden; }
.show-letter .result-tail { visibility: visible; animation: reveal-title 160ms var(--ease) both; }
.result-letter {
  min-height: 95px;
  padding: 17px 20px;
  border-radius: 15px;
  background: #0f3026;
  text-align: left;
  overflow-wrap: anywhere;
}
.result-letter h2 { font-size: 23px; line-height: 1.2; font-weight: 710; letter-spacing: -.03em; }
.result-letter p { font-size: 16px; line-height: 1.42; margin-top: 6px; white-space: pre-wrap; }
.result-tail .solid { margin-top: 43px; }
.notice {
  position: fixed;
  z-index: 2;
  inset: auto 16px calc(80px + var(--safe-bottom));
  width: fit-content;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  margin: auto;
  border-radius: 10px;
  color: var(--light);
  background: #173d30;
  box-shadow: 0 3px 22px #0006;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 360px) {
  .meta { gap: 7px; font-size: 13px; }
  .entry h1 { font-size: 40px; }
  .people .section-header h1 { font-size: 28px; }
  .manage { padding-inline: 8px; gap: 5px; font-size: 12px; }
  .sheet-pair .solid { margin-top: 17px; }
}
@media (max-height: 730px) {
  .entry .profile-options { margin-top: 15px; }
  .game h2 { margin-bottom: 18px; }
  .sheet-draw { min-height: min(480px, 92dvh); padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .game-artwork .envelope-light { animation: none; }
  .game.is-intro :is(.stack-paper, .stack-sparks),
  .stack-float, .stack-shadow, .personal-envelope { animation: none; }
  .profile-option input:checked + span::before { animation: none; opacity: 0; }
  .solid:active:not(:disabled) { transform: none; }
  .wishes-reminder:active, .wishes-reminder:hover > .icon { transform: none; }
  .solid::after { animation: none !important; opacity: 0 !important; }
}
