:root {
  --night: #080c24;
  --gold: #f4d38b;
  --gold-soft: #ffeabb;
  --gold-deep: #b9832f;
  --cream: #fff6e6;
  --paper: #fbf1de;
  --ink: #3a2130;
  --berry: #b3253f;
  --wine: #6d0f2a;
  --rose: #f6a2b8;
  --serif: "Fraunces", Georgia, serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --hand: "Caveat", "Bradley Hand", cursive;
  --letter: "Nothing You Could Do", "Caveat", cursive;
  --ui: "Nunito", system-ui, -apple-system, sans-serif;
  --gold-gradient: linear-gradient(165deg, #fff0c6 0%, #f1cb7c 38%, #b9832f 62%, #f6d996 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.no-scroll, html.no-scroll body { overflow: hidden; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--ui);
  font-weight: 500;
  color: var(--cream);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 3px; }
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
svg { display: block; }

/* ---------- sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #060920 0%, #101746 34%, #27195a 62%, #542458 86%, #7d3358 100%);
}
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky__aurora {
  position: absolute;
  inset: -20% -30% 30% -30%;
  background:
    radial-gradient(42% 30% at 22% 42%, rgba(70, 190, 170, .20), transparent 70%),
    radial-gradient(40% 34% at 74% 30%, rgba(150, 100, 230, .24), transparent 70%),
    radial-gradient(50% 26% at 55% 70%, rgba(240, 120, 150, .14), transparent 70%);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-3%, 0, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}
.sky__moon {
  position: absolute;
  top: max(66px, 8vh);
  left: 7vw;
  width: clamp(44px, 9vw, 86px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 34%, rgba(190, 160, 120, .35) 0 8%, transparent 9%),
    radial-gradient(circle at 38% 64%, rgba(190, 160, 120, .3) 0 12%, transparent 13%),
    radial-gradient(circle at 70% 68%, rgba(190, 160, 120, .25) 0 6%, transparent 7%),
    radial-gradient(circle at 35% 35%, #fffdf3, #f6e3b8 70%, #e7c98f);
  box-shadow: 0 0 30px 8px rgba(255, 230, 170, .35), 0 0 110px 40px rgba(255, 215, 150, .16);
}
#snow, #fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#snow { z-index: 15; }
#fx { z-index: 90; }

/* ---------- fairy lights ---------- */
.garland { position: absolute; top: env(safe-area-inset-top); left: 0; right: 0; height: 60px; pointer-events: none; }
.garland svg { width: 100%; height: 100%; overflow: visible; }
.garland .bulb { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- header ---------- */
.home { position: relative; min-height: 100dvh; display: flex; flex-direction: column; }
.hero { text-align: center; padding: calc(env(safe-area-inset-top) + 92px) 16px 22px; position: relative; }
.eyebrow {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .42em;
  text-indent: .42em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero__title { line-height: 1; margin-top: 10px; }
.hero__small {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  color: var(--cream);
  opacity: .92;
}
.hero__script {
  display: block;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 16vw, 7rem);
  line-height: 1.12;
  padding: 0 .12em;
  background: var(--gold-gradient);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 196, 100, .35));
}
.hero__greeting { font-family: var(--hand); font-size: 1.55rem; color: var(--rose); min-height: 1.6em; width: max-content; max-width: 100%; margin: 2px auto 0; cursor: pointer; transition: opacity .4s, translate .4s; }
.hero__greeting.is-changing { opacity: 0; translate: 0 -6px; }
.countdown {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 26px 13px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
  border: 1px solid rgba(244, 211, 139, .32);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.countdown__main { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.countdown__main b { color: var(--gold); font-size: 1.5rem; margin-right: .1em; }
.countdown__next { font-size: .82rem; opacity: .78; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- dock ---------- */
.dock { position: fixed; z-index: 25; top: calc(env(safe-area-inset-top) + 56px); right: 12px; display: flex; gap: 10px; }
.dock__btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-soft);
  background: rgba(14, 18, 52, .78);
  border: 1px solid rgba(244, 211, 139, .42);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  transition: transform .2s;
}
.dock__btn:active { transform: scale(.92); }
.dock__btn svg { width: 23px; height: 23px; }
.dock__btn[aria-pressed="true"] { background: var(--gold-gradient); color: var(--wine); }
.dock__btn[aria-pressed="false"]#musicBtn::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-soft);
  transform: rotate(-45deg);
}
.dock__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--berry);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  line-height: 20px;
  box-shadow: 0 0 0 2px var(--night);
}

