/* heretoget.space — a quiet corner of the internet */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #050302;
  color: #f0e0c0;
  font-family: "VT323", "Courier New", monospace;
  overflow: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, #150c0a 0%, #050302 80%) fixed,
    #050302;
}

/* ---------- Boot splash ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #050302;
  transition: opacity 900ms ease 200ms, visibility 0s linear 1100ms;
}
.boot.gone {
  opacity: 0;
  visibility: hidden;
}
.boot-inner {
  text-align: center;
  color: #f0d4a0;
}
.boot-title {
  font-family: "VT323", monospace;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: 6px;
  color: #ffd97a;
  text-shadow: 0 0 12px rgba(255, 200, 100, 0.4), 0 0 32px rgba(255, 160, 60, 0.2);
}
.boot-sub {
  margin-top: 0.6em;
  font-size: clamp(14px, 2vw, 20px);
  letter-spacing: 2px;
  opacity: 0.65;
}
.boot-dots {
  margin-top: 1.5em;
  display: inline-flex;
  gap: 0.5em;
}
.boot-dots span {
  width: 8px;
  height: 8px;
  background: #ffd97a;
  display: inline-block;
  animation: dot 1.2s infinite ease-in-out;
}
.boot-dots span:nth-child(2) { animation-delay: 0.2s; }
.boot-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot {
  0%, 100% { opacity: 0.15; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-3px); }
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
  background: #050302;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 160, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 120px rgba(255, 160, 60, 0.05);
}

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* Subtle static scanlines + vignette baked into the stage (no blend modes — those kill perf
   when stacked over an animated canvas). The warm bloom / lens glare is painted into the
   canvas itself in applyGlobalFx(). */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(
      to bottom,
      transparent 0 2px,
      rgba(0, 0, 0, 0.06) 2px 3px
    );
}

/* ---------- Scene overlays ---------- */
.scene-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease;
  pointer-events: none;
}
.scene-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 300ms;
}
.scene-overlay > * { pointer-events: auto; }

/* Hotspots (clickable invisible regions on canvas) */
.hot {
  position: absolute;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: filter 200ms ease;
}
.hot::after {
  content: "";
  position: absolute;
  inset: -3%;
  border: 0 dashed rgba(255, 220, 140, 0);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  pointer-events: none;
}
.hot:hover::after,
.hot:focus-visible::after {
  border: 2px dashed rgba(255, 220, 140, 0.45);
  box-shadow: 0 0 24px rgba(255, 200, 100, 0.18) inset;
}
.hot:hover { filter: drop-shadow(0 0 8px rgba(255, 200, 100, 0.5)); }

/* Cafe hotspot positions — match painted canvas regions */
[data-scene="cafe"] .hot-cat     { left: 76%; top: 75%; width: 16%; height: 18%; }
[data-scene="cafe"] .hot-tea     { left: 28%; top: 38%; width: 25%; height: 30%; }
[data-scene="cafe"] .hot-books   { left:  2%; top: 22%; width: 12%; height: 55%; }
[data-scene="cafe"] .hot-note    { left: 38%; top: 70%; width: 14%; height: 18%; }
[data-scene="cafe"] .hot-wall    { left: 56%; top: 22%; width: 32%; height: 22%; }
[data-scene="cafe"] .hot-door    { left: 90%; top: 30%; width: 10%; height: 60%; }
[data-scene="cafe"] .hot-stairs  { left: 14%; top: 14%; width: 12%; height: 10%; }

/* ---------- Wall scene frames ---------- */
[data-scene="wall"] .frame {
  position: absolute;
  background-color: transparent;
  background-size: cover;
  background-position: center;
  border: 0;
  cursor: pointer;
  padding: 0;
  outline: 0;
  transition: filter 200ms ease;
  image-rendering: pixelated;
}
[data-scene="wall"] .frame[data-frame="0"] { left:  9.583%; top: 27.04%; width: 20.833%; height: 38.15%; }
[data-scene="wall"] .frame[data-frame="1"] { left: 39.583%; top: 22.96%; width: 20.833%; height: 42.22%; }
[data-scene="wall"] .frame[data-frame="2"] { left: 69.583%; top: 27.04%; width: 20.833%; height: 38.15%; }
[data-scene="wall"] .frame:hover,
[data-scene="wall"] .frame:focus-visible {
  filter: drop-shadow(0 0 18px rgba(255, 210, 130, 0.45));
}
[data-scene="wall"] .frame::after {
  content: "+ hang a picture";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: "VT323", monospace;
  font-size: clamp(10px, 1.4vw, 18px);
  letter-spacing: 2px;
  color: rgba(255, 220, 160, 0.55);
  background: rgba(20, 12, 8, 0);
  opacity: 0;
  transition: opacity 250ms ease, background 250ms ease;
  pointer-events: none;
  text-transform: lowercase;
}
[data-scene="wall"] .frame:hover::after,
[data-scene="wall"] .frame:focus-visible::after {
  opacity: 1;
  background: rgba(20, 12, 8, 0.45);
}
[data-scene="wall"] .frame.has-image::after { content: "× clear"; opacity: 0; }
[data-scene="wall"] .frame.has-image:hover::after,
[data-scene="wall"] .frame.has-image:focus-visible::after {
  opacity: 1;
  background: rgba(20, 12, 8, 0.55);
}

