:root {
  --shell-width: min(100vw, 430px);
  --shell-height: 100vh;
  --viewport-width: 1600px;
  --viewport-height: 1000px;
  --scene-width: 1120px;
  --scene-height: 900px;
  --ink: #241816;
  --ink-soft: rgba(36, 24, 22, 0.72);
  --paper: rgba(255, 250, 242, 0.95);
  --paper-soft: rgba(255, 248, 238, 0.88);
  --gold: #d2a54a;
  --gold-soft: #f4d48d;
  --jade: #35574a;
  --jade-soft: #6b8d7b;
  --cinnabar: #8f4034;
  --rose: #c9786a;
  --shadow-lg: 0 28px 70px rgba(57, 38, 21, 0.28);
  --shadow-md: 0 16px 34px rgba(57, 38, 21, 0.22);
  --shadow-sm: 0 10px 20px rgba(57, 38, 21, 0.16);
  --ui-font: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --title-font: "STKaiti", "KaiTi", "FangSong", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  font-family: var(--ui-font);
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 244, 211, 0.85), transparent 28%),
    linear-gradient(180deg, #dbe0c0 0%, #b8c29c 45%, #93a679 100%);
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
}

button {
  font: inherit;
}

.game-shell {
  width: var(--shell-width);
  height: 100vh;
  height: 100dvh;
  height: var(--shell-height);
}

.game-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #d9e5b8 0%, #bfd194 47%, #a8bd7f 100%);
  box-shadow: var(--shadow-lg);
}

.game-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.32), transparent 20%),
    radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 12%, transparent 12% 100%);
  mix-blend-mode: screen;
}

.game-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 251, 240, 0.24);
}

.ornament {
  position: absolute;
  left: 50%;
  width: 200px;
  height: 22px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.62;
  background:
    radial-gradient(circle, rgba(244, 212, 141, 1) 0 14%, transparent 15%),
    linear-gradient(90deg, transparent 0 16%, rgba(244, 212, 141, 0.92) 16% 84%, transparent 84%);
}

.ornament--top {
  top: 14px;
}

.ornament--bottom {
  bottom: 14px;
}

.top-ui {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.mission-card {
  width: min(calc(100% - 132px), 270px);
  padding: 14px 16px 15px;
  border: 1px solid rgba(221, 190, 139, 0.5);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.9)),
    var(--paper);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 4px;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  animation: drift 3.8s ease-in-out infinite;
}

.mission-card__eyebrow,
.scene-titleplate__eyebrow,
.inventory-panel__eyebrow,
.item-modal__eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6c98cc;
}

.mission-card__title,
.scene-titleplate strong,
.item-modal__title,
.inventory-panel__title {
  font-family: var(--title-font);
  font-size: 26px;
  font-weight: 700;
  color: #2a1c17;
}

.mission-card__hint,
.scene-titleplate span:last-child {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.status-pill {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(35, 33, 26, 0.76);
  color: #fff4dc;
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow-sm);
}

.roster-rail {
  position: absolute;
  top: 154px;
  left: 10px;
  bottom: 150px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.roster-item {
  position: relative;
  width: 54px;
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
  cursor: pointer;
}

.roster-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.roster-item__avatar,
.portrait {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  color: #fffcf6;
  font-family: var(--title-font);
  font-size: 18px;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.18);
}

.roster-item__avatar--image,
.portrait--image {
  background-color: #f1e2cb;
  background-image: var(--avatar-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  overflow: hidden;
}

.roster-item__name {
  width: 64px;
  text-align: center;
  font-size: 10px;
  color: #fffef3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.roster-item__badge {
  position: absolute;
  top: 30px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7f6dff, #8c78ff);
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  box-shadow: 0 8px 14px rgba(68, 53, 176, 0.3);
}

.utility-rail {
  position: absolute;
  top: 154px;
  right: 12px;
  z-index: 34;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.utility-button {
  position: relative;
  width: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.95), rgba(245, 232, 214, 0.92));
  box-shadow: var(--shadow-md);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 6px 8px;
  cursor: pointer;
}

