/* =========================================================
   我们的小屋 — Stardew-ish winter cabin UI
   All scene art is drawn on the 480×270 canvas; this file
   only styles the frame, HUD and dialogue furniture.
   ========================================================= */

/* Fusion Pixel Font (TakWolf, OFL-1.1) — self-hosted so the cabin
   keeps its chunky 12px letterforms even when the site is offline. */
@font-face {
  font-family: "Fusion Pixel";
  src: url("../assets/fonts/fusion-pixel-12px-proportional-latin.ttf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-024F, U+2000-206F, U+20A0-20CF, U+2100-214F;
}

@font-face {
  font-family: "Fusion Pixel";
  src: url("../assets/fonts/fusion-pixel-12px-proportional-zh_hans.ttf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #3b2116;
  --ink-soft: #6b432b;
  --parchment: #f4deb2;
  --parchment-deep: #e4c78f;
  --gold: #d9a248;
  --gold-bright: #f6d47c;
  --pine: #273f35;
  --night: #070a0f;
  --wood-dark: #2a1710;
  --serif-cn: "Fusion Pixel", "SimSun", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--night);
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--parchment);
  font-family: var(--serif-cn);
  font-synthesis: none;
  -webkit-font-smoothing: none;
  font-smooth: never;
  background:
    radial-gradient(ellipse at 50% 46%, #121b25 0%, #090d14 42%, #05070b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    radial-gradient(1px 1px at 7% 14%, rgba(210, 228, 241, .55) 50%, transparent 51%),
    radial-gradient(1px 1px at 17% 38%, rgba(210, 228, 241, .35) 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 22%, rgba(210, 228, 241, .45) 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 64%, rgba(210, 228, 241, .25) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 82%, rgba(210, 228, 241, .28) 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 88%, rgba(210, 228, 241, .22) 50%, transparent 51%);
}

.app {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.scene-wrap {
  position: relative;
  width: min(100vw, calc(100dvh * 16 / 9));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  container-type: size;
  background: #070a0f;
  box-shadow:
    0 0 0 1px rgba(217, 162, 72, .16),
    0 30px 90px rgba(0, 0, 0, .75);
  isolation: isolate;
  animation: scene-in 1.1s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes scene-in {
  from { opacity: 0; transform: scale(1.012); filter: brightness(.6); }
  to   { opacity: 1; transform: scale(1); filter: brightness(1); }
}

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: default;
  touch-action: manipulation;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 62% at 50% 47%, transparent 38%, rgba(3, 6, 10, .22) 72%, rgba(2, 4, 8, .62) 100%),
    linear-gradient(to bottom, rgba(3, 6, 11, .28), transparent 16%, transparent 83%, rgba(3, 6, 11, .38));
}

/* --------------------------------------------- brand */

.brand {
  position: absolute;
  z-index: 5;
  top: 1.9%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .72cqw;
  padding: .45cqw .95cqw .5cqw;
  color: #f3dfba;
  text-align: left;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .55));
}

.brand::before,
.brand::after {
  content: "";
  position: absolute;
  top: 22%;
  width: 5.5cqw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 162, 72, .55));
}

.brand::before { right: 100%; }
.brand::after {
  left: 100%;
  background: linear-gradient(90deg, rgba(217, 162, 72, .55), transparent);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.7cqw;
  height: 2.7cqw;
  min-width: 22px;
  min-height: 22px;
  border: 1px solid rgba(246, 212, 124, .55);
  border-radius: 50%;
  color: var(--gold-bright);
  font-size: 1.25cqw;
  background: rgba(31, 45, 38, .42);
  box-shadow: inset 0 0 0 2px rgba(6, 10, 14, .4);
}

.brand h1 {
  margin: 0;
  font-family: var(--serif-cn);
  font-size: 1.9cqw;
  font-weight: 700;
  letter-spacing: .3cqw;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 2px 0 #28150f, 0 0 18px rgba(246, 212, 124, .18);
  -webkit-font-smoothing: none;
  font-smooth: never;
}

/* The title is also a tiny easter egg: our cabin → 昕昕 → 霖霖. */
.brand-title {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  color: inherit;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-shadow: inherit;
  cursor: pointer;
  pointer-events: auto;
  -webkit-font-smoothing: none;
  font-smooth: never;
  transition: color .18s ease, text-shadow .18s ease;
}

.brand-title:hover,
.brand-title:focus-visible {
  color: #fff1cf;
  text-shadow: 0 2px 0 #28150f, 0 0 24px rgba(246, 212, 124, .38);
}

.brand-title:focus-visible {
  outline: 1px solid rgba(246, 212, 124, .65);
  outline-offset: 4px;
}

.brand-title.is-name {
  padding-left: .55em;
  letter-spacing: .55em;
}

.brand-title.title-pop {
  animation: title-pop .38s cubic-bezier(.2, .8, .2, 1);
}

@keyframes title-pop {
  0% { opacity: .35; transform: translateY(2px) scale(.96); }
  65% { opacity: 1; transform: translateY(-1px) scale(1.03); }
  100% { opacity: 1; transform: none; }
}

.brand p {
  margin: .25cqw 0 0;
  color: rgba(229, 207, 171, .66);
  font-family: var(--serif-cn);
  font-size: .55cqw;
  letter-spacing: .17cqw;
  white-space: nowrap;
}

.brand p span { color: var(--gold); }

/* --------------------------------------------- Stardew clock */

.stardew-clock {
  position: absolute;
  z-index: 6;
  top: 2.3%;
  right: 2.5%;
  width: clamp(148px, 14.2cqw, 246px);
  padding: .5cqw .62cqw .55cqw;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 250, 231, .55), transparent 34%),
    linear-gradient(180deg, #f6e1b7 0%, #efd6a4 58%, #e5c58c 100%);
  border: 2px solid #6a3d24;
  border-radius: 7px;
  box-shadow:
    0 0 0 2px #2b1710,
    0 0 0 3px rgba(246, 212, 124, .28),
    0 8px 22px rgba(0, 0, 0, .48),
    inset 0 0 0 2px rgba(255, 247, 222, .5);
  font-family: var(--serif-cn);
}

.stardew-clock::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(106, 61, 36, .24);
  border-radius: 4px;
  pointer-events: none;
}

