:root {
  --wood-dark: #5a3a24;
  --wood: #8b5a36;
  --wood-mid: #c48a55;
  --cream: #f6ead4;
  --cream-2: #efe0c4;
  --ink: #4a3426;
  --ink-soft: #6b5342;
  --panel: rgba(255, 246, 228, 0.92);
  --panel-border: #e4c9a0;
  --glow: #ffd27a;
  --pink: #f4a7bc;
  --gold: #efc15a;
  --blue: #7ec8e3;
  --green: #8fce7a;
  --nav: #6b4a30;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body, #app {
  margin: 0;
  height: 100%;
  font-family: Nunito, Quicksand, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #1c140f;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
button, [role="button"] { -webkit-user-select: none; user-select: none; }

button, [role="button"] {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
[role="button"]:focus-visible,
.hotspot:focus-visible {
  outline: 3px solid #fff4c2;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.stage {
  min-height: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at top, #3a2418, #1a100c);
}

.stage {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.game-frame {
  position: relative;
  width: min(100vw - env(safe-area-inset-left) - env(safe-area-inset-right), 1366px);
  height: min(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom), 1024px);
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}
@media (min-aspect-ratio: 16/10) {
  .game-frame {
    height: min(100svh, 900px);
    width: min(100vw, calc(min(100svh, 900px) * 1.333));
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
  }
}

.cottage {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(80,50,30,.15), transparent 30%),
    #7a4e32;
}

.cottage-wall {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(90,50,28,.18) 0 18px, transparent 18px 86px),
    linear-gradient(#9a623c, #7a4a2c);
}

.beams {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--wood-dark), var(--wood-dark)) top / 100% 28px no-repeat,
    linear-gradient(var(--wood-dark), var(--wood-dark)) 0 0 / 26px 100% no-repeat,
    linear-gradient(var(--wood-dark), var(--wood-dark)) right / 26px 100% no-repeat;
  box-shadow: inset 0 0 80px rgba(40,20,10,.25);
}