.utility-button__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--jade), #21362e);
  color: #fef6df;
  font-family: var(--title-font);
  font-size: 16px;
}

.utility-button__label {
  font-size: 11px;
  color: var(--ink-soft);
}

.utility-button__count {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f19876, #dc6e4b);
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  box-shadow: 0 10px 16px rgba(196, 95, 62, 0.28);
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.layer.active {
  opacity: 1;
  pointer-events: auto;
}

.camera {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.world,
.scene-stage {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.world {
  width: var(--viewport-width);
  height: var(--viewport-height);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(27, 40, 22, 0.05)),
    url("./assets/world-map.png") center top / 100% 100% no-repeat,
    url("./assets/world-map.jpg") center top / 100% 100% no-repeat;
}

.world::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 28%);
}

.world::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.28), transparent 26%),
    linear-gradient(180deg, transparent 68%, rgba(35, 47, 24, 0.1) 100%);
  box-shadow: inset 0 0 120px rgba(58, 64, 30, 0.1);
}

.world-routes {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(81, 62, 30, 0.08));
  display: none;
}

.world-route {
  fill: none;
  stroke-linecap: round;
  stroke-width: 40;
}

.world-route--glow {
  stroke: rgba(255, 249, 225, 0.92);
}

.world-route--main {
  stroke: #dfcfad;
}

.world-water {
  position: absolute;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(152, 222, 241, 0.96), rgba(85, 176, 219, 0.92)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent 40%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.22),
    0 18px 22px rgba(31, 102, 138, 0.14);
  z-index: 1;
  display: none;
}

.world-water--north {
  left: 92px;
  top: 520px;
  width: 210px;
  height: 410px;
  transform: rotate(18deg);
}

.world-water--east {
  right: 86px;
  bottom: 250px;
  width: 150px;
  height: 250px;
  transform: rotate(-18deg);
}

.world-scenery,
.world-items,
.world-locations,
.world-nodes,
.actors,
.scene-decor,
.scene-npcs {
  position: absolute;
  inset: 0;
}

.world-scenery,
.actors,
.scene-decor {
  pointer-events: none;
}

.world-scenery {
  z-index: 3;
  display: none;
}

.world-items {
  z-index: 6;
  pointer-events: auto;
}

.world-nodes {
  z-index: 5;
  display: none;
  pointer-events: none;
}

.world-locations {
  z-index: 8;
}

.actors {
  z-index: 9;
}

.building {
  position: absolute;
  border-radius: 20px 20px 14px 14px;
  background: linear-gradient(180deg, #b86549 0%, #954535 100%);
  box-shadow:
    0 18px 28px rgba(75, 50, 27, 0.18),
    inset 0 0 0 3px rgba(118, 56, 39, 0.14);
}

.building::before {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: -22px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f0d16a 0%, #ca9531 100%);
  box-shadow: 0 10px 0 rgba(112, 80, 18, 0.08);
}

.building::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  height: 16px;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, rgba(255, 246, 220, 0.3) 0 18px, rgba(120, 64, 50, 0.14) 18px 28px);
}

.building--hall {
  border-radius: 26px 26px 18px 18px;
}

.building--hall::before {
  height: 46px;
  top: -24px;
}

.building--yard::after,
.building--gate::after {
  display: none;
}