/* ---------- Note scene ---------- */
#notepad {
  position: absolute;
  left: 24%; top: 27%; width: 53%; height: 58%;
  background: transparent;
  border: 0; outline: 0; resize: none;
  color: #2a1810;
  font-family: "Caveat", "Comic Sans MS", cursive;
  font-size: clamp(14px, 2.4vw, 28px);
  line-height: 1.55;
  letter-spacing: 0.3px;
  padding: 0.3em 0.6em 0 0.6em;
  caret-color: #4a2818;
  text-shadow: 0 0 1px rgba(60, 40, 20, 0.08);
}
#notepad::placeholder { color: rgba(60, 40, 20, 0.35); font-style: italic; }
#notepad::selection { background: rgba(80, 50, 20, 0.18); }
#notepad:focus { outline: none; }

.note-meta {
  position: absolute;
  bottom: 6%;
  right: 8%;
  font-family: "VT323", monospace;
  font-size: clamp(10px, 1.4vw, 16px);
  letter-spacing: 2px;
  color: rgba(60, 40, 20, 0.45);
  pointer-events: none;
  transition: opacity 400ms ease;
}
.note-meta.flash { color: rgba(120, 80, 30, 0.75); }
.note-tools {
  position: absolute;
  left: 8%;
  bottom: 5%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 3;
}
.note-tool-btn {
  background: rgba(232, 218, 184, 0.75);
  border: 1px solid rgba(80, 50, 20, 0.25);
  color: #3a2410;
  font-family: "VT323", monospace;
  font-size: clamp(10px, 1.3vw, 14px);
  letter-spacing: 2px;
  padding: 4px 10px;
  cursor: pointer;
  text-transform: lowercase;
}
.note-tool-btn:hover { background: rgba(255, 245, 220, 0.9); }