.clock-face {
  display: flex;
  align-items: center;
  gap: .55cqw;
}

.season-orb {
  position: relative;
  flex: none;
  width: 2.15cqw;
  height: 2.15cqw;
  min-width: 25px;
  min-height: 25px;
  overflow: hidden;
  border: 2px solid #6a3d24;
  border-radius: 50%;
  background:
    radial-gradient(circle at 66% 30%, #f7e9bd 0 8%, transparent 9%),
    linear-gradient(180deg, #1c2d4d 0%, #2f4e70 62%, #7892a8 100%);
  box-shadow: inset 0 -5px 0 rgba(238, 244, 244, .5), inset 0 0 0 1px rgba(0, 0, 0, .2);
}

.orb-moon {
  position: absolute;
  top: 18%;
  left: 18%;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: #f5e6b7;
  box-shadow: 0 0 6px rgba(246, 230, 183, .65);
}

.orb-moon::after {
  content: "";
  position: absolute;
  top: -18%;
  left: 42%;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  background: #243c5b;
}

.orb-snow {
  position: absolute;
  top: 22%;
  right: 18%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #eef6f8;
  box-shadow: 0 0 3px #eef6f8;
  animation: snow-twinkle 2.4s ease-in-out infinite;
}

.orb-snow.s2 { top: 46%; right: 34%; animation-delay: .8s; }
.orb-snow.s3 { top: 62%; right: 14%; animation-delay: 1.4s; }

@keyframes snow-twinkle {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

.clock-date {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.clock-date strong {
  font-size: .9cqw;
  font-weight: 700;
  letter-spacing: .06cqw;
}

.clock-date span {
  margin-top: .1cqw;
  color: #7c5336;
  font-size: .62cqw;
  letter-spacing: .1cqw;
}

.clock-time {
  margin-top: .35cqw;
  padding: .18cqw 0 .16cqw;
  border-top: 1px solid rgba(106, 61, 36, .25);
  border-bottom: 1px solid rgba(106, 61, 36, .25);
  font-family: var(--serif-cn);
  font-size: 1.1cqw;
  font-weight: 700;
  letter-spacing: .18cqw;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 250, 235, .6);
}

.clock-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25cqw;
  margin-top: .28cqw;
  color: #67442c;
  font-size: .62cqw;
  letter-spacing: .07cqw;
}

.snow-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #7d9aad;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}

/* --------------------------------------------- side actions */

.side-actions {
  position: absolute;
  z-index: 8;
  left: 2.4%;
  bottom: 5.5%;
  display: flex;
  flex-direction: column;
  gap: .55cqw;
}

.wood-btn {
  display: grid;
  place-items: center;
  width: clamp(30px, 2.5cqw, 42px);
  height: clamp(30px, 2.5cqw, 42px);
  padding: 0;
  border: 2px solid #6f4328;
  border-radius: 6px;
  color: #e9d2a6;
  background:
    linear-gradient(180deg, #885633 0%, #684028 50%, #50301f 100%);
  box-shadow:
    0 0 0 2px #24130d,
    inset 0 1px 0 rgba(255, 220, 160, .35),
    0 4px 10px rgba(0, 0, 0, .35);
  font-family: var(--serif-cn);
  font-size: clamp(12px, 1.1cqw, 18px);
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, filter .2s ease, color .2s ease;
}

.wood-btn:hover {
  filter: brightness(1.16);
  transform: translateY(-1px);
}

.wood-btn:active { transform: translateY(1px); }

.wood-btn.is-on {
  color: #3c2417;
  background: linear-gradient(180deg, #ffe6a8, #e8bd68 55%, #c9933f);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}

/* --------------------------------------------- hint & welcome */

.hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 3.1%;
  display: flex;
  align-items: center;
  gap: .42cqw;
  transform: translateX(-50%);
  padding: .38cqw .95cqw;
  border: 1px solid rgba(217, 162, 72, .24);
  border-radius: 999px;
  color: rgba(241, 223, 190, .76);
  background: rgba(9, 14, 18, .55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
  backdrop-filter: blur(3px);
  font-size: .63cqw;
  letter-spacing: .12cqw;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}

.hint-key {
  color: var(--gold-bright);
  font-size: .8cqw;
  animation: hint-glow 3.6s ease-in-out infinite;
}

@keyframes hint-glow {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; text-shadow: 0 0 7px rgba(246, 212, 124, .8); }
}

.scene-wrap.dialogue-open .hint {
  opacity: 0;
  transform: translate(-50%, 5px);
}

.welcome {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 12.5%;
  display: flex;
  align-items: center;
  gap: .45cqw;
  transform: translateX(-50%);
  padding: .4cqw 1.05cqw;
  border: 1px solid rgba(238, 213, 169, .3);
  border-radius: 3px;
  color: #efdfc1;
  background: rgba(15, 25, 23, .78);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .35);
  font-size: .62cqw;
  letter-spacing: .14cqw;
  pointer-events: none;
  animation: welcome-life 6.2s ease forwards;
}

.welcome-snow {
  color: #bcd8df;
  font-size: .72cqw;
}

@keyframes welcome-life {
  0% { opacity: 0; transform: translate(-50%, -5px); }
  9%, 70% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}

/* --------------------------------------------- tooltip */

.tooltip {
  position: absolute;
  z-index: 12;
  display: none;
  padding: .26cqw .58cqw;
  border: 1px solid rgba(246, 212, 124, .5);
  border-radius: 2px;
  color: #f3e2c1;
  background: rgba(12, 19, 20, .92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .38);
  font-size: .58cqw;
  letter-spacing: .08cqw;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(10px, -130%);
}

.tooltip.is-visible { display: block; }

/* --------------------------------------------- dialogue */

.dialogue {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 7.1%;
  display: flex;
  align-items: flex-start;
  gap: .8cqw;
  width: min(66cqw, 660px);
  padding: .85cqw 1.05cqw .8cqw;
  color: #f5e1bf;
  background:
    repeating-linear-gradient(90deg, rgba(255, 221, 166, .07) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(24, 10, 6, .16) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, #603b26 0%, #4a2a1b 52%, #341b11 100%);
  border: 3px solid #2b160e;
  border-radius: 4px;
  box-shadow:
    0 0 0 2px #b07a45,
    0 0 0 5px #21100a,
    0 18px 42px rgba(0, 0, 0, .62),
    inset 0 1px 0 rgba(255, 231, 191, .2),
    inset 0 0 0 1px rgba(32, 15, 9, .65);
  transform: translate(-50%, 10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.dialogue::before,
.dialogue::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 7px;
  height: 7px;
  border: 1px solid #1b0d08;
  border-radius: 50%;
  background: #c99a59;
  box-shadow: inset 0 0 0 1px #f0cf93;
}

.dialogue::before { left: 7px; }
.dialogue::after { right: 7px; }

.scene-wrap.dialogue-open .dialogue {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.dialogue.is-character {
  align-items: flex-end;
  min-height: 5.65cqw;
  padding-left: 6.35cqw;
}

.dialogue-portrait {
  display: none;
  position: absolute;
  left: .7cqw;
  bottom: .7cqw;
  width: clamp(58px, 4.8cqw, 84px);
  height: clamp(58px, 4.8cqw, 84px);
  padding: 2px;
  border: 3px solid #1d0e08;
  border-radius: 2px;
  background: #170c07;
  box-shadow:
    0 0 0 2px #a97743,
    0 0 0 4px #29150e,
    inset 0 0 0 2px #d7ab6e,
    0 5px 12px rgba(0, 0, 0, .45);
}

.dialogue-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #120805;
  filter: saturate(.96) contrast(1.02);
}

.dialogue.is-character .dialogue-portrait { display: block; }
.dialogue.is-character .dialogue-emblem { display: none; }

.dialogue-emblem {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5cqw;
  height: 2.5cqw;
  min-width: 28px;
  min-height: 28px;
  margin-top: .25cqw;
  border: 1px solid rgba(224, 175, 105, .45);
  border-radius: 50%;
  color: #ffd68d;
  background: rgba(20, 10, 6, .4);
  font-size: 1.05cqw;
  box-shadow: inset 0 0 0 2px rgba(217, 162, 72, .12);
}

.dialogue-copy { min-width: 0; padding-right: .9cqw; }

.dialogue-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .42cqw;
  margin-top: .55cqw;
}

.dialogue-choices[hidden] { display: none; }

.dialogue-choice {
  padding: .22cqw .72cqw;
  border: 1px solid #2a140c;
  border-radius: 2px;
  color: #f7e4bd;
  background:
    linear-gradient(180deg, #7a4b2c 0%, #5a321e 60%, #3c1e12 100%);
  box-shadow:
    0 0 0 1px rgba(220, 171, 105, .62),
    inset 0 1px 0 rgba(255, 231, 191, .2);
  font: inherit;
  font-size: clamp(11px, .64cqw, 14px);
  letter-spacing: .04em;
  cursor: pointer;
}

.dialogue-choice:hover,
.dialogue-choice:focus-visible {
  color: #fff3d2;
  background: linear-gradient(180deg, #94603a 0%, #6b3d24 60%, #472316 100%);
  outline: none;
}

.dialogue-choice.is-quiet {
  color: #d9bd94;
  background: linear-gradient(180deg, #4b2d1c, #342015);
}

.dialogue-kicker {
  display: inline-block;
  margin-bottom: .3cqw;
  padding-bottom: .14cqw;
  border-bottom: 1px solid rgba(226, 180, 112, .32);
  color: #e8bd79;
  font-size: .64cqw;
  letter-spacing: .16cqw;
}

.dialogue-copy p {
  margin: 0;
  color: #f7e6c8;
  font-size: 1.02cqw;
  line-height: 1.7;
  letter-spacing: .045cqw;
  text-shadow: 0 1px 0 rgba(22, 10, 6, .65);
  text-wrap: pretty;
}

.dialogue-close {
  position: absolute;
  top: .4cqw;
  right: .45cqw;
  width: 1.4cqw;
  height: 1.4cqw;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: none;
  color: rgba(246, 225, 191, .58);
  background: transparent;
  font-family: var(--serif-cn);
  font-size: .95cqw;
  line-height: 1;
  cursor: pointer;
}

.dialogue-close:hover { color: #ffd58a; }

/* --------------------------------------------- stamp */

.corner-stamp {
  position: absolute;
  z-index: 5;
  right: 2.5%;
  bottom: 3.2%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: rgba(217, 162, 72, .38);
  font-family: var(--serif-cn);
  font-size: .43cqw;
  letter-spacing: .13cqw;
  pointer-events: none;
}

/* --------------------------------------------- responsive */

@media (max-width: 1000px) {
  .brand { top: 1.2%; }
  .brand-mark { display: none; }
  .brand::before, .brand::after { width: 3cqw; }
  .stardew-clock { top: 1.6%; right: 1.8%; }
  .clock-time { padding: .12cqw 0; }
  .hint { bottom: 2.2%; }
  .corner-stamp { display: none; }
  .dialogue { bottom: 6%; width: 76cqw; }
}

@media (max-width: 700px), (max-height: 420px) {
  .brand { display: none; }
  .stardew-clock { top: 1.2%; right: 1.2%; width: clamp(132px, 18cqw, 170px); }
  .clock-date strong { font-size: clamp(10px, 1.6cqw, 12px); }
  .clock-date span, .clock-weather { font-size: clamp(7px, 1.05cqw, 9px); }
  .clock-time { font-size: clamp(11px, 1.7cqw, 14px); }
  .season-orb { width: 22px; height: 22px; min-width: 22px; min-height: 22px; }
  .hint { font-size: clamp(8px, 1.4cqw, 10px); padding: .7cqw 1.4cqw; }
  .side-actions { left: 1.5%; bottom: 4%; }
  .dialogue { width: 88cqw; bottom: 5.6%; padding: 2.2cqw 2.6cqw 2cqw; }
  .dialogue-copy p { font-size: clamp(11px, 2.15cqw, 15px); }
  .dialogue-kicker { font-size: clamp(8px, 1.45cqw, 10px); }
  .dialogue-emblem { width: 26px; height: 26px; min-width: 26px; min-height: 26px; font-size: 12px; }
  .dialogue-close { font-size: 16px; width: 24px; height: 24px; }
  .dialogue.is-character { padding: 2.2cqw 2.6cqw 2cqw 72px; min-height: 72px; }
  .dialogue-portrait {
    width: 52px;
    height: 52px;
    left: 9px;
    bottom: 9px;
    padding: 2px;
    border-width: 2px;
    box-shadow:
      0 0 0 2px #a97743,
      0 0 0 3px #29150e,
      inset 0 0 0 2px #d7ab6e,
      0 4px 8px rgba(0, 0, 0, .4);
  }
  .welcome { display: none; }
}

/* Portrait phones: keep the little clock, but shrink it to a corner tab
   and move the interaction hint into the letterbox below the room. */
.rotate-hint { display: none; }

@media (orientation: portrait) and (max-width: 760px) {
  .scene-wrap { overflow: visible; }
  .stardew-clock {
    top: -58px;
    right: 0;
    width: 142px;
    padding: 6px 7px;
    border-width: 2px;
    border-radius: 6px;
  }
  .season-orb {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }
  .clock-date span,
  .clock-weather { display: none; }
  .clock-face { gap: 5px; }
  .clock-date strong { font-size: 11px; letter-spacing: .03em; }
  .clock-time {
    margin-top: 2px;
    padding: 2px 0;
    font-size: 13px;
    letter-spacing: .1em;
  }
  .hint { display: none; }
  .side-actions { left: 1%; bottom: 3%; gap: 4px; }
  .wood-btn { width: 30px; height: 30px; font-size: 12px; }
  .rotate-hint {
    display: flex;
    position: absolute;
    z-index: 7;
    left: 50%;
    bottom: 3.2%;
    align-items: center;
    gap: .5em;
    padding: .5em .9em;
    border: 1px solid rgba(217, 162, 72, .28);
    border-radius: 999px;
    background: rgba(12, 9, 7, .66);
    color: #d9c39a;
    font-size: 9px;
    letter-spacing: .08em;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
  }
  .rotate-arrow { color: var(--gold-bright); font-size: 13px; }
}

/* --------------------------------------------- photo wall */

.photowall {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.2vmin, 24px);
  background: rgba(4, 7, 11, .78);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility .24s;
}

.photowall.is-open {
  opacity: 1;
  visibility: visible;
}

.photowall-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(94vw, 860px);
  height: min(86vh, 620px);
  height: min(86dvh, 620px);
  max-width: 100%;
  max-height: 100%;
  padding: clamp(10px, 1.6vmin, 18px) clamp(12px, 2vmin, 22px) clamp(10px, 1.6vmin, 16px);
  color: #f5e1bf;
  background:
    repeating-linear-gradient(90deg, rgba(255, 221, 166, .05) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, rgba(20, 9, 5, .18) 0 2px, transparent 2px 24px),
    linear-gradient(180deg, #4a2d1c 0%, #342014 55%, #24150e 100%);
  border: 3px solid #180c07;
  border-radius: 4px;
  box-shadow:
    0 0 0 2px #a97743,
    0 0 0 6px #1a0d08,
    0 26px 64px rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(255, 231, 191, .16),
    inset 0 0 0 1px rgba(32, 15, 9, .7);
  transform: translateY(8px) scale(.985);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}

.photowall.is-open .photowall-panel { transform: none; }

.photowall-head {
  display: flex;
  align-items: baseline;
  gap: clamp(6px, 1vmin, 10px);
  padding-right: 34px;
  padding-bottom: clamp(6px, 1.2vmin, 10px);
  border-bottom: 1px solid rgba(226, 180, 112, .3);
}

.photowall-snow {
  color: #f6d47c;
  font-size: clamp(11px, 1.8vmin, 14px);
  text-shadow: 0 0 6px rgba(255, 214, 141, .5);
}

.photowall-head h2 {
  margin: 0;
  color: #f8dfae;
  font-size: clamp(15px, 2.6vmin, 20px);
  font-weight: 400;
  letter-spacing: .06em;
  text-shadow: 0 1px 0 rgba(20, 10, 6, .8);
}

.photowall-count {
  color: rgba(232, 189, 121, .72);
  font-size: clamp(11px, 1.8vmin, 13px);
  letter-spacing: .05em;
}

.photowall-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  color: rgba(246, 225, 191, .62);
  background: transparent;
  font-family: var(--serif-cn);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.photowall-close:hover { color: #ffd58a; }

.photowall-body {
  flex: 1;
  min-height: 0;
  margin: clamp(8px, 1.4vmin, 14px) 0;
  padding: 2px;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: #7a4b2c rgba(20, 9, 5, .5);
}

.photowall-body::-webkit-scrollbar { width: 8px; }
.photowall-body::-webkit-scrollbar-track { background: rgba(18, 8, 4, .55); }
.photowall-body::-webkit-scrollbar-thumb { background: #7a4b2c; border: 2px solid #2a170e; }

.photowall-empty {
  margin: clamp(16px, 4vmin, 30px) 0;
  color: rgba(245, 225, 191, .66);
  font-size: clamp(12px, 2.2vmin, 15px);
  line-height: 2;
  letter-spacing: .04em;
  text-align: center;
}

.photowall-empty[hidden] { display: none; }

.photowall-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.4vmin, 12px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.photowall-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 2px solid #1d0e08;
  background: #120906;
  box-shadow: 0 0 0 2px #8a5c33, 0 4px 10px rgba(0, 0, 0, .4);
}

.photowall-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.photowall-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) contrast(1.03);
}

.photowall-open:hover img { filter: saturate(1.02) brightness(1.06); }

.photowall-del {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #1b0d08;
  border-radius: 2px;
  color: #f3d7a6;
  background: rgba(24, 10, 6, .78);
  font-family: var(--serif-cn);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s ease, background .15s ease;
}

.photowall-cell:hover .photowall-del { opacity: 1; }

.photowall-del:hover {
  color: #fff0cf;
  background: #7a2a1f;
  opacity: 1;
}

.photowall-del.is-armed {
  color: #ffd9bd;
  background: #8d2f22;
  opacity: 1;
}

.photowall-pin {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid #1b0d08;
  border-radius: 2px;
  color: #f6ddb0;
  background: rgba(24, 10, 6, .78);
  font-family: var(--serif-cn);
  font-size: 11px;
  line-height: 20px;
  letter-spacing: .04em;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s ease, background .15s ease;
}

.photowall-cell:hover .photowall-pin { opacity: 1; }

.photowall-pin:hover { background: #6d4a26; }

.photowall-cell.is-on-wall {
  border-color: #f0c987;
  box-shadow: 0 0 0 2px #c9963f, 0 0 12px rgba(240, 201, 135, .45), 0 4px 10px rgba(0, 0, 0, .4);
}

.photowall-cell.is-on-wall .photowall-pin {
  opacity: 1;
  color: #ffe9bd;
  background: #7a5227;
  cursor: default;
}

.photowall-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1.4vmin, 12px);
  padding-top: clamp(6px, 1.2vmin, 10px);
  border-top: 1px solid rgba(226, 180, 112, .24);
}

.photowall-add {
  padding: clamp(7px, 1.4vmin, 10px) clamp(12px, 2.4vmin, 18px);
  border: 1px solid #2a140c;
  border-radius: 2px;
  color: #f7e4bd;
  background: linear-gradient(180deg, #7a4b2c 0%, #5a321e 60%, #3c1e12 100%);
  box-shadow:
    0 0 0 1px rgba(220, 171, 105, .62),
    inset 0 1px 0 rgba(255, 231, 191, .2);
  font: inherit;
  font-size: clamp(12px, 2.2vmin, 14px);
  letter-spacing: .05em;
  cursor: pointer;
}

.photowall-add:hover,
.photowall-add:focus-visible {
  color: #fff3d2;
  background: linear-gradient(180deg, #94603a 0%, #6b3d24 60%, #472316 100%);
  outline: none;
}

.photowall-add:disabled {
  cursor: progress;
  color: rgba(247, 228, 189, .7);
}

.photowall-tip {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(217, 195, 154, .62);
  font-size: clamp(10px, 1.9vmin, 12px);
  line-height: 1.55;
  letter-spacing: .04em;
}

.photowall-file { display: none; }

.photowall-view {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: clamp(12px, 3vmin, 24px);
  background: rgba(6, 4, 8, .88);
  cursor: zoom-out;
}

.photowall-view[hidden] { display: none; }

.photowall-view img {
  max-width: 100%;
  max-height: 84%;
  object-fit: contain;
  border: 3px solid #180c07;
  box-shadow: 0 0 0 2px #a97743, 0 14px 36px rgba(0, 0, 0, .6);
}

.photowall-view-hint {
  color: rgba(245, 225, 191, .55);
  font-size: clamp(10px, 1.9vmin, 12px);
  letter-spacing: .1em;
}

/* Narrow screens: fewer columns so each photo stays tappable. */
@media (max-width: 560px) {
  .photowall-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .photowall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.scene-wrap.photowall-open .hint { opacity: 0; }
/* --------------------------------------------- memo book
   The little book on the coffee table: a calendar page on the left,
   the shared notes on the right.  Paper, not wood, so it reads as an
   open notebook lying over our dark UI. */

.memobook {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.2vmin, 24px);
  background: rgba(4, 7, 11, .78);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility .24s;
}

.memobook.is-open { opacity: 1; visibility: visible; }

.memobook-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(94vw, 900px);
  height: min(88vh, 660px);
  height: min(88dvh, 660px);
  max-width: 100%;
  max-height: 100%;
  padding: clamp(10px, 1.6vmin, 16px);
  color: #3b2116;
  background:
    repeating-linear-gradient(0deg, rgba(20, 9, 5, .2) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #3d2417 0%, #2a1810 100%);
  border: 3px solid #170c07;
  border-radius: 5px;
  box-shadow:
    0 0 0 2px #8a5c33,
    0 0 0 6px #170c07,
    0 26px 64px rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(255, 231, 191, .14);
  transform: translateY(8px) scale(.985);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}

.memobook.is-open .memobook-panel { transform: none; }

.memobook-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: clamp(6px, 1.2vmin, 12px);
  padding: 2px clamp(8px, 1.4vmin, 14px) clamp(8px, 1.2vmin, 12px);
  color: #f6dfb2;
}

.memobook-head h2 {
  margin: 0;
  color: #f8dfae;
  font-size: clamp(15px, 2.4vmin, 20px);
  font-weight: 400;
  letter-spacing: .08em;
  text-shadow: 0 1px 0 rgba(20, 10, 6, .8);
}

.memobook-date {
  color: rgba(246, 223, 178, .74);
  font-size: clamp(11px, 1.8vmin, 13px);
  letter-spacing: .06em;
}

.memobook-count {
  margin-left: auto;
  color: rgba(246, 223, 178, .48);
  font-size: clamp(10px, 1.7vmin, 12px);
  letter-spacing: .05em;
}

.memobook-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  color: rgba(246, 225, 191, .62);
  background: transparent;
  font-family: var(--serif-cn);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.memobook-close:hover { color: #ffd58a; }

.memobook-spread {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr);
  background: #f4e7c8;
  border: 2px solid #1d0e08;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(120, 80, 40, .18),
    0 4px 10px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.memobook-page {
  position: relative;
  min-height: 0;
  padding: clamp(12px, 2.2vmin, 20px) clamp(12px, 2vmin, 20px);
  background:
    repeating-linear-gradient(0deg, rgba(120, 86, 44, .13) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, #f7ecd2 0%, #f0e2bf 100%);
  overflow: hidden;
}

.memobook-page + .memobook-page {
  border-left: 1px solid rgba(90, 58, 30, .32);
  box-shadow: inset 14px 0 20px -16px rgba(60, 36, 20, .38);
}

.memobook-page-cal {
  display: flex;
  flex-direction: column;
  gap: clamp(3px, .7vmin, 6px);
}

.memobook-ribbon {
  position: absolute;
  top: 0;
  right: 18%;
  width: 9px;
  height: 26px;
  background: #a63d32;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  box-shadow: 0 1px 2px rgba(70, 20, 12, .35);
}

.memobook-cal-title {
  margin: 0 0 2px;
  color: #4a3220;
  font-size: clamp(13px, 2.2vmin, 17px);
  font-weight: 400;
  letter-spacing: .12em;
}

.memobook-week,
.memobook-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(1px, .4vmin, 3px);
}

.memobook-weekday {
  text-align: center;
  color: rgba(90, 60, 32, .58);
  font-size: clamp(9px, 1.5vmin, 11px);
  line-height: 1.2;
}

.memobook-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  color: #4a3220;
  font-size: clamp(10px, 1.7vmin, 13px);
  line-height: 1;
  border-radius: 50%;
}

.memobook-day.is-blank { visibility: hidden; }

.memobook-day.is-today {
  color: #fff6dd;
  background: #a63d32;
  box-shadow: 0 0 0 1px #7f2a22, 0 1px 2px rgba(60, 20, 10, .35);
}

.memobook-today {
  margin: auto 0 0;
  color: rgba(90, 60, 32, .66);
  font-size: clamp(10px, 1.7vmin, 12px);
  letter-spacing: .06em;
}

.memobook-page-notes {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.memobook-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: clamp(6px, 1vmin, 10px);
  border-bottom: 1px dashed rgba(120, 86, 44, .38);
}

.memobook-input {
  width: 100%;
  min-height: 52px;
  padding: 6px 8px;
  resize: none;
  color: #3b2116;
  background: rgba(255, 252, 240, .78);
  border: 1px solid rgba(120, 86, 44, .42);
  border-radius: 2px;
  font: inherit;
  font-size: clamp(12px, 1.9vmin, 14px);
  line-height: 1.6;
  outline: none;
}

.memobook-input::placeholder { color: rgba(90, 60, 32, .42); }

.memobook-input:focus {
  border-color: #b3762f;
  box-shadow: 0 0 0 2px rgba(179, 118, 47, .18);
}

.memobook-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.memobook-hint {
  flex: 1;
  min-width: 0;
  color: rgba(90, 60, 32, .52);
  font-size: clamp(9px, 1.5vmin, 11px);
  letter-spacing: .03em;
}

.memobook-post {
  padding: clamp(6px, 1.1vmin, 8px) clamp(12px, 2.2vmin, 18px);
  border: 1px solid #5b3a1e;
  border-radius: 2px;
  color: #f9eccb;
  background: linear-gradient(180deg, #8a5a33 0%, #5d3a1e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 231, 191, .2);
  font: inherit;
  font-size: clamp(12px, 1.9vmin, 14px);
  letter-spacing: .05em;
  cursor: pointer;
}

.memobook-post:hover,
.memobook-post:focus-visible {
  background: linear-gradient(180deg, #a06a3c 0%, #6b4524 100%);
  outline: none;
}

.memobook-post:disabled { opacity: .6; cursor: progress; }

.memobook-empty {
  margin: clamp(12px, 3vmin, 22px) 0;
  color: rgba(90, 60, 32, .55);
  font-size: clamp(12px, 1.9vmin, 14px);
  line-height: 1.9;
  letter-spacing: .04em;
  text-align: center;
}

.memobook-empty[hidden] { display: none; }

.memobook-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vmin, 10px);
  margin: clamp(6px, 1vmin, 10px) 0 0;
  padding: 2px 4px 6px 0;
  list-style: none;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: #b3925f rgba(120, 86, 44, .12);
}

.memobook-list::-webkit-scrollbar { width: 8px; }
.memobook-list::-webkit-scrollbar-track { background: rgba(120, 86, 44, .12); }
.memobook-list::-webkit-scrollbar-thumb { background: #b3925f; border: 2px solid #f1e3c0; }

.memobook-note {
  position: relative;
  padding: clamp(7px, 1.2vmin, 10px) clamp(8px, 1.4vmin, 12px) clamp(6px, 1vmin, 8px);
  background: linear-gradient(180deg, #fffaf0 0%, #fbf0d8 100%);
  border: 1px solid rgba(140, 102, 54, .45);
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(70, 42, 20, .14);
  transform: rotate(-.35deg);
}

.memobook-note:nth-child(2n) { transform: rotate(.4deg); }

.memobook-note.is-pinned {
  border-left: 3px solid #a63d32;
  background: linear-gradient(180deg, #fffdf3 0%, #fdf4dd 100%);
}

.memobook-note-pin {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(140, 102, 54, .4);
  border-radius: 999px;
  color: rgba(90, 60, 32, .62);
  background: rgba(255, 252, 240, .8);
  font: inherit;
  font-size: clamp(9px, 1.5vmin, 11px);
  line-height: 1.2;
  cursor: pointer;
  opacity: .8;
}

.memobook-note-pin:hover { color: #8d2f22; border-color: #a63d32; }

.memobook-note-pin.is-on {
  color: #fff4dc;
  background: #a63d32;
  border-color: #7f2a22;
  opacity: 1;
}

.memobook-note-text {
  margin: 0;
  padding-right: 56px;
  color: #3b2116;
  font-size: clamp(12px, 1.9vmin, 14px);
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}

.memobook-note-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.memobook-note-time {
  flex: 1;
  color: rgba(90, 60, 32, .5);
  font-size: clamp(9px, 1.5vmin, 11px);
}

.memobook-note-del {
  padding: 4px 7px;
  border: 1px solid rgba(140, 102, 54, .35);
  border-radius: 2px;
  color: rgba(90, 60, 32, .55);
  background: transparent;
  font: inherit;
  font-size: clamp(10px, 1.6vmin, 12px);
  line-height: 1;
  cursor: pointer;
}

.memobook-note-del:hover { color: #8d2f22; border-color: #a63d32; }

.memobook-note-del.is-armed {
  color: #fff4dc;
  background: #8d2f22;
  border-color: #6f2118;
}

.memobook-foot {
  padding-top: clamp(6px, 1vmin, 10px);
  color: rgba(246, 223, 178, .45);
  font-size: clamp(9px, 1.6vmin, 11px);
  letter-spacing: .04em;
  line-height: 1.5;
}

.scene-wrap.memobook-open .hint { opacity: 0; }

@media (max-width: 720px) {
  .memobook-panel { height: min(92dvh, 780px); }

  .memobook-spread {
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden auto;
  }

  .memobook-page + .memobook-page {
    border-left: none;
    border-top: 1px solid rgba(90, 58, 30, .32);
    box-shadow: inset 0 14px 20px -16px rgba(60, 36, 20, .38);
  }

  .memobook-page-cal { flex: 0 0 auto; }

  .memobook-page-notes { min-height: 58vh; }

  .memobook-note-text { padding-right: 52px; }

  .memobook-page-cal { min-height: 42vh; }
}

/* ---------------------------------------------------------------
   the recipe book: the same leather and the same paper as the memo
   book, but the left page is a list of dishes and the right page is
   the one you picked.  Reusing .memobook classes on purpose - the
   frame, the spine and the paper should not drift apart. */

.recipebook-spread { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); }

.recipebook-page-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.recipebook-compose {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: clamp(6px, 1vmin, 10px);
  border-bottom: 1px dashed rgba(120, 86, 44, .38);
}

.recipebook-new {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  color: #3b2116;
  background: rgba(255, 252, 240, .78);
  border: 1px solid rgba(120, 86, 44, .42);
  border-radius: 2px;
  font: inherit;
  font-size: clamp(12px, 1.9vmin, 14px);
  outline: none;
}

.recipebook-new::placeholder { color: rgba(90, 60, 32, .42); }

.recipebook-new:focus {
  border-color: #b3762f;
  box-shadow: 0 0 0 2px rgba(179, 118, 47, .18);
}

.recipebook-add { white-space: nowrap; }

.recipebook-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: clamp(6px, 1vmin, 10px) 0 0;
  padding: 0 4px 6px 0;
  list-style: none;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: #b3925f rgba(120, 86, 44, .12);
}

.recipebook-list::-webkit-scrollbar { width: 8px; }
.recipebook-list::-webkit-scrollbar-track { background: rgba(120, 86, 44, .12); }
.recipebook-list::-webkit-scrollbar-thumb { background: #b3925f; border: 2px solid #f1e3c0; }

.recipebook-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: clamp(6px, 1.1vmin, 9px) clamp(8px, 1.3vmin, 11px);
  color: #3b2116;
  text-align: left;
  background: rgba(255, 250, 238, .55);
  border: 1px solid transparent;
  border-left: 3px solid rgba(120, 86, 44, .25);
  border-radius: 2px;
  font: inherit;
  cursor: pointer;
}

.recipebook-item:hover {
  background: rgba(255, 252, 242, .82);
  border-left-color: #b3762f;
}

.recipebook-item.is-active {
  background: linear-gradient(180deg, #fffaf0 0%, #fbf0d8 100%);
  border-left-color: #a63d32;
  box-shadow: 0 2px 5px rgba(70, 42, 20, .12);
}

.recipebook-item-name {
  flex: 1;
  min-width: 0;
  font-size: clamp(12px, 1.9vmin, 14px);
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipebook-item-meta {
  flex: 0 0 auto;
  color: rgba(90, 60, 32, .45);
  font-size: clamp(9px, 1.5vmin, 11px);
}

.recipebook-page-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: #b3925f rgba(120, 86, 44, .12);
}

.recipebook-page-detail::-webkit-scrollbar { width: 8px; }
.recipebook-page-detail::-webkit-scrollbar-track { background: rgba(120, 86, 44, .12); }
.recipebook-page-detail::-webkit-scrollbar-thumb { background: #b3925f; border: 2px solid #f1e3c0; }

.recipebook-placeholder {
  margin: auto 0;
  color: rgba(90, 60, 32, .5);
  font-size: clamp(12px, 1.9vmin, 14px);
  line-height: 2;
  letter-spacing: .04em;
  text-align: center;
}

.recipebook-placeholder[hidden] { display: none; }

.recipebook-editor {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.recipebook-editor[hidden] { display: none; }

.recipebook-label {
  margin-top: clamp(4px, .8vmin, 7px);
  color: rgba(90, 60, 32, .62);
  font-size: clamp(9px, 1.5vmin, 11px);
  letter-spacing: .14em;
}

.recipebook-field {
  width: 100%;
  padding: 5px 8px;
  resize: vertical;
  color: #3b2116;
  background: rgba(255, 252, 240, .7);
  border: 1px solid rgba(120, 86, 44, .38);
  border-radius: 2px;
  font: inherit;
  font-size: clamp(12px, 1.9vmin, 14px);
  line-height: 1.6;
  outline: none;
}

.recipebook-field::placeholder { color: rgba(90, 60, 32, .38); }

.recipebook-field:focus {
  border-color: #b3762f;
  box-shadow: 0 0 0 2px rgba(179, 118, 47, .16);
}

.recipebook-name {
  font-size: clamp(14px, 2.3vmin, 17px);
  letter-spacing: .04em;
}

.recipebook-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(6px, 1.2vmin, 10px);
  padding-top: clamp(6px, 1vmin, 10px);
  border-top: 1px dashed rgba(120, 86, 44, .32);
}

.recipebook-del {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(140, 102, 54, .4);
  border-radius: 2px;
  color: rgba(90, 60, 32, .62);
  background: transparent;
  font: inherit;
  font-size: clamp(10px, 1.6vmin, 12px);
  cursor: pointer;
}

.recipebook-del:hover { color: #8d2f22; border-color: #a63d32; }

.recipebook-del.is-armed {
  color: #fff4dc;
  background: #8d2f22;
  border-color: #6f2118;
}

.scene-wrap.recipebook-open .hint { opacity: 0; }

@media (max-width: 720px) {
  .recipebook-spread { grid-template-columns: minmax(0, 1fr); }
  .recipebook-page-list { min-height: 34vh; }
  .recipebook-page-detail { min-height: 46vh; }
}

/* the day counter, flipped open over the calendar page */
.memobook-page-cal {
  cursor: pointer;
  container-type: size;
}

.memobook-page-cal:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(179, 118, 47, .5);
}

.memobook-daylink {
  display: block;
  margin-top: 2px;
  color: rgba(90, 60, 32, .45);
  font-size: clamp(9px, 1.5vmin, 11px);
  letter-spacing: .06em;
  text-align: right;
}

.memobook-daycard {
  display: none;
  position: absolute;
  inset: clamp(8px, 1.6vmin, 14px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.2vmin, 10px);
  padding: clamp(10px, 2vmin, 18px) clamp(8px, 1.6vmin, 14px);
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(255, 226, 178, .05) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #3a2417 0%, #22140d 100%);
  border: 2px solid #120a06;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(214, 168, 102, .34),
    0 6px 16px rgba(30, 18, 10, .42);
}

.memobook-daycard.is-open { display: flex; }

.memobook-daycard-label {
  margin: 0;
  color: rgba(246, 223, 178, .72);
  font-size: clamp(11px, 1.9vmin, 13px);
  letter-spacing: .14em;
}

.memobook-daycard-count {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 1vmin, 8px);
  margin: 0;
  width: 100%;
}

.memobook-daycard-num {
  height: 42cqh;
  width: auto;
  max-width: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 0 rgba(10, 6, 3, .45));
}

.memobook-daycard-unit {
  padding-bottom: .35em;
  color: #f4d9a0;
  font-size: clamp(13px, 3vmin, 20px);
  letter-spacing: .1em;
}

.memobook-daycard-start {
  margin: 0;
  color: rgba(246, 223, 178, .56);
  font-size: clamp(9px, 1.6vmin, 11px);
  letter-spacing: .05em;
}

.memobook-daycard-note {
  margin: 0;
  color: rgba(246, 223, 178, .38);
  font-size: clamp(8px, 1.5vmin, 10px);
  letter-spacing: .04em;
}

.memobook-daycard-back {
  margin-top: clamp(2px, .8vmin, 6px);
  padding: clamp(5px, 1vmin, 7px) clamp(10px, 1.8vmin, 14px);
  border: 1px solid #8a5c33;
  border-radius: 2px;
  color: #f0d9a8;
  background: rgba(90, 58, 30, .5);
  font: inherit;
  font-size: clamp(10px, 1.7vmin, 12px);
  letter-spacing: .06em;
  cursor: pointer;
}

.memobook-daycard-back:hover,
.memobook-daycard-back:focus-visible {
  color: #fff3d6;
  border-color: #c69456;
  outline: none;
}

/* --------------------------------------------- TV picker
   Reuses the photo-wall panel and cells; only the small new
   pieces live here: the fire thumbnail, the length chip, ... */

.scene-wrap.tvwall-open .hint { opacity: 0; }

.tvwall .photowall-head h2 { letter-spacing: .06em; }

.tvwall-cell .photowall-open { cursor: pointer; }

.tvwall-cell .photowall-open img { filter: saturate(.98) contrast(1.04); }

.tvwall-fire-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #0d1418;
  image-rendering: pixelated;
}

/* the fire card's label is a status line, not a button */
.tvwall-fire .photowall-pin {
  display: block;
  text-align: center;
  cursor: default;
}

.tvwall-len {
  position: absolute;
  top: 2px;
  left: 2px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid #1b0d08;
  border-radius: 2px;
  color: #f3d7a6;
  background: rgba(24, 10, 6, .78);
  font-family: var(--serif-cn);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .04em;
  pointer-events: none;
}

.tvwall-blank {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(240, 217, 174, .5);
  background: repeating-linear-gradient(45deg, #17100c 0 6px, #1e1611 6px 12px);
  font-size: 10px;
  letter-spacing: .1em;
}

/* --------------------------------------------- gift view */

.giftview {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 2cqw;
  background: rgba(4, 7, 11, .74);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility .24s;
}

.giftview.is-open {
  opacity: 1;
  visibility: visible;
}

.giftview-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(40cqw, 440px);
  padding: 1cqw 1.15cqw .95cqw;
  color: #f5e1bf;
  background:
    repeating-linear-gradient(90deg, rgba(255, 221, 166, .05) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, rgba(20, 9, 5, .18) 0 2px, transparent 2px 24px),
    linear-gradient(180deg, #4a2d1c 0%, #342014 55%, #24150e 100%);
  border: 3px solid #180c07;
  border-radius: 4px;
  box-shadow:
    0 0 0 2px #a97743,
    0 0 0 6px #1a0d08,
    0 26px 64px rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(255, 231, 191, .16),
    inset 0 0 0 1px rgba(32, 15, 9, .7);
  transform: translateY(8px) scale(.985);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}

.giftview.is-open .giftview-panel { transform: none; }

.giftview-head {
  display: flex;
  align-items: baseline;
  gap: .45cqw;
  padding-bottom: .5cqw;
  border-bottom: 1px solid rgba(226, 180, 112, .3);
}

.giftview-spark {
  color: #f6d47c;
  font-size: .78cqw;
  text-shadow: 0 0 6px rgba(255, 214, 141, .5);
}

.giftview-head h2 {
  margin: 0;
  color: #f8dfae;
  font-size: .86cqw;
  font-weight: 400;
  letter-spacing: .08cqw;
  text-shadow: 0 1px 0 rgba(20, 10, 6, .8);
}

.giftview-close {
  position: absolute;
  top: .3cqw;
  right: .45cqw;
  width: 1.45cqw;
  height: 1.45cqw;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: none;
  color: rgba(246, 225, 191, .62);
  background: transparent;
  font-family: var(--serif-cn);
  font-size: 1.05cqw;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease;
}

.giftview-close:hover { color: #ffd58a; }

.giftview-stage {
  display: grid;
  place-items: center;
  margin: .8cqw 0 .6cqw;
  padding: .6cqw;
  background:
    linear-gradient(180deg, rgba(255, 214, 141, .07), rgba(20, 10, 6, .35)),
    #241610;
  border: 2px solid #180c07;
  box-shadow: inset 0 0 0 1px rgba(169, 119, 67, .45);
}

.giftview-img {
  display: block;
  max-height: min(44cqh, 330px);
  width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 .35cqw .35cqw rgba(0, 0, 0, .55));
}

.giftview-copy {
  margin: 0;
  color: rgba(245, 225, 191, .82);
  font-size: clamp(10px, .6cqw, 14px);
  line-height: 1.7;
  letter-spacing: .04em;
  text-align: center;
}

.giftview-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7cqw;
  margin-top: .8cqw;
  padding-top: .6cqw;
  border-top: 1px solid rgba(226, 180, 112, .3);
}

.giftview-ok {
  padding: .28cqw .95cqw;
  border: 2px solid #1b0d08;
  border-radius: 2px;
  color: #2a170e;
  background: linear-gradient(180deg, #f0cd8c, #d3a35e);
  font-family: var(--serif-cn);
  font-size: clamp(10px, .58cqw, 13px);
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 246, 214, .7);
}

.giftview-ok:hover { background: linear-gradient(180deg, #ffe3a8, #e0b06a); }

.giftview-tip {
  color: rgba(232, 189, 121, .55);
  font-size: clamp(9px, .5cqw, 11px);
  letter-spacing: .06em;
}

.scene-wrap.giftview-open .hint { opacity: 0; }



@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