.building--gate {
  background: linear-gradient(180deg, #85504a 0%, #6d3f3b 100%);
}

.building--gate::before {
  background: linear-gradient(180deg, #dfbf5a 0%, #b78427 100%);
}

.tree {
  position: absolute;
  width: var(--size);
  height: calc(var(--size) * 1.08);
  z-index: 2;
}

.tree::before,
.tree::after {
  content: "";
  position: absolute;
}

.tree::before {
  left: 50%;
  bottom: 8px;
  width: calc(var(--size) * 0.12);
  height: calc(var(--size) * 0.28);
  transform: translateX(-50%);
  border-radius: 999px;
  background: #694c34;
}

.tree::after {
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #7ec580 0 26%, transparent 27%),
    radial-gradient(circle at 62% 26%, #67b76c 0 24%, transparent 25%),
    radial-gradient(circle at 54% 58%, #4f9658 0 32%, transparent 33%),
    radial-gradient(circle at 20% 60%, #8ad08b 0 24%, transparent 25%),
    radial-gradient(circle at 82% 58%, #4a8f54 0 22%, transparent 23%),
    radial-gradient(circle at 50% 46%, #5ea75f 0 42%, transparent 43%);
}

.world-item {
  position: absolute;
  margin-left: -30px;
  margin-top: -42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: auto;
  touch-action: manipulation;
}

.world-item__glow {
  position: absolute;
  top: 6px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 237, 177, 0.5), transparent 70%);
  filter: blur(4px);
  animation: pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}

.world-item__icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 227, 194, 0.92));
  border: 1px solid rgba(213, 167, 84, 0.62);
  color: #70462a;
  font-family: var(--title-font);
  font-size: 18px;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.world-item__name {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(37, 35, 27, 0.78);
  color: #fff8e4;
  font-size: 11px;
  box-shadow: 0 10px 18px rgba(20, 18, 12, 0.16);
}

.location-tag {
  position: absolute;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  gap: 10px;
  justify-items: start;
  animation: rise 560ms ease both;
}

.location-tag__avatars {
  display: inline-flex;
  gap: 4px;
  padding-left: 10px;
}

.location-tag__avatars .portrait {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.location-tag__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 16px;
  border-radius: 22px;
  background: rgba(12, 12, 11, 0.84);
  color: #fffdfa;
  box-shadow: 0 18px 24px rgba(20, 20, 18, 0.16);
}

.location-tag__label::before {
  content: "入";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-family: var(--title-font);
  font-size: 13px;
}

.location-tag__name {
  font-family: var(--title-font);
  font-size: 22px;
  letter-spacing: 0.05em;
}

.location-tag__line {
  position: absolute;
  left: var(--line-left);
  top: var(--line-top);
  width: var(--line-width);
  height: 2px;
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(var(--line-rotate));
  transform-origin: left center;
}

.location-tag__line::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.16);
}

.location-tag__objective {
  position: absolute;
  top: -12px;
  left: -2px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff967a, #eb6f4f);
  color: white;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(222, 105, 73, 0.3);
}

.location-tag.objective .location-tag__label {
  outline: 2px solid rgba(255, 210, 164, 0.52);
}

.location-tag.visited .location-tag__label {
  background: rgba(29, 25, 19, 0.76);
}

.node-button {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.node-button::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.18),
    0 10px 18px rgba(69, 46, 17, 0.18);
}

.actor {
  --actor-sprite: none;
  position: absolute;
  width: 76px;
  height: 190px;
  margin-left: -38px;
  margin-top: -174px;
  pointer-events: none;
  background: var(--actor-sprite) center bottom / contain no-repeat;
  filter: drop-shadow(0 14px 16px rgba(43, 35, 24, 0.26));
}

.actor__head,
.actor__body,
.actor__shadow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.actor__head,
.actor__body {
  display: none;
}

.actor__head {
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0)),
    var(--avatar-image),
    var(--head-color);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  z-index: 3;
}

.actor__body {
  top: 31px;
  width: 56px;
  height: 82px;
  clip-path: polygon(50% 0%, 70% 7%, 86% 21%, 90% 58%, 82% 100%, 18% 100%, 10% 58%, 14% 21%, 30% 7%);
  background:
    linear-gradient(130deg, transparent 0 40%, rgba(244, 225, 221, 0.78) 40% 46%, transparent 46%),
    linear-gradient(180deg, var(--robe-second) 0 18%, var(--robe-main) 18% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.22),
    inset 0 -10px 16px rgba(120, 84, 76, 0.12);
}

