:root {
  --ink: #344b42;
  --muted: #8a9387;
  --paper: #fffdf5;
  --green: #647c56;
  --line: #e4e7da;
  --shadow: 0 12px 45px #344a3620;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: #d2dfc1;
  font-size: 14px;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #c59552;
  outline-offset: 4px;
}
button:hover {
  filter: brightness(0.96);
}
[hidden] {
  display: none !important;
}
#app {
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  position: relative;
}
#game {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
  cursor: grab;
}
#game:active {
  cursor: grabbing;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 130px #493e2317;
  background: linear-gradient(
    #f9f5e322,
    transparent 30%,
    transparent 65%,
    #f5f4e626
  );
}
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: #fffdf3ed;
  border-bottom: 1px solid #fff8;
  gap: 38px;
  box-shadow: 0 2px 15px #48503609;
}
.brand {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  font-size: 42px;
  color: #73885d;
  line-height: 1;
}
.brand b {
  font-size: 20px;
  letter-spacing: -1px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 3px;
  margin-top: 4px;
  color: #929a82;
}
.village-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--line);
  padding-left: 30px;
}
.sun {
  color: #d6aa60;
  font-size: 28px;
}
.village-status b {
  font-size: 12px;
  font-weight: 600;
}
.village-status small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
}
.top-actions > span {
  font-size: 10px;
  color: #89947e;
  margin-right: 12px;
}
.top-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid #dfe4d5;
  border-radius: 50%;
  font-size: 17px;
}
.top-actions button[aria-pressed="true"] {
  background: #647c56;
  color: white;
}
.side-nav {
  position: absolute;
  top: 116px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.side-nav button {
  width: 68px;
  height: 67px;
  background: #fffdf2ee;
  border: 1px solid #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-size: 10px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.side-nav button span {
  font-size: 25px;
  font-weight: 300;
  color: #788761;
}
.scene-title {
  position: absolute;
  top: 118px;
  left: 121px;
  pointer-events: none;
  text-shadow: 0 1px 15px #fffbeb;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: #7e8a6a;
}
.scene-title h1 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -1.5px;
  margin: 11px 0 7px;
}
.scene-title p {
  font-size: 12px;
  margin: 0;
  color: #657552;
}
.camera-control {
  position: absolute;
  left: 50%;
  top: 94px;
  transform: translateX(-50%);
  display: flex;
  padding: 4px;
  border-radius: 12px;
  background: #fffdf1ed;
  box-shadow: var(--shadow);
  align-items: center;
  gap: 4px;
}
.camera-control button {
  font-size: 11px;
  border-radius: 9px;
  padding: 10px 14px;
  white-space: nowrap;
}
.camera-control button span {
  color: #8e9784;
  margin-left: 5px;
  font-size: 10px;
}
.camera-control button.active {
  color: white;
  background: #637d56;
}
.camera-control button.active span {
  color: #dde5d5;
}
kbd {
  font-size: 9px;
  border: 1px solid #c9cfbf;
  border-radius: 4px;
  padding: 3px 5px;
  font-family: inherit;
  background: #fff9;
}
.camera-control kbd {
  margin: 0 7px 0 3px;
  color: #929b87;
}
.journey {
  position: absolute;
  right: 26px;
  top: 111px;
  width: 273px;
  border: 1px solid #fff;
  border-radius: 18px;
  background: #fffdf3ed;
  box-shadow: var(--shadow);
  padding: 19px;
}
.card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tiny-flower {
  font-size: 28px;
  color: #af9865;
}
.card-heading small {
  font-size: 10px;
  color: #95957d;
}
.card-heading h2 {
  font-size: 13px;
  margin: 5px 0 0;
  font-weight: 600;
}
.card-heading button {
  margin-left: auto;
  font-size: 19px;
  color: #8e9984;
}
.journey p {
  font-size: 11px;
  color: #969d8b;
  margin: 15px 0;
}
.quest {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 0;
  border-top: 1px solid #e6e8dc;
  font-size: 12px;
}
.quest i {
  border: 1px solid #c5cfba;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  display: grid;
  place-items: center;
  font-style: normal;
  flex-shrink: 0;
}
.quest.done i {
  background: #81956a;
  color: white;
  border-color: #81956a;
}
.quest.done {
  color: #8c9980;
}
.quest small {
  display: block;
  font-size: 9px;
  color: #a0a492;
  margin-top: 4px;
}
.quest > span:last-child {
  margin-left: auto;
  color: #a4ac99;
}
.journey-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 9px;
  color: #939b86;
}
.bottom-left {
  position: absolute;
  bottom: 25px;
  left: 28px;
}
.location {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fffdf2e8;
  padding: 8px 13px;
  border-radius: 20px;
  font-size: 11px;
  box-shadow: var(--shadow);
}
.location i {
  width: 6px;
  height: 6px;
  background: #7b8f60;
  border-radius: 50%;
}
.bottom-left p {
  font-size: 10px;
  color: #485a3e;
  text-shadow: 0 1px 3px white;
  margin: 13px 0 0;
}
.bottom-left p span {
  padding: 0 6px;
}
.resident-dock {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: #fffdf3eb;
  border: 1px solid white;
  box-shadow: var(--shadow);
}
.dock-title {
  position: absolute;
  top: -24px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #536b43;
  font-size: 10px;
  text-shadow: 0 1px 5px white;
}
.resident-dock button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  min-width: 117px;
  border-right: 1px solid #e4e7da;
  text-align: left;
}
.resident-dock button:last-child {
  border: 0;
}
.portrait {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border-radius: 14px;
  font-style: normal;
  background: #e2e9d4;
  color: #57704d;
  font-weight: 600;
}
.portrait.mira {
  background: #eadac4;
  color: #8a6c49;
}
.portrait.hyunwoo {
  background: #d7e2e8;
  color: #637f8b;
}
.portrait.yuna {
  background: #e7dce3;
  color: #987a8e;
}
.resident-dock b {
  font-size: 12px;
}
.resident-dock small {
  display: block;
  font-size: 9px;
  color: #929a87;
  margin-top: 5px;
}
.resident-dock em {
  font-style: normal;
  color: #a2ad93;
  font-size: 10px;
}
.minimap-wrap {
  position: absolute;
  bottom: 24px;
  right: 26px;
  padding: 5px;
  background: #fffdf3ed;
  border: 1px solid white;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
#minimap {
  display: block;
  border-radius: 11px;
  width: 171px;
  height: 124px;
}
.minimap-wrap span {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  padding: 7px 7px 3px;
  color: #7b886d;
}
#labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.world-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  border-radius: 8px;
  background: #fffdf3ed;
  box-shadow: 0 4px 14px #2f3c3020;
  font-size: 10px;
  white-space: nowrap;
  color: #5b6e4f;
}
.world-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #89a274;
}
.world-label small {
  font-size: 8px;
  color: #929a87;
}
#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 35px;
  color: white;
  transform: translate(-50%, -50%);
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
#interact {
  position: absolute;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 17px 9px 9px;
  background: #3f5549ed;
  color: #fff;
  border: 1px solid #ffffff66;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