/* ---------- calendar board ---------- */
.board {
  width: min(100% - 20px, 940px);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 28px);
  border-radius: 30px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 220, 160, .13), transparent 60%),
    linear-gradient(180deg, rgba(34, 28, 82, .62), rgba(24, 16, 56, .72));
  border: 1px solid rgba(244, 211, 139, .28);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .42), inset 0 0 0 5px rgba(8, 10, 32, .35), inset 0 0 0 6px rgba(244, 211, 139, .18);
  position: relative;
  z-index: 2;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(9px, 2.4vw, 16px);
  grid-template-areas:
    "d7  d12 d3  d19"
    "d15 d1  d22 d9"
    "d6  d6  d17 d4"
    "d21 d24 d24 d11"
    "d2  d24 d24 d16"
    "d13 d8  d20 d5"
    "d18 d23 d10 d14";
}
@media (min-width: 700px) {
  .mascot { right: 12px; bottom: 10px; }
  .mascot__btn { width: 92px; height: 92px; }
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas:
      "d7  d12 d1  d1  d19 d3"
      "d15 d22 d9  d17 d4  d21"
      "d6  d6  d24 d24 d11 d2"
      "d16 d8  d24 d24 d13 d13"
      "d20 d5  d18 d23 d10 d14";
  }
}

/* ---------- doors ---------- */
@media (min-width: 700px) {
  .grid .door[data-n="1"], .grid .door[data-n="13"] { aspect-ratio: auto; width: 100%; height: 100%; --radius: 56px 56px 14px 14px; }
}
.door {
  --radius: 14px;
  --frame: 4px;
  position: relative;
  aspect-ratio: 3 / 4;
  min-width: 0;
  border-radius: var(--radius);
  background: var(--gold-gradient);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .42);
  perspective: 620px;
  opacity: 0;
  animation: door-in .7s cubic-bezier(.2, .9, .3, 1.25) forwards;
  animation-delay: calc(var(--i) * 38ms);
  transition: scale .18s;
}
@keyframes door-in { from { opacity: 0; transform: translateY(26px) scale(.86); } to { opacity: 1; transform: none; } }
.door.is-settled { animation: none; opacity: 1; }
.door:active { scale: .96; }
.door--arch { --radius: 50% 50% 14px 14px / 30% 30% 14px 14px; }
/* Wide and large doors fill their grid area instead of keeping the single-door ratio. */
.door--span { aspect-ratio: auto; width: 100%; height: 100%; }

.door__inside, .door__leaf, .door__face {
  position: absolute;
  display: block;
  border-radius: var(--radius);
}
.door__inside {
  inset: var(--frame);
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #ffe2a8, #d3813f 48%, #5d2230 100%);
}
.door__inside img { width: 100%; height: 100%; object-fit: cover; }
.door__inside::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 9px 0 18px rgba(30, 6, 10, .55), inset 0 0 14px rgba(255, 190, 90, .55);
}
.door__icon { position: absolute; inset: 0; display: grid; place-items: center; color: #fff3d2; }
.door__icon svg { width: 48%; height: auto; filter: drop-shadow(0 3px 8px rgba(90, 20, 20, .6)); }
.door__chip {
  position: absolute;
  z-index: 1;
  right: 5px;
  bottom: 5px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: rgba(255, 246, 230, .94);
  color: var(--wine);
  font-family: var(--serif);
  font-weight: 800;
  font-size: .82rem;
  line-height: 24px;
  text-align: center;
  opacity: 0;
  transition: opacity .4s .8s;
}
.door.is-open .door__chip { opacity: 1; }

.door__leaf {
  inset: var(--frame);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(.62, .02, .22, 1);
}
.door__face { inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden; }
.door__face--back {
  transform: rotateY(180deg);
  background: repeating-linear-gradient(90deg, #7a4a2c 0 9px, #6b3f25 9px 11px, #855333 11px 22px);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .45);
}
.door__face--front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--gold-soft);
}
.door__face--front::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 225, 160, .55);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .12), inset 0 0 0 4px rgba(255, 225, 160, .2);
}
.door__face--front::after {
  /* soft light sweeping over the paint */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, .2) 0%, transparent 32%, transparent 70%, rgba(0, 0, 0, .22) 100%);
}
.door__ornament { width: clamp(15px, 4.6vw, 26px); opacity: .95; position: relative; }
.door__ornament svg { width: 100%; height: auto; }
.door__num {
  position: relative;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.7rem, 8.4vw, 2.9rem);
  line-height: 1;
  font-variant-numeric: lining-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .18), 0 3px 5px rgba(0, 0, 0, .35);
}
.door__knob {
  position: absolute;
  z-index: 1;
  right: 9%;
  top: 56%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6d8, #d8a548 55%, #6d4612);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
}