.actor__body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 14px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.actor__shadow {
  bottom: 4px;
  width: 52px;
  height: 15px;
  border-radius: 50%;
  background: rgba(40, 33, 21, 0.16);
  filter: blur(3px);
}

#worldPlayer,
#scenePlayer {
  --actor-sprite: url("./assets/player-sprite.png");
}

#worldCompanion,
#sceneCompanion {
  --actor-sprite: url("./assets/oc-sprite.png");
}

.layer--scene .actor {
  width: 92px;
  height: 232px;
  margin-left: -46px;
  margin-top: -214px;
  filter: drop-shadow(0 16px 18px rgba(43, 35, 24, 0.24));
}

.scene-ui {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: 18px;
  right: 18px;
  z-index: 26;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.scene-back {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(16, 15, 12, 0.82);
  color: #fff6df;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  cursor: pointer;
}

.scene-titleplate {
  max-width: 220px;
  padding: 14px 16px;
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 3px;
  text-align: right;
}

.scene-stage {
  width: var(--scene-width);
  height: var(--scene-height);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(34, 23, 18, 0.08)),
    var(--scene-image, none) center top / 100% 100% no-repeat,
    url("./assets/scene-reference.jpg") center top / 100% 100% no-repeat;
}

.scene-backdrop,
.scene-backdrop__sky,
.scene-backdrop__mist,
.scene-backdrop__wall,
.scene-backdrop__floor {
  position: absolute;
  inset: 0;
}

.scene-backdrop {
  display: none;
}