#interact kbd {
  color: #44553e;
}
#proactive {
  position: absolute;
  bottom: 150px;
  left: 120px;
  max-width: 345px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fffdf5f5;
  padding: 16px;
  border: 1px solid white;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.letter-symbol {
  font-size: 24px;
  color: #a18b61;
}
#proactive b {
  font-size: 11px;
}
#proactive p {
  font-size: 11px;
  line-height: 1.6;
  margin: 5px 0 0;
  color: #89907e;
}
#proactiveOpen {
  font-size: 11px;
  background: #e8eddd;
  border-radius: 8px;
  padding: 8px;
  white-space: nowrap;
}
#proactiveDismiss {
  position: absolute;
  right: 4px;
  top: 2px;
  font-size: 18px;
  color: #9ba28f;
}
.panel {
  background: #fffdf7f7;
  box-shadow: 0 25px 100px #243c4140;
  border: 1px solid #fff;
  border-radius: 24px;
  backdrop-filter: blur(16px);
  z-index: 30;
}
.close {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #edf0e4;
  font-size: 22px;
  color: #7e8974;
}
.dialogue {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: min(660px, calc(100% - 40px));
  padding: 24px;
}
.dialogue header {
  display: flex;
  gap: 12px;
  align-items: center;
}
.dialogue header .portrait {
  width: 49px;
  height: 54px;
}
.dialogue header small {
  color: #959b89;
  font-size: 10px;
}
.dialogue h2 {
  margin: 5px 0;
  font-size: 19px;
}
.no-pressure {
  font-size: 10px;
  color: #a0a38f;
  margin-left: auto;
  margin-right: 35px;
}
#chatLog {
  max-height: 31vh;
  min-height: 120px;
  overflow-y: auto;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.message {
  padding: 13px 16px;
  border-radius: 14px;
  max-width: 90%;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
}
.message.npc {
  background: #edf0e5;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.message.player {
  background: #6a805d;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.message.error {
  background: #f4e7dc;
}
#quickReplies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 13px;
}
#quickReplies button {
  border: 1px solid #d7dec9;
  border-radius: 15px;
  font-size: 11px;
  padding: 8px 12px;
  background: #fcfdf8;
}
#chatForm {
  display: flex;
  padding: 5px 6px 5px 12px;
  border: 1px solid #dce2d2;
  border-radius: 13px;
  background: #fff;
}
#chatInput {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12px;
}
#chatForm button {
  background: #667d58;
  color: #fff;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 21px;
}
.dialogue-note {
  display: block;
  font-size: 9px;
  color: #9ca28e;
  text-align: center;
  margin-top: 11px;
}
#dialogueAction {
  font-size: 11px;
  border-left: 3px solid #aaae72;
  background: #f4f1df;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 33px;
  width: min(510px, calc(100% - 30px));
  max-height: 85%;
  overflow-y: auto;
}
.modal h2 {
  font-weight: 500;
  font-size: 25px;
  letter-spacing: -0.8px;
  margin: 14px 0 20px;
}
.modal p {
  color: #838c78;
  font-size: 12px;
  line-height: 1.9;
}
.modal button.option {
  width: 100%;
  text-align: left;
  border: 1px solid #dfe5d5;
  padding: 14px 16px;
  border-radius: 12px;
  margin-top: 9px;
  background: #ffffff80;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal button.option small {
  font-size: 10px;
  color: #8e9784;
  display: block;
  margin-top: 4px;
}
.primary {
  width: 100%;
  border-radius: 12px;
  background: #647d55;
  color: #fff;
  padding: 15px 20px;
  margin-top: 15px;
  font-size: 13px;
}
.primary span {
  float: right;
}
.secondary {
  border: 1px solid #d9e0d0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 9px;
  width: 100%;
  font-size: 12px;
}
.moods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.moods button {
  padding: 15px 8px;
  border-radius: 12px;
  border: 1px solid #dfe5d5;
  font-size: 12px;
}
.moods button.selected {
  background: #e1e8d5;
  border-color: #819268;
}
.modal textarea {
  resize: vertical;
  min-height: 110px;
  width: 100%;
  padding: 15px;
  border: 1px solid #d8dfcd;
  border-radius: 12px;
  background: white;
  line-height: 1.8;
  font-size: 12px;
  outline-color: #8d9c76;
}
.entry {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.entry small {
  color: #9aa18b;
  font-size: 10px;
}
.entry p {
  white-space: pre-wrap;
  color: #627455;
}
.welcome-shade {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #243d3525;
  z-index: 50;
}
.welcome {
  width: 410px;
  max-width: calc(100% - 30px);
  padding: 36px;
  text-align: center;
}
.welcome-mark {
  display: block;
  color: #879369;
  font-size: 44px;
  margin-bottom: 13px;
}
.welcome h2 {
  font-weight: 500;
  font-size: 37px;
  line-height: 1.45;
  letter-spacing: -2px;
  margin: 20px 0 14px;
}
.welcome p {
  font-size: 13px;
  line-height: 1.9;
  color: #8d9581;
}
.welcome-rule {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 9px;
  color: #9ca58b;
  margin: 25px 0;
}
.welcome-rule b {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 8px;
  color: #758268;
}
.welcome > small:last-child {
  display: block;
  font-size: 10px;
  color: #a0a68f;
  margin-top: 18px;
}
#loading {
  position: absolute;
  inset: 0;
  background: #f5f3e8;
  display: grid;
  place-items: center;
  z-index: 80;
  color: #8b9676;
  font-size: 14px;
}
#toast {
  position: absolute;
  top: 95px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  background: #3d5549f5;
  color: #fff;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  border-radius: 12px;
  font-size: 12px;
  z-index: 90;
}
#touchControls {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
body.overlay-open .resident-dock,
body.overlay-open #interact {
  visibility: hidden;
}
body.first-person .scene-title {
  display: none;
}
.breath-circle {
  height: 120px;
  width: 120px;
  border-radius: 50%;
  margin: 25px auto;
  background: radial-gradient(circle, #d5dfb8, #edf0dc);
  display: grid;
  place-items: center;
  color: #778662;
  font-size: 12px;
  animation: breathe 8s infinite ease-in-out;
}
@keyframes breathe {
  50% {
    transform: scale(1.2);
  }
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.setting-row input {
  accent-color: #6b805b;
}
.map-large {
  width: 100%;
  border-radius: 14px;
  background: #dce5cc;
}
.world-note {
  font-size: 11px;
  line-height: 1.9;
  color: #7c8c6c;
  padding: 12px;
  background: #eef2e4;
  border-radius: 12px;
}
@media (max-width: 1100px) {
  .scene-title {
    top: 160px;
  }
  .scene-title h1 {
    font-size: 23px;
  }
  .journey {
    width: 235px;
    right: 18px;
  }
  .resident-dock {
    bottom: 23px;
  }
  .bottom-left p {
    max-width: 210px;
    line-height: 2;
  }
  .minimap-wrap {
    right: 18px;
  }
  #minimap {
    width: 135px;
    height: 100px;
  }
  #proactive {
    left: 105px;
    bottom: 160px;
  }
}
@media (max-width: 760px) {
  #app {
    min-height: 480px;
  }
  .topbar {
    height: 65px;
    padding: 0 16px;
    gap: 10px;
  }
  .brand b {
    font-size: 16px;
  }
  .brand small {
    font-size: 7px;
  }
  .brand-icon {
    font-size: 30px;
  }
  .village-status {
    border: 0;
    padding-left: 5px;
    margin-left: auto;
  }
  .village-status small {
    display: none;
  }
  .village-status b {
    font-size: 10px;
  }
  .sun {
    font-size: 22px;
  }
  .top-actions {
    margin-left: 0;
  }
  .top-actions > span {
    display: none;
  }
  .top-actions button {
    width: 29px;
    height: 29px;
  }
  .side-nav {
    left: 12px;
    top: 140px;
    gap: 7px;
  }
  .side-nav button {
    height: 50px;
    width: 51px;
    font-size: 8px;
    border-radius: 12px;
  }
  .side-nav button span {
    font-size: 20px;
  }
  .scene-title {
    left: 16px;
    top: 78px;
  }
  .scene-title .eyebrow {
    display: none;
  }
  .scene-title h1 {
    font-size: 18px;
    margin: 0 0 5px;
  }
  .scene-title p {
    font-size: 9px;
  }
  .camera-control {
    top: 78px;
    left: auto;
    right: 12px;
    transform: none;
  }
  .camera-control button {
    padding: 9px 10px;
    font-size: 10px;
  }
  .camera-control button span,
  .camera-control kbd {
    display: none;
  }
  .journey {
    right: 12px;
    top: 140px;
    width: 190px;
    padding: 12px;
    border-radius: 14px;
  }
  .card-heading {
    gap: 6px;
  }
  .card-heading h2 {
    font-size: 10px;
  }
  .card-heading small {
    font-size: 9px;
  }
  .tiny-flower {
    font-size: 22px;
  }
  .quest {
    font-size: 10px;
    padding: 9px 0;
  }
  .quest small {
    font-size: 8px;
  }
  .journey p {
    font-size: 10px;
    margin: 10px 0;
  }
  .journey-bottom {
    font-size: 8px;
    gap: 5px;
  }
  .resident-dock {
    bottom: 16px;
    left: auto;
    right: 12px;
    transform: none;
    gap: 0;
    padding: 4px;
    border-radius: 13px;
  }
  .resident-dock button {
    min-width: 0;
    padding: 6px;
    gap: 6px;
  }
  .resident-dock .portrait {
    width: 28px;
    height: 33px;
    font-size: 11px;
    border-radius: 10px;
  }
  .resident-dock b {
    font-size: 10px;
  }
  .resident-dock small {
    font-size: 8px;
  }
  .resident-dock em {
    display: none;
  }
  .dock-title {
    font-size: 9px;
  }
  .minimap-wrap {
    display: none;
  }
  .bottom-left {
    left: 16px;
    bottom: 140px;
  }
  .bottom-left p {
    display: none;
  }
  .location {
    font-size: 9px;
    padding: 6px 10px;
  }
  #touchControls {
    display: block;
    position: absolute;
    left: 15px;
    bottom: 15px;
    text-align: center;
  }
  #touchControls button {
    width: 32px;
    height: 32px;
    background: #fffdf2e6;
    border: 1px solid #fff;
    border-radius: 8px;
    margin: 2px;
    touch-action: none;
  }
  #proactive {
    left: 75px;
    bottom: 190px;
    max-width: calc(100% - 90px);
    padding: 13px;
  }
  #interact {
    bottom: 110px;
    font-size: 11px;
    white-space: nowrap;
  }
  .dialogue {
    bottom: 10px;
    padding: 18px;
    width: calc(100% - 20px);
  }
  .no-pressure {
    display: none;
  }
  #chatLog {
    max-height: 35dvh;
  }
  .message {
    font-size: 12px;
  }
  .dialogue-note {
    font-size: 8px;
  }
  #toast {
    top: 115px;
    width: max-content;
    font-size: 11px;
  }
  .modal {
    padding: 25px;
  }
  .welcome {
    padding: 26px;
  }
  .welcome h2 {
    font-size: 31px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
/* The village takes priority while walking at eye level. */
body.first-person .side-nav,
body.first-person .resident-dock {
  opacity: 0.3;
  transition: opacity 0.25s;
}
body.first-person .side-nav:hover,
body.first-person .side-nav:focus-within,
body.first-person .resident-dock:hover,
body.first-person .resident-dock:focus-within {
  opacity: 1;
}
body.first-person .minimap-wrap {
  opacity: 0.7;
}

/* Leave room to see the listener's face while reading. */
body.conversation .journey,
body.conversation .side-nav,
body.conversation #touchControls,
body.conversation .scene-title {
  opacity: 0;
  pointer-events: none;
}
body.conversation #chatLog {
  min-height: 88px;
  max-height: 22dvh;
}