/* ---------- Cat close-up ---------- */
[data-scene="cat"] .pet-zone {
  position: absolute;
  left: 28%; top: 36%; width: 50%; height: 52%;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  outline: 0;
  border-radius: 50%;
}
[data-scene="cat"] .pet-zone:hover {
  cursor: grab;
  background: radial-gradient(circle at center, rgba(255,220,140,0.06), transparent 70%);
}
[data-scene="cat"] .pet-zone:active { cursor: grabbing; }
[data-scene="cat"] .pet-hint {
  display: none;
}
[data-scene="cat"] .pet-zone:hover .pet-hint {
  display: block;
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Caveat", cursive;
  font-size: clamp(14px, 2vw, 22px);
  color: rgba(255, 220, 160, 0.7);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.cat-status {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Caveat", cursive;
  font-size: clamp(14px, 2.4vw, 26px);
  color: rgba(245, 220, 180, 0.7);
  letter-spacing: 0.3px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  transition: opacity 400ms ease, color 400ms ease;
  pointer-events: none;
}
.cat-status.happy { color: #ffd9b0; }

.cat-meter {
  position: absolute;
  bottom: 4%;
  left: 10%;
  width: 28%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.cat-meter-fill {
  height: 6px;
  background: linear-gradient(to right, #c87248, #ffd97a);
  width: 0%;
  border: 1px solid rgba(255, 220, 140, 0.3);
  transition: width 250ms ease;
}
.cat-meter-label {
  font-family: "VT323", monospace;
  font-size: clamp(10px, 1.4vw, 16px);
  color: rgba(255, 220, 140, 0.6);
  letter-spacing: 1.5px;
}

/* ---------- Tea Station ---------- */
[data-scene="tea"] .tea-panel {
  position: absolute;
  inset: 6% 6% 6% 6%;
  background: rgba(14, 8, 4, 0.92);
  border: 1px solid rgba(255, 200, 130, 0.18);
  padding: 18px clamp(14px, 2.4vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: "Caveat", "Gaegu", cursive;
  color: #f5e6c8;
  overflow: hidden;
}
.tea-title {
  font-family: "VT323", monospace;
  font-size: clamp(14px, 1.7vw, 18px);
  letter-spacing: 4px;
  color: rgba(255, 220, 160, 0.65);
  text-transform: uppercase;
}
.tea-sub {
  font-size: clamp(15px, 2vw, 22px);
  color: rgba(255, 230, 180, 0.78);
}
.tea-herbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 720px) {
  .tea-herbs { grid-template-columns: repeat(2, 1fr); }
}
.tea-herb {
  position: relative;
  background: rgba(40, 24, 14, 0.65);
  border: 1px solid rgba(255, 200, 130, 0.12);
  color: #f3e2c2;
  padding: 8px 10px 10px 38px;
  font-family: inherit;
  font-size: clamp(14px, 1.7vw, 18px);
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.tea-herb:hover {
  background: rgba(80, 48, 24, 0.7);
  border-color: rgba(255, 200, 130, 0.3);
  transform: translateY(-1px);
}
.tea-herb.is-in-cup {
  background: rgba(120, 80, 36, 0.55);
  border-color: rgba(255, 210, 140, 0.55);
}
.tea-jar {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 26px;
  background: var(--jar-color, #b08858);
  border: 1px solid rgba(0,0,0,0.4);
  border-radius: 2px 2px 4px 4px;
  box-shadow: inset 0 6px 0 rgba(255,255,255,0.08), inset 0 -6px 0 rgba(0,0,0,0.18);
}
.tea-jar::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -4px;
  right: -2px;
  height: 4px;
  background: rgba(40, 24, 14, 0.85);
  border-radius: 1px;
}
.tea-name {
  display: block;
  letter-spacing: 0.5px;
}
.tea-cup-row {
  display: flex;
  gap: clamp(14px, 2.4vw, 28px);
  align-items: center;
  margin-top: auto;
}
.tea-cup-wrap {
  position: relative;
  width: clamp(80px, 12vw, 130px);
  height: clamp(100px, 14vw, 150px);
  flex-shrink: 0;
}
.tea-cup {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 80%;
  height: 70%;
  background: linear-gradient(180deg, #f0e3cc 0%, #d9c4a0 100%);
  border: 2px solid #6b4827;
  border-radius: 4px 4px 30% 30%;
  overflow: hidden;
}
.tea-cup::before {
  content: "";
  position: absolute;
  right: -16%;
  top: 18%;
  width: 22%;
  height: 50%;
  border: 2px solid #6b4827;
  border-left: 0;
  border-radius: 0 50% 50% 0;
  background: transparent;
}
.tea-liquid {
  position: absolute;
  inset: auto 4px 4px 4px;
  height: 0%;
  background: #3a2a1c;
  transition: height 600ms ease, background 600ms ease;
  border-radius: 0 0 28% 28%;
  box-shadow: inset 0 4px rgba(0,0,0,0.18);
}
.tea-saucer {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 96%;
  height: 10px;
  background: #d9c4a0;
  border: 2px solid #6b4827;
  border-radius: 50%;
}
.tea-steam {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tea-steam span {
  position: absolute;
  left: 50%;
  bottom: 78%;
  width: 4px;
  height: 24px;
  background: linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 60%, rgba(255,255,255,0) 100%);
  border-radius: 4px;
  animation: tea-steam 2200ms ease-in-out infinite;
  filter: blur(0.5px);
}
.tea-steam span:nth-child(2) { left: 42%; animation-delay: 350ms; }
.tea-steam span:nth-child(3) { left: 58%; animation-delay: 700ms; }
@keyframes tea-steam {
  0%   { transform: translate(-50%, 0)   scale(0.8); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translate(-50%, -36px) scale(1.3); opacity: 0; }
}
.tea-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tea-recipe {
  font-size: clamp(15px, 1.9vw, 21px);
  color: #ffd9a8;
  min-height: 1.4em;
}
.tea-recipe em { color: rgba(255, 220, 160, 0.4); font-style: italic; }
.tea-btn {
  background: rgba(60, 36, 18, 0.7);
  border: 1px solid rgba(255, 200, 130, 0.2);
  color: #ffd9b0;
  padding: 8px 14px;
  font-family: "VT323", monospace;
  font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease;
  text-align: left;
}
.tea-btn:hover:not(:disabled) { background: rgba(120, 70, 40, 0.78); color: #fff1c8; }
.tea-btn:disabled { opacity: 0.3; cursor: default; }
.tea-btn-primary {
  background: rgba(140, 90, 40, 0.78);
  color: #fff5d8;
  border-color: rgba(255, 220, 160, 0.4);
}
.tea-btn-primary:hover:not(:disabled) { background: rgba(170, 110, 50, 0.85); }
.tea-btn-ghost {
  background: transparent;
  border-color: rgba(255, 200, 130, 0.12);
  opacity: 0.6;
}
.tea-btn-ghost:hover:not(:disabled) { opacity: 1; background: rgba(40, 22, 10, 0.6); }

/* ---------- Cafe hotspots: window, chime, fortune ---------- */
[data-scene="cafe"] .hot-window  { left: 27%; top: 10%; width: 22%; height: 42%; z-index: 2; }
[data-scene="cafe"] .hot-chime   { left: 63%; top:  5%; width: 4%; height: 14%; z-index: 2; }
[data-scene="cafe"] .hot-fortune { left: 78%; top: 60%; width: 5%; height: 8%;  z-index: 2; }

/* ---------- Books (browse) ---------- */
[data-scene="books"] .book-grid {
  position: absolute;
  left: 8%; top: 18%; right: 8%; bottom: 18%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,200,130,0.2) transparent;
}
.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 12px 12px 12px;
  min-height: 120px;
  background: linear-gradient(135deg, var(--c1, #6a3a2a), var(--c2, #4a2818) 70%);
  border: 0;
  border-left: 6px solid rgba(0,0,0,0.5);
  color: #f5e6c8;
  font-family: "Cormorant Garamond", "Georgia", serif;
  cursor: pointer;
  outline: 0;
  text-align: left;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.book-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.12);
}
.book-card .book-title {
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.book-card .book-author {
  margin-top: 6px;
  font-size: clamp(11px, 1.4vw, 14px);
  opacity: 0.7;
  font-style: italic;
}
.book-card .book-pages {
  position: absolute;
  top: 8px; right: 10px;
  font-family: "VT323", monospace;
  font-size: 12px;
  color: rgba(255, 220, 160, 0.4);
  letter-spacing: 1px;
}
.book-toolbar {
  position: absolute;
  top: 10%;
  right: 8%;
  z-index: 2;
}
.book-import-btn {
  background: rgba(20, 12, 8, 0.75);
  border: 1px solid rgba(255, 200, 130, 0.25);
  color: #ffd9b0;
  font-family: "Caveat", cursive;
  font-size: clamp(14px, 2vw, 20px);
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 200ms ease, color 200ms ease;
}
.book-import-btn:hover {
  background: rgba(60, 36, 18, 0.9);
  color: #fff1c8;
}

.book-hint {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Caveat", cursive;
  font-size: clamp(13px, 1.8vw, 20px);
  color: rgba(255, 220, 160, 0.55);
  letter-spacing: 0.5px;
  pointer-events: none;
  text-align: center;
  max-width: 90%;
}

/* ---------- Book reader ---------- */
[data-scene="book"] .reader {
  position: absolute;
  inset: 6% 10%;
  background: linear-gradient(170deg, #f4e9c8 0%, #e8d8a8 100%);
  box-shadow:
    0 0 0 1px #5a3a1c,
    0 0 0 6px #8b5a2b,
    0 0 0 7px #4a2818,
    0 20px 60px rgba(0,0,0,0.7),
    inset 0 0 60px rgba(80, 50, 20, 0.12);
  display: flex;
  flex-direction: column;
  color: #2a1810;
  font-family: "Cormorant Garamond", "Georgia", serif;
  padding: 28px 36px 18px 36px;
  overflow: hidden;
}
[data-scene="book"] .reader-close {
  position: absolute;
  top: 8px; left: 12px;
  background: transparent;
  border: 0;
  color: #5a3a1c;
  font-family: "VT323", monospace;
  letter-spacing: 2px;
  font-size: clamp(11px, 1.5vw, 15px);
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
}
[data-scene="book"] .reader-close:hover { opacity: 1; color: #8b5a2b; }

.reader-page {
  flex: 1;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 60, 30, 0.3) transparent;
  padding-top: 10px;
}
.reader-page::-webkit-scrollbar { width: 6px; }
.reader-page::-webkit-scrollbar-thumb { background: rgba(90, 60, 30, 0.3); }

.reader-title {
  font-size: clamp(20px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-style: italic;
}
.reader-author {
  font-size: clamp(12px, 1.6vw, 16px);
  color: rgba(90, 60, 30, 0.7);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.reader-body {
  font-size: clamp(14px, 2vw, 19px);
  line-height: 1.65;
  white-space: pre-wrap;
  text-indent: 1.4em;
  hyphens: auto;
}
.reader-body p { margin: 0 0 0.9em 0; }
.reader-body p:first-child::first-letter {
  font-size: 2.6em;
  float: left;
  line-height: 0.9;
  margin-right: 6px;
  margin-top: 2px;
  font-weight: 600;
  color: #6a3a1c;
}
.reader-body em { font-style: italic; color: #5a3a1c; }
.reader-body .center { text-align: center; text-indent: 0; font-style: italic; opacity: 0.7; }

.reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(90, 60, 30, 0.18);
  font-family: "VT323", monospace;
  color: #6a3a1c;
  letter-spacing: 1.5px;
  font-size: clamp(13px, 1.7vw, 17px);
}
.reader-nav button {
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 4px 10px;
  transition: color 150ms ease;
}
.reader-nav button:hover:not(:disabled) { color: #8b5a2b; }
.reader-nav button:disabled { opacity: 0.25; cursor: default; }
.reader-pagenum { opacity: 0.6; }

/* ---------- Outside / hotel / bedroom / garden hotspots ---------- */
[data-scene="outside"] .hot-back-cafe { left: 12%; top: 36%; width: 28%; height: 50%; }
[data-scene="outside"] .hot-garden    { left: 64%; top: 50%; width: 24%; height: 38%; }
[data-scene="outside"] .scene-action {
  position: absolute;
  right: 6%;
  bottom: 8%;
  z-index: 3;
  background: rgba(14, 8, 4, 0.82);
  border: 1px solid rgba(255, 200, 130, 0.2);
  color: #f5e6c8;
  font-family: "VT323", monospace;
  font-size: clamp(11px, 1.4vw, 15px);
  letter-spacing: 2px;
  padding: 6px 12px;
  cursor: pointer;
  text-transform: lowercase;
}
[data-scene="outside"] .scene-action:hover { background: rgba(80, 50, 30, 0.85); }
[data-scene="outside"] .scene-action[aria-pressed="true"] {
  background: rgba(100, 70, 40, 0.9);
  color: #fff5d8;
}

[data-scene="garden"]  .hot-back-outside { left:  2%; top: 38%; width: 14%; height: 52%; }
[data-scene="garden"]  .hot-koi          { left: 30%; top: 60%; width: 40%; height: 28%; }
[data-scene="garden"]  .hot-wish          { left:  4%; top:  8%; width: 22%; height: 55%; }

[data-scene="hotel"]   .hot-bedroom { left: 18%; top: 30%; width: 28%; height: 50%; }
[data-scene="hotel"]   .hot-roof    { left: 56%; top: 18%; width: 16%; height: 30%; }
[data-scene="hotel"]   .hot-down    { left: 82%; top: 60%; width: 16%; height: 36%; }
[data-scene="hotel"]   .hot-lantern  { left: 44%; top: 22%; width: 8%; height: 22%; }

[data-scene="bedroom"] .hot-bed   { left: 18%; top: 50%; width: 64%; height: 38%; }
[data-scene="bedroom"] .hot-music { left: 20%; top: 68%; width: 12%; height: 14%; }

/* Sleep veil overlay */
.sleep-veil {
  position: absolute;
  inset: 0;
  background: #050302;
  opacity: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  transition: opacity 1800ms ease;
  z-index: 8;
}
.sleep-veil.show { opacity: 1; }
.sleep-z {
  font-family: "Caveat", cursive;
  font-size: clamp(30px, 6vw, 64px);
  color: #ffd97a;
  letter-spacing: 18px;
  text-shadow: 0 0 14px rgba(255,200,100,0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1200ms ease, transform 1200ms ease;
}
.sleep-veil.show .sleep-z { opacity: 1; transform: translateY(0); }
.sleep-dream {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(14px, 2.2vw, 22px);
  font-style: italic;
  color: rgba(255, 220, 170, 0.55);
  line-height: 1.5;
  opacity: 0;
  transition: opacity 2000ms ease 800ms;
  pointer-events: none;
}
.sleep-veil.show .sleep-dream { opacity: 1; }

/* ---------- Roof (stargazing) ---------- */
[data-scene="roof"] .star-zone {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}
.star-reveal {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Caveat", cursive;
  font-size: clamp(15px, 2.4vw, 26px);
  color: #fff2c0;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(255,200,100,0.45), 0 0 24px rgba(0,0,0,0.7);
  max-width: 70%;
  text-align: center;
  opacity: 0;
  transition: opacity 700ms ease;
  pointer-events: none;
}
.star-reveal.show { opacity: 1; }

/* ---------- Back button ---------- */
.back {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 10;
  background: rgba(20, 12, 8, 0.9);
  border: 1px solid #6b4a2a;
  color: #f0d4a0;
  padding: 6px 14px;
  cursor: pointer;
  font-family: "VT323", monospace;
  letter-spacing: 3px;
  font-size: clamp(12px, 1.6vw, 17px);
  text-transform: lowercase;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.back:hover {
  background: rgba(60, 36, 18, 0.92);
  color: #fff1c0;
  transform: translateX(-2px);
}
.back .arrow { display: inline-block; margin-right: 4px; }

/* ---------- Caption / Title ---------- */
.caption {
  position: absolute;
  bottom: 12px; right: 16px;
  z-index: 7;
  color: rgba(240, 224, 180, 0.42);
  font-family: "VT323", monospace;
  font-size: clamp(11px, 1.4vw, 16px);
  letter-spacing: 3px;
  text-transform: lowercase;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transition: opacity 600ms ease;
}

/* ---------- Welcome guide ---------- */
.guide {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 3, 2, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease, visibility 0s linear 500ms;
}
.guide.show {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.guide-card {
  max-width: min(420px, 88vw);
  padding: 22px 26px 20px;
  background: rgba(24, 14, 8, 0.92);
  border: 1px solid rgba(255, 200, 130, 0.22);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  color: #f5e6c8;
  font-family: "Caveat", cursive;
}
.guide-kicker {
  margin: 0 0 8px;
  font-family: "VT323", monospace;
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 4px;
  color: #ffd97a;
  text-transform: lowercase;
}
.guide-body {
  margin: 0 0 12px;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.45;
  color: rgba(245, 230, 200, 0.88);
}
.guide-list {
  margin: 0 0 16px;
  padding-left: 1.1em;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.5;
  color: rgba(245, 230, 200, 0.75);
}
.guide-list strong {
  font-weight: 600;
  color: #ffd9b0;
}
.guide-close {
  width: 100%;
  background: rgba(80, 50, 30, 0.55);
  border: 1px solid rgba(255, 200, 130, 0.2);
  color: #fff1c8;
  font-family: "Caveat", cursive;
  font-size: clamp(17px, 2.4vw, 24px);
  padding: 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.guide-close:hover { background: rgba(120, 70, 40, 0.75); }

/* ---------- Top bar (audio / breath / mood / install) ---------- */
.topbar {
  position: absolute;
  top: 14px; right: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.tbbtn {
  width: 34px;
  height: 34px;
  background: rgba(20, 12, 8, 0.6);
  border: 1px solid #6b4a2a;
  color: #ffd97a;
  cursor: pointer;
  font-family: "VT323", monospace;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: background 200ms ease, color 200ms ease, transform 160ms ease;
}
.tbbtn:hover { background: rgba(60, 36, 18, 0.9); transform: translateY(-1px); }
.tbbtn[hidden] { display: none; }
.tbbtn-glyph { font-size: 18px; }

#audioBtn .audio-on  { display: none; }
#audioBtn .audio-off { display: block; }
#audioBtn.on .audio-on  { display: block; }
#audioBtn.on .audio-off { display: none; }

/* ---------- Breathing pacer ---------- */
.breath {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(8, 4, 2, 0.78);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 350ms ease;
}
.breath.show { opacity: 1; }
.breath[hidden] { display: none; }
.breath-stage {
  position: relative;
  width: clamp(220px, 40vmin, 360px);
  height: clamp(220px, 40vmin, 360px);
  display: grid;
  place-items: center;
}
.breath-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255, 220, 160, 0.18);
}
.breath-circle {
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 230, 180, 0.95), rgba(255, 200, 130, 0.55) 50%, rgba(200, 150, 90, 0.15) 100%);
  box-shadow: 0 0 60px rgba(255, 220, 160, 0.18);
  transition: transform 4000ms cubic-bezier(0.4, 0, 0.5, 1), background 600ms ease;
  transform: scale(1);
}
.breath-circle.inhale { transform: scale(2.4); }
.breath-circle.hold   { transform: scale(2.4); }
.breath-circle.exhale { transform: scale(1); }
.breath-circle.holdout { transform: scale(1); }
.breath-label {
  position: absolute;
  font-family: "Caveat", cursive;
  font-size: clamp(28px, 5vw, 48px);
  color: #ffe5b0;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(0,0,0,0.5);
}
.breath-count {
  position: absolute;
  bottom: -8px;
  font-family: "VT323", monospace;
  font-size: clamp(12px, 1.6vw, 15px);
  letter-spacing: 3px;
  color: rgba(255, 220, 160, 0.45);
  text-transform: uppercase;
}
.breath-foot {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.breath-toggle, .breath-close {
  background: rgba(80, 50, 30, 0.6);
  border: 1px solid rgba(255, 200, 130, 0.22);
  color: #ffd9b0;
  padding: 8px 18px;
  font-family: "VT323", monospace;
  font-size: clamp(12px, 1.5vw, 15px);
  letter-spacing: 3px;
  cursor: pointer;
  text-transform: uppercase;
}
.breath-toggle:hover, .breath-close:hover { background: rgba(120, 70, 40, 0.75); color: #fff1c8; }

/* ---------- Fortune card ---------- */
.fortune {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(8, 4, 2, 0.78);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 320ms ease;
}
.fortune.show { opacity: 1; }
.fortune[hidden] { display: none; }
.fortune-card {
  max-width: min(440px, 88vw);
  padding: 24px 28px 18px;
  background: #f4e8cc;
  background-image: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.6), transparent 60%),
                    radial-gradient(circle at 80% 100%, rgba(180, 140, 90, 0.12), transparent 60%);
  border: 1px solid rgba(120, 90, 60, 0.45);
  box-shadow: 0 12px 50px rgba(0,0,0,0.6);
  color: #3a2616;
  font-family: "Cormorant Garamond", serif;
  text-align: center;
  transform: rotate(-1.2deg);
}
.fortune-kicker {
  font-family: "VT323", monospace;
  font-size: 13px;
  letter-spacing: 6px;
  color: rgba(80, 50, 25, 0.7);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.fortune-text {
  font-size: clamp(20px, 2.6vw, 28px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
  color: #2a1808;
  min-height: 3em;
  padding: 0 4px;
}
.fortune-foot {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.fortune-again, .fortune-close {
  background: rgba(60, 36, 18, 0.85);
  border: 0;
  color: #ffe5b0;
  font-family: "VT323", monospace;
  font-size: 13px;
  letter-spacing: 3px;
  padding: 7px 14px;
  cursor: pointer;
  text-transform: uppercase;
}
.fortune-again:hover, .fortune-close:hover { background: rgba(100, 60, 28, 0.95); }

/* ---------- Mood check-in ---------- */
.mood {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(8, 4, 2, 0.78);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 320ms ease;
}
.mood.show { opacity: 1; }
.mood[hidden] { display: none; }
.mood-card {
  max-width: min(440px, 88vw);
  padding: 22px 24px 18px;
  background: rgba(24, 14, 8, 0.94);
  border: 1px solid rgba(255, 200, 130, 0.22);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  color: #f5e6c8;
  font-family: "Caveat", cursive;
}
.mood-kicker {
  font-family: "VT323", monospace;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: lowercase;
  color: #ffd97a;
  margin-bottom: 14px;
  text-align: center;
}
.mood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.mood-opt {
  background: rgba(60, 36, 18, 0.55);
  border: 1px solid rgba(255, 200, 130, 0.18);
  color: #fce4c8;
  font-family: inherit;
  font-size: clamp(17px, 2vw, 22px);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}
.mood-opt:hover { background: rgba(100, 60, 28, 0.7); transform: translateY(-1px); }
.mood-opt.is-picked { background: rgba(140, 90, 40, 0.85); color: #fff5d8; }
.mood-log {
  font-family: "VT323", monospace;
  font-size: 13px;
  color: rgba(255, 220, 160, 0.55);
  letter-spacing: 1px;
  min-height: 1.5em;
  margin: 6px 0 10px;
  text-align: center;
}
.mood-close {
  width: 100%;
  background: rgba(80, 50, 30, 0.55);
  border: 1px solid rgba(255, 200, 130, 0.2);
  color: #fff1c8;
  font-family: "Caveat", cursive;
  font-size: clamp(15px, 2vw, 18px);
  padding: 8px;
  cursor: pointer;
}
.mood-close:hover { background: rgba(120, 70, 40, 0.75); }

/* ---------- Shared dialog shells (gaze, wish, postcard, warmth) ---------- */
.gaze, .wish, .postcard, .warmth {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  background: rgba(4, 2, 1, 0.55);
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}
.gaze.show, .wish.show, .postcard.show, .warmth.show {
  opacity: 1;
  pointer-events: auto;
}
.gaze[hidden], .wish[hidden], .postcard[hidden], .warmth[hidden] { display: none; }
.gaze-card, .wish-card, .postcard-card, .warmth-card {
  width: min(92%, 380px);
  background: rgba(18, 10, 6, 0.94);
  border: 1px solid rgba(255, 200, 130, 0.2);
  padding: 18px 20px;
  color: #f5e6c8;
}
.gaze-kicker, .wish-kicker, .postcard-kicker, .warmth-kicker {
  font-family: "VT323", monospace;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: lowercase;
  color: rgba(255, 220, 160, 0.55);
  margin-bottom: 10px;
}
.gaze-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(17px, 2.4vw, 24px);
  font-style: italic;
  line-height: 1.55;
  color: #fce8c8;
  margin-bottom: 14px;
  min-height: 3em;
}
.gaze-close, .wish-close, .postcard-close, .warmth-close {
  width: 100%;
  background: rgba(80, 50, 30, 0.55);
  border: 1px solid rgba(255, 200, 130, 0.2);
  color: #fff1c8;
  font-family: "Caveat", cursive;
  font-size: clamp(15px, 2vw, 18px);
  padding: 8px;
  cursor: pointer;
  margin-top: 8px;
}
.gaze-close:hover, .wish-close:hover, .postcard-close:hover, .warmth-close:hover {
  background: rgba(120, 70, 40, 0.75);
}
#wishInput, #postcardInput {
  width: 100%;
  box-sizing: border-box;
  background: rgba(30, 18, 10, 0.6);
  border: 1px solid rgba(255, 200, 130, 0.15);
  color: #fce4c8;
  font-family: "Caveat", cursive;
  font-size: clamp(16px, 2.2vw, 22px);
  padding: 8px 10px;
  resize: none;
  margin-bottom: 8px;
}
#wishInput::placeholder, #postcardInput::placeholder { color: rgba(255, 220, 160, 0.35); }
.wish-tie, .postcard-save {
  width: 100%;
  background: rgba(120, 70, 40, 0.65);
  border: 1px solid rgba(255, 200, 130, 0.25);
  color: #fff5d8;
  font-family: "Caveat", cursive;
  font-size: clamp(16px, 2vw, 20px);
  padding: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}
.wish-tie:hover, .postcard-save:hover { background: rgba(150, 95, 45, 0.85); }
.wish-recent {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(13px, 1.8vw, 17px);
  font-style: italic;
  color: rgba(255, 220, 170, 0.65);
  line-height: 1.45;
  margin: 8px 0;
  min-height: 2em;
}
.postcard-foot { display: flex; gap: 8px; }
.postcard-foot .postcard-save, .postcard-foot .postcard-close { flex: 1; margin: 0; }
.warmth-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-family: "Caveat", cursive;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.6;
  color: #fce4c8;
}
.warmth-list li { padding: 2px 0; border-bottom: 1px dashed rgba(255, 200, 130, 0.08); }
.warmth-list li:last-child { border-bottom: none; }
.warmth-list strong { color: #ffe2a8; font-weight: 600; }

/* ---------- Signature ---------- */
.signature {
  position: absolute;
  bottom: 12px; left: 16px;
  z-index: 7;
  font-family: "Caveat", "Comic Sans MS", cursive;
  font-size: clamp(12px, 1.6vw, 18px);
  color: rgba(245, 220, 180, 0.32);
  letter-spacing: 0.5px;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0,0,0,0.6);
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 18, 10, 0.85);
  border: 1px solid rgba(255, 200, 130, 0.25);
  color: #ffd9b0;
  font-family: "Caveat", cursive;
  font-size: clamp(13px, 1.8vw, 18px);
  padding: 6px 14px;
  letter-spacing: 0.5px;
  z-index: 12;
  opacity: 0;
  transition: opacity 250ms ease, transform 350ms cubic-bezier(0.3, 1.2, 0.6, 1);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scene-overlay { transition-duration: 0ms !important; }
  .boot-dots span { animation: none; opacity: 0.4; }
  .sleep-veil { transition-duration: 600ms !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  [data-scene="tea"] .tea-panel { padding: 12px; }
  [data-scene="tea"] .tea-herbs { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  #notepad { font-size: 16px; line-height: 1.4; }
  .signature { font-size: 11px; }
  .topbar { top: 8px; right: 8px; }
  .tbbtn { width: 30px; height: 30px; }
}