.theme-red .door__face--front {
  background: radial-gradient(rgba(255, 215, 140, .3) 1px, transparent 1.7px) 0 0 / 13px 13px, linear-gradient(165deg, #bd2c48, #690d27);
}
.theme-green .door__face--front {
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 11px), linear-gradient(165deg, #277a5d, #0a342a);
}
.theme-blue .door__face--front {
  background:
    radial-gradient(#fff 0 .7px, transparent 1.4px) 3px 5px / 23px 27px,
    radial-gradient(rgba(255, 255, 255, .7) 0 .5px, transparent 1.2px) 14px 18px / 31px 29px,
    linear-gradient(165deg, #35579f, #101c49);
}
.theme-plum .door__face--front {
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 150, .1) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(-45deg, rgba(255, 215, 150, .1) 0 1px, transparent 1px 12px),
    linear-gradient(165deg, #7a3376, #34123f);
}
.theme-cream .door__face--front {
  background: radial-gradient(rgba(179, 37, 63, .22) 1px, transparent 1.7px) 0 0 / 12px 12px, linear-gradient(165deg, #fff8ea, #e8cfa6);
  color: var(--berry);
}
.theme-cream .door__face--front::before { border-color: rgba(179, 37, 63, .5); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35), inset 0 0 0 4px rgba(179, 37, 63, .22); }
.theme-cream .door__num { text-shadow: 0 2px 0 rgba(255, 255, 255, .7); }
.theme-candy .door__face--front {
  background: repeating-linear-gradient(135deg, #b3253f 0 11px, #f9ead9 11px 18px, #b3253f 18px 20px, #1f6a52 20px 31px, #f9ead9 31px 38px);
  color: var(--wine);
}
.theme-candy .door__face--front::before {
  inset: 50% auto auto 50%;
  width: 76%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, #fffaf0, #f0dcb7);
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}
.door--span.theme-candy .door__face--front::before { width: auto; height: 84%; }
.theme-candy .door__ornament { width: clamp(12px, 3.4vw, 20px); }
.theme-candy .door__num { font-size: clamp(1.4rem, 6.6vw, 2.4rem); text-shadow: none; }

.door__snow { position: absolute; left: -3px; right: -3px; top: -7px; height: 16px; pointer-events: none; z-index: 3; filter: drop-shadow(0 2px 2px rgba(20, 20, 60, .35)); }
.door__snow svg { width: 100%; height: 100%; }

.door__lock {
  position: absolute;
  z-index: 1;
  bottom: 7%;
  width: 15px;
  height: 15px;
  opacity: 0;
}
.door.is-locked .door__lock { opacity: .8; }
.door.is-locked .door__face--front { filter: brightness(.74) saturate(.78); }
.door.is-locked .theme-cream .door__face--front { filter: brightness(.84) saturate(.8); }

.door__tag {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: -9px;
  translate: -50% 0;
  padding: 2px 10px 3px;
  border-radius: 999px;
  background: var(--gold-gradient);
  color: var(--wine);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4);
  pointer-events: none;
}

/* Today's door stands ajar with light spilling out. */
.door.is-today:not(.is-open) { z-index: 5; }
.door.is-today:not(.is-open)::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px rgba(255, 231, 170, .9), 0 0 26px 9px rgba(255, 196, 92, .7);
  animation: halo 1.8s ease-in-out infinite;
  pointer-events: none;
}
.door.is-today:not(.is-open) .door__leaf { animation: ajar 3.2s ease-in-out infinite; }
.door.is-ready:not(.is-today):not(.is-open)::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: var(--radius);
  box-shadow: 0 0 16px 3px rgba(255, 205, 110, .5);
  animation: halo 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes halo { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes ajar { 0%, 100% { transform: rotateY(-7deg); } 50% { transform: rotateY(-23deg); } }

.door.is-open { z-index: 3; }
.door.is-open .door__leaf { transform: rotateY(-104deg); }
.door.is-shaking { animation: shake .5s; opacity: 1; }
@keyframes shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -6px 0; rotate: -2deg; }
  40% { translate: 5px 0; rotate: 2deg; }
  60% { translate: -4px 0; rotate: -1deg; }
  80% { translate: 3px 0; }
}

/* The grand double door for Christmas Eve. */
.door--double { --radius: 50% 50% 20px 20px / 28% 28% 20px 20px; --frame: 6px; perspective: 900px; }
.door--double .door__leaf { width: calc(50% - var(--frame)); right: auto; border-radius: 0; }
.door--double .door__leaf--left { border-radius: 100% 0 0 18px / 28% 0 0 18px; }
.door--double .door__leaf--right { left: 50%; right: var(--frame); width: auto; transform-origin: 100% 50%; border-radius: 0 100% 18px 0 / 0 28% 18px 0; }
.door--double .door__face { border-radius: inherit; }
.door--double .door__face--front::before { inset: 9px 7px; border-radius: inherit; }
.door--double .door__knob { width: 11px; height: 11px; top: 60%; }
.door--double .door__leaf--left .door__knob { right: 8px; }
.door--double .door__leaf--right .door__knob { right: auto; left: 8px; }
.door--double.is-open .door__leaf--left { transform: rotateY(-106deg); }
.door--double.is-open .door__leaf--right { transform: rotateY(106deg); }
.door--double.is-today:not(.is-open) .door__leaf--left { animation: ajar 3.2s ease-in-out infinite; }
.door--double.is-today:not(.is-open) .door__leaf--right { animation: ajar-right 3.2s ease-in-out infinite; }
@keyframes ajar-right { 0%, 100% { transform: rotateY(7deg); } 50% { transform: rotateY(21deg); } }
.door__medal {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 46%;
  translate: -50% -50%;
  width: 74%;
  pointer-events: none;
  transition: opacity .5s, scale .7s;
}
.door__medal svg { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.door.is-open .door__medal { opacity: 0; scale: 1.25; }

/* ---------- landscape footer ---------- */
.land { margin-top: auto; padding-top: 28px; position: relative; }
.land svg { width: 100%; height: clamp(170px, 34vw, 320px); }
.land__note {
  background: #e9edfc;
  color: #5b4a7a;
  text-align: center;
  font-family: var(--hand);
  font-size: 1.3rem;
  padding: 2px 70px calc(env(safe-area-inset-bottom) + 22px);
  margin-top: -1px;
}
.land .win { animation: windowlight 4s ease-in-out infinite; }
@keyframes windowlight { 0%, 100% { opacity: 1; } 50% { opacity: .68; } }
.land .tail { transform-box: fill-box; transform-origin: 100% 100%; animation: wag .75s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-12deg); } to { transform: rotate(16deg); } }
.thari .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.08); } }