/* Business-plan artwork: one illustrated town, with the source cast. */
#planView {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  cursor: pointer;
}
body.world-view .scene-title {
  display: none;
}
.topbar {
  height: 62px;
  background: #243e35f2;
  color: #fff8e6;
  border-bottom: 1px solid #cfb77590;
  box-shadow: 0 3px 20px #18332635;
}
.brand-icon,
.brand small,
.village-status small,
.top-actions > span {
  color: #d6d4b9;
}
.brand b {
  font-size: 18px;
}
.top-actions button {
  border-color: #aebda35c;
  background: #ffffff0b;
}
.village-status {
  border-color: #fff2;
}
.camera-control {
  top: 78px;
  border: 1px solid #c7b88a;
}
.side-nav {
  top: 88px;
  left: 18px;
  gap: 8px;
}
.side-nav button {
  background: #29483ce8;
  color: #fff6df;
  border: 1px solid #cab67a;
  border-radius: 13px;
  width: 62px;
  height: 64px;
  box-shadow: 0 4px 16px #213f3d2b;
}
.side-nav button span {
  color: #e5d29b;
}
body.world-view .journey {
  top: auto;
  bottom: 190px;
  width: 260px;
}
body.world-view .world-label {
  background: #fff9e6ed;
  border: 1px solid #ad9d6a;
  color: #375548;
  box-shadow: 0 2px 7px #324d3933;
  font-size: 10px;
}
body.world-view .vignette {
  background: none;
  box-shadow: inset 0 0 70px #253e3522;
}
.portrait.mira,
.portrait.hyunwoo,
.portrait.yuna {
  background-image: url("/assets/plan-art/portraits.png");
  background-size: 300% 300%;
  background-color: #e6eadb;
  color: transparent;
  font-size: 0;
  border: 1px solid #a6b59d;
}
.portrait.hyunwoo {
  background-position: 0 0;
}
.portrait.yuna {
  background-position: 0 50%;
}
.portrait.mira {
  background-position: 0 100%;
}
#conversationPortrait {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  background-image: url("/assets/plan-art/portraits.png");
  background-size: 300% 300%;
  width: min(39vw, 440px);
  height: min(39vw, 440px);
  left: calc(50% - 460px);
  bottom: 80px;
  filter: drop-shadow(0 12px 20px #263f3a30);
  animation: portrait-arrive 0.45s ease-out;
}
body.conversation::after {
  content: "";
  position: absolute;
  inset: 62px 0 0;
  pointer-events: none;
  z-index: 20;
  background: linear-gradient(0deg, #193e3a80, transparent 90%);
}
body.conversation .dialogue {
  left: auto;
  right: max(32px, calc(50% - 540px));
  transform: none;
  width: min(480px, 44vw);
  bottom: 45px;
  border: 1px solid #d2be87;
  background: #fffdf5f5;
  box-shadow: 0 20px 65px #183b3b50;
}
body.conversation .camera-control,
body.conversation .minimap-wrap,
body.conversation .bottom-left {
  opacity: 0;
  pointer-events: none;
}
body.conversation #chatLog {
  max-height: 27dvh;
  min-height: 110px;
}
@keyframes portrait-arrive {
  from {
    opacity: 0;
    translate: 0 12px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 62px;
    padding: 0 15px;
  }
  .camera-control {
    top: 76px;
  }
  .side-nav {
    top: 130px;
    left: 10px;
  }
  .side-nav button {
    width: 48px;
    height: 51px;
    font-size: 8px;
  }
  .side-nav button span {
    font-size: 21px;
  }
  body.world-view .journey {
    top: 130px;
    bottom: auto;
    width: 190px;
    right: 12px;
  }
  body.world-view .world-label {
    font-size: 9px;
    padding: 5px 7px;
  }
  body.conversation .dialogue {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 10px;
    padding: 16px;
    max-height: 56dvh;
    overflow-y: auto;
  }
  body.conversation #chatLog {
    min-height: 68px;
    max-height: 19dvh;
    margin: 12px 0;
  }
  body.conversation .message {
    font-size: 12px;
    line-height: 1.65;
    padding: 10px 12px;
  }
  #conversationPortrait {
    left: 50%;
    transform: translateX(-50%);
    width: clamp(130px, calc(var(--dialogue-top, 400px) - 70px), 300px);
    height: clamp(130px, calc(var(--dialogue-top, 400px) - 70px), 300px);
    bottom: calc(100% - var(--dialogue-top, 400px) - 12px);
  }
  body.conversation #quickReplies button {
    padding: 7px 9px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #conversationPortrait {
    animation: none;
  }
}