.scene-backdrop__sky {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(180deg, var(--scene-sky, #e5ebd1) 0%, var(--scene-mid, #ddcfb2) 100%);
}

.scene-backdrop__mist {
  background:
    radial-gradient(circle at 18% 48%, rgba(255, 255, 255, 0.48), transparent 22%),
    radial-gradient(circle at 82% 42%, rgba(255, 255, 255, 0.3), transparent 18%);
  opacity: 0.7;
}

.scene-backdrop__wall {
  top: 220px;
  bottom: auto;
  height: 560px;
  background:
    linear-gradient(180deg, rgba(201, 177, 140, 0.82), rgba(181, 152, 112, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 58px, rgba(114, 86, 48, 0.09) 58px 70px);
}

.scene-backdrop__wall::before {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  top: -40px;
  height: 70px;
  background: linear-gradient(180deg, #e2c463, #c48f31);
  border-radius: 24px;
}

.scene-backdrop__floor {
  top: 700px;
  background:
    linear-gradient(180deg, rgba(255, 252, 240, 0.24), transparent 20%),
    repeating-linear-gradient(90deg, rgba(236, 219, 193, 0.8) 0 42px, rgba(206, 183, 148, 0.9) 42px 46px),
    repeating-linear-gradient(180deg, rgba(238, 221, 194, 0.74) 0 34px, rgba(198, 171, 135, 0.86) 34px 38px);
}

.scene-decor {
  z-index: 4;
  display: none;
}

.scene-figure {
  position: absolute;
  left: 18px;
  bottom: 0;
  width: 320px;
  height: 745px;
  z-index: 5;
  pointer-events: none;
  background: url("./assets/oc-sprite.png") left bottom / contain no-repeat;
  opacity: 0.96;
  filter: drop-shadow(0 18px 24px rgba(34, 21, 14, 0.2));
}

.scene-npcs {
  z-index: 6;
}

.scene-prop {
  position: absolute;
  filter: drop-shadow(0 16px 18px rgba(62, 46, 24, 0.14));
}

.scene-prop--screen,
.scene-prop--desk,
.scene-prop--cabinet,
.scene-prop--table,
.scene-prop--rack,
.scene-prop--altar,
.scene-prop--gate {
  border-radius: 16px;
  background: linear-gradient(180deg, #9d5640, #7f4030);
}

.scene-prop--screen::before,
.scene-prop--desk::before,
.scene-prop--cabinet::before,
.scene-prop--table::before,
.scene-prop--rack::before,
.scene-prop--altar::before,
.scene-prop--gate::before {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: -18px;
  height: 28px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ebcb61, #bd8a2c);
}

.scene-prop--screen::after,
.scene-prop--cabinet::after,
.scene-prop--gate::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid rgba(255, 244, 226, 0.34);
  border-radius: 10px;
}

.scene-prop--lantern,
.scene-prop--brazier,
.scene-prop--vase,
.scene-prop--chest {
  border-radius: 50%;
}

.scene-prop--lantern {
  background:
    radial-gradient(circle at 50% 44%, #fff2ca 0 38%, transparent 39%),
    radial-gradient(circle at 50% 55%, #c14b36 0 60%, transparent 61%);
}

.scene-prop--brazier {
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 200, 110, 0.8), transparent 26%),
    radial-gradient(circle at 50% 65%, #62483d 0 48%, transparent 49%);
}

.scene-prop--tree {
  border-radius: 40%;
  background:
    radial-gradient(circle at 30% 26%, #92d38e 0 20%, transparent 21%),
    radial-gradient(circle at 64% 20%, #7bc27b 0 18%, transparent 19%),
    radial-gradient(circle at 52% 54%, #63a960 0 30%, transparent 31%),
    radial-gradient(circle at 22% 58%, #86ca88 0 22%, transparent 23%),
    radial-gradient(circle at 78% 58%, #52955b 0 20%, transparent 21%);
}

.scene-prop--tree::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 18px;
  height: 32px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #71523a;
}

.npc {
  position: absolute;
  width: 126px;
  margin-left: -63px;
  margin-top: -112px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.npc .portrait {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.npc__card {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(17, 17, 16, 0.84);
  color: #fffefb;
  text-align: center;
  box-shadow: 0 16px 24px rgba(12, 10, 10, 0.18);
}

.npc__name {
  display: block;
  font-family: var(--title-font);
  font-size: 20px;
}

.npc__role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

.dialogue-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 110px;
  z-index: 40;
  padding: 18px;
  border: 1px solid rgba(217, 182, 120, 0.45);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(255, 246, 235, 0.94));
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
}

.dialogue-panel.hidden,
.story-panel.hidden,
.item-modal.hidden,
.inventory-panel.hidden,
.ui-overlay.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.dialogue-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dialogue-panel__speaker {
  font-family: var(--title-font);
  font-size: 28px;
}

.dialogue-panel__progress {
  color: rgba(34, 24, 19, 0.56);
  font-size: 13px;
}

.dialogue-panel__text {
  margin: 0;
  min-height: 72px;
  font-size: 17px;
  line-height: 1.8;
}

.dialogue-panel__action,
.action-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
}

.dialogue-panel__action {
  justify-self: end;
  min-width: 100px;
  background: linear-gradient(180deg, #2f2e2b, #141412);
  color: #fff3d2;
}

.story-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 110px;
  z-index: 42;
  padding: 16px 18px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24, 20, 16, 0.84), rgba(12, 10, 8, 0.8));
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 12px;
  color: #fff8ee;
}

.story-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.story-panel__badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 214, 136, 0.16);
  color: #ffd991;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.story-panel__progress {
  font-size: 12px;
  color: rgba(255, 248, 238, 0.72);
}

.story-panel__text {
  margin: 0;
  min-height: 84px;
  font-size: 17px;
  line-height: 1.9;
  color: #fffaf2;
}

.story-panel__action {
  justify-self: end;
  min-width: 100px;
  background: linear-gradient(180deg, #f2d17a, #cf9a3f);
  color: #4a3018;
  font-weight: 700;
}

.message-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 32;
  min-height: 86px;
  padding: 16px 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 249, 240, 0.9));
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 14px;
}

.message-bar__badge {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f6d67d, #d8a94d);
  color: #5f3c21;
  font-family: var(--title-font);
  font-size: 24px;
  box-shadow: var(--shadow-sm);
}

.message-bar__content {
  display: grid;
  gap: 3px;
}

.message-bar__content strong {
  font-size: 17px;
  font-family: var(--title-font);
}

.message-bar__content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 41;
  background: rgba(19, 16, 14, 0.35);
  backdrop-filter: blur(4px);
}

.item-modal {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  z-index: 43;
  transform: translateY(-50%);
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(217, 182, 120, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 246, 236, 0.96));
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
}