/* ---------- mascot ---------- */
.mascot { position: fixed; z-index: 22; right: -8px; bottom: calc(env(safe-area-inset-bottom) - 6px); display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.mascot__btn { pointer-events: auto; width: 64px; height: 64px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45)); animation: bob 3.4s ease-in-out infinite; }
.mascot__btn svg { width: 100%; height: 100%; }
.mascot__btn.is-happy { animation: hop .6s ease; }
.mascot__btn .ear { transform-box: fill-box; transform-origin: 50% 10%; transition: transform .25s; }
.mascot__btn.is-happy .ear-l { transform: rotate(22deg); }
.mascot__btn.is-happy .ear-r { transform: rotate(-22deg); }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: -17deg; } 50% { translate: -2px -5px; rotate: -10deg; } }
@keyframes hop { 30% { translate: 0 -22px; scale: 1.08; } 60% { translate: 0 0; scale: .96 1.02; } }
.mascot__bubble {
  max-width: min(240px, 66vw);
  margin: 0 18px 4px 0;
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 1.22rem;
  line-height: 1.15;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  opacity: 0;
  translate: 0 8px;
  transition: opacity .3s, translate .3s;
}
.mascot__bubble.is-visible { opacity: 1; translate: 0 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 85;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  translate: -50% 16px;
  width: max-content;
  max-width: min(92vw, 420px);
  padding: 12px 20px;
  border-radius: 20px;
  background: rgba(255, 246, 230, .97);
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, translate .3s;
}
.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ---------- lock screen ---------- */
.lock {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 56px) 16px calc(env(safe-area-inset-bottom) + 24px);
  transition: opacity .7s, scale .7s;
}
.lock.is-leaving { opacity: 0; scale: 1.08; pointer-events: none; }
.lock__card {
  position: relative;
  width: min(100%, 370px);
  padding: 52px 22px 22px;
  text-align: center;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  border: 1px solid rgba(244, 211, 139, .36);
  box-shadow: 0 34px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16);
  animation: card-in .9s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes card-in { from { opacity: 0; translate: 0 40px; } }
