@font-face {
  font-family: "Henny Penny";
  src: url("fonts/henny-penny.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Merienda";
  src: url("fonts/merienda.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Exact PlumPop-Christmas.html Ice-Porcelain & Cobalt Gaudí Palette */
  --ink: #263954;
  --muted: #405980;
  --paper: #f3f6fa;
  --cobalt: #284675;
  --cobalt-hover: #345584;
  --ice-tag: #dce8f7;
  --moss: #5d7b45;
  --terracotta: #c6643a;
  --gold: #ecc17c;
  --lettering: "Henny Penny", "Songti SC", "STSong", serif;
  --handwriting: "Merienda", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", cursive;
  font-family: var(--handwriting);
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  background: linear-gradient(180deg, #3f5a7d 0%, #587599 52%, #86a0bc 100%);
  background-attachment: fixed;
}
button, select, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2.5px solid #f7dc9b; outline-offset: 3px; }
button:disabled { cursor: default; }
button:not(:disabled) { cursor: pointer; }

.book {
  position: relative;
  min-height: 100svh;
  padding: 0 0 max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #3f5a7d 0%, #587599 52%, #86a0bc 100%);
  transition: background 0.8s ease, color 0.8s ease;
}

/* Ambient Falling Snow Canvas across Nordic Blue-Hour Sky */
.ambient-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Compact Top-Right Utility Pills (Frosted Nordic Glass) */
.utility-bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
}
.util-pill {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(18, 30, 52, 0.18);
  transition: transform 0.12s ease, background 0.15s ease;
}
.util-pill:hover { background: rgba(255, 255, 255, 0.28); }
.util-pill:active { transform: scale(0.95); }

/* Exact Opening & Pop-Up Gaudí House Scene with Dedicated Warm Porcelain Backlight */
.scene {
  position: relative;
  z-index: 3;
  width: min(calc(100% - 24px), 488px);
  aspect-ratio: 488 / 726;
  container-type: inline-size;
  isolation: isolate;
  --cat-x: 0px;
  --cat-y: 0px;
}
.scene::before {
  content: "";
  position: absolute;
  inset: 10% -8% 12% -8%;
  background: radial-gradient(circle at 50% 48%, rgba(255, 248, 232, 0.46) 0%, rgba(220, 235, 255, 0.18) 44%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.masthead {
  position: absolute;
  left: 8%;
  top: 6.5%;
  width: 84%;
  z-index: 6;
  text-align: center;
  pointer-events: none;
}
.address {
  margin: 0 0 1.8cqw;
  font: 600 3.35cqw/1.4 var(--handwriting);
  color: rgba(235, 244, 255, 0.92);
  text-shadow: 0 1px 8px rgba(20, 34, 58, 0.3);
}
h1 {
  margin: 0;
  font: 400 8.1cqw/1.15 var(--lettering);
  color: #ffffff;
  text-shadow: 0 3px 16px rgba(20, 34, 58, 0.38);
  white-space: nowrap;
}
html[lang="zh"] h1 {
  font-family: "PingFang SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 7.4cqw;
  letter-spacing: 0.04em;
}
.intro {
  margin: 0;
  font: 400 0.94rem/1.55 var(--handwriting);
  text-align: center;
}
.intro:empty { display: none; }
.welcome { display: contents; }
#gift-note {
  position: absolute;
  left: 8%;
  top: 17.5%;
  width: 84%;
  text-align: center;
  color: #fff6dc;
  text-shadow: 0 1px 10px rgba(20, 34, 58, 0.44);
  font-weight: 600;
  z-index: 6;
}

.package-area, .ribbon-grip {
  position: absolute;
  left: 2%;
  top: 33.2%;
  width: 96%;
  aspect-ratio: 1586 / 992;
}
.package-area { z-index: 1; pointer-events: none; }
.package-area img, .paper-motion { display: block; width: 100%; height: 100%; user-select: none; }
.paper-motion { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; }
.cat {
  position: absolute;
  z-index: 4;
  left: 9.8%;
  top: 19.6%;
  width: 58.6%;
  height: auto;
  user-select: none;
  pointer-events: none;
  transform: translate(var(--cat-x), var(--cat-y));
  transform-origin: 77% 82%;
}
.scene:not([data-phase="closed"]) .envelope-closed { visibility: hidden; }
.scene[data-phase="dragging"] .paper-motion,
.scene[data-phase="returning"] .paper-motion,
.scene[data-phase="opening"] .paper-motion,
.scene[data-phase="open"]:has(.house:not([hidden])) .paper-motion {
  opacity: 1;
  filter: brightness(1.07) contrast(1.03) saturate(1.05);
}
.fountain-spray { display: none; position: absolute; z-index: 2; pointer-events: none; }
.scene[data-phase="open"]:has(.house:not([hidden])) .fountain-spray { display: block; filter: brightness(1.08); }
.scene[data-phase="opening"] .cat { animation: make-room 0.59s ease both; }
.scene[data-phase="open"] .cat { visibility: hidden; }
@keyframes make-room {
  from { transform: translate(var(--cat-x), var(--cat-y)); }
  42% { opacity: 1; transform: translate(1cqw, -1.5cqw) rotate(-3deg); }
  to { opacity: 0; transform: translate(-15cqw, -3cqw) rotate(-7deg); }
}

.ribbon-grip {
  z-index: 5;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  clip-path: polygon(42% 8%, 54% 8%, 61% 15%, 70% 12%, 77% 26%, 95% 25%, 98% 34%, 97% 54%, 88% 54%, 84% 55%, 96% 79%, 99% 89%, 97% 95%, 90% 95%, 75% 59%, 71% 47%, 65% 61%, 55% 74%, 51% 70%, 55% 50%, 62% 40%, 53% 32%, 43% 21%);
}
.scene[data-phase="dragging"] .ribbon-grip { cursor: grabbing; }
.scene[data-phase="opening"] .ribbon-grip,
.scene[data-phase="open"] .ribbon-grip { visibility: hidden; }

.drag-tip {
  position: absolute;
  top: 72.3%;
  left: 13%;
  margin: 0;
  color: rgba(240, 247, 255, 0.94);
  text-shadow: 0 1px 6px rgba(18, 30, 52, 0.35);
  font-size: clamp(13px, 3.05cqw, 15px);
}
.scene[data-phase="opening"] .drag-tip,
.scene[data-phase="open"] .drag-tip { visibility: hidden; }

.open-button {
  position: absolute;
  z-index: 11;
  left: 12%;
  top: 77%;
  isolation: isolate;
  min-height: max(44px, 9.65cqw);
  padding: 0.9cqw 5.4cqw 0.9cqw 8.4cqw;
  border: 0;
  color: #1f3354;
  background: transparent;
  font: 600 clamp(12px, 3.7cqw, 18px)/1.4 var(--handwriting);
  transform: rotate(-2.7deg);
  filter: drop-shadow(0 3px 6px rgba(18, 30, 52, 0.32));
  transition: transform 0.16s ease, top 0.29s ease;
}
.open-button::before, .open-button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.open-button::before {
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #fffaf0, #f5e2b5);
  clip-path: polygon(10% 1%, 93% 0, 100% 23%, 99% 99%, 10% 98%, 0 51%);
}
.open-button::after {
  top: 0;
  right: 0;
  width: 8%;
  height: 25%;
  background: #e2bd6c;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.tag-hole {
  position: absolute;
  left: 11%;
  top: 50%;
  width: 8px;
  aspect-ratio: 1;
  translate: 0 -50%;
  background: #587599;
  border: 1px solid #d7ad5c;
  border-radius: 50%;
}
.open-button:hover { transform: translateY(-2px) rotate(-0.8deg); }
.scene[data-phase="opening"] .open-button:not(:focus-visible) { opacity: 0; pointer-events: none; }

/* Buttons (Unified Ice-Porcelain & Cobalt System) */
.button, .text-button, .close { min-height: 40px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  padding: 8px 16px;
  border: 1px solid #b0c4dd;
  background: #eef4fb;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(38, 57, 84, 0.14);
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); background: #ffffff; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: 0.5; }
.button.primary {
  background: var(--cobalt);
  color: #f5f8fc;
  border-color: #1e355b;
  box-shadow: 0 2px 0 rgba(30, 53, 91, 0.35);
}
.button.primary:hover:not(:disabled) { background: var(--cobalt-hover); }
.button.accent {
  background: var(--moss);
  color: #f8faf5;
  border-color: #466033;
}
.button.accent:hover:not(:disabled) { background: #6b8d50; }
.full-width { width: 100%; }

.text-button {
  border: 0;
  background: none;
  color: inherit;
  text-underline-offset: 4px;
  text-decoration: underline;
  padding: 4px 7px;
  font-size: 0.84rem;
  font-weight: 600;
}
.text-button:empty { pointer-events: none; text-decoration: none; }

/* Gaudí House & 24 Facade Doors (6 Featured Windows Spotlighted!) */
.house {
  position: absolute;
  z-index: 3;
  top: 20.6%;
  left: 10%;
  width: 80%;
  aspect-ratio: 1122 / 1402;
  isolation: isolate;
  container-type: inline-size;
}
.house.pop-up { top: 0; left: 0; transform-origin: 0 0; transform: var(--paper-perspective); }
.house-picture, .house-light { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.house-picture {
  filter: brightness(1.09) contrast(1.04) saturate(1.06) drop-shadow(0 12px 18px rgba(17, 29, 52, 0.28));
  transition: filter 0.85s ease;
}
.house.pop-up .house-picture { filter: brightness(var(--paper-daylight, 1)); }
.house-light {
  background: var(--house-art) center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.7s ease;
  mask-image: radial-gradient(ellipse 12% 10% at 18% 83.6%, #000 45%, transparent 96%);
}
.house.night .house-picture { filter: brightness(0.49) saturate(0.66) hue-rotate(6deg) drop-shadow(0 6px 7px #18233f65); }
.house.night.pop-up .house-picture { filter: brightness(0.49) saturate(0.66) hue-rotate(6deg); }
.house.night .house-light { opacity: 0.48; }
.house.night.lit .house-light {
  mask-image: radial-gradient(ellipse 12% 10% at 18% 83.6%, #000 58%, transparent 98%),
    radial-gradient(ellipse 7.7% 7.4% at 66.7% 89%, #0008 32%, transparent 96%);
  opacity: 1;
}
.book.night { background: radial-gradient(ellipse at 50% 38%, #445a7a, #273951 64%, #1d2b42); color: #f0f5ff; }
.book.night .address, .book.night .footer, .book.night .featured-caption { color: #dce7fb; }
.book.night .footer select { color: #f4f7ff; background: #35475f; border-color: #93a9c4; }

.display-window {
  position: absolute;
  z-index: 4;
  inset: 77% 74.4% 10.7% 9.8%;
  overflow: hidden;
  pointer-events: none;
  border-radius: 45% 45% 7% 7%;
}
.ornament {
  position: absolute;
  width: 9%;
  aspect-ratio: 1;
  background: #ffe2a4;
  clip-path: polygon(50% 0,62% 33%,98% 34%,71% 56%,79% 92%,50% 72%,21% 92%,28% 56%,0 34%,37% 33%);
  filter: drop-shadow(0 0 3px #ffc981);
  opacity: 0.92;
}
.ornament:nth-child(3n+2) { clip-path: circle(40%); background: #c6643a; }
.ornament:nth-child(3n+3) { clip-path: polygon(50% 0,62% 39%,100% 50%,62% 61%,50% 100%,38% 61%,0 50%,38% 39%); background: #fff0c9; }

.door-layer { position: absolute; z-index: 5; inset: 0; }
.door {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  color: #20375b;
  touch-action: manipulation;
  --cut: 50% 50% 2px 2px / 24% 24% 2px 2px;
  --face-x: 50%;
  --face-y: 53%;
  --outline-gold: #ecb974;
}
.door-bay {
  position: absolute;
  inset: var(--face-inset);
  perspective: 180px;
  pointer-events: none;
}
.door-bay::before, .door-bay::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--cut);
  opacity: 0;
  pointer-events: none;
}
.door-bay::before {
  background: radial-gradient(ellipse at 57% 58%, #ffe8a9, #d4964a 72%, #65452e);
  box-shadow: inset 0 1px 4px #2a3652;
}
.door-bay::after {
  box-shadow: inset 0 0 0 1.5px var(--outline-gold), 0 0 8px 2px rgba(246, 201, 122, 0.72);
  transition: opacity 0.2s ease;
}
.door-face {
  position: absolute;
  z-index: 1;
  display: block;
  inset: 0;
  border-radius: var(--cut);
  overflow: hidden;
  font: 600 clamp(11px, 4.36cqw, 19px)/1 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  transform-origin: left center;
  transition: transform 0.29s cubic-bezier(0.3, 0.75, 0.27, 1);
}
.door-date {
  position: absolute;
  top: var(--face-y);
  left: var(--face-x);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.door-round { --cut: 50%; --face-y: 51%; }
.door-left-leaf { --cut: 90% 0 1px 1px / 27% 0 1px 1px; --face-x: 52%; }
.door-right-leaf { --cut: 0 90% 1px 1px / 0 27% 1px 1px; --face-x: 48%; }
.door-left-leaf .door-face, .door-right-leaf .door-face {
  font-family: Arial, sans-serif;
  font-size: clamp(10px, 3.5cqw, 14px);
}
.door-left-leaf .door-date, .door-right-leaf .door-date { transform: translate(-50%, -50%) scaleX(0.68); }
#door-22, #door-23 { --cut: 1px; }
.door-front { --cut: 51% 49% 20% 20% / 48% 48% 18% 18%; --face-y: 37%; }
.door-front .door-face { font-size: clamp(16px, 6.2cqw, 25px); }

/* Visual Hierarchy Across All 24 Doors on the Bright Ice-Porcelain Gaudí House */
/* 1. Daily Micro-Moment Windows (18 days): clean & inviting when unlocked, softly muted when future-locked */
.door.is-daily { color: #263d66; }
.door.is-daily[data-status="locked"] { opacity: 0.56; color: #4a5e7d; }
.door.is-daily[data-status="available"] .door-bay::after {
  opacity: 0.42;
  box-shadow: inset 0 0 0 1px rgba(40, 70, 117, 0.32);
}
.door.is-daily[data-status="done"] .door-bay::after {
  opacity: 0.65;
  background: radial-gradient(circle at 50% 50%, rgba(255, 232, 165, 0.22), transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(124, 158, 97, 0.55);
}

/* 2. Six Gold-Star Flagship Game Windows (05, 10, 13, 18, 22, 24): Deluxe gold trim + ★ badge! */
.door.is-featured { color: #193463; font-weight: 700; }
.door.is-featured .door-bay::after {
  opacity: 0.9;
  box-shadow: inset 0 0 0 1.8px #e5ad42, 0 0 8px 1px rgba(236, 185, 92, 0.52);
  background: radial-gradient(circle at 50% 50%, rgba(255, 236, 174, 0.28), transparent 74%);
}
.door.is-featured[data-status="locked"] .door-bay::after {
  opacity: 0.72;
  box-shadow: inset 0 0 0 1.5px #d4a651, 0 0 5px rgba(230, 180, 90, 0.3);
  background: none;
}

/* 3. TODAY's Window (Any date 01–24!): Unmistakable Cobalt + Honey Breathing Halo + Floating Tag! */
.door[data-status="today"] {
  z-index: 8;
  color: #16305e;
  font-weight: 700;
}
.door[data-status="today"] .door-bay::after {
  opacity: 1 !important;
  background: radial-gradient(circle at 50% 50%, rgba(255, 238, 178, 0.46), transparent 74%) !important;
  animation: pulse-today 2s ease-in-out infinite;
}
@keyframes pulse-today {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px #284675,
      0 0 0 2.5px rgba(255, 255, 255, 0.9),
      0 0 12px 4px rgba(236, 179, 72, 0.85);
  }
  50% {
    box-shadow:
      inset 0 0 0 2.2px #c6643a,
      0 0 0 3.5px rgba(255, 255, 255, 0.95),
      0 0 18px 6px rgba(245, 196, 83, 1);
  }
}
.door-today-tag {
  position: absolute;
  left: 50%;
  top: -13px;
  transform: translateX(-50%);
  z-index: 12;
  padding: 1px 6px;
  border-radius: 999px;
  background: #284675;
  color: #fff8e6;
  border: 1.5px solid #f5c453;
  font: 700 clamp(9px, 2.3cqw, 11px)/1.25 var(--handwriting);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(38, 57, 84, 0.28);
  pointer-events: none;
  animation: float-tag 2s ease-in-out infinite;
}
@keyframes float-tag {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-2.5px); }
}

.door-badge {
  position: absolute;
  right: 5%;
  top: 2%;
  z-index: 4;
  font-size: clamp(9px, 2.7cqw, 12px);
  line-height: 1;
  color: #cf8a1d;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.95));
  pointer-events: none;
}

/* Tree Progress Pill & Daily Treat Modal */
.tree-progress-pill {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 11px;
  border-radius: 999px;
  background: #e6effa;
  border: 1px solid #b5cae6;
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 700;
}

.treat-body {
  text-align: center;
}
.treat-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  margin: 6px 0 8px;
  padding: 14px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 42%, #ffffff 0%, #eaf2fc 75%, #dce8f7 100%);
  border: 1.5px solid #b5cae6;
}
.treat-ornament-drop {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 28px;
  animation: ornament-bob 1.8s ease-in-out infinite;
  filter: drop-shadow(0 3px 5px rgba(38, 57, 84, 0.16));
}
@keyframes ornament-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-5px) rotate(6deg); }
}
.treat-scene-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.treat-cat-img {
  width: 148px;
  height: auto;
  max-height: 118px;
  object-fit: contain;
  transition: transform 0.22s cubic-bezier(0.2, 1.5, 0.4, 1);
  cursor: pointer;
}
.treat-cat-img.bounce {
  transform: scale(1.1) rotate(-3deg);
}
.treat-cat-img.flip-h {
  transform: scaleX(-1);
}
.treat-cat-img.purring {
  animation: cat-purr-wiggle 0.55s ease-in-out 2;
}
@keyframes cat-purr-wiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.06, 0.96) rotate(-3deg); }
  50% { transform: scale(0.98, 1.04) rotate(2.5deg); }
  75% { transform: scale(1.05, 0.97) rotate(-2deg); }
}
.treat-cat-img.gnawing {
  animation: cat-gnaw-chomp 0.22s ease-in-out 3;
}
@keyframes cat-gnaw-chomp {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(12px) rotate(5deg) scale(1.05); }
}
.treat-fishbone {
  cursor: pointer;
  margin-left: -26px;
  margin-top: 28px;
  z-index: 2;
  transition: transform 0.16s ease;
}
.treat-fishbone.nibbled {
  animation: bone-shake 0.22s ease-in-out 3;
}
@keyframes bone-shake {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  45% { transform: rotate(14deg) scale(0.92); }
}
.treat-sfx-bubble {
  position: absolute;
  top: 10px;
  left: 14px;
  max-width: calc(100% - 76px);
  padding: 3px 10px;
  border-radius: 999px;
  background: #fffdf5;
  border: 1.5px solid #d9a34a;
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 5;
  animation: bubble-bob 1.4s ease-in-out infinite;
}
@keyframes bubble-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.treat-heading {
  margin: 4px 0 6px !important;
  text-align: center;
}
.treat-line {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.treat-fortune-box {
  margin-bottom: 10px;
  text-align: center;
  background: #fffdf5;
  border-color: #d9a34a;
}
.treat-next-pill {
  margin: 10px 0 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #edf4fc;
  border: 1px dashed #8da8cc;
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 700;
}

/* Flying Ornament Animation to Ground-Floor Tree Window */
.flying-ornament {
  position: fixed;
  z-index: 9999;
  font-size: 26px;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(236, 179, 72, 0.7));
  transition: transform 0.75s cubic-bezier(0.22, 0.9, 0.36, 1), opacity 0.75s ease;
}

.house.night .door { color: #fff1cc; text-shadow: 0 1px 2px #1b263b; }
.door[data-played="true"] .door-date { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.door.opening { z-index: 6; }
.door.opening .door-bay::before { opacity: 1; }
.door.opening .door-face {
  background: var(--house-art) var(--flap-position) / var(--flap-size) no-repeat;
  transform: rotateY(-82deg);
}
.door[data-hinge="right"] .door-face { transform-origin: right center; }
.door[data-hinge="right"].opening .door-face { transform: rotateY(82deg); }
.door[data-hinge="top"] .door-face { transform-origin: center top; }
.door[data-hinge="top"].opening .door-face { transform: rotateX(84deg); }
.door.shake .door-face { animation: paper-tap 0.32s ease; }
@keyframes paper-tap { 24%, 70% { transform: rotate(-4deg); } 47% { transform: rotate(4deg); } }

/* Streamlined Minimalist Dock Beneath the House (Scheme B · Nordic Blue-Hour) */
.calendar-controls {
  width: min(calc(100% - 28px), 400px);
  margin: clamp(-44px, -7.5vw, -20px) 0 0;
  text-align: center;
  position: relative;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.primary-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cta-main {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid #e2bd6c;
  background: linear-gradient(180deg, #fffaf0, #f5e2b5);
  color: #1f3354;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(16, 28, 50, 0.24);
  transition: transform 0.14s ease, filter 0.15s ease;
}
.cta-main:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.03); }
.cta-main:active:not(:disabled) { transform: translateY(1px); }

.tree-chip {
  height: 44px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(24, 40, 68, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f8fbff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

.notice {
  margin: -4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(240, 247, 255, 0.9);
  text-shadow: 0 1px 6px rgba(18, 30, 52, 0.3);
}
.notice:empty { display: none; }

/* 6-Game Frosted Icon Dock (Zero wall of text!) */
.star-dock {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border-radius: 16px;
  background: rgba(24, 40, 68, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(16, 28, 50, 0.18);
}
.star-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 48px;
  padding: 5px 2px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  transition: transform 0.14s ease, background 0.15s ease, border-color 0.15s ease;
}
.star-pill:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.24);
}
.star-pill.is-today {
  background: linear-gradient(180deg, #fff9e5, #f9e3a8);
  border-color: #e4b54f;
  color: #263954;
  box-shadow: 0 3px 10px rgba(235, 185, 76, 0.35);
}
.star-pill.is-done:not(.is-today) {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(182, 232, 166, 0.55);
}
.star-pill.is-locked {
  opacity: 0.56;
  border-style: dashed;
}
.star-pill .em { font-size: 16px; line-height: 1.15; }
.star-pill .dt { font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; }
.star-pill .done-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #77d463;
  box-shadow: 0 0 6px rgba(119, 212, 99, 0.85);
}
.star-pill .lock-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 8px;
  line-height: 1;
}

.footer.whisper-footer {
  position: relative;
  z-index: 8;
  color: rgba(242, 248, 255, 0.92);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 12px;
}
.wl-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 246, 218, 0.2);
  color: #fff4d2;
  border: 1px solid rgba(247, 214, 134, 0.55);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s ease, transform 0.12s ease;
}
.wl-pill-btn:hover {
  background: rgba(255, 246, 218, 0.34);
  transform: translateY(-1px);
}
.footer .text-button {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
  color: rgba(242, 248, 255, 0.9);
  text-decoration: none;
}
.footer .text-button:hover { text-decoration: underline; }
.preview-dates { position: relative; }
.preview-dates summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 4px 6px;
  font-weight: 600;
  color: rgba(242, 248, 255, 0.9);
}
.preview-dates summary::-webkit-details-marker { display: none; }
.preview-dates[open] summary { margin-bottom: 4px; }
.footer select {
  color: var(--ink);
  background: rgba(245, 249, 255, 0.96);
  border: 1px solid #9db6d6;
  padding: 5px 8px;
  border-radius: 8px;
  min-height: 32px;
  font-size: 12px;
}

/* Ceramic Dialogs (Aligned 100% to Ice-Porcelain & Cobalt House Theme) */
dialog.ceramic-dialog {
  width: min(calc(100% - 20px), 444px);
  max-height: calc(100dvh - 18px);
  border: 1.5px solid #9fb6d4;
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: #f6f8fc;
  box-shadow: 0 18px 48px rgba(25, 39, 64, 0.34);
  overflow: auto;
}
dialog.ceramic-dialog::backdrop {
  background: rgba(25, 39, 64, 0.58);
  backdrop-filter: blur(3px);
}
.task {
  position: relative;
  padding: 15px 16px 12px;
}
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.task-header .address { margin: 0; font-size: 0.8rem; color: var(--muted); text-shadow: none; }
.close {
  margin: -6px -6px -4px 0;
  background: none;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink);
  font: 1.7rem/1 var(--handwriting);
}
.close:hover { background: var(--ice-tag); }
.modal-abs-close {
  position: absolute;
  top: 8px;
  right: 10px;
  margin: 0;
}
h2 {
  margin: 2px 28px 8px 0;
  font: 400 clamp(1.38rem, 5.4vw, 1.85rem)/1.2 var(--lettering);
  color: var(--ink);
}
html[lang="zh"] h2 {
  font-family: "PingFang SC", "Songti SC", serif;
  font-weight: 700;
  font-size: clamp(1.22rem, 4.8vw, 1.55rem);
}
.instruction {
  margin: 8px 0 8px;
  line-height: 1.42;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--muted);
}

/* Shared Gift Banner inside Game Dialog */
.gift-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px dashed var(--cobalt);
  background: var(--ice-tag);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.gift-banner-close {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

/* 1:1 Interactive Game Stage inside Dialog */
.game-stage-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1.5px solid #a9bed8;
  border-radius: 10px;
  background: #edf2f8;
  box-shadow: inset 0 1px 5px rgba(38, 57, 84, 0.12);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.game-mount {
  position: relative;
  width: 100%;
  height: 100%;
}
.game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.game-canvas.cursor-scissors {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg stroke='%23253558' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='4' x2='20' y2='21' stroke='%23e8ecf4' stroke-width='4.2'/%3E%3Cline x1='3' y1='4' x2='20' y2='21' stroke='%23334978' stroke-width='2.2'/%3E%3Cline x1='15' y1='3' x2='11' y2='22' stroke='%23e8ecf4' stroke-width='4.2'/%3E%3Cline x1='15' y1='3' x2='11' y2='22' stroke='%23334978' stroke-width='2.2'/%3E%3Ccircle cx='12.5' cy='13.5' r='1.8' fill='%23eab348' stroke='%23253558' stroke-width='1.3'/%3E%3Ccircle cx='23.5' cy='24.5' r='4.6' fill='%23c6643a'/%3E%3Ccircle cx='23.5' cy='24.5' r='2.1' fill='%23fff8ec' stroke='none'/%3E%3Ccircle cx='9.5' cy='25.5' r='4.6' fill='%235d7b45'/%3E%3Ccircle cx='9.5' cy='25.5' r='2.1' fill='%23fff8ec' stroke='none'/%3E%3C/g%3E%3C/svg%3E") 4 4, crosshair;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 6px 0 4px;
}
/* Compatibility classes used by games.js controls */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn-primary {
  border: 1px solid #1e355b;
  background: var(--cobalt);
  color: #f5f8fc;
  box-shadow: 0 2px 0 rgba(30, 53, 91, 0.3);
}
.btn-primary:hover:not(:disabled) { background: var(--cobalt-hover); }
.btn-primary.cranberry {
  border-color: #466033;
  background: var(--moss);
}
.btn-primary.cranberry:hover:not(:disabled) { background: #6b8d50; }
.btn-secondary {
  border: 1px solid #b0c4dd;
  background: #edf4fb;
  color: var(--ink);
}
.btn-secondary:hover:not(:disabled) { background: #ffffff; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.48; cursor: not-allowed; }

.result-stamp {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px dashed #8da8cc;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}
.result-stamp strong {
  display: block;
  color: var(--cobalt);
  font-size: 14px;
  margin-bottom: 2px;
}

.dialog-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #d4e0ef;
}
.dialog-nav .text-button {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 4px 2px;
}
#dialog-prev { justify-self: start; }
#back-to-house { justify-self: center; }
#dialog-next { justify-self: end; }

/* Locked Future Window Wax Seal Dialog */
.locked-body { text-align: center; padding-top: 22px; }
.wax-seal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}
.peek-cat { width: 158px; margin-bottom: -14px; z-index: 1; }
.peek-cat-img { display: block; width: 100%; height: auto; }
.wax-seal {
  position: relative;
  z-index: 2;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #5876b8, #2e4982 65%, #1d305c);
  border: 3px solid rgba(236, 193, 124, 0.85);
  box-shadow: 0 5px 14px rgba(34, 48, 86, 0.28);
  display: grid;
  place-items: center;
}
.wax-seal-date {
  color: #fff4da;
  font: 400 15px/1.1 var(--lettering);
  letter-spacing: 0.04em;
}
.locked-heading { margin: 4px 0 4px; text-align: center; }
.locked-game-name { margin: 0 0 2px; font-weight: 700; font-size: 14px; color: var(--cobalt); }
.vertical-actions { flex-direction: column; width: min(260px, 100%); margin: 12px auto 4px; }

/* Camus Scratch Card */
.camus-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 35%, #ffffff, #edf3fa);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 22px;
  text-align: center;
  overflow: hidden;
}
.camus-wrap.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(255, 251, 242, 0.72) 0%, rgba(255, 249, 238, 0.42) 54%, rgba(28, 42, 72, 0.14) 100%);
  pointer-events: none;
  z-index: 1;
}
.camus-wrap > *:not(.scratch-canvas) {
  position: relative;
  z-index: 2;
}
.camus-wrap.has-bg .camus-quote-en,
.camus-wrap.has-bg .camus-quote-zh {
  color: #1f2f4c;
  text-shadow: 0 1px 12px rgba(255, 252, 244, 0.96), 0 0 22px rgba(255, 248, 230, 0.92);
}
.camus-wrap.has-bg .camus-author {
  color: #2f4d28;
  background: rgba(255, 251, 242, 0.72);
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.camus-quote-en {
  margin: 0 0 14px;
  font: 400 clamp(16px, 4.6vw, 20px)/1.45 var(--handwriting);
  color: var(--ink);
}
.camus-quote-zh {
  margin: 0 0 14px;
  font-family: "PingFang SC", "Songti SC", "Hiragino Sans GB", serif;
  font-weight: 600;
  font-size: clamp(16px, 4.6vw, 19px);
  line-height: 1.65;
  color: var(--ink);
}
.camus-author {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moss);
}
.camus-from {
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ice-tag);
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 700;
}
.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  touch-action: none;
  cursor: crosshair;
  transition: opacity 0.6s ease;
}
.scratch-canvas.revealed { opacity: 0; pointer-events: none; }

/* MERRY XMAS Hidden Letter Slots */
.xmas-slots {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(24, 34, 56, 0.8);
  border: 1px solid rgba(255, 224, 158, 0.42);
}
.xmas-slot {
  width: 22px;
  height: 26px;
  border-bottom: 2px dashed rgba(255, 229, 173, 0.55);
  color: #ffd985;
  font: 400 18px/26px var(--lettering);
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.xmas-slot.filled {
  border-bottom-color: #ffd985;
  text-shadow: 0 0 10px rgba(255, 214, 118, 0.85);
  transform: scale(1.12);
}
.xmas-space { width: 8px; }

/* Share & 2027 Postcard Forms */
.share-preview-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed #8da8cc;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.45;
}
.form-field { margin-bottom: 12px; }
.form-field label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.form-field input, .share-url-row input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid #b0c4dd;
  background: #ffffff;
  font-size: 13px;
}
.share-url-row { display: flex; gap: 6px; }
.copy-toast { min-height: 18px; margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--moss); }
.postcard-stamp {
  position: absolute;
  top: 14px;
  right: 48px;
  width: 44px;
  height: 50px;
  border: 2px dashed var(--cobalt);
  background: var(--ice-tag);
  color: var(--cobalt);
  font: 400 12px/1.1 var(--lettering);
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotate(6deg);
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #b0c4dd;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.choice-chip.selected {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #f5f8fc;
}
.wl-consent {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.poster-preview-wrap {
  margin: 8px 0 12px;
  display: flex;
  justify-content: center;
}
.poster-preview-img {
  width: min(100%, 300px);
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(24, 38, 66, 0.24);
  -webkit-touch-callout: default;
}
.wl-success {
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1.5px dashed var(--cobalt);
  text-align: center;
}
.wl-success-title { margin: 0 0 6px; font: 400 22px/1.2 var(--lettering); color: var(--cobalt); }
.wl-success-desc { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.social-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.social-link {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--cobalt);
  background: #f3f6fa;
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.social-link:hover { background: var(--cobalt); color: #fff; }