.item-modal__hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.item-emblem {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 229, 194, 0.94));
  border: 1px solid rgba(213, 167, 84, 0.58);
  color: #664227;
  font-family: var(--title-font);
  font-size: 30px;
  box-shadow: var(--shadow-sm);
}

.item-modal__copy {
  display: grid;
  gap: 4px;
}

.inventory-detail__source {
  font-size: 12px;
  color: rgba(36, 24, 22, 0.58);
}

.item-modal__desc,
.inventory-detail__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.item-modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.action-button--primary {
  min-width: 108px;
  background: linear-gradient(180deg, #35574a, #233a30);
  color: #fff8e7;
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(44, 37, 31, 0.08);
  color: var(--ink);
  font-size: 20px;
  line-height: 34px;
  cursor: pointer;
}

.inventory-panel {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 56px;
  z-index: 44;
  padding: 18px;
  border-radius: 30px;
  border: 1px solid rgba(217, 182, 120, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 247, 237, 0.95));
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.inventory-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.inventory-panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inventory-panel__total {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(51, 87, 74, 0.1);
  color: var(--jade);
  font-size: 12px;
  font-weight: 700;
}

.inventory-panel__body {
  min-height: 0;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
}

.inventory-list {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.inventory-item {
  border: 1px solid rgba(216, 197, 164, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px 10px;
  display: grid;
  justify-items: center;
  gap: 8px;
  cursor: pointer;
}

.inventory-item.is-active {
  border-color: rgba(53, 87, 74, 0.48);
  background: rgba(230, 240, 234, 0.9);
}

.inventory-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 229, 194, 0.9));
  border: 1px solid rgba(213, 167, 84, 0.56);
  color: #664227;
  font-family: var(--title-font);
  font-size: 18px;
}

.inventory-item__name {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}

.inventory-empty {
  padding: 18px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.inventory-detail {
  min-height: 0;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(252, 244, 233, 0.85));
  border: 1px solid rgba(220, 199, 164, 0.6);
  padding: 18px;
  display: grid;
  align-content: start;
}

.inventory-detail__hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.inventory-detail__icon {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 229, 194, 0.94));
  border: 1px solid rgba(213, 167, 84, 0.62);
  color: #664227;
  font-family: var(--title-font);
  font-size: 32px;
  box-shadow: var(--shadow-sm);
}

.inventory-detail__copy {
  display: grid;
  gap: 4px;
}

.inventory-detail__title {
  font-family: var(--title-font);
  font-size: 28px;
  color: #2a1c17;
}

.inventory-detail__placeholder {
  height: 100%;
  min-height: 240px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 10px;
  color: var(--ink-soft);
}

.inventory-detail__placeholder-icon {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 229, 194, 0.92));
  border: 1px solid rgba(213, 167, 84, 0.5);
  color: #664227;
  font-family: var(--title-font);
  font-size: 30px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@media (min-width: 431px) {
  .game-shell {
    width: 430px;
    height: min(100dvh - 24px, 920px);
    padding: 12px 0;
  }

  .game-screen {
    border-radius: 36px;
  }
}

@media (max-width: 390px) {
  .top-ui {
    left: 0;
    right: 0;
  }

  .mission-card {
    width: min(calc(100% - 124px), 248px);
  }

  .mission-card__title,
  .scene-titleplate strong,
  .item-modal__title,
  .inventory-panel__title {
    font-size: 24px;
  }

  .inventory-panel {
    left: 42px;
  }
}