.window-scene {
  position: absolute;
  left: 38%;
  top: 8%;
  width: 32%;
  height: 46%;
  border: 10px solid #6a4128;
  border-radius: 18px 18px 8px 8px;
  overflow: hidden;
  background: linear-gradient(#6a4d8a 0%, #e07a6a 38%, #f2b07a 62%, #4a6ea8 62%, #2b4c7a 100%);
  box-shadow: 0 0 0 6px #4a2c18, inset 0 0 30px rgba(20,10,40,.25);
}

.window-scene .moon {
  position: absolute;
  right: 18%;
  top: 16%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f8e7b0;
  box-shadow: 0 0 24px #ffe8a0;
}

.window-scene .water {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(#3d5f96, #243e6c);
}

.window-scene .island {
  position: absolute;
  right: 10%;
  bottom: 28%;
  width: 42%;
  height: 22%;
  background: #2d3a2a;
  border-radius: 40% 50% 0 0;
}

.window-scene .lighthouse {
  position: absolute;
  right: 22%;
  bottom: 40%;
  width: 8px;
  height: 28px;
  background: #efe6d2;
  box-shadow: 0 -10px 16px #ffd98a;
}

.string-lights {
  position: absolute;
  left: 34%;
  top: 4%;
  width: 38%;
  height: 40px;
  pointer-events: none;
}

.bulb {
  position: absolute;
  width: 16px;
  height: 20px;
  background: #f4c56a;
  border-radius: 8px 8px 10px 10px;
  box-shadow: 0 0 16px #ffd27a;
}

.bookshelf {
  position: absolute;
  left: 16%;
  top: 12%;
  width: 16%;
  height: 48%;
  background: linear-gradient(#6b3f24, #4e2c18);
  border-radius: 6px;
  box-shadow: inset 0 0 0 4px #3a2112;
}

.shelf-row {
  height: 22%;
  margin: 6% 8%;
  background: linear-gradient(90deg, #8b4f2c, #6a3820);
  border-radius: 3px;
  position: relative;
}

.book {
  position: absolute;
  bottom: 4px;
  width: 10px;
  height: 70%;
  border-radius: 2px;
}

.sofa {
  position: absolute;
  left: 17%;
  top: 52%;
  width: 22%;
  height: 22%;
  background: #5f8e86;
  border-radius: 22px 22px 10px 10px;
  box-shadow: 8px 10px 0 #4d746e;
}

.sofa-pillow {
  position: absolute;
  right: 12%;
  top: 12%;
  width: 34%;
  height: 48%;
  background: #f3e2b0;
  border-radius: 50%;
}

.book-stack {
  position: absolute;
  left: 18%;
  top: 68%;
  width: 10%;
}

.book-stack span {
  display: block;
  height: 16px;
  margin-bottom: 3px;
  background: #d7b48a;
  border-radius: 3px;
  font-size: 9px;
  padding: 1px 6px;
  color: #5a3a24;
}

.rug {
  position: absolute;
  left: 32%;
  top: 64%;
  width: 36%;
  height: 26%;
  background:
    radial-gradient(circle at 50% 50%, #d9c6e8 0 18%, transparent 19%),
    repeating-conic-gradient(from 0deg, #c9b8e0 0 12deg, #b39bd0 12deg 24deg);
  border-radius: 50%;
  box-shadow: 0 10px 0 rgba(70,40,20,.18);
}

.pet-bed {
  position: absolute;
  left: 66%;
  top: 58%;
  width: 13%;
  height: 12%;
  background: #efe0c8;
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px #e2c8a0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #7a5a40;
}

.plant-left, .plant-right {
  position: absolute;
  width: 90px;
  height: 140px;
  pointer-events: none;
}

.plant-left { left: 2%; bottom: 18%; }
.plant-right { right: 3%; bottom: 16%; }

.leaf {
  position: absolute;
  background: #4f8a46;
  border-radius: 60% 40%;
  width: 28px;
  height: 48px;
}

.table-left {
  position: absolute;
  left: 1%;
  bottom: 14%;
  width: 18%;
  height: 18%;
  background: #8a5634;
  border-radius: 10px;
  z-index: 3;
}

.lantern-obj {
  position: absolute;
  left: 3%;
  bottom: 24%;
  width: 54px;
  height: 70px;
  z-index: 4;
}

.lantern-body {
  width: 40px;
  height: 46px;
  margin: 0 auto;
  background: linear-gradient(#f0c36a, #c98432);
  border-radius: 8px;
  box-shadow: 0 0 24px #ffb347;
}

.mug {
  position: absolute;
  left: 10%;
  bottom: 20%;
  width: 48px;
  height: 42px;
  background: #efe6d6;
  border-radius: 6px 6px 10px 10px;
  z-index: 5;
  display: grid;
  place-items: end center;
  font-size: 9px;
  padding-bottom: 6px;
}

.rabbit {
  position: absolute;
  left: 58%;
  top: 74%;
  width: 70px;
  height: 46px;
  background: #d8b48a;
  border-radius: 40% 50% 40% 40%;
  z-index: 5;
}

.sign-left, .sign-right, .sign-top {
  position: absolute;
  background: #d7c09a;
  color: #5b422e;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.25;
  box-shadow: 2px 3px 0 rgba(80,50,20,.2);
}

.sign-left { left: 1%; bottom: 4%; width: 120px; z-index: 8; }
.sign-right { right: 1%; bottom: 4%; width: 110px; z-index: 8; }
.sign-top { right: 1%; top: 1%; width: 120px; z-index: 20; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

.brand {
  position: absolute;
  left: 18px;
  top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(#7fb7d8, #3d6a8a);
  box-shadow: 0 0 0 4px #efe3c8;
  display: grid;
  place-items: center;
  font-size: 26px;
}

.brand h1 {
  margin: 0;
  font-size: 34px;
  color: #f3e2b4;
  text-shadow: 0 2px 0 #5a3a18;
  letter-spacing: .5px;
}

.brand p {
  margin: 0;
  color: #d7c29a;
  font-size: 13px;
}

.currencies {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: #5a3a24;
  padding: 6px 10px;
  border-radius: 24px;
  box-shadow: 0 6px 0 #3d2416;
}

.currency {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff8e8;
  font-weight: 800;
}

.currency button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #e7c27a;
  color: #5a3a24;
  font-weight: 800;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 10px 0 rgba(90,50,20,.12);
}

.daily {
  position: absolute;
  left: 18px;
  top: 86px;
  width: 250px;
  padding: 14px 14px 10px;
}

.daily h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.task {
  display: grid;
  grid-template-columns: 28px 1fr 26px;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  color: inherit;
  border-radius: 10px;
}

.task:hover { background: rgba(255,255,255,.45); }

.check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #c9ae86;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.check.on {
  background: #6db56a;
  border-color: #4e8d4c;
  color: white;
}

.daily-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.status {
  position: absolute;
  right: 16px;
  top: 78px;
  width: 270px;
  padding: 12px;
}

.status-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
}

.status-head h2 { margin: 0; font-size: 26px; }
.status-head p { margin: 0; font-size: 12px; color: var(--ink-soft); }

.portrait {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(#efe6d4, #d7c4a4);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.stat-row {
  display: grid;
  grid-template-columns: 28px 70px 1fr;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
}

.bar {
  height: 10px;
  background: #ead9be;
  border-radius: 99px;
  overflow: hidden;
}

.bar > span { display: block; height: 100%; border-radius: 99px; }
.bar.comfort > span { background: #f2a0b6; }
.bar.curiosity > span { background: #efc15a; }
.bar.energy > span { background: #7ec8e3; }
.bar.friendship > span { background: #8fce7a; }

.status-foot {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.inventory-panel {
  position: absolute;
  right: 16px;
  top: 360px;
  width: 270px;
  padding: 12px;
}

.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.slot {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid #e2c9a2;
  background: #fff8ea;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.memory-toast {
  position: absolute;
  right: 16px;
  bottom: 92px;
  width: 300px;
  padding: 10px;
  display: grid;
  grid-template-columns: 72px 1fr 22px;
  gap: 8px;
  align-items: center;
}

.memory-toast img, .memory-art {
  width: 72px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(#3d5a4a, #1e2e28);
}

.memory-toast h3 { margin: 0; font-size: 14px; }
.memory-toast p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }

.close-x {
  border: 0;
  background: transparent;
  font-size: 16px;
}

.nav {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: #5a3a24;
  padding: 8px 14px;
  border-radius: 20px 20px 12px 12px;
  z-index: 20;
}

.nav-btn {
  min-width: 86px;
  border: 0;
  background: #efe3c8;
  border-radius: 16px;
  padding: 8px 8px 6px;
  color: var(--ink);
  box-shadow: 0 3px 0 #c9ae86;
}

.nav-btn.active {
  background: #fff4d6;
  box-shadow: 0 0 0 3px #f0d48a, 0 3px 0 #c9ae86;
}

.nav-btn .ico { font-size: 20px; display: block; }
.nav-btn span.label { font-size: 12px; font-weight: 800; }

/* Miso */
.miso-wrap {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -40%);
  width: 280px;
  height: 260px;
  z-index: 6;
  background: none;
  border: 0;
  padding: 0;
}

.miso-wrap.react .miso { animation: hop .45s ease; }

@keyframes hop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

.speech {
  position: absolute;
  left: 54%;
  top: 36%;
  transform: translateX(-10%);
  background: #fff8ea;
  border-radius: 16px;
  padding: 10px 14px;
  max-width: 180px;
  box-shadow: 0 6px 0 rgba(90,50,20,.12);
  z-index: 7;
  font-size: 14px;
}

.speech:after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -10px;
  border: 8px solid transparent;
  border-top-color: #fff8ea;
}

.hotspot {
  background: transparent;
  border: 0;
  padding: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(30,18,12,.45);
  z-index: 40;
  display: grid;
  place-items: center;
}

.modal {
  width: min(520px, 90%);
  background: #fff6e8;
  border-radius: 20px;
  padding: 20px;
  border: 3px solid #e4c9a0;
}

.modal h2 { margin-top: 0; }

.coming {
  text-align: center;
}

.coming p { color: var(--ink-soft); }

.inv-full-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.dev-toggle {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 30;
  font-size: 11px;
  background: #3d2818;
  color: #f3e2b4;
  border: 0;
  border-radius: 8px;
  padding: 4px 8px;
}

.dev-panel {
  position: absolute;
  left: 8px;
  bottom: 36px;
  z-index: 30;
  width: 260px;
  max-height: 70%;
  overflow: auto;
  background: #2a1b12;
  color: #f3e2b4;
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
}

.dev-panel label { display: block; margin: 6px 0; }
.dev-panel input, .dev-panel select {
  width: 100%;
}

.actions-bar {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 15;
}

.actions-bar button {
  border: 0;
  background: #fff1d6;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 0 3px 0 #d7b888;
}

@media (prefers-reduced-motion: reduce) {
  .miso-wrap.react .miso-art { animation: none; }
}

@media (max-width: 1100px) {
  .daily { width: 210px; }
  .status, .inventory-panel, .memory-toast { width: 230px; }
  .brand h1 { font-size: 26px; }
}

@media (max-height: 700px) {
  .game-frame { height: 100vh; border-radius: 0; }
}

.cottage[data-period="morning"] .cottage-wall {
  filter: brightness(1.08) saturate(0.95);
}
.cottage[data-period="morning"] .window-scene {
  background: linear-gradient(#9ec7e8 0%, #f3e2b4 55%, #7aa0c8 55%, #4d7aa8 100%);
}
.cottage[data-period="afternoon"] .cottage-wall {
  filter: brightness(1.14);
}
.cottage[data-period="afternoon"] .window-scene {
  background: linear-gradient(#6eb4e6 0%, #fff1c2 50%, #5b8ec4 50%, #3d6ea8 100%);
}
.cottage[data-period="evening"] .cottage-wall {
  filter: brightness(0.96) saturate(1.1);
}
.cottage[data-period="evening"] .window-scene {
  background: linear-gradient(#c46b6a 0%, #f2b07a 45%, #4a6ea8 62%, #2b4c7a 100%);
}
.cottage[data-period="night"] .window-scene {
  background: linear-gradient(#6a4d8a 0%, #e07a6a 38%, #f2b07a 62%, #4a6ea8 62%, #2b4c7a 100%);
}

@media (max-width: 1180px) {
  .daily { width: 200px; }
  .status, .inventory-panel { width: 220px; }
  .nav-btn { min-width: 72px; padding: 10px 6px; }
  .actions-bar button { padding: 10px 12px; }
}

@media (max-width: 1024px) {
  .brand h1 { font-size: 22px; }
  .daily { top: 72px; }
}

.version-tag { font-size: 11px; color: #d7c29a; margin: 2px 0 0; }
.nav { bottom: max(10px, env(safe-area-inset-bottom)); }
.nav-btn { min-height: 52px; min-width: 72px; }
.actions-bar button, .touch-row button, .task {
  min-height: 44px;
}

.miso-wrap.pose-happy .miso { filter: saturate(1.1); }
.miso-wrap.pose-curious .miso { transform: rotate(-4deg); }
.miso-wrap.pose-sleepy .miso { opacity: .92; }
.miso-wrap.pose-excited .miso { animation: hop .45s ease; }

.village { position:absolute; inset:0; background:#6aa36a; }
.village-sky {
  position:absolute; inset:0 0 42% 0;
  background: linear-gradient(#7eb7e6, #f3d7a4 70%, #88c07a);
}
.cottage[data-period="morning"] .village-sky,
.village[data-period="morning"] .village-sky { background: linear-gradient(#9fd0f0, #f7e7c2); }
.cottage[data-period="afternoon"] .window-scene { filter: brightness(1.08); }
.cottage[data-period="evening"] .window-scene { filter: saturate(1.15); }
.village-water {
  position:absolute; left:0; right:0; bottom:18%; height:22%;
  background: linear-gradient(#4d86b8, #2f5e8a);
}
.village-island {
  position:absolute; right:6%; bottom:32%; width:18%; height:16%;
  background:#3f5a3a; border-radius: 40% 50% 0 0;
}
.village-lighthouse {
  position:absolute; right:12%; bottom:44%; width:14px; height:46px;
  background:#f3ead2; box-shadow: 0 -12px 18px #ffd98a;
}
.village-square {
  position:absolute; left:8%; right:8%; top:18%; bottom:18%;
  background: radial-gradient(circle at 50% 60%, #e8c27a 0 14%, #d7a85c 15% 40%, #7fb56a 41%);
  border-radius: 24px;
}
.v-fountain {
  position:absolute; left:50%; top:42%; width:90px; height:90px; transform:translate(-50%,-50%);
  background: radial-gradient(circle, #9ad7f0 0 30%, #5aa0c8 31%);
  border-radius:50%;
}
.v-clock { position:absolute; left:8%; top:8%; width:70px; height:90px; background:#d9c4a0; border-radius:8px; }
.v-flowers { position:absolute; right:12%; top:20%; width:80px; height:40px; background:#6fbf6a; border-radius:20px; }
.v-bench { position:absolute; left:18%; bottom:16%; width:90px; height:28px; background:#8a5634; border-radius:8px; }
.v-board { position:absolute; right:16%; bottom:20%; width:54px; height:64px; background:#efe0c4; }
.v-sign { position:absolute; left:8%; top:38%; width:48px; height:64px; background:#c98432; }
.nell {
  position:absolute; left:62%; top:48%; width:88px; height:110px;
  border:0; background:transparent; color:#4a3426;
}
.nell-face { font-size:48px; display:block; }
.nell-name { font-weight:800; }
.village-panel {
  position:absolute; left:16px; top:86px; width:min(320px, 34%);
  padding:14px;
}
.touch-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.touch-row button {
  border:0; background:#fff1d6; border-radius:14px; padding:8px 10px; font-weight:800;
}
.shop-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap:10px; }
.shop-card {
  border:2px solid #e2c9a2; background:#fff8ea; border-radius:14px; padding:10px;
  display:flex; flex-direction:column; gap:4px; min-height:96px;
}
.quiet { color: var(--ink-soft); font-size:13px; }

.orient-gate {
  position:fixed; inset:0; z-index:80; display:none; place-items:center;
  background:#2a1b12; color:#f3e2b4; text-align:center; padding:24px;
}
@media (orientation: portrait) {
  .orient-gate { display:grid; }
  .game-frame { visibility:hidden; }
}

.nell-face { opacity: 0; }

.layer-env {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  z-index: 0;
}
.cottage > .hotspot, .village > .hotspot { z-index: 5; background: transparent; }
.hs-window { left: 38%; top: 8%; width: 32%; height: 40%; }
.hs-shelf { left: 16%; top: 12%; width: 16%; height: 40%; }
.hs-bed { left: 66%; top: 56%; width: 13%; height: 12%; }
.hs-lantern { left: 3%; bottom: 22%; width: 54px; height: 70px; }
.hs-mug { left: 10%; bottom: 18%; width: 48px; height: 42px; }
.hs-rabbit { left: 58%; top: 72%; width: 70px; height: 46px; }
.miso-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.nell img { width: 88px; height: auto; display: block; margin: 0 auto; }
.portrait .miso-art { width: 64px; height: 64px; }
.cottage-wall, .beams, .window-scene, .bookshelf, .sofa, .rug, .village-sky, .village-water, .village-square {
  /* illustrated plate supplies these now */
}

/* =========================================================
   Little Haven v0.2.4 approved visual integration
   iPad landscape first. Runtime UI remains live and separate
   from the environment/character art layers.
   ========================================================= */

:root {
  --panel: rgba(255, 248, 232, 0.94);
  --panel-border: #d8b981;
  --wood-dark: #50301f;
  --nav: #50301f;
}

.stage {
  background:
    radial-gradient(circle at 50% 10%, rgba(88,120,137,.24), transparent 38%),
    linear-gradient(180deg, #17242b, #21150f 72%);
}

.cottage,
.village {
  background: #2d2018;
  isolation: isolate;
}

.layer-env {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.period-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  transition: background .35s ease, opacity .35s ease;
}

.cottage[data-period="morning"] .period-wash,
.village[data-period="morning"] .period-wash {
  background: linear-gradient(180deg, rgba(202,227,244,.08), rgba(255,224,156,.05));
}
.cottage[data-period="afternoon"] .period-wash,
.village[data-period="afternoon"] .period-wash {
  background: linear-gradient(180deg, rgba(255,242,205,.035), transparent 55%);
}
.cottage[data-period="evening"] .period-wash,
.village[data-period="evening"] .period-wash {
  background: linear-gradient(180deg, rgba(238,139,98,.14), rgba(92,74,128,.08));
}
.cottage[data-period="night"] .period-wash,
.village[data-period="night"] .period-wash {
  background: linear-gradient(180deg, rgba(39,61,104,.30), rgba(36,31,67,.18));
}

/* Old prototype CSS artwork is intentionally disabled. */
.cottage-wall, .beams, .window-scene, .string-lights, .bookshelf,
.sofa, .book-stack, .rug, .pet-bed, .plant-left, .plant-right,
.table-left, .lantern-obj, .mug, .rabbit, .sign-left, .sign-right,
.sign-top, .village-sky, .village-water, .village-island,
.village-square {
  display: none !important;
}

.hud {
  z-index: 12;
}

.brand {
  left: 18px;
  top: 14px;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(40,61,62,.92), rgba(30,46,49,.92));
  border: 1px solid rgba(244,219,162,.48);
  box-shadow: 0 6px 18px rgba(25,15,10,.26);
}
.brand-mark {
  width: 42px;
  height: 42px;
  background: transparent;
  box-shadow: none;
  font-size: 28px;
}
.brand h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.5vw, 34px);
  color: #fff1c8;
  letter-spacing: .2px;
}
.brand p { color: #e7d6af; }
.version-tag { opacity: .72; }

.currencies {
  top: 14px;
  padding: 7px 12px;
  gap: 14px;
  border: 1px solid rgba(238,203,137,.45);
  background: linear-gradient(180deg, rgba(84,52,33,.96), rgba(62,39,26,.96));
  box-shadow: 0 6px 16px rgba(35,20,12,.25);
}
.currency button {
  background: #77adc0;
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.panel {
  background:
    radial-gradient(circle at 10px 10px, rgba(100,143,77,.20) 0 5px, transparent 6px),
    radial-gradient(circle at calc(100% - 10px) 10px, rgba(100,143,77,.16) 0 5px, transparent 6px),
    linear-gradient(180deg, rgba(255,250,238,.965), rgba(249,236,211,.95));
  border: 2px solid rgba(191,151,93,.82);
  box-shadow:
    0 10px 24px rgba(53,31,19,.18),
    inset 0 0 0 2px rgba(255,255,255,.42);
  border-radius: 20px;
}
.panel h2, .panel h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.daily {
  left: 16px;
  top: 90px;
  width: clamp(198px, 20vw, 236px);
  padding: 14px 13px 11px;
}
.daily h2 { font-size: clamp(19px, 2vw, 23px); }
.task {
  min-height: 42px;
  padding: 6px 4px;
}
.task:hover { background: rgba(255,255,255,.28); }

.status {
  right: 16px;
  top: 80px;
  width: clamp(220px, 22vw, 260px);
  padding: 12px;
}
.status-head h2 { font-size: clamp(22px, 2.3vw, 28px); }
.portrait {
  background: linear-gradient(#e9f0ee, #d8e3df);
  border: 1px solid #d5ba87;
}

.inventory-panel {
  right: 16px;
  top: 354px;
  width: clamp(220px, 22vw, 260px);
}
.slot {
  background: linear-gradient(#fffaf0,#f4e4c7);
  border-color: #d8bc8b;
}

.memory-toast {
  right: 16px;
  bottom: 98px;
  width: clamp(250px, 27vw, 310px);
}

.miso-wrap {
  left: 50%;
  top: 67%;
  width: clamp(235px, 25vw, 320px);
  height: clamp(270px, 31vw, 385px);
  transform: translate(-50%, -50%);
  z-index: 6;
  filter: drop-shadow(0 12px 14px rgba(47,31,21,.26));
}
.miso-wrap.react .miso-art { animation: hop .45s ease; }
.miso-wrap.pose-happy .miso-art { filter: saturate(1.06) brightness(1.03); }
.miso-wrap.pose-curious .miso-art { transform: rotate(-2deg); }
.miso-wrap.pose-sleepy .miso-art { opacity: .96; }
.miso-wrap.pose-excited .miso-art { animation: hop .45s ease; }
.miso-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.portrait .miso-art {
  width: 68px;
  height: 68px;
  object-position: center 22%;
}

.speech {
  left: 52%;
  top: 40%;
  max-width: 210px;
  padding: 11px 15px;
  font-family: Georgia, "Times New Roman", serif;
  background: rgba(255,249,235,.97);
  border: 1px solid rgba(203,168,111,.75);
  box-shadow: 0 7px 18px rgba(65,39,22,.16);
}

.actions-bar {
  bottom: 90px;
  gap: 7px;
}
.actions-bar button,
.touch-row button {
  background: linear-gradient(#fff7e6,#ead4ad);
  border: 1px solid #caa76d;
  color: #4c3526;
  box-shadow: 0 3px 8px rgba(66,39,20,.16);
}

.nav {
  bottom: max(8px, env(safe-area-inset-bottom));
  gap: clamp(4px, .65vw, 9px);
  padding: 7px 10px;
  width: min(calc(100% - 30px), 780px);
  justify-content: center;
  border-radius: 22px;
  border: 1px solid rgba(230,197,137,.42);
  background: linear-gradient(180deg, rgba(73,47,31,.97), rgba(50,33,23,.98));
  box-shadow: 0 9px 22px rgba(37,22,15,.30);
}
.nav-btn {
  min-width: 0;
  width: 98px;
  min-height: 56px;
  padding: 7px 5px 6px;
  border: 1px solid #c9a66f;
  border-radius: 15px;
  background: linear-gradient(#fbf0d9,#e6cfaa);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.nav-btn.active {
  background: linear-gradient(#fff6dd,#ead69f);
  box-shadow: 0 0 0 3px rgba(110,193,224,.75), 0 0 18px rgba(103,188,224,.42);
}
.nav-btn .ico { font-size: clamp(18px,2vw,23px); }
.nav-btn span.label { font-size: clamp(10px,1.1vw,12px); }

/* Home interaction regions aligned with the approved environment. */
.hs-window { left: 33%; top: 8%; width: 34%; height: 38%; }
.hs-shelf { left: 10%; top: 10%; width: 19%; height: 38%; }
.hs-bed { left: 70%; top: 26%; width: 23%; height: 36%; }
.hs-lantern { left: 6%; top: 17%; width: 9%; height: 21%; }
.hs-mug { left: 4%; bottom: 13%; width: 13%; height: 16%; }
.hs-rabbit { left: 74%; bottom: 6%; width: 18%; height: 14%; }

/* Village art is now a single clean environment plate. Hotspots are invisible. */
.village-lighthouse,
.v-clock,
.v-fountain,
.v-flowers,
.v-bench,
.v-board,
.v-sign {
  position: absolute;
  display: block !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.village-lighthouse { right: 7%; top: 4%; width: 18%; height: 25%; }
.v-clock { left: 34%; top: 11%; width: 16%; height: 32%; }
.v-fountain { left: 40%; top: 49%; width: 28%; height: 28%; transform: none; }
.v-flowers { right: 0; bottom: 9%; width: 24%; height: 25%; }
.v-bench { right: 1%; bottom: 12%; width: 22%; height: 26%; }
.v-board { right: 0; top: 24%; width: 19%; height: 35%; }
.v-sign { left: 2%; top: 22%; width: 29%; height: 36%; }

.nell {
  left: 14%;
  top: auto;
  bottom: 104px;
  width: clamp(126px, 15vw, 190px);
  height: clamp(210px, 25vw, 320px);
  z-index: 7;
  background: none !important;
  filter: drop-shadow(0 12px 14px rgba(41,28,21,.25));
}
.nell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}
.nell-name {
  display: inline-block;
  margin-top: -4px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #4a3426;
  background: rgba(255,247,227,.94);
  border: 1px solid #c9a66f;
}

.village-speech {
  left: 28%;
  top: auto;
  bottom: 300px;
  max-width: 260px;
  z-index: 8;
}

.village-panel {
  left: 50%;
  top: auto;
  bottom: 88px;
  transform: translateX(-50%);
  width: min(610px, 58%);
  padding: 12px 15px;
  z-index: 13;
}
.village-panel h2 { margin: 0 0 2px; }
.village-panel .quiet { margin: 0 0 5px; }
.village-panel .touch-row { margin-top: 6px; justify-content: center; }

/* Keep the active game readable at the smaller 1024x768 iPad class. */
@media (max-width: 1080px) {
  .brand { left: 12px; top: 10px; padding: 6px 10px 6px 7px; }
  .brand p:not(.version-tag) { display: none; }
  .daily { left: 12px; top: 73px; width: 194px; padding: 11px 10px 8px; }
  .status { right: 12px; top: 72px; width: 214px; padding: 10px; }
  .inventory-panel { right: 12px; top: 337px; width: 214px; padding: 10px; }
  .stat-row { grid-template-columns: 25px 58px 1fr; gap: 4px; }
  .miso-wrap { width: 235px; height: 292px; top: 67%; }
  .speech { top: 40%; max-width: 175px; font-size: 12px; }
  .actions-bar { bottom: 79px; }
  .actions-bar button { padding: 7px 9px; font-size: 12px; min-height: 38px; }
  .nav { width: calc(100% - 20px); padding: 6px 7px; }
  .nav-btn { min-height: 50px; padding: 5px 3px; }
  .village-panel { width: 62%; bottom: 78px; }
  .nell { bottom: 92px; width: 132px; height: 228px; }
}

.forest { position: relative; min-height: 100%; }
.forest-panel, .forest-desc, .forest-energy, .forest-paths, .forest-finds {
  position: relative; z-index: 4;
}
.forest-panel {
  margin: 18% auto 0;
  width: min(420px, 70%);
  background: rgba(255,248,236,.94);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(40,20,10,.2);
}
.forest-hud { display:flex; justify-content:space-between; padding: 10px 16px; position:relative; z-index:5; }
.forest-desc, .forest-energy { color:#f4efe4; text-shadow:0 1px 2px #0008; margin: 4px 18px; }

.path-btn, .find-btn, .rest-btn, .forest-panel .primary {
  min-height: 44px; min-width: 120px; margin: 6px; border-radius: 14px;
  border: 0; background: #fff6e8; color:#3b2a1c; font-weight:600; padding: 8px 14px;
}
.forest-paths, .forest-finds { display:flex; flex-wrap:wrap; padding: 8px 12px; }
.muted { color:#efe6d4; }

.path-btn.locked { opacity: 0.55; background: #e8dcc8; }

.forest.explore {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a261c;
}
.forest-canvas {
  position: relative;
  aspect-ratio: 4 / 3;
  width: min(100%, calc((100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 88px) * 4 / 3));
  height: auto;
  max-height: calc(100% - 12px);
  overflow: hidden;
}
.forest.explore .layer-env {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.forest-canvas .env-hotspot,
.forest-canvas .fx,
.forest-canvas .forest-miso { position: absolute; }

.env-hotspot {
  position: absolute;
  z-index: 6;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  border-radius: 18px;
}
.env-hotspot.shimmer { box-shadow: inset 0 0 18px rgba(244, 226, 140, 0.28); }
.env-hotspot.locked { opacity: 0.35; }
.forest[data-reduced="true"] .env-hotspot.shimmer { box-shadow: none; }
.forest-minihud {
  position: absolute; top: 10px; left: 14px; z-index: 7;
  background: rgba(255,248,236,.86); border-radius: 12px; padding: 6px 12px;
}
.forest-place { margin: 0; font-weight: 700; color: #3b2a1c; }

.forest-canvas .forest-miso,
.forest-miso {
  top: auto !important;
  left: 50%;
  bottom: 14%;
  width: clamp(110px, 13vw, 160px);
  height: clamp(145px, 17vw, 215px);
  transform: translateX(-50%);
  z-index: 6;
}
.forest-miso .miso-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
}


.fx { position:absolute; inset:0; pointer-events:none; z-index:3; overflow:hidden; }
.fx-mist { position:absolute; inset:10% 0 20%; background:linear-gradient(90deg,transparent,rgba(180,210,220,.18),transparent); animation: mist 8s ease-in-out infinite; }
.fx-motes, .fx-dust { position:absolute; inset:0; pointer-events:none; }
.fx-motes::before, .fx-dust::before {
  content:"";
  position:absolute;
  width:6px; height:6px; border-radius:50%;
  left: 22%; top: 34%;
  background: rgba(255,250,220,.35);
  box-shadow: 180px 80px 8px 1px rgba(255,250,220,.28), 420px 160px 6px 1px rgba(255,250,220,.22);
  animation: motes 7s ease-in-out infinite;
}
.fx-glow { position:absolute; left:8%; top:48%; width:24%; height:28%; border-radius:50%; background:radial-gradient(circle,rgba(190,220,255,.28),transparent 70%); animation: breathe 4s ease-in-out infinite; }
.fx-mark-glow { position:absolute; left:62%; top:34%; width:24%; height:30%; border-radius:40%; background:radial-gradient(circle,rgba(244,226,140,.32),transparent 70%); animation: breathe 3s ease-in-out infinite; }
.fx-leaves { position:absolute; inset:0; background-image:radial-gradient(circle at 20% 10%, rgba(80,120,70,.15) 0 2px, transparent 3px); animation: leaves 9s linear infinite; }
@keyframes mist { 50% { transform: translateX(8%); } }
@keyframes motes { 50% { opacity: .6; } }
@keyframes breathe { 50% { opacity: .45; transform: scale(1.06); } }
@keyframes leaves { 50% { transform: translateY(6px); } }
.forest[data-reduced="true"] .fx span { animation: none; }
.env-hotspot.obstructed { background: rgba(10,20,16,.28); }
.forest[data-path-open="true"] [data-travel="lockedPath"].obstructed { background: transparent; opacity: 1; }


/* LITTLE HAVEN v0.3.8 PRE-DEVICE GATE */
.forest-canvas .forest-miso,
.forest-canvas .forest-miso .miso-art,
.forest .speech { pointer-events: none; }

.forest-canvas .forest-miso .miso-pet-control {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  appearance: none;
  pointer-events: auto;
  touch-action: manipulation;
}
.forest-canvas .forest-miso .miso-pet-control:focus-visible {
  outline: 3px solid rgba(255,255,255,.9);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .fx-mist, .fx-motes::before, .fx-dust::before, .fx-glow, .fx-mark-glow, .fx-leaves,
  .miso-art, .miso-wrap.react .miso-art {
    animation: none !important;
    transition: none !important;
  }
}


/* LITTLE HAVEN v0.3.9 MISO VISUAL STABILIZATION
   Use original pose art at a common rendered height. The sleepy pose is
   naturally wider, so it is allowed to overflow horizontally rather than
   being shrunk to fit a portrait box. */
.miso-wrap {
  overflow: visible;
}
.miso-wrap > .miso-art {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}
.miso-wrap.pose-curious > .miso-art {
  transform: translateX(-50%) rotate(-2deg);
}
.forest-canvas .forest-miso {
  width: clamp(120px, 14vw, 180px);
  height: clamp(160px, 19vw, 230px);
  z-index: 7;
  overflow: visible;
}
.forest-canvas .forest-miso > .miso-art {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  opacity: 1;
  visibility: visible;
}
.forest-canvas .forest-miso.pose-curious > .miso-art {
  transform: translateX(-50%) rotate(-2deg);
}
.forest-canvas .forest-miso .miso-pet-control {
  top: 8%;
  right: 8%;
  z-index: 2;
}


/* LITTLE HAVEN v0.4.0 CHARACTER LAYER SEPARATION
   Home and Forest no longer share the same Miso wrapper geometry. */

/* Home Miso: position from the action bar upward and let the artwork keep
   its natural aspect ratio. This removes pose-specific clipping edges. */
.cottage > .miso-wrap {
  left: 50% !important;
  top: auto !important;
  bottom: 132px !important;
  width: min(46vw, 390px) !important;
  height: min(46vh, 360px) !important;
  transform: translateX(-50%) !important;
  overflow: visible !important;
}
.cottage > .miso-wrap > .miso-art {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  width: auto !important;
  height: 100% !important;
  max-width: min(58vw, 440px) !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  transform: translateX(-50%) !important;
}
.cottage > .miso-wrap.pose-curious > .miso-art {
  transform: translateX(-50%) rotate(-2deg) !important;
}

/* Forest Miso is now a completely independent sprite layer. */
.forest-canvas > .forest-miso-art {
  position: absolute;
  left: 50%;
  bottom: 13%;
  height: clamp(150px, 18vw, 220px);
  width: auto;
  max-width: 30%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  z-index: 7;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  filter: drop-shadow(0 8px 10px rgba(35,28,21,.20));
}
.forest-canvas > .forest-miso-art.pose-curious {
  transform: translateX(-50%) rotate(-2deg);
}
.forest-canvas > .forest-miso-pet-control {
  position: absolute;
  left: calc(50% + 34px);
  bottom: calc(13% + 112px);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  appearance: none;
  z-index: 8;
  pointer-events: auto;
  touch-action: manipulation;
}
.forest-canvas > .forest-miso-pet-control:focus-visible {
  outline: 3px solid rgba(255,255,255,.95);
  outline-offset: 2px;
}
@media (max-height: 700px) and (orientation: landscape) {
  .cottage > .miso-wrap {
    bottom: 112px !important;
    height: min(42vh, 300px) !important;
  }
  .forest-canvas > .forest-miso-art {
    height: clamp(125px, 17vw, 185px);
  }
  .forest-canvas > .forest-miso-pet-control {
    bottom: calc(13% + 90px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .forest-canvas > .forest-miso-art { animation: none !important; transition: none !important; }
}


/* Dev-only reset control inserted by navBar when running Vite in DEV mode. */
.test-reset {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 60;
  border: 2px solid #8a4f32;
  border-radius: 10px;
  padding: 7px 11px;
  background: #fff2df;
  color: #4d2b1c;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(35, 20, 11, 0.22);
  touch-action: manipulation;
}

.test-reset:focus-visible {
  outline: 3px solid #244f73;
  outline-offset: 2px;
}

/* Cloudflare tester maintenance gate. */
.testing-closed {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(244, 217, 154, 0.18), transparent 36%),
    linear-gradient(180deg, #263a3a 0%, #172929 100%);
  font-family: 'Nunito', system-ui, sans-serif;
}

.testing-closed-card {
  width: min(560px, 92vw);
  padding: 34px 30px;
  text-align: center;
  color: #fff6df;
  border: 1px solid rgba(255, 244, 214, 0.28);
  border-radius: 24px;
  background: rgba(23, 52, 49, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.testing-closed-mark {
  font-size: 54px;
  margin-bottom: 8px;
}

.testing-closed-card h1 {
  margin: 0 0 12px;
  font-family: 'Quicksand', 'Nunito', system-ui, sans-serif;
  font-size: clamp(24px, 4vw, 36px);
}

.testing-closed-card p {
  margin: 0;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.5;
  opacity: 0.9;
}