.portrait-previous {
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: inherit;
  pointer-events: none;
}
/* Keep the illustrated scene crisp around dialogue, including WebKit compositing. */
body.conversation .dialogue { backdrop-filter:none; background:#fffdf5; }

/* Both views share the same WebGL world and controls. */
body.world-view #game { visibility: visible; touch-action: none; }
body.world-view .world-label { pointer-events:none; }

.dialogue-chapter { margin:10px 0 6px; font-size:11px; color:#69806b; letter-spacing:.02em; }
#chatLog .message { white-space:pre-wrap; }
#quickReplies { gap:6px; }

/* Cottage: the room stays visible while browsing and making placement decisions. */
body.inside-home #app > :not(#cottage) {display:none!important}
body.inside-home #app {min-height:0}
#cottage {position:absolute;inset:0;display:flex;flex-direction:column;background:#f5f1e5;color:#30483d;}
.room-header {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px clamp(16px,3vw,42px);border-bottom:1px solid var(--venue-color,#c9c5ae);background:#faf7ec;flex:none}
.room-name small {font-size:11px;letter-spacing:.14em;color:#6a7563}
.room-name h1 {margin:1px 0 0;font-size:clamp(19px,2.1vw,29px);font-family:"Nanum Myeongjo",Georgia,serif;letter-spacing:-.045em}
.room-head-actions,.room-wallet,.room-position,.room-edit-heading {display:flex;gap:12px;align-items:center}
.room-wallet {padding:7px 14px;border-radius:24px;background:#e4ead8;font-size:14px;gap:7px;color:#38563d}
.room-wallet i {font-size:21px;line-height:1}
#roomExit,#roomView,#roomRotate,#roomStore,#roomCancel {border:1px solid #bcc3ae;border-radius:9px;padding:9px 13px;background:#fffcf3;color:#455942;font-weight:600}
.room-layout {display:grid;grid-template-columns:minmax(0,1fr) clamp(270px,26vw,410px);flex:1;min-height:0}
#roomStage {position:relative;overflow:hidden;min-height:0;background:#ded9ca}
#roomStage #game {position:absolute;inset:0;touch-action:none;cursor:pointer;}
#roomView {position:absolute;top:16px;left:16px;box-shadow:0 2px 8px #54483513}
#roomNotice {position:absolute;bottom:14px;left:50%;transform:translateX(-50%);max-width:92%;width:max-content;text-align:center;margin:0;padding:8px 15px;border-radius:18px;background:#fffaf0eb;color:#465848;font-size:13px;pointer-events:none}
.room-drawer {border-left:1px solid #c5c1ae;background:#faf7ef;overflow-y:auto;overscroll-behavior:contain;padding:0 18px 18px}
.room-tabs {display:flex;position:sticky;top:0;z-index:1;background:#faf7ef;border-bottom:1px solid #d9dac7}
.room-tabs button {padding:17px 4px 13px;flex:1;font-weight:650;color:#7c8375;font-size:15px;border-bottom:3px solid transparent}
.room-tabs button[aria-pressed=true]{color:#315441;border-color:#597352}
#roomFilters {display:flex;gap:6px;margin:15px 0 12px}
#roomFilters button {border:1px solid #d2d5c4;padding:4px 12px;border-radius:18px;font-size:12px}
#roomFilters button[aria-pressed=true]{background:#435e4d;color:#fff}
#roomList {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:8px 0}
.room-card {display:flex;flex-direction:column;padding:0 0 10px;text-align:left;border:1px solid #d9d2bf;border-radius:10px;overflow:hidden;background:#fffcf5}
.room-card img {display:block;width:100%;height:auto;background:#ebe5d7}
.room-card b,.room-card small {padding:0 9px;line-height:1.4}
.room-card b {font-size:13px;margin-top:7px}.room-card small,#roomEditPrice{font-size:12px;color:#697954}
.room-earn,.room-empty {font-size:12px;color:#6d7564;line-height:1.55}.room-empty {grid-column:1/-1}
.room-edit-heading{justify-content:space-between;margin:15px 0;border-bottom:1px solid #ddd9c8;padding-bottom:12px}
.room-product img {width:100%;max-height:200px;object-fit:contain;border-radius:12px;background:#ebe5d7}
.room-product h2 {font-size:21px;margin:12px 0 4px}.room-position{flex-wrap:wrap;justify-content:space-between;margin:20px 0}
#roomArrows,#roomWalkKeys {display:flex;gap:3px}
#roomArrows button,#roomWalkKeys button {background:#e9ebdf;border:1px solid #ccd1bd;border-radius:7px;min-width:30px;height:36px;font-size:16px}
#roomConfirm,#roomStore {display:block;width:100%;margin:7px 0;padding:10px;font-weight:650}
#roomConfirm:disabled{opacity:.42;cursor:not-allowed}
#roomWalkKeys {position:absolute;bottom:55px;left:14px;touch-action:none}
#roomWalkKeys button {min-width:40px;height:40px}
#cottage.walking .room-layout {grid-template-columns:1fr}
#cottage.walking .room-drawer {display:none}
@media(max-width:740px) {
 .room-header{padding:9px 13px}.room-head-actions{gap:6px}.room-name small{font-size:10px}.room-wallet{font-size:12px;padding:6px 9px}
 #roomExit,#roomView,#roomRotate,#roomStore,#roomCancel{font-size:12px;padding:7px 9px}
 .room-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1.1fr) minmax(0,1fr)}
 #cottage.walking .room-layout{grid-template-rows:1fr}
 .room-drawer{padding:0 12px 12px;border-left:0;border-top:1px solid #c5c1ae}
 #roomView{top:7px;left:7px}#roomNotice{bottom:5px;font-size:11px;padding:5px 11px}
 #roomList{grid-template-columns:repeat(auto-fill,minmax(94px,1fr));gap:6px}.room-tabs button{padding:9px 4px 7px}
 #roomFilters{margin:6px 0 2px}.room-card b{font-size:12px}.room-card small{font-size:11px}
 .room-edit-heading{margin:7px 0;padding-bottom:5px}.room-product{display:flex;align-items:center;gap:12px}.room-product img{width:80px;height:55px}
 .room-product h2{margin:0;font-size:16px}.room-position{margin:8px 0}#roomConfirm,#roomStore{margin:4px 0;padding:7px}
}

/* The shop counter sits alongside the walkable room on a wide screen, below it on a phone. */
#venueCounter {padding:18px 0;}
#venueCounter h2 {font-family:"Nanum Myeongjo",Georgia,serif; font-size:22px; margin:0 0 8px;}
.venue-intro,.venue-footnote,.venue-paper p,.venue-fit p {font-size:13px;line-height:1.6;color:#596652;margin:6px 0 13px;}
.venue-stock {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
.venue-product {border:1px solid #d9d1bb;background:#fffaf0;border-radius:9px;overflow:hidden;text-align:left;padding:0 0 7px;display:grid;}
.venue-product img {width:100%;display:block;background:#ebe5d7;}
.venue-product b,.venue-product small {padding:2px 8px 0;font-size:13px;}
.venue-product small{font-size:12px;color:#647451;}
.venue-product[aria-pressed=true],.venue-swatch[aria-pressed=true] {outline:2px solid #617c62;outline-offset:-2px;}
.venue-confirm,.venue-talk,.venue-read {display:block;width:100%;border-radius:8px;padding:8px 12px;margin:9px 0;font-size:13px;}
.venue-talk,.venue-read {border:1px solid #c5c7af;background:#eeedde;font-weight:600;color:#425644;}
.venue-swatches{display:flex;gap:5px;flex-wrap:wrap;}
.venue-swatch{border:1px solid #c8c4b2;border-radius:15px;background:#fffaf2;padding:6px 8px;font-size:12px;}
.venue-swatch i{display:inline-block;border-radius:50%;width:10px;height:10px;margin-right:4px;}
.venue-fit{display:flex;align-items:center;justify-content:center;gap:9px;margin:9px 0;border:1px solid #d6ccc2;border-radius:12px;background:#ede5dc;}
.venue-fit canvas {max-width:38%;height:105px;object-fit:contain;}
.venue-footnote{font-size:12px;margin:9px 0;}
.venue-paper{padding:13px 18px;background:#f4ecda;border-left:3px solid #b58a6e;border-radius:3px 9px 9px 3px;}
.venue-paper h3{margin:7px 0;font-family:Georgia,serif;}.venue-paper small{color:#84745f;}
body.inside-home.conversation #app > #dialoguePanel:not([hidden]) {display:block!important;}
body.inside-home.conversation #cottage {pointer-events:none;}
body.inside-home.conversation #cottage .room-drawer,body.inside-home.conversation #roomView,body.inside-home.conversation #roomNotice {visibility:hidden;}
@media(max-width:740px){#venueCounter{padding:11px 1px;}#venueCounter h2{font-size:19px;}.venue-stock{grid-template-columns:repeat(3,minmax(0,1fr));}.venue-intro{margin:4px 0 8px;}}
.venue-directory {display:grid;gap:5px;margin:10px 0 14px;}
.venue-directory > div {display:flex;align-items:center;gap:6px;padding:7px 8px;border-left:4px solid var(--sign-color);background:#f4f1e5;border-radius:5px;}
.venue-directory span {display:grid;flex:1;text-align:left;}.venue-directory small{color:#788071;font-size:10px;}
.venue-directory b{color:#354b3d;font-size:13px;}.venue-directory button{border:1px solid #bdc6b3;padding:6px 8px;border-radius:7px;font-size:12px;background:#fffaf0;}
.venue-directory button:last-child{background:#e3ebdc;}
.world-label.venue-label i{background:var(--sign-color);}