.lock__card.is-wrong { animation: shake .55s; }
.lock__thari { position: absolute; left: 50%; top: -58px; translate: -50% 0; width: 108px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .4)); }
.lock__thari svg { width: 100%; height: auto; }
.lock__title { font-family: var(--script); font-weight: 400; font-size: 3.4rem; line-height: 1.15; background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .1em; }
.lock__text { font-size: .95rem; opacity: .85; }
.lock__dots { display: flex; justify-content: center; gap: 12px; margin: 18px 0 8px; height: 22px; align-items: center; }
.lock__dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--gold); transition: background .15s, scale .2s; position: relative; }
.lock__dot.is-filled { background: var(--gold); scale: 1.15; }
.lock__dot.is-heart { border-color: transparent; background: transparent; }
.lock__dot.is-heart::after { content: "♥"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--rose); font-size: 24px; animation: pop .45s cubic-bezier(.2, .9, .3, 1.6); }
@keyframes pop { from { scale: 0; } }
.lock__hint { font-family: var(--hand); font-size: 1.2rem; color: var(--rose); min-height: 2.5em; display: grid; place-items: center; line-height: 1.1; }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); justify-content: center; gap: 12px 20px; margin-top: 6px; }
.keypad button {
  height: 72px;
  border-radius: 50%;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.7rem;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  transition: background .15s, scale .12s;
  -webkit-user-select: none;
  user-select: none;
}
.keypad button:active, .keypad button.is-pressed { background: rgba(244, 211, 139, .42); scale: .93; }
.keypad button.keypad__del { background: transparent; border-color: transparent; font-size: 1.4rem; }
@media (max-height: 740px) {
  .keypad { grid-template-columns: repeat(3, 62px); gap: 8px 22px; }
  .keypad button { height: 62px; font-size: 1.45rem; }
  .lock__title { font-size: 2.8rem; }
  .lock__dots { margin-top: 10px; }
}

/* very small or short screens */
@media (max-height: 640px) {
  .lock { padding-top: calc(env(safe-area-inset-top) + 46px); padding-bottom: 12px; }
  .lock__card { padding: 34px 16px 14px; }
  .lock__card .eyebrow { display: none; }
  .lock__thari { width: 78px; top: -42px; }
  .lock__title { font-size: 2.3rem; }
  .lock__text { font-size: .85rem; }
  .lock__dots { margin: 8px 0 2px; }
  .lock__hint { font-size: 1rem; min-height: 2.3em; }
  .keypad { grid-template-columns: repeat(3, 54px); gap: 6px 24px; }
  .keypad button { height: 54px; font-size: 1.3rem; }
}
@media (max-width: 360px) {
  .hero { padding-top: calc(env(safe-area-inset-top) + 114px); }
}

.noscript { padding: 40px 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .sky__aurora, .mascot__btn, .garland .bulb, .land .win, .land .tail { animation: none; }
  .door { animation-duration: .01s; animation-delay: 0s; }
  .door.is-today:not(.is-open) .door__leaf { animation: none; transform: rotateY(-15deg); }
  .door--double.is-today:not(.is-open) .door__leaf--right { animation: none; transform: rotateY(15deg); }
}
