:root {
  color-scheme: light;
  --ink: #261d15;
  --muted: #77634d;
  --paper: #f8efd8;
  --paper-deep: #e6d5ad;
  --red: #9e2f25;
  --jade: #2e5e4d;
  --gold: #bb8a35;
  --coal: #1d1814;
  --line: rgba(86, 59, 34, 0.22);
  --shadow: rgba(35, 22, 12, 0.24);
}

html {
  scrollbar-gutter: stable;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(187, 138, 53, 0.24), transparent 26%),
    linear-gradient(90deg, rgba(80, 56, 34, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(80, 56, 34, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #efe0bf, #b99d69 50%, #3e4435);
  background-size: auto, 42px 42px, 42px 42px, auto;
}

button {
  font: inherit;
}

.game-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px clamp(12px, 3vw, 34px);
}

.topbar,
.layout {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: rise-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.seal {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border: 3px solid #f4df9a;
  color: #f4df9a;
  background: var(--red);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 12px 26px var(--shadow);
  animation: seal-stamp 620ms cubic-bezier(0.2, 1.35, 0.45, 1) backwards;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.title-lockup:hover .seal {
  transform: rotate(-2deg) translateY(-1px);
  box-shadow: 0 15px 30px var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: "Kaiti SC", "STKaiti", "Songti SC", serif;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.title-lockup p {
  margin-top: 6px;
  color: rgba(38, 29, 21, 0.72);
  font-size: 15px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.top-actions button,
.choices button,
#continueBtn {
  min-height: 42px;
  border: 1px solid rgba(248, 239, 216, 0.68);
  border-radius: 8px;
  color: #fff8e8;
  background: rgba(44, 34, 25, 0.78);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.top-actions button {
  padding: 0 14px;
}

.top-actions button:hover,
.choices button:hover,
#continueBtn:hover {
  transform: translateY(-1px);
  background: rgba(126, 42, 32, 0.92);
  border-color: rgba(244, 223, 154, 0.9);
  box-shadow: 0 7px 16px rgba(35, 22, 12, 0.2);
}

.top-actions button:active,
.choices button:active,
#continueBtn:active {
  transform: translateY(1px) scale(0.99);
}

.layout {
  display: block;
  min-height: 0;
}

.story-panel {
  min-width: 0;
  border: 1px solid rgba(248, 239, 216, 0.5);
  border-radius: 8px;
  background: rgba(248, 239, 216, 0.82);
  box-shadow: 0 20px 48px var(--shadow);
  animation: panel-settle 620ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-overview {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(420px, 1.2fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding: 0 2px 10px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 14px;
}

.stat-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 7px;
  color: var(--muted);
  font-size: 14px;
}

.stat-label {
  min-width: 0;
  white-space: nowrap;
}

.stat-rank {
  overflow: hidden;
  color: var(--jade);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-row b {
  min-width: 30px;
  color: var(--ink);
  text-align: left;
}

.home-statuses {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.progression-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.progression-summary > span {
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr);
  align-items: baseline;
  min-width: 0;
  gap: 6px;
}

.progression-summary small {
  color: var(--muted);
  font-size: 10px;
}

.progression-summary b {
  color: var(--jade);
  font-size: 13px;
  white-space: nowrap;
}

.progression-summary em {
  overflow: hidden;
  color: rgba(86, 59, 34, 0.68);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin-bottom: 10px;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 22px;
}

.home-statuses ul,
.collection-window-list,
.journal-window-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-statuses strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.home-statuses li {
  margin-bottom: 4px;
  border: 1px solid rgba(158, 47, 37, 0.24);
  border-radius: 6px;
  padding: 4px 7px;
  color: #7a2a22;
  background: rgba(158, 47, 37, 0.08);
  font-size: 12px;
  line-height: 1.3;
}

.home-statuses small {
  margin-left: 5px;
  color: rgba(122, 42, 34, 0.72);
  font-size: 10px;
}

.collection-window-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border-bottom: 1px dashed rgba(86, 59, 34, 0.2);
  color: var(--muted);
  font-size: 14px;
}

.coin-entry {
  padding: 6px 0;
}

.coin-info {
  display: grid;
  min-width: 0;
}

.coin-count {
  flex: 0 0 auto;
  color: var(--red);
  font-weight: 700;
}

.coin-entry-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.package-item-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.cleaning-overlay {
  z-index: 50;
  background: rgba(12, 17, 14, 0.88);
}

.travel-overlay {
  z-index: 55;
  background: rgba(16, 20, 17, 0.9);
}

.travel-panel {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(470px, 100%);
  min-height: 440px;
  overflow: hidden;
  border: 1px solid rgba(232, 201, 120, 0.7);
  border-radius: 8px;
  padding: 34px 28px 28px;
  color: #fff7dc;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #18362d;
  background-size: 20px 20px, 20px 20px, auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 0 64px rgba(0, 0, 0, 0.28);
  animation: travel-panel-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.travel-panel::before {
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(232, 201, 120, 0.22);
  content: "";
  pointer-events: none;
}

.travel-kicker {
  color: #d9bd75;
  font-size: 12px;
  font-weight: 700;
}

.travel-panel h2 {
  margin: 4px 0 18px;
  color: #fff8df;
  font-size: 29px;
}

.travel-die {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: 118px;
  height: 118px;
  border: 4px double rgba(74, 47, 23, 0.8);
  border-radius: 16px;
  padding: 15px;
  background: #d3ad5f;
  box-shadow:
    inset 8px 8px 16px rgba(255, 239, 177, 0.32),
    inset -9px -10px 18px rgba(70, 43, 18, 0.3),
    0 18px 30px rgba(0, 0, 0, 0.42);
  transform: rotate(-5deg);
}

.travel-die.is-rolling {
  animation: travel-die-roll 620ms cubic-bezier(0.36, 0.08, 0.2, 1) infinite;
}

.travel-die.is-landed {
  animation: travel-die-land 420ms cubic-bezier(0.18, 1.4, 0.35, 1) both;
}

.travel-die i {
  display: block;
  align-self: center;
  justify-self: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #6f261f;
  box-shadow: inset 2px 2px 3px rgba(32, 14, 11, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.72);
  transition:
    opacity 70ms ease,
    transform 70ms ease;
}

.travel-die .dot-1 {
  grid-area: 1 / 1;
}

.travel-die .dot-2 {
  grid-area: 1 / 2;
}

.travel-die .dot-3 {
  grid-area: 1 / 3;
}

.travel-die .dot-4 {
  grid-area: 2 / 1;
}

.travel-die .dot-5 {
  grid-area: 2 / 2;
}

.travel-die .dot-6 {
  grid-area: 2 / 3;
}

.travel-die .dot-7 {
  grid-area: 3 / 1;
}

.travel-die .dot-8 {
  grid-area: 3 / 2;
}

.travel-die .dot-9 {
  grid-area: 3 / 3;
}

.travel-die[data-value="1"] .dot-5,
.travel-die[data-value="2"] .dot-1,
.travel-die[data-value="2"] .dot-9,
.travel-die[data-value="3"] .dot-1,
.travel-die[data-value="3"] .dot-5,
.travel-die[data-value="3"] .dot-9,
.travel-die[data-value="4"] .dot-1,
.travel-die[data-value="4"] .dot-3,
.travel-die[data-value="4"] .dot-7,
.travel-die[data-value="4"] .dot-9,
.travel-die[data-value="5"] .dot-1,
.travel-die[data-value="5"] .dot-3,
.travel-die[data-value="5"] .dot-5,
.travel-die[data-value="5"] .dot-7,
.travel-die[data-value="5"] .dot-9,
.travel-die[data-value="6"] .dot-1,
.travel-die[data-value="6"] .dot-3,
.travel-die[data-value="6"] .dot-4,
.travel-die[data-value="6"] .dot-6,
.travel-die[data-value="6"] .dot-7,
.travel-die[data-value="6"] .dot-9 {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.travel-status {
  min-height: 22px;
  margin-top: 20px;
  color: rgba(255, 247, 220, 0.76);
  font-size: 14px;
}

.travel-route {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: min(330px, 88%);
  margin: 20px 0 16px;
}

.travel-route::before {
  position: absolute;
  top: 50%;
  right: 7%;
  left: 7%;
  height: 2px;
  background: rgba(217, 189, 117, 0.22);
  content: "";
  transform: translateY(-50%);
}

.travel-route i {
  z-index: 1;
  width: 17px;
  height: 17px;
  justify-self: center;
  border: 2px solid rgba(217, 189, 117, 0.52);
  border-radius: 50%;
  background: #18362d;
}

.travel-route i.is-reached {
  border-color: #f1d487;
  background: #d3ad5f;
  box-shadow: 0 0 0 5px rgba(211, 173, 95, 0.13), 0 0 16px rgba(241, 212, 135, 0.4);
  animation: travel-step-in 260ms cubic-bezier(0.18, 1.4, 0.35, 1) both;
}

.travel-distance {
  color: #f1d487;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 23px;
}

.travel-total {
  margin-top: 5px;
  color: rgba(255, 247, 220, 0.58);
  font-size: 11px;
}

.cleaning-panel {
  --prize-accent: #c59a46;
  position: relative;
  width: min(520px, 100%);
  min-height: 470px;
  overflow: hidden;
  border: 1px solid rgba(235, 209, 137, 0.66);
  border-radius: 8px;
  color: #fff7dc;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #17372e;
  background-size: 18px 18px, 18px 18px, auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58), inset 0 0 70px rgba(0, 0, 0, 0.24);
  animation: cleaning-window-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cleaning-panel::before {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(231, 200, 121, 0.24);
  content: "";
  pointer-events: none;
}

.cleaning-close {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
}

.cleaning-process,
.cleaning-reveal {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  min-height: 470px;
  padding: 38px 28px 32px;
  text-align: center;
}

.cleaning-kicker {
  color: #d9bd75;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.cleaning-process h2,
.cleaning-reveal h2 {
  margin: 5px 0 0;
  color: #fff8df;
  font-size: 30px;
  letter-spacing: 0;
}

.cleaning-process p,
.cleaning-reveal p {
  margin: 0;
  color: rgba(255, 247, 220, 0.72);
  font-size: 14px;
}

.cleaning-focus-coin,
.cleaning-prize-coin {
  position: relative;
  display: grid;
  place-items: center;
  width: 164px;
  height: 164px;
  margin: 22px 0 18px;
  border: 8px solid #725336;
  border-radius: 50%;
  background: radial-gradient(circle at 37% 31%, #b08a55, #715136 62%, #3b2a1e);
  box-shadow: inset 0 0 0 5px rgba(255, 227, 161, 0.14), 0 18px 38px rgba(0, 0, 0, 0.42);
  transform-style: preserve-3d;
}

.cleaning-focus-coin {
  animation: cleaning-focus-turn 760ms ease-in-out infinite alternate;
}

.cleaning-focus-coin::before,
.cleaning-prize-coin::before {
  position: absolute;
  inset: -22px;
  border: 1px solid rgba(227, 197, 119, 0.32);
  border-radius: 50%;
  content: "";
  animation: cleaning-ring 1.2s ease-out infinite;
}

.cleaning-focus-coin::after {
  position: absolute;
  top: -8%;
  left: -55%;
  width: 36%;
  height: 116%;
  background: linear-gradient(90deg, transparent, rgba(255, 239, 183, 0.78), transparent);
  content: "";
  animation: cleaning-brush-sweep 820ms ease-in-out infinite;
  transform: rotate(14deg);
}

.cleaning-focus-coin i,
.cleaning-prize-coin i {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(55, 35, 21, 0.86);
  background: #17372e;
  box-shadow: inset 0 0 9px rgba(0, 0, 0, 0.66);
}

.cleaning-progress {
  width: min(240px, 72%);
  height: 3px;
  margin-top: 23px;
  overflow: hidden;
  background: rgba(255, 247, 220, 0.14);
}

.cleaning-progress i {
  display: block;
  width: 45%;
  height: 100%;
  background: #d9bd75;
  animation: cleaning-progress-run 1.1s ease-in-out infinite;
}

.cleaning-reveal {
  align-content: start;
  animation: cleaning-result-in 560ms cubic-bezier(0.18, 1.2, 0.4, 1) both;
}

.cleaning-reveal::after {
  position: absolute;
  right: 34px;
  bottom: 31px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--prize-accent);
  color: var(--prize-accent);
  content: "得";
  font-family: serif;
  font-size: 23px;
  transform: rotate(-8deg);
  animation: cleaning-seal-in 420ms 350ms ease-out both;
}

.cleaning-prize-coin {
  width: 178px;
  height: 178px;
  margin: 28px 0 18px;
  border-color: var(--prize-accent);
  background: radial-gradient(circle at 37% 31%, #f0cf7e, var(--prize-accent) 60%, #4c3520);
  box-shadow: inset 0 0 0 5px rgba(255, 244, 203, 0.2), 0 0 36px rgba(225, 188, 92, 0.24), 0 20px 44px rgba(0, 0, 0, 0.48);
  animation: cleaning-prize-rise 720ms cubic-bezier(0.2, 1.35, 0.35, 1) both;
}

.cleaning-tier {
  border: 1px solid var(--prize-accent);
  border-radius: 3px;
  padding: 3px 9px;
  color: var(--prize-accent);
  font-size: 12px;
  font-weight: 700;
}

.cleaning-reveal h2 {
  max-width: 100%;
  margin-top: 8px;
  color: var(--prize-accent);
  overflow-wrap: anywhere;
}

.cleaning-reveal p strong {
  color: #fff7dc;
  font-size: 19px;
}

.cleaning-accept {
  min-width: 150px;
  min-height: 42px;
  margin-top: 20px;
  border: 1px solid var(--prize-accent);
  border-radius: 5px;
  color: #17372e;
  background: var(--prize-accent);
  font-weight: 700;
  cursor: pointer;
}

.cleaning-window-level-1 {
  --prize-accent: #65b486;
}

.cleaning-window-level-2 {
  --prize-accent: #b58add;
}

.cleaning-window-level-3 {
  --prize-accent: #e66b62;
}

.collection-window-list .package-section-label {
  display: block;
  min-height: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 0 5px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 700;
}

.coin-name.coin-level-1,
.coin-count.coin-level-1,
.exchange-coin-name.coin-level-1 {
  color: #28704d;
}

.coin-name.coin-level-2,
.coin-count.coin-level-2,
.exchange-coin-name.coin-level-2 {
  color: #72449b;
}

.coin-name.coin-level-3,
.coin-count.coin-level-3,
.exchange-coin-name.coin-level-3 {
  color: #a52d2d;
}

.exchange-coin-name {
  font-weight: 700;
}

.collection-window-list b {
  color: var(--ink);
  font-weight: 700;
}

.tool-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(29, 24, 20, 0.68);
}

.tool-overlay:not([hidden]) {
  animation: overlay-in 180ms ease-out both;
}

.tool-overlay:not([hidden]) .tool-panel {
  animation: tool-panel-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tool-panel {
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(244, 223, 154, 0.72);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(29, 24, 20, 0.42);
}

.album-panel {
  width: min(760px, 100%);
}

.route-panel {
  width: min(680px, 100%);
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  background: var(--jade);
  color: #fff5d6;
}

.tool-header span {
  color: rgba(255, 245, 214, 0.68);
  font-size: 12px;
}

.tool-header h2 {
  margin: 2px 0 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 245, 214, 0.5);
  border-radius: 50%;
  padding: 0;
  color: #fff5d6;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 245, 214, 0.12);
}

.tool-scroll {
  max-height: calc(min(720px, 100vh - 32px) - 91px);
  overflow: auto;
}

.package-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding: 8px 18px;
  color: var(--muted);
  background: rgba(187, 138, 53, 0.08);
  font-size: 12px;
  line-height: 1.4;
}

.package-notice b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 12px;
}

.package-panel .tool-scroll {
  max-height: calc(min(720px, 100vh - 32px) - 130px);
}

.album-summary {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  color: var(--muted);
  background: rgba(46, 94, 77, 0.06);
  font-size: 13px;
}

.album-summary b {
  color: var(--ink);
  font-size: 16px;
}

.album-sets {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  background: rgba(187, 138, 53, 0.05);
  scrollbar-width: thin;
}

.album-set {
  display: grid;
  flex: 0 0 min(230px, 76vw);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(255, 250, 238, 0.72);
}

.album-set > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.album-set strong {
  font-size: 12px;
}

.album-set small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-set em {
  color: var(--red);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.album-set.is-complete {
  border-color: rgba(46, 94, 77, 0.52);
  background: rgba(46, 94, 77, 0.09);
  box-shadow: inset 3px 0 0 var(--jade);
}

.album-set.is-complete em {
  color: var(--jade);
}

.album-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: calc(min(720px, 100vh - 32px) - 205px);
  padding: 12px 18px 18px;
}

.route-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 9px 18px;
  color: var(--muted);
  background: rgba(46, 94, 77, 0.06);
  font-size: 11px;
}

.route-summary b {
  color: var(--ink);
  font-size: 15px;
}

.route-summary small {
  min-width: 0;
  overflow: hidden;
  margin-left: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-list {
  display: grid;
  gap: 8px;
  max-height: calc(min(720px, 100vh - 32px) - 132px);
  padding: 12px 18px 18px;
}

.route-entry {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 250, 238, 0.68);
}

.route-entry.is-selected {
  border-color: rgba(46, 94, 77, 0.56);
  background: rgba(46, 94, 77, 0.08);
  box-shadow: inset 3px 0 0 var(--jade);
}

.route-entry.is-locked {
  opacity: 0.58;
}

.route-marker {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold);
  color: #8c651f;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 17px;
  transform: rotate(-2deg);
}

.route-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.route-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.route-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-action {
  min-width: 72px;
  min-height: 36px;
  border: 1px solid var(--jade);
  border-radius: 6px;
  color: #fff8e8;
  background: var(--jade);
  cursor: pointer;
}

.route-action:disabled {
  border-color: rgba(86, 59, 34, 0.16);
  color: rgba(38, 29, 21, 0.48);
  background: rgba(86, 59, 34, 0.08);
  cursor: default;
}

.album-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 250, 238, 0.64);
  animation: item-rise 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.album-entry:hover {
  transform: translateY(-2px);
  border-color: rgba(187, 138, 53, 0.58);
  box-shadow: 0 8px 18px rgba(35, 22, 12, 0.12);
}

.album-entry.is-collected {
  border-color: rgba(187, 138, 53, 0.54);
  background: rgba(187, 138, 53, 0.09);
}

.album-entry.is-missing .album-coin-info {
  opacity: 0.58;
}

.album-coin-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.album-coin-info small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-action {
  min-width: 64px;
  min-height: 34px;
  border: 1px solid var(--jade);
  border-radius: 6px;
  padding: 5px 9px;
  color: #fff8e8;
  background: var(--jade);
  cursor: pointer;
}

.album-action.compact-action {
  min-width: 56px;
  min-height: 30px;
  padding: 3px 7px;
  font-size: 12px;
}

.album-action.is-collect {
  border-color: #28704d;
  background: #28704d;
}

.album-action.is-collect:hover {
  border-color: #1e573b;
  background: #1e573b;
}

.album-action.is-withdraw {
  border-color: var(--red);
  background: var(--red);
}

.album-action.is-withdraw:hover {
  border-color: #7d241d;
  background: #7d241d;
}

.album-action:disabled {
  border-color: rgba(86, 59, 34, 0.16);
  color: rgba(38, 29, 21, 0.44);
  background: rgba(86, 59, 34, 0.08);
  cursor: not-allowed;
}

.exchange-panel {
  width: min(720px, 100%);
}

.exchange-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 18px;
  color: var(--muted);
  background: rgba(46, 94, 77, 0.06);
  font-size: 12px;
}

.exchange-summary b {
  margin-left: 3px;
  color: var(--ink);
  font-size: 16px;
}

.exchange-list {
  display: grid;
  gap: 8px;
  max-height: calc(min(720px, 100vh - 32px) - 132px);
  padding: 10px 14px 16px;
}

.pawn-list {
  padding: 6px 18px 18px;
}

.collection-window-list,
.journal-window-list {
  padding: 8px 18px 18px;
}

.exchange-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 250, 238, 0.66);
  animation: item-rise 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.exchange-route.is-ready {
  border-color: rgba(46, 94, 77, 0.52);
  background: rgba(46, 94, 77, 0.07);
  box-shadow: inset 3px 0 0 var(--jade);
}

.exchange-route-info {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.exchange-conversion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.exchange-node {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.exchange-mini-coin {
  --mini-coin: #967241;
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 2px solid var(--mini-coin);
  border-radius: 50%;
  background: rgba(150, 114, 65, 0.14);
  box-shadow: inset 0 0 0 2px rgba(255, 250, 238, 0.7);
}

.exchange-mini-coin::after {
  position: absolute;
  inset: 8px;
  border: 1px solid var(--mini-coin);
  background: var(--paper);
  content: "";
}

.exchange-mini-coin.coin-level-1 {
  --mini-coin: #28704d;
  background: rgba(40, 112, 77, 0.12);
}

.exchange-mini-coin.coin-level-2 {
  --mini-coin: #72449b;
  background: rgba(114, 68, 155, 0.12);
}

.exchange-mini-coin.coin-level-3 {
  --mini-coin: #a52d2d;
  background: rgba(165, 45, 45, 0.12);
}

.exchange-node-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.exchange-node-copy small {
  color: var(--muted);
  font-size: 10px;
}

.exchange-node-copy .exchange-coin-name {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.2;
}

.exchange-arrow {
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.exchange-progress {
  display: grid;
  grid-template-columns: minmax(40px, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: 8px;
}

.exchange-progress > span {
  position: relative;
  height: 4px;
  overflow: hidden;
  background: rgba(86, 59, 34, 0.11);
}

.exchange-progress > span::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--exchange-progress);
  background: var(--gold);
  content: "";
  transition: width 260ms ease;
}

.exchange-route.is-ready .exchange-progress > span::after {
  background: var(--jade);
}

.exchange-progress small {
  color: var(--muted);
  font-size: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
}

.exchange-action {
  min-width: 72px;
  min-height: 40px;
  border: 1px solid var(--jade);
  border-radius: 6px;
  padding: 7px 10px;
  color: #fff8e8;
  background: var(--jade);
  cursor: pointer;
  font-weight: 700;
}

.exchange-action:disabled {
  border-color: rgba(86, 59, 34, 0.16);
  color: rgba(38, 29, 21, 0.44);
  background: rgba(86, 59, 34, 0.08);
  cursor: not-allowed;
}

.pawn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding: 12px 0;
}

.pawn-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pawn-info small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pawn-action {
  min-width: 82px;
  min-height: 38px;
  border: 1px solid var(--jade);
  border-radius: 6px;
  padding: 7px 10px;
  color: #fff8e8;
  background: var(--jade);
  cursor: pointer;
}

.pawn-action:disabled {
  border-color: rgba(86, 59, 34, 0.16);
  color: rgba(38, 29, 21, 0.44);
  background: rgba(86, 59, 34, 0.08);
  cursor: not-allowed;
}

.story-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: clamp(14px, 2vw, 22px);
}

.story-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.encounter-heading,
.encounter-context,
.encounter-location,
.difficulty-mark,
.wind-mark {
  display: flex;
  align-items: center;
}

.encounter-heading {
  min-width: 0;
  gap: 10px;
}

.encounter-seal {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(158, 47, 37, 0.82);
  color: var(--red);
  background: rgba(158, 47, 37, 0.06);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 23px;
  font-weight: 700;
  transform: rotate(-2deg);
}

.encounter-heading-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.encounter-heading-copy small,
.encounter-location small,
.difficulty-mark small,
.wind-mark small {
  color: var(--muted);
  font-size: 10px;
}

.encounter-heading-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.encounter-context {
  flex: 0 0 auto;
  gap: 9px;
}

.encounter-location {
  gap: 7px;
  border-right: 1px solid var(--line);
  padding-right: 11px;
}

.encounter-location b {
  max-width: 180px;
  overflow: hidden;
  color: var(--jade);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty-mark {
  --difficulty-color: #8d642d;
  gap: 5px;
  border: 1px solid var(--difficulty-color);
  border-radius: 4px;
  padding: 4px 7px;
  color: var(--difficulty-color);
  background: rgba(255, 250, 238, 0.54);
}

.difficulty-mark b {
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 15px;
}

.difficulty-mark[data-tone="danger"] {
  --difficulty-color: var(--red);
}

.difficulty-mark[data-tone="fortune"] {
  --difficulty-color: var(--jade);
}

.difficulty-mark[data-tone="rare"] {
  --difficulty-color: #72449b;
}

.wind-mark {
  gap: 5px;
  max-width: 132px;
  border-left: 1px solid var(--line);
  padding-left: 9px;
}

.wind-mark b {
  overflow: hidden;
  color: #8c651f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(180px, 1fr) auto;
  gap: 14px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 clamp(18px, 3vw, 34px) clamp(18px, 3vw, 30px);
  background:
    linear-gradient(rgba(122, 85, 45, 0.08) 1px, transparent 1px),
    rgba(255, 250, 238, 0.66);
  background-size: 100% 30px;
  box-shadow: inset 5px 0 0 rgba(158, 47, 37, 0.62);
}

.scene-scroll {
  position: relative;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(22px, 3vw, 34px) 0 14px;
  scrollbar-width: thin;
}

.scene-coin {
  position: absolute;
  top: 50%;
  right: 8%;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 5px double rgba(86, 59, 34, 0.12);
  border-radius: 50%;
  opacity: 0.8;
  transform: translateY(-50%) rotate(9deg);
}

.scene-coin i {
  width: 27px;
  height: 27px;
  border: 3px double rgba(86, 59, 34, 0.14);
}

.scene-text {
  position: relative;
  z-index: 1;
  max-width: min(860px, calc(100% - 72px));
  white-space: pre-line;
  font-size: 21px;
  line-height: 1.85;
}

.scene-text::first-letter {
  color: var(--red);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 34px;
  font-weight: 700;
}

.scene-text.is-entering {
  animation: scene-in 420ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.choice-area {
  min-width: 0;
  border-top: 1px solid rgba(86, 59, 34, 0.18);
  padding-top: 10px;
}

.choice-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.choice-caption i {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(158, 47, 37, 0.42), transparent);
}

.choice-caption small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.choices {
  display: grid;
  gap: 8px;
}

.choices button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(86, 59, 34, 0.2);
  border-left: 3px solid var(--jade);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--ink);
  background: rgba(255, 252, 241, 0.78);
  box-shadow: none;
  text-align: left;
}

.choices button:hover {
  border-color: rgba(158, 47, 37, 0.44);
  border-left-color: var(--red);
  color: var(--ink);
  background: rgba(255, 250, 232, 0.98);
  box-shadow: 0 7px 16px rgba(35, 22, 12, 0.12);
}

.choices button:disabled {
  border-left-color: rgba(86, 59, 34, 0.2);
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.choices button.is-entering {
  animation: choice-in 320ms var(--choice-delay, 100ms) cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.choice-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(158, 47, 37, 0.5);
  color: var(--red);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 16px;
  font-weight: 700;
}

.choice-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.choice-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 700;
}

.choice-risk {
  flex: 0 0 auto;
  border: 1px solid rgba(46, 94, 77, 0.4);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--jade);
  background: rgba(46, 94, 77, 0.06);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
}

.choices button[data-risk="bold"] {
  border-left-color: var(--red);
}

.choices button[data-risk="bold"] .choice-risk {
  border-color: rgba(158, 47, 37, 0.4);
  color: var(--red);
  background: rgba(158, 47, 37, 0.06);
}

.choices button[data-risk="balanced"] .choice-risk {
  border-color: rgba(187, 138, 53, 0.5);
  color: #8c651f;
  background: rgba(187, 138, 53, 0.08);
}

.choice-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.choice-go {
  color: var(--gold);
  font-family: sans-serif;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.result-panel {
  position: relative;
  margin-top: 0;
  border: 1px solid rgba(46, 94, 77, 0.36);
  border-left: 4px solid var(--jade);
  border-radius: 6px;
  padding: 14px;
  background: rgba(255, 252, 241, 0.84);
}

.result-panel:not([hidden]) {
  animation: result-reveal 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--jade);
  font-size: 11px;
  font-weight: 700;
}

.result-panel p {
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.result-delta {
  display: inline-block;
  font-weight: 800;
  animation: delta-pop 340ms 100ms cubic-bezier(0.2, 1.4, 0.35, 1) both;
}

.result-delta.is-positive {
  color: #28704d;
}

.result-delta.is-negative {
  color: var(--red);
}

.result-heading,
.result-status,
.result-reward,
.result-lost-item,
.result-follow-up,
.result-grade {
  display: inline-block;
  font-weight: 800;
  animation: delta-pop 340ms 100ms cubic-bezier(0.2, 1.4, 0.35, 1) both;
}

.result-heading {
  margin-right: 3px;
  border-radius: 2px;
  padding: 0 4px;
  color: #fff8e8;
  background: var(--red);
  font-size: 0.86em;
  line-height: 1.45;
}

.result-status {
  color: #c26718;
}

.result-lost-item {
  color: var(--red);
}

.result-follow-up {
  color: #8c651f;
}

.result-grade {
  margin-right: 3px;
  color: var(--jade);
}

.result-grade[data-grade="mixed"],
.result-grade[data-grade="failure"] {
  color: #8c651f;
}

.result-grade[data-grade="disaster"] {
  color: var(--red);
}

.result-grade[data-grade="fortune"] {
  color: #72449b;
}

.result-reward.coin-level-0 {
  color: var(--ink);
}

.result-reward.coin-level-1 {
  color: #28704d;
}

.result-reward.coin-level-2 {
  color: #72449b;
}

.result-reward.coin-level-3 {
  color: #a52d2d;
}

#continueBtn {
  width: 100%;
  margin-top: 12px;
}

#continueBtn:disabled {
  color: rgba(255, 248, 232, 0.58);
  background: rgba(44, 34, 25, 0.48);
  cursor: not-allowed;
  transform: none;
}

.journal-window-list {
  display: grid;
  gap: 10px;
}

.journal-window-list li {
  border-left: 3px solid rgba(158, 47, 37, 0.45);
  padding: 4px 0 4px 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.journal-window-list strong {
  color: var(--ink);
}

@keyframes rise-in {
  from {
    transform: translateY(-8px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes seal-stamp {
  from {
    opacity: 0;
    transform: scale(1.28) rotate(4deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes panel-settle {
  from {
    transform: translateY(12px);
    box-shadow: 0 30px 70px rgba(35, 22, 12, 0.12);
  }
  to {
    transform: translateY(0);
    box-shadow: 0 20px 48px var(--shadow);
  }
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tool-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes item-rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
    border-color: rgba(187, 138, 53, 0.12);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    border-color: rgba(187, 138, 53, 0.42);
  }
}

@keyframes scene-in {
  from {
    transform: translateY(10px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes choice-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes delta-pop {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes travel-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes travel-die-roll {
  0% {
    transform: translate(-18px, 8px) rotate(-18deg) scale(0.92);
  }
  28% {
    transform: translate(15px, -12px) rotate(105deg) scale(1.04);
  }
  56% {
    transform: translate(-9px, -3px) rotate(205deg) scale(0.96);
  }
  82% {
    transform: translate(13px, 9px) rotate(310deg) scale(1.03);
  }
  100% {
    transform: translate(-18px, 8px) rotate(342deg) scale(0.92);
  }
}

@keyframes travel-die-land {
  from {
    transform: translateY(-18px) rotate(12deg) scale(1.12);
  }
  65% {
    transform: translateY(4px) rotate(-6deg) scale(0.96);
  }
  to {
    transform: translateY(0) rotate(-3deg) scale(1);
  }
}

@keyframes travel-step-in {
  from {
    opacity: 0.35;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cleaning-window-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cleaning-focus-turn {
  from {
    filter: saturate(0.55) brightness(0.72);
    transform: rotateY(-18deg) rotate(-8deg) scale(0.96);
  }
  to {
    filter: saturate(1.08) brightness(1.12);
    transform: rotateY(18deg) rotate(8deg) scale(1.03);
  }
}

@keyframes cleaning-brush-sweep {
  from {
    left: -55%;
    opacity: 0;
  }
  38%,
  62% {
    opacity: 1;
  }
  to {
    left: 120%;
    opacity: 0;
  }
}

@keyframes cleaning-progress-run {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(245%);
  }
}

@keyframes cleaning-ring {
  from {
    opacity: 0.7;
    transform: scale(0.86);
  }
  to {
    opacity: 0;
    transform: scale(1.14);
  }
}

@keyframes cleaning-result-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cleaning-prize-rise {
  from {
    opacity: 0;
    filter: brightness(1.8);
    transform: rotateY(100deg) scale(0.58);
  }
  to {
    opacity: 1;
    filter: brightness(1);
    transform: rotateY(0) scale(1);
  }
}

@keyframes cleaning-seal-in {
  from {
    opacity: 0;
    transform: rotate(8deg) scale(1.5);
  }
  to {
    opacity: 1;
    transform: rotate(-8deg) scale(1);
  }
}

@media (max-width: 420px) {
  .cleaning-overlay {
    padding: 8px;
  }

  .cleaning-panel,
  .cleaning-process,
  .cleaning-reveal {
    min-height: min(470px, calc(100dvh - 16px));
  }

  .cleaning-process,
  .cleaning-reveal {
    padding: 30px 20px 24px;
  }

  .cleaning-focus-coin,
  .cleaning-prize-coin {
    width: 142px;
    height: 142px;
    margin: 20px 0 16px;
  }

  .cleaning-focus-coin i,
  .cleaning-prize-coin i {
    width: 40px;
    height: 40px;
  }

  .cleaning-process h2,
  .cleaning-reveal h2 {
    font-size: 26px;
  }

  .cleaning-reveal::after {
    right: 24px;
    bottom: 24px;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep the illustrated stage above legacy scene rules in the cascade. */
.scene-scroll {
  display: grid;
  grid-template-rows: auto minmax(76px, auto);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(69, 78, 61, 0.18);
  border-radius: 5px;
  padding: 0;
  background: rgba(247, 242, 222, 0.76);
  box-shadow: 0 8px 18px rgba(35, 42, 31, 0.08);
}

.scene-narrative {
  min-height: 76px;
  max-height: 126px;
  padding: 10px 16px 11px;
}

.scene-text {
  max-width: none;
  margin: 0;
  font-size: 17px;
  line-height: 1.62;
}

.scene-text::first-letter {
  font-size: 27px;
}

@media (max-width: 820px) {
  .scene-scroll {
    grid-template-rows: auto minmax(68px, auto);
    padding: 0;
  }

  .scene-narrative {
    min-height: 68px;
    max-height: 112px;
    padding: 8px 11px 9px;
  }

  .scene-text {
    max-width: none;
    font-size: 15px;
    line-height: 1.56;
  }

  .scene-text::first-letter {
    font-size: 24px;
  }
}

/* Illustrated encounter stage */
.scene-scroll {
  display: grid;
  grid-template-rows: auto minmax(76px, auto);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(69, 78, 61, 0.18);
  border-radius: 5px;
  padding: 0;
  background: rgba(247, 242, 222, 0.76);
  box-shadow: 0 8px 18px rgba(35, 42, 31, 0.08);
}

.scene-visual {
  position: relative;
  height: clamp(160px, 28vh, 230px);
  min-height: 160px;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid rgba(68, 78, 61, 0.26);
  background: #bbc1a3;
}

.scene-art {
  position: absolute;
  z-index: -3;
  inset: -8px;
  background-image: url("assets/jianghu-riverside-market.webp");
  background-repeat: no-repeat;
  background-position: 35% 62%;
  background-size: cover;
  filter: saturate(0.88) contrast(1.04);
  transform: scale(1.035);
  animation: scene-camera-drift 18s ease-in-out infinite alternate;
  transition:
    background-position 700ms ease,
    filter 700ms ease;
}

.scene-visual::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 31, 23, 0.08), transparent 45%, rgba(12, 24, 18, 0.34)),
    linear-gradient(90deg, rgba(15, 26, 20, 0.12), transparent 38%, rgba(227, 198, 126, 0.04));
  content: "";
  pointer-events: none;
  transition: background 500ms ease;
}

.scene-visual::after {
  position: absolute;
  z-index: -1;
  right: -12%;
  bottom: -22px;
  left: 26%;
  height: 58px;
  border-top: 1px solid rgba(235, 222, 171, 0.24);
  border-radius: 50%;
  background: repeating-linear-gradient(
    176deg,
    rgba(240, 225, 172, 0.09) 0 1px,
    transparent 1px 8px
  );
  content: "";
  opacity: 0;
  transform: translateX(-2%);
  pointer-events: none;
}

.scene-visual[data-scene="river"] .scene-art {
  background-position: 56% 66%;
  filter: saturate(0.98) contrast(1.03) brightness(1.02);
}

.scene-visual[data-scene="river"]::after {
  opacity: 1;
  animation: scene-water-flow 6s linear infinite;
}

.scene-visual[data-scene="temple"] .scene-art {
  background-position: 86% 28%;
  filter: saturate(0.72) contrast(1.07) sepia(0.08);
}

.scene-visual[data-scene="road"] .scene-art {
  background-position: 45% 88%;
}

.scene-visual[data-scene="collector"] .scene-art {
  background-position: 10% 70%;
  filter: saturate(0.94) contrast(1.08) brightness(1.04);
}

.scene-visual[data-scene="collector"]::before {
  background:
    linear-gradient(180deg, rgba(37, 49, 34, 0.02), transparent 48%, rgba(64, 42, 19, 0.38)),
    radial-gradient(circle at 24% 66%, rgba(221, 176, 78, 0.18), transparent 30%);
}

.scene-visual[data-scene="night"] .scene-art {
  background-position: 72% 46%;
  filter: brightness(0.56) saturate(0.68) hue-rotate(8deg) contrast(1.12);
}

.scene-visual[data-scene="night"]::before {
  background: linear-gradient(180deg, rgba(14, 28, 31, 0.25), rgba(8, 19, 18, 0.46));
}

.scene-visual[data-scene="danger"] .scene-art {
  background-position: 18% 62%;
  filter: brightness(0.72) saturate(0.64) sepia(0.22) contrast(1.18);
}

.scene-visual[data-scene="danger"]::before {
  background:
    linear-gradient(90deg, rgba(90, 25, 20, 0.26), transparent 58%),
    linear-gradient(180deg, transparent, rgba(19, 22, 17, 0.5));
}

.scene-location-label {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 92px);
  overflow: hidden;
  border-left: 3px solid #b64939;
  padding: 5px 10px;
  color: #fff4d5;
  background: rgba(18, 37, 29, 0.74);
  box-shadow: 0 4px 12px rgba(9, 17, 13, 0.2);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-event-emblem {
  position: absolute;
  top: 12px;
  right: 13px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px double rgba(255, 232, 181, 0.82);
  color: #fff2cd;
  background: rgba(153, 49, 39, 0.88);
  box-shadow: 0 6px 18px rgba(35, 18, 13, 0.28);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 23px;
  font-weight: 800;
  transform: rotate(4deg);
}

.scene-birds {
  position: absolute;
  top: 42px;
  left: 44%;
  width: 90px;
  height: 26px;
  opacity: 0.64;
  animation: scene-birds-cross 13s linear infinite;
}

.scene-birds i,
.scene-birds i::after {
  position: absolute;
  width: 8px;
  height: 4px;
  border-top: 1px solid rgba(26, 38, 30, 0.8);
  border-radius: 50%;
  content: "";
  transform: rotate(16deg);
}

.scene-birds i::after {
  left: 7px;
  transform: rotate(-16deg);
}

.scene-birds i:nth-child(2) {
  top: 8px;
  left: 30px;
  transform: scale(0.72);
}

.scene-birds i:nth-child(3) {
  top: 2px;
  left: 58px;
  transform: scale(0.56);
}

.scene-lantern {
  position: absolute;
  bottom: 24px;
  width: 10px;
  height: 15px;
  border: 1px solid rgba(101, 28, 22, 0.72);
  border-radius: 44%;
  background: rgba(213, 72, 48, 0.86);
  box-shadow: 0 0 18px rgba(226, 139, 55, 0.48);
  opacity: 0;
  transform-origin: 50% -14px;
}

.scene-lantern::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 15px;
  background: rgba(39, 34, 23, 0.65);
  content: "";
}

.scene-lantern-one {
  left: 19%;
}

.scene-lantern-two {
  right: 22%;
  bottom: 39px;
  transform: scale(0.72);
}

.scene-visual[data-scene="market"] .scene-lantern,
.scene-visual[data-scene="night"] .scene-lantern,
.scene-visual[data-wind="busy_market"] .scene-lantern {
  opacity: 0.86;
  animation: scene-lantern-sway 3.2s ease-in-out infinite alternate;
}

.scene-mist {
  position: absolute;
  right: -12%;
  bottom: 18%;
  width: 58%;
  height: 28px;
  border-radius: 50%;
  background: rgba(240, 235, 208, 0.18);
  filter: blur(8px);
  opacity: 0;
  transform: translateX(0);
}

.scene-mist-two {
  right: 20%;
  bottom: 34%;
  width: 42%;
  transform: scale(0.7);
}

.scene-visual[data-wind="low_river"] .scene-mist,
.scene-visual[data-scene="river"] .scene-mist {
  opacity: 1;
  animation: scene-mist-drift 9s ease-in-out infinite alternate;
}

.scene-visual[data-wind="false_coin_wave"]::before {
  box-shadow: inset 0 0 70px rgba(104, 27, 23, 0.2);
}

.scene-narrative {
  position: relative;
  z-index: 3;
  display: grid;
  align-items: center;
  min-height: 76px;
  max-height: 126px;
  overflow-y: auto;
  border-top: 3px double rgba(150, 107, 55, 0.18);
  padding: 10px 16px 11px;
  background:
    linear-gradient(90deg, rgba(158, 53, 43, 0.05), transparent 20%),
    rgba(255, 252, 238, 0.94);
  scrollbar-width: thin;
}

.scene-text {
  max-width: none;
  margin: 0;
  color: #202820;
  font-size: 17px;
  line-height: 1.62;
  text-shadow: 0 1px rgba(255, 255, 255, 0.72);
}

.scene-text::first-letter {
  font-size: 27px;
}

.scene-visual.is-entering {
  animation: scene-stage-open 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.scene-visual.is-entering .scene-location-label {
  animation: scene-label-in 420ms 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.scene-visual.is-entering .scene-event-emblem {
  animation: scene-emblem-stamp 420ms 280ms cubic-bezier(0.18, 1.4, 0.35, 1) both;
}

.scene-visual.is-outcome-positive .scene-art {
  animation: scene-positive-glow 780ms ease-out, scene-camera-drift 18s 780ms ease-in-out infinite alternate;
}

.scene-visual.is-outcome-negative .scene-art {
  animation: scene-negative-pulse 620ms ease-out, scene-camera-drift 18s 620ms ease-in-out infinite alternate;
}

.story-card.has-result .scene-visual {
  height: clamp(124px, 20vh, 165px);
  min-height: 124px;
}

.story-card.has-result .scene-narrative {
  max-height: 92px;
}

@keyframes scene-camera-drift {
  from { transform: scale(1.035) translateX(-0.6%); }
  to { transform: scale(1.075) translateX(0.8%); }
}

@keyframes scene-water-flow {
  from { transform: translateX(-3%); }
  to { transform: translateX(4%); }
}

@keyframes scene-birds-cross {
  from { transform: translateX(-42px) translateY(4px); }
  to { transform: translateX(68px) translateY(-8px); }
}

@keyframes scene-lantern-sway {
  from { transform: rotate(-4deg); }
  to { transform: rotate(5deg); }
}

@keyframes scene-mist-drift {
  from { transform: translateX(-5%) scaleX(0.92); }
  to { transform: translateX(6%) scaleX(1.08); }
}

@keyframes scene-stage-open {
  from {
    clip-path: inset(0 50% 0 50%);
    filter: saturate(0.6);
  }
  to {
    clip-path: inset(0 0 0 0);
    filter: saturate(1);
  }
}

@keyframes scene-label-in {
  from { transform: translateX(-16px); }
  to { transform: translateX(0); }
}

@keyframes scene-emblem-stamp {
  from {
    opacity: 0;
    transform: rotate(12deg) scale(1.5);
  }
  to {
    opacity: 1;
    transform: rotate(4deg) scale(1);
  }
}

@keyframes scene-positive-glow {
  0% { filter: brightness(1) saturate(0.9); }
  48% { filter: brightness(1.22) saturate(1.16); }
  100% { filter: brightness(1) saturate(0.9); }
}

@keyframes scene-negative-pulse {
  0% { filter: brightness(1) saturate(0.9); }
  45% { filter: brightness(0.62) saturate(0.65) sepia(0.24); }
  100% { filter: brightness(1) saturate(0.9); }
}

@media (max-width: 820px) {
  .scene-scroll {
    grid-template-rows: auto minmax(68px, auto);
    padding: 0;
  }

  .scene-visual {
    height: clamp(142px, 25vh, 190px);
    min-height: 142px;
  }

  .scene-narrative {
    min-height: 68px;
    max-height: 112px;
    padding: 8px 11px 9px;
  }

  .scene-text {
    max-width: none;
    font-size: 15px;
    line-height: 1.56;
  }

  .scene-text::first-letter {
    font-size: 24px;
  }

  .scene-location-label {
    top: 9px;
    left: 9px;
    padding: 4px 8px;
    font-size: 13px;
  }

  .scene-event-emblem {
    top: 9px;
    right: 9px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .story-card.has-result .scene-visual {
    height: 116px;
    min-height: 116px;
  }
}

@media (max-width: 420px) {
  .scene-visual {
    height: 148px;
    min-height: 148px;
  }

  .scene-narrative {
    max-height: 108px;
  }

  .scene-birds {
    left: 36%;
  }

  .story-card.has-result .scene-visual {
    height: 108px;
    min-height: 108px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-visual,
  .scene-art,
  .scene-mist,
  .scene-birds,
  .scene-lantern,
  .scene-location-label,
  .scene-event-emblem {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Collector commissions */
#commissionOpenBtn {
  position: relative;
}

#commissionOpenBtn[data-ready="true"]::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(255, 241, 204, 0.8);
  border-radius: 50%;
  background: #c84235;
  box-shadow: 0 0 8px rgba(218, 72, 57, 0.58);
  content: "";
}

.commission-panel {
  width: min(680px, 100%);
}

.commission-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid rgba(61, 83, 70, 0.2);
  background: rgba(39, 75, 59, 0.05);
}

.commission-summary > span {
  padding: 10px 12px 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.commission-summary > span + span {
  border-left: 1px solid rgba(61, 83, 70, 0.14);
}

.commission-summary b {
  color: var(--accent);
  font-size: 16px;
}

.commission-summary small {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(61, 83, 70, 0.1);
  padding: 7px 12px;
  color: #6a7c70;
  font-size: 11px;
  text-align: center;
}

.commission-list {
  display: grid;
  max-height: min(610px, calc(100dvh - 170px));
  gap: 8px;
  padding: 12px;
}

.commission-entry {
  position: relative;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(64, 84, 70, 0.2);
  border-left: 4px solid #98734a;
  border-radius: 6px;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(159, 113, 61, 0.05), transparent 45%),
    rgba(255, 253, 245, 0.62);
  box-shadow: 0 5px 16px rgba(42, 38, 27, 0.06);
}

.commission-entry.is-ready {
  border-left-color: #2f7652;
  background:
    linear-gradient(90deg, rgba(42, 116, 78, 0.08), transparent 48%),
    rgba(255, 253, 245, 0.7);
}

.commission-entry > header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.commission-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px double rgba(158, 53, 42, 0.72);
  color: #9f3b31;
  background: rgba(159, 53, 42, 0.05);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 20px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.commission-identity {
  display: grid;
  gap: 2px;
}

.commission-identity small,
.commission-copy small {
  color: #748176;
  font-size: 10px;
}

.commission-identity strong,
.commission-copy strong {
  color: var(--ink);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 18px;
}

.commission-entry > header > em {
  border: 1px solid rgba(152, 115, 74, 0.38);
  border-radius: 3px;
  padding: 3px 7px;
  color: #876443;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.commission-entry.is-ready > header > em {
  border-color: rgba(47, 118, 82, 0.42);
  color: #2f7652;
  background: rgba(47, 118, 82, 0.07);
}

.commission-request {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #655f52;
  font-size: 13px;
}

.commission-request > strong {
  flex: 0 0 auto;
  color: #8f382f;
  font-size: 14px;
}

.commission-progress {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(64, 83, 70, 0.12);
}

.commission-progress i {
  display: block;
  width: var(--commission-progress);
  height: 100%;
  border-radius: inherit;
  background: #a37a49;
  transition: width 280ms ease;
}

.commission-entry.is-ready .commission-progress i {
  background: #3a805c;
}

.commission-entry > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.commission-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.commission-rewards b {
  border: 1px solid rgba(149, 110, 60, 0.2);
  border-radius: 3px;
  padding: 3px 6px;
  color: #7e5d35;
  background: rgba(157, 112, 55, 0.05);
  font-size: 10px;
}

.commission-submit {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 34px;
  border: 1px solid #2f7652;
  border-radius: 4px;
  padding: 0 12px;
  color: #fff9e8;
  background: #2f684d;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.commission-submit:disabled {
  border-color: rgba(83, 91, 83, 0.22);
  color: #8d918b;
  background: rgba(83, 91, 83, 0.08);
}

.commission-entry.is-waiting {
  min-height: 76px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  border-left-color: rgba(80, 99, 87, 0.32);
  background: rgba(246, 244, 234, 0.68);
}

.commission-copy {
  display: grid;
  gap: 2px;
}

.commission-copy > span {
  color: var(--muted);
  font-size: 11px;
}

.commission-wait-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(75, 100, 83, 0.28);
  border-radius: 50%;
  color: #687a6e;
  font-family: "Kaiti SC", "STKaiti", serif;
}

.tool-overlay:not([hidden]) .commission-entry {
  animation: commission-entry-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tool-overlay:not([hidden]) .commission-entry:nth-child(2) {
  animation-delay: 55ms;
}

.tool-overlay:not([hidden]) .commission-entry:nth-child(3) {
  animation-delay: 110ms;
}

@keyframes commission-entry-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .top-actions {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .commission-list {
    max-height: calc(100dvh - 151px);
    gap: 7px;
    padding: 8px;
  }

  .commission-summary > span {
    padding: 8px 5px 5px;
    font-size: 10px;
  }

  .commission-summary b {
    font-size: 14px;
  }

  .commission-entry {
    gap: 7px;
    padding: 9px;
  }

  .commission-entry > header {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .commission-avatar {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .commission-identity strong,
  .commission-copy strong {
    font-size: 16px;
  }

  .commission-entry > footer {
    align-items: stretch;
  }

  .commission-rewards {
    align-content: center;
  }

  .commission-submit {
    min-width: 88px;
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commission-entry,
  .commission-progress i {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Journey, encounter and reward cinematics */
.travel-panel {
  min-height: min(590px, calc(100dvh - 24px));
  padding-top: 26px;
}

.travel-panel h2 {
  margin-bottom: 12px;
}

.travel-die {
  width: 104px;
  height: 104px;
  padding: 13px;
}

.travel-die i {
  width: 13px;
  height: 13px;
}

.travel-status {
  margin-top: 13px;
}

.travel-landscape {
  --travel-stop: 10%;
  position: relative;
  width: min(382px, 94%);
  height: 112px;
  margin-top: 5px;
  overflow: hidden;
  border-block: 1px solid rgba(226, 199, 128, 0.22);
  background:
    linear-gradient(180deg, rgba(233, 217, 167, 0.08), transparent 58%),
    linear-gradient(90deg, transparent, rgba(238, 216, 153, 0.05), transparent);
}

.travel-sun {
  position: absolute;
  top: 13px;
  right: 32px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(194, 81, 61, 0.78);
  border-radius: 50%;
  background: rgba(162, 52, 39, 0.28);
  box-shadow: 0 0 18px rgba(192, 82, 57, 0.16);
}

.travel-mountain {
  position: absolute;
  right: -4%;
  bottom: 24px;
  left: -4%;
  transform-origin: 50% 100%;
}

.travel-mountain-back {
  height: 70px;
  background: rgba(148, 163, 132, 0.18);
  clip-path: polygon(0 88%, 12% 54%, 23% 74%, 37% 24%, 48% 69%, 61% 38%, 73% 71%, 87% 30%, 100% 78%, 100% 100%, 0 100%);
  animation: journey-mountain-drift 6s ease-in-out infinite alternate;
}

.travel-mountain-front {
  height: 58px;
  background: rgba(10, 27, 22, 0.64);
  clip-path: polygon(0 80%, 14% 45%, 28% 78%, 44% 34%, 58% 76%, 72% 51%, 85% 73%, 100% 44%, 100% 100%, 0 100%);
}

.travel-road {
  position: absolute;
  right: 5%;
  bottom: 17px;
  left: 5%;
  height: 32px;
  border-top: 2px solid rgba(221, 194, 122, 0.48);
  border-radius: 50%;
  transform: rotate(-2deg);
}

.travel-road::after {
  position: absolute;
  top: 5px;
  right: 0;
  left: 0;
  border-top: 1px dashed rgba(235, 214, 158, 0.2);
  border-radius: 50%;
  content: "";
}

.travel-walker {
  position: absolute;
  z-index: 3;
  bottom: 28px;
  left: 10%;
  width: 16px;
  height: 27px;
  border-radius: 9px 9px 3px 3px;
  background: #a33e31;
  box-shadow: 0 6px 10px rgba(4, 13, 10, 0.42);
  transition: left 780ms cubic-bezier(0.36, 0.06, 0.24, 1);
}

.travel-walker::before {
  position: absolute;
  top: -8px;
  left: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d7b46d;
  content: "";
}

.travel-walker::after {
  position: absolute;
  top: -10px;
  left: 0;
  width: 17px;
  height: 4px;
  border-radius: 50%;
  background: #1c2d26;
  content: "";
}

.travel-walker i {
  position: absolute;
  top: 9px;
  right: -6px;
  width: 11px;
  height: 2px;
  background: #d7b46d;
  transform: rotate(-35deg);
}

.travel-landscape.is-moving .travel-walker {
  left: var(--travel-stop);
  animation: journey-walker-step 180ms ease-in-out 4 alternate;
}

.travel-landscape.is-arrived .travel-walker {
  box-shadow: 0 0 0 5px rgba(209, 174, 94, 0.12), 0 6px 12px rgba(4, 13, 10, 0.45);
}

.travel-landscape > b {
  position: absolute;
  bottom: 7px;
  color: rgba(230, 207, 150, 0.48);
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 11px;
  font-weight: 400;
}

.travel-landscape > b:first-of-type {
  left: 5%;
}

.travel-landscape > b:last-of-type {
  right: 5%;
}

.travel-route {
  margin: 12px 0 10px;
}

.encounter-reveal,
.reward-reveal {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    rgba(10, 20, 16, 0.92);
  background-size: 22px 22px, auto;
}

.encounter-reveal-panel {
  position: relative;
  display: grid;
  width: min(560px, 100%);
  min-height: 300px;
  place-items: center;
  align-content: center;
  overflow: hidden;
  border-block: 1px solid rgba(226, 195, 117, 0.4);
  color: #f5e7bd;
  background:
    radial-gradient(circle at 50% 50%, rgba(84, 113, 88, 0.2), transparent 58%),
    linear-gradient(90deg, transparent, rgba(230, 208, 150, 0.05), transparent);
}

.encounter-reveal-panel::before,
.encounter-reveal-panel::after {
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 195, 123, 0.48));
  content: "";
}

.encounter-reveal-panel::before {
  left: 0;
}

.encounter-reveal-panel::after {
  right: 0;
  transform: rotate(180deg);
}

.encounter-reveal-panel > button {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 52px;
  border: 1px solid rgba(231, 207, 146, 0.35);
  border-radius: 4px;
  padding: 6px 10px;
  color: rgba(246, 231, 189, 0.72);
  background: rgba(13, 34, 26, 0.7);
  font: inherit;
}

.encounter-reveal-panel > span {
  color: rgba(232, 207, 145, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.encounter-reveal-panel > strong {
  margin-top: 8px;
  color: #fff4d4;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 40px;
  font-weight: 700;
}

.encounter-reveal-panel > i {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 22px 0 10px;
  place-items: center;
  border: 3px double rgba(205, 74, 54, 0.9);
  color: #e05c48;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 34px;
  font-style: normal;
  font-weight: 800;
  transform: rotate(-6deg);
}

.encounter-reveal-panel > small {
  color: rgba(241, 220, 164, 0.72);
  font-size: 13px;
}

.encounter-reveal.is-active {
  animation: cinematic-curtain-in 240ms ease-out both;
}

.encounter-reveal.is-active .encounter-reveal-panel > strong {
  animation: location-brush-in 520ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.encounter-reveal.is-active .encounter-reveal-panel > i {
  animation: cinematic-seal-stamp 420ms 340ms cubic-bezier(0.18, 1.45, 0.35, 1) both;
}

.encounter-reveal.is-active .encounter-reveal-panel > small {
  animation: cinematic-caption-in 300ms 530ms ease-out both;
}

.encounter-reveal.is-leaving,
.reward-reveal.is-leaving {
  animation: cinematic-curtain-out 220ms ease-in both;
}

.reward-reveal {
  z-index: 62;
  background:
    radial-gradient(circle at 50% 44%, rgba(182, 137, 56, 0.16), transparent 32%),
    rgba(8, 16, 13, 0.94);
}

.reward-reveal-panel {
  --reward-accent: #b68a48;
  --reward-glow: rgba(202, 160, 82, 0.36);
  position: relative;
  display: grid;
  width: min(440px, 100%);
  min-height: 460px;
  place-items: center;
  align-content: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--reward-accent) 65%, transparent);
  border-radius: 8px;
  color: #fff4d6;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    #17352b;
  background-size: 20px 20px, 20px 20px, auto;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.62), inset 0 0 70px rgba(0, 0, 0, 0.22);
}

.reward-reveal-panel[data-level="1"] {
  --reward-accent: #55a975;
  --reward-glow: rgba(74, 170, 108, 0.38);
}

.reward-reveal-panel[data-level="2"] {
  --reward-accent: #a16fd0;
  --reward-glow: rgba(157, 94, 208, 0.42);
}

.reward-reveal-panel[data-level="3"] {
  --reward-accent: #d64d47;
  --reward-glow: rgba(221, 64, 57, 0.48);
}

.reward-reveal-panel::before,
.reward-reveal-panel::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 270px;
  height: 270px;
  border: 1px solid color-mix(in srgb, var(--reward-accent) 46%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.reward-reveal-panel::before {
  transform: translate(-50%, -58%);
}

.reward-reveal-panel::after {
  width: 230px;
  height: 230px;
  border-style: dashed;
  transform: translate(-50%, -68%) rotate(18deg);
}

.reward-reveal-kicker {
  position: relative;
  z-index: 2;
  color: var(--reward-accent);
  font-size: 12px;
  font-weight: 800;
}

.reward-reveal-coin {
  position: relative;
  z-index: 2;
  display: grid;
  width: 154px;
  height: 154px;
  margin: 18px 0 16px;
  place-items: center;
  border: 7px double color-mix(in srgb, var(--reward-accent) 84%, #3a2818);
  border-radius: 50%;
  color: #39271a;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 244, 185, 0.44), transparent 18%),
    var(--reward-accent);
  box-shadow:
    inset 9px 9px 15px rgba(255, 244, 184, 0.18),
    inset -11px -12px 18px rgba(35, 20, 14, 0.35),
    0 0 44px var(--reward-glow),
    0 24px 36px rgba(0, 0, 0, 0.45);
}

.reward-reveal-coin i {
  position: absolute;
  width: 43px;
  height: 43px;
  border: 5px double color-mix(in srgb, var(--reward-accent) 50%, #38251a);
  background: #17352b;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.52);
}

.reward-reveal-panel > small,
.reward-reveal-panel > strong,
.reward-reveal-panel > p,
.reward-reveal-panel > button {
  position: relative;
  z-index: 2;
}

.reward-reveal-panel > small {
  color: var(--reward-accent);
  font-size: 12px;
  font-weight: 800;
}

.reward-reveal-panel > strong {
  max-width: 90%;
  margin-top: 6px;
  color: #fff4d5;
  font-family: "Kaiti SC", "STKaiti", serif;
  font-size: 29px;
  text-align: center;
}

.reward-reveal-panel > p {
  margin: 7px 0 18px;
  color: rgba(250, 234, 194, 0.68);
  font-size: 13px;
}

.reward-reveal-panel > button {
  min-width: 126px;
  border: 1px solid var(--reward-accent);
  border-radius: 4px;
  padding: 10px 24px;
  color: #fff5d8;
  background: color-mix(in srgb, var(--reward-accent) 24%, #18372c);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.reward-reveal.is-active {
  animation: cinematic-curtain-in 220ms ease-out both;
}

.reward-reveal.is-active .reward-reveal-panel {
  animation: reward-panel-rise 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reward-reveal.is-active .reward-reveal-panel::before {
  animation: reward-ring-open 700ms 100ms ease-out both;
}

.reward-reveal.is-active .reward-reveal-panel::after {
  animation: reward-ring-turn 7s linear infinite;
}

.reward-reveal.is-active .reward-reveal-coin {
  animation: reward-coin-reveal 760ms 120ms cubic-bezier(0.16, 1.35, 0.32, 1) both;
}

.reward-reveal.is-active .reward-reveal-panel > strong,
.reward-reveal.is-active .reward-reveal-panel > p,
.reward-reveal.is-active .reward-reveal-panel > button {
  animation: cinematic-caption-in 330ms 610ms ease-out both;
}

@keyframes journey-mountain-drift {
  from { transform: translateX(-5px) scaleY(0.98); }
  to { transform: translateX(5px) scaleY(1.02); }
}

@keyframes journey-walker-step {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-3px) rotate(2deg); }
}

@keyframes cinematic-curtain-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cinematic-curtain-out {
  to { opacity: 0; }
}

@keyframes location-brush-in {
  from {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(9px) scaleX(0.82);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scaleX(1);
  }
}

@keyframes cinematic-seal-stamp {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: rotate(8deg) scale(1.75);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: rotate(-6deg) scale(1);
  }
}

@keyframes cinematic-caption-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reward-panel-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes reward-ring-open {
  from {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.55);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -58%) scale(1);
  }
}

@keyframes reward-ring-turn {
  from { transform: translate(-50%, -68%) rotate(18deg); }
  to { transform: translate(-50%, -68%) rotate(378deg); }
}

@keyframes reward-coin-reveal {
  0% {
    opacity: 0;
    filter: brightness(0.45) saturate(0.4);
    transform: rotateY(105deg) scale(0.58);
  }
  62% {
    opacity: 1;
    filter: brightness(1.32) saturate(1.12);
    transform: rotateY(-10deg) scale(1.08);
  }
  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
    transform: rotateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .travel-panel {
    min-height: calc(100dvh - 16px);
    padding: 18px 16px 16px;
  }

  .travel-panel h2 {
    margin: 2px 0 8px;
    font-size: 23px;
  }

  .travel-die {
    width: 88px;
    height: 88px;
    border-radius: 13px;
    padding: 11px;
  }

  .travel-die i {
    width: 11px;
    height: 11px;
  }

  .travel-status {
    min-height: 19px;
    margin-top: 9px;
    font-size: 12px;
  }

  .travel-landscape {
    height: 104px;
  }

  .travel-route {
    margin: 9px 0 8px;
  }

  .travel-distance {
    font-size: 20px;
  }

  .encounter-reveal-panel {
    min-height: 280px;
  }

  .encounter-reveal-panel > strong {
    font-size: 32px;
  }

  .reward-reveal {
    padding: 9px;
  }

  .reward-reveal-panel {
    min-height: min(500px, calc(100dvh - 18px));
  }

  .reward-reveal-coin {
    width: 138px;
    height: 138px;
  }

  .reward-reveal-panel > strong {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .travel-mountain-back,
  .travel-walker,
  .encounter-reveal *,
  .reward-reveal * {
    animation: none !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 980px) {
  .home-overview {
    grid-template-columns: 1fr;
  }

  .home-statuses {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 6px 0 0;
  }

  .home-statuses strong,
  .home-statuses ul,
  .home-statuses li {
    display: inline;
  }

  .home-statuses strong {
    margin-right: 5px;
  }

  .home-statuses li {
    margin-right: 4px;
  }
}

@media (max-width: 820px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .game-shell {
    height: 100dvh;
    min-height: 0;
    gap: 8px;
    padding: 8px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .seal {
    display: none;
  }

  h1 {
    font-size: 24px;
  }

  .title-lockup p {
    max-width: 98px;
    overflow: hidden;
    margin-top: 3px;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .top-actions button {
    min-height: 34px;
    padding: 0 2px;
    font-size: 11px;
  }

  .layout {
    position: relative;
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  .story-panel {
    width: 100%;
    height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    padding: 10px;
  }

  .home-overview {
    grid-template-columns: 1fr;
    gap: 5px 8px;
    margin-bottom: 7px;
    padding: 0 2px 7px;
  }

  .home-stats {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
  }

  .home-statuses {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 7px;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .progression-summary {
    grid-column: 1;
    grid-row: 3;
    gap: 5px;
    padding-top: 5px;
  }

  .progression-summary > span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px;
    border-right: 1px solid var(--line);
    padding-right: 5px;
  }

  .progression-summary > span:last-child {
    border-right: 0;
  }

  .progression-summary small {
    font-size: 8px;
  }

  .progression-summary b {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  .progression-summary em {
    display: none;
  }

  .home-statuses::-webkit-scrollbar {
    display: none;
  }

  .home-statuses small {
    font-size: 9px;
  }

  .home-stats .stat-row {
    gap: 2px 6px;
    font-size: 12px;
  }

  .home-stats .stat-rank {
    font-size: 10px;
  }

  .home-stats .stat-row b {
    min-width: 30px;
    font-size: 12px;
  }

  .story-meta {
    gap: 8px;
    margin-bottom: 6px;
  }

  .encounter-seal {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .encounter-heading {
    gap: 7px;
  }

  .encounter-heading-copy strong {
    font-size: 16px;
  }

  .encounter-context {
    gap: 5px;
  }

  .encounter-location {
    gap: 4px;
    padding-right: 6px;
  }

  .encounter-location b {
    max-width: 84px;
    font-size: 11px;
  }

  .difficulty-mark {
    gap: 3px;
    padding: 3px 5px;
  }

  .difficulty-mark b {
    font-size: 13px;
  }

  .wind-mark {
    max-width: 82px;
    gap: 3px;
    padding-left: 5px;
  }

  .wind-mark small {
    display: none;
  }

  .wind-mark b {
    font-size: 10px;
  }

  .story-card {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    padding: 0 10px 10px;
  }

  .scene-scroll {
    padding: 14px 2px 8px;
  }

  .scene-coin {
    top: 50%;
    right: 10%;
    width: 92px;
    height: 92px;
    border-width: 3px;
  }

  .scene-coin i {
    width: 18px;
    height: 18px;
    border-width: 2px;
  }

  .scene-text {
    max-width: calc(100% - 34px);
    min-height: 0;
    font-size: 16px;
    line-height: 1.65;
  }

  .scene-text::first-letter {
    font-size: 26px;
  }

  .choice-area {
    padding-top: 7px;
  }

  .choice-caption {
    margin-bottom: 5px;
  }

  .choices {
    gap: 6px;
  }

  .choices button {
    grid-template-columns: 28px minmax(0, 1fr) 14px;
    gap: 7px;
    min-height: 50px;
    padding: 7px 8px;
  }

  .choice-index {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .choice-title {
    font-size: 14px;
  }

  .choice-risk {
    font-size: 8px;
  }

  .choice-hint {
    font-size: 11px;
  }

  .choice-go {
    font-size: 20px;
  }

  .result-panel:not([hidden]) {
    display: grid;
    grid-template-rows: auto auto;
    max-height: none;
    min-height: 0;
    margin-top: 0;
    padding: 10px;
  }

  #resultText {
    max-height: 160px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.45;
  }

  #continueBtn {
    min-height: 38px;
    margin-top: 8px;
  }

  .album-summary {
    padding: 8px 10px;
    font-size: 11px;
  }

  .album-summary b {
    font-size: 14px;
  }

  .album-list {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 209px);
    padding: 8px;
  }

  .album-sets {
    padding: 7px 8px;
  }

  .album-set {
    flex-basis: min(216px, 78vw);
  }

  .route-summary {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 5px 10px;
    padding: 7px 10px;
  }

  .route-summary small {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .route-list {
    max-height: calc(100dvh - 153px);
    padding: 8px;
  }

  .route-entry {
    grid-template-columns: 32px minmax(0, 1fr) 62px;
    min-height: 62px;
    gap: 7px;
    padding: 7px;
  }

  .route-marker {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .route-action {
    min-width: 62px;
    width: 62px;
    min-height: 34px;
    font-size: 12px;
  }

  .exchange-list.tool-scroll {
    max-height: calc(100dvh - 142px);
  }

  .exchange-summary {
    padding: 7px 10px;
  }

  .exchange-route {
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 8px;
    min-height: 78px;
    padding: 9px;
  }

  .exchange-action {
    min-width: 68px;
    width: 68px;
  }

  .exchange-progress {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .exchange-progress small {
    text-align: left;
  }

  .pawn-row {
    grid-template-columns: 1fr;
  }

  .pawn-action {
    width: 100%;
  }

  .tool-overlay {
    z-index: 30;
    padding: 8px;
  }

  .travel-overlay {
    z-index: 55;
  }

  .travel-panel {
    width: min(390px, 100%);
    min-height: min(500px, calc(100dvh - 16px));
    padding: 28px 20px 24px;
  }

  .travel-panel h2 {
    margin-bottom: 14px;
    font-size: 26px;
  }

  .travel-die {
    width: 104px;
    height: 104px;
    padding: 13px;
  }

  .travel-die i {
    width: 13px;
    height: 13px;
  }

  .travel-status {
    margin-top: 16px;
  }

  .travel-route {
    margin: 18px 0 14px;
  }

  .tool-panel {
    max-height: calc(100dvh - 16px);
  }

  .tool-scroll {
    max-height: calc(100dvh - 107px);
  }

  .package-notice {
    padding: 7px 10px;
    font-size: 11px;
  }

  .package-panel .tool-scroll {
    max-height: calc(100dvh - 145px);
  }

  .album-list.tool-scroll {
    max-height: calc(100dvh - 209px);
  }
}

/* Premium visual refinement */
:root {
  --ink: #1e2924;
  --muted: #696256;
  --paper: #f4f0df;
  --paper-deep: #d9cca4;
  --red: #9f352b;
  --jade: #244f43;
  --gold: #b58b38;
  --coal: #17211d;
  --line: rgba(64, 70, 58, 0.2);
  --shadow: rgba(19, 28, 24, 0.3);
  --paper-glow: rgba(255, 253, 239, 0.82);
}

html {
  background: #26362f;
}

body {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(rgba(22, 33, 28, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 33, 28, 0.1) 1px, transparent 1px),
    linear-gradient(145deg, #d8c895 0%, #75806a 47%, #26362f 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 235, 178, 0.3), transparent 24%),
    radial-gradient(circle at 88% 82%, rgba(9, 29, 23, 0.38), transparent 30%);
  content: "";
  pointer-events: none;
}

button:focus-visible {
  outline: 2px solid #e0bd68;
  outline-offset: 2px;
}

.game-shell {
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.topbar {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(225, 193, 112, 0.52);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff4cf;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(115deg, #17251f 0%, #285044 62%, #1d2d27 100%);
  background-size: 26px 100%, auto;
  box-shadow:
    0 18px 38px rgba(16, 25, 21, 0.3),
    inset 0 1px 0 rgba(255, 247, 213, 0.1);
}

.topbar::after {
  position: absolute;
  top: 50%;
  right: 30%;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(226, 194, 111, 0.1);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 12px rgba(226, 194, 111, 0.025),
    inset 0 0 0 38px rgba(226, 194, 111, 0.02);
  content: "";
  pointer-events: none;
  transform: translateY(-50%);
}

.title-lockup {
  position: relative;
  z-index: 1;
}

.seal {
  width: 50px;
  border-color: #ead08b;
  color: #ffeebd;
  background: #96382f;
  box-shadow:
    0 8px 20px rgba(6, 14, 11, 0.32),
    inset 0 0 0 2px rgba(91, 22, 19, 0.24);
}

h1 {
  color: #fff3cc;
  font-size: 42px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.title-lockup p {
  color: rgba(255, 239, 197, 0.7);
}

.top-actions {
  position: relative;
  z-index: 1;
}

.top-actions button {
  min-width: 70px;
  border-color: rgba(235, 211, 151, 0.28);
  color: #f8edce;
  background: rgba(8, 22, 17, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 247, 217, 0.06);
  font-weight: 700;
}

.top-actions button:hover {
  border-color: rgba(243, 211, 126, 0.78);
  color: #fff7dd;
  background: #84342d;
  box-shadow:
    0 7px 16px rgba(8, 20, 15, 0.28),
    inset 0 1px 0 rgba(255, 238, 195, 0.12);
}

.story-panel {
  position: relative;
  border-color: rgba(222, 194, 124, 0.68);
  background:
    linear-gradient(rgba(47, 59, 50, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 59, 50, 0.02) 1px, transparent 1px),
    rgba(247, 242, 222, 0.96);
  background-size: 24px 24px, 24px 24px, auto;
  box-shadow:
    0 24px 58px rgba(15, 24, 20, 0.36),
    inset 0 0 0 1px rgba(255, 254, 239, 0.74);
}

.story-panel::before {
  position: absolute;
  z-index: 0;
  inset: 7px;
  border: 1px solid rgba(117, 91, 45, 0.11);
  border-radius: 5px;
  content: "";
  pointer-events: none;
}

.story-panel > * {
  position: relative;
  z-index: 1;
}

.home-overview {
  gap: 10px 16px;
  margin: -2px -2px 11px;
  border-bottom-color: rgba(54, 76, 64, 0.24);
  padding: 2px 4px 10px;
}

.home-stats {
  gap: 7px 20px;
}

.stat-row {
  grid-template-columns: 3px auto auto minmax(0, 1fr);
  gap: 5px 7px;
}

.stat-row::before {
  width: 3px;
  height: 16px;
  background: linear-gradient(var(--red), #c19442);
  content: "";
}

.stat-label {
  color: #777063;
  font-size: 12px;
}

.stat-row b {
  min-width: 34px;
  color: #17251f;
  font-size: 15px;
}

.stat-rank {
  color: #2d6554;
}

.home-statuses {
  border-left-color: rgba(54, 76, 64, 0.24);
}

.home-statuses strong {
  color: #31584d;
}

.home-statuses li {
  border-color: rgba(159, 53, 43, 0.26);
  color: #84352e;
  background: rgba(159, 53, 43, 0.055);
}

.progression-summary {
  gap: 0;
  border-top-color: rgba(54, 76, 64, 0.2);
  padding-top: 7px;
  background: linear-gradient(90deg, rgba(36, 79, 67, 0.04), transparent);
}

.progression-summary > span {
  border-left: 2px solid rgba(181, 139, 56, 0.42);
  padding: 2px 12px;
}

.progression-summary small {
  color: #807767;
}

.progression-summary b {
  color: #265b4b;
}

.story-meta {
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(54, 76, 64, 0.12);
  padding: 0 2px 9px;
}

.encounter-seal {
  width: 44px;
  height: 44px;
  border: 2px solid #eed79d;
  color: #fff0c5;
  background: #9b382f;
  box-shadow:
    0 6px 14px rgba(82, 31, 27, 0.2),
    inset 0 0 0 2px rgba(102, 25, 20, 0.18);
}

.encounter-heading-copy small {
  color: #8b7657;
  font-weight: 700;
}

.encounter-heading-copy strong {
  color: #17251f;
  font-size: 23px;
}

.encounter-location b {
  color: #2c6654;
}

.difficulty-mark {
  border-width: 1px;
  background: rgba(255, 253, 239, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.wind-mark b {
  color: #8a661e;
}

.story-card {
  overflow: hidden;
  border-color: rgba(102, 82, 47, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 0 38px, rgba(159, 53, 43, 0.08) 38px 39px, transparent 39px),
    linear-gradient(rgba(102, 82, 47, 0.08) 1px, transparent 1px),
    rgba(255, 253, 242, 0.8);
  background-size: 100% 100%, 100% 30px, auto;
  box-shadow:
    inset 5px 0 0 rgba(159, 53, 43, 0.78),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 12px 28px rgba(40, 43, 33, 0.09);
}

.story-card::before {
  position: absolute;
  z-index: 0;
  inset: 8px;
  border: 1px solid rgba(181, 139, 56, 0.1);
  border-radius: 3px;
  content: "";
  pointer-events: none;
}

.scene-scroll,
.choice-area {
  position: relative;
  z-index: 1;
}

.scene-coin {
  width: 112px;
  height: 112px;
  border: 3px solid rgba(107, 82, 42, 0.1);
  background:
    radial-gradient(circle, transparent 0 34%, rgba(181, 139, 56, 0.035) 35% 55%, transparent 56%),
    rgba(181, 139, 56, 0.025);
  box-shadow:
    inset 0 0 0 8px rgba(107, 82, 42, 0.035),
    0 0 0 1px rgba(107, 82, 42, 0.055);
  animation: coin-watermark-float 9s ease-in-out infinite;
}

.scene-coin i {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(86, 59, 34, 0.12);
  background: rgba(247, 242, 222, 0.72);
}

.scene-text {
  color: #202922;
  line-height: 1.9;
  text-shadow: 0 1px rgba(255, 255, 255, 0.74);
}

.scene-text::first-letter {
  color: #9d352c;
}

.choice-caption {
  color: #96352d;
}

.choice-caption i {
  background: linear-gradient(90deg, rgba(159, 53, 43, 0.42), rgba(181, 139, 56, 0.2), transparent);
}

.choices {
  gap: 7px;
}

.choices button {
  position: relative;
  overflow: hidden;
  border-color: rgba(66, 82, 71, 0.2);
  border-left-width: 4px;
  background:
    linear-gradient(90deg, rgba(36, 79, 67, 0.035), transparent 34%),
    rgba(255, 254, 246, 0.88);
  box-shadow:
    0 4px 10px rgba(27, 39, 32, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.choices button::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 22%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.64), transparent);
  content: "";
  pointer-events: none;
  transform: skewX(-18deg);
  transition: left 360ms ease;
}

.choices button:hover {
  border-color: rgba(159, 53, 43, 0.46);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(159, 53, 43, 0.045), transparent 38%),
    #fffdf3;
  box-shadow:
    0 10px 22px rgba(27, 39, 32, 0.12),
    inset 0 1px 0 #fff;
  transform: translateX(2px);
}

.choices button:hover::after {
  left: 118%;
}

.choice-index {
  border-color: rgba(159, 53, 43, 0.6);
  color: #97372f;
  background: rgba(159, 53, 43, 0.035);
  box-shadow: inset 0 0 0 2px rgba(159, 53, 43, 0.035);
}

.choice-title {
  color: #1b2822;
}

.choice-hint {
  color: #746c5e;
}

.choice-go {
  color: #a77b28;
}

.result-panel {
  border-color: rgba(36, 79, 67, 0.34);
  background:
    linear-gradient(90deg, rgba(36, 79, 67, 0.07), transparent 38%),
    rgba(255, 254, 246, 0.92);
  box-shadow:
    0 8px 20px rgba(27, 39, 32, 0.08),
    inset 0 1px 0 #fff;
}

#continueBtn {
  border-color: rgba(225, 193, 112, 0.5);
  color: #fff3cd;
  background: linear-gradient(110deg, #1e4539, #326a58);
  box-shadow:
    0 8px 18px rgba(25, 55, 45, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

#continueBtn:hover {
  background: linear-gradient(110deg, #8e332c, #ad493c);
}

.tool-overlay {
  background: rgba(13, 22, 18, 0.74);
  backdrop-filter: blur(5px);
}

.tool-panel {
  border-color: rgba(225, 193, 112, 0.78);
  background:
    linear-gradient(rgba(63, 78, 66, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 28px, auto;
  box-shadow:
    0 30px 90px rgba(7, 16, 12, 0.56),
    inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

.tool-header {
  border-bottom-color: rgba(225, 193, 112, 0.38);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(110deg, #1b3d33, #2f6251);
  background-size: 24px 100%, auto;
  box-shadow: inset 0 -1px 0 rgba(7, 25, 19, 0.28);
}

.tool-header span {
  color: rgba(255, 239, 197, 0.66);
}

.tool-header h2 {
  color: #fff4d1;
}

.icon-button {
  border-color: rgba(243, 218, 154, 0.46);
  color: #ffeec0;
  background: rgba(7, 24, 18, 0.18);
}

.icon-button:hover {
  border-color: #e4c36e;
  background: #8e352d;
}

.album-summary,
.exchange-summary,
.route-summary {
  border-bottom-color: rgba(54, 76, 64, 0.18);
  background: linear-gradient(90deg, rgba(36, 79, 67, 0.09), rgba(181, 139, 56, 0.04));
}

.album-set,
.album-entry,
.exchange-route,
.route-entry {
  border-color: rgba(63, 77, 66, 0.18);
  background: rgba(255, 254, 246, 0.74);
  box-shadow:
    0 3px 9px rgba(27, 39, 32, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.album-entry.is-collected,
.album-set.is-complete,
.exchange-route.is-ready,
.route-entry.is-selected {
  border-color: rgba(43, 100, 82, 0.42);
  background: linear-gradient(90deg, rgba(36, 79, 67, 0.09), rgba(255, 254, 246, 0.74));
}

.album-action,
.exchange-action,
.pawn-action,
.route-action {
  border-color: #2b5c4d;
  background: linear-gradient(110deg, #244f43, #36705e);
  box-shadow:
    0 4px 10px rgba(25, 55, 45, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.11);
  font-weight: 700;
}

.album-action.is-withdraw {
  border-color: #92362f;
  background: linear-gradient(110deg, #8f342d, #ad4a3d);
}

.route-marker {
  border-color: rgba(181, 139, 56, 0.72);
  color: #8d6720;
  background: rgba(181, 139, 56, 0.055);
  box-shadow: inset 0 0 0 2px rgba(181, 139, 56, 0.055);
}

.package-notice {
  border-bottom-color: rgba(54, 76, 64, 0.16);
  background: linear-gradient(90deg, rgba(181, 139, 56, 0.09), transparent);
}

.journal-window-list li {
  border-left-color: rgba(159, 53, 43, 0.66);
  background: linear-gradient(90deg, rgba(159, 53, 43, 0.035), transparent 44%);
}

.tool-scroll,
.scene-scroll,
.album-sets {
  scrollbar-color: rgba(64, 92, 77, 0.48) transparent;
  scrollbar-width: thin;
}

.tool-scroll::-webkit-scrollbar,
.scene-scroll::-webkit-scrollbar,
.album-sets::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.tool-scroll::-webkit-scrollbar-thumb,
.scene-scroll::-webkit-scrollbar-thumb,
.album-sets::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 6px;
  background: rgba(64, 92, 77, 0.48);
  background-clip: padding-box;
}

.travel-panel,
.cleaning-panel {
  border-color: rgba(231, 199, 119, 0.76);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 35%, #285345, #142a23 72%);
  background-size: 20px 20px, 20px 20px, auto;
}

@keyframes coin-watermark-float {
  0%,
  100% {
    transform: translateY(-50%) rotate(7deg);
  }
  50% {
    transform: translateY(calc(-50% - 4px)) rotate(11deg);
  }
}

@media (max-width: 980px) {
  .home-statuses {
    border-top-color: rgba(54, 76, 64, 0.18);
  }
}

@media (max-width: 820px) {
  body {
    background:
      linear-gradient(rgba(22, 33, 28, 0.08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(22, 33, 28, 0.08) 1px, transparent 1px),
      linear-gradient(145deg, #cdbd8f, #53675a 100%);
    background-size: 30px 30px, 30px 30px, auto;
  }

  .game-shell {
    gap: 7px;
    padding: 7px;
  }

  .topbar {
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px;
  }

  .topbar::after {
    right: 42%;
    width: 90px;
    height: 90px;
  }

  h1 {
    color: #fff2ca;
    font-size: 24px;
  }

  .title-lockup p {
    color: rgba(255, 238, 195, 0.64);
  }

  .top-actions {
    gap: 3px;
  }

  .top-actions button {
    min-width: 0;
    min-height: 32px;
    border-radius: 5px;
    font-size: 10px;
  }

  .story-panel {
    padding: 9px;
  }

  .story-panel::before {
    inset: 5px;
  }

  .home-overview {
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .home-stats {
    gap: 4px 9px;
  }

  .stat-row {
    grid-template-columns: 2px auto auto minmax(0, 1fr);
    gap: 2px 5px;
  }

  .stat-row::before {
    width: 2px;
    height: 13px;
  }

  .progression-summary > span {
    border-left-width: 1px;
    border-right: 0;
    padding: 1px 5px;
  }

  .story-meta {
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .encounter-seal {
    width: 34px;
    height: 34px;
  }

  .encounter-heading-copy strong {
    font-size: 17px;
  }

  .story-card {
    background:
      linear-gradient(90deg, transparent 0 22px, rgba(159, 53, 43, 0.07) 22px 23px, transparent 23px),
      linear-gradient(rgba(102, 82, 47, 0.07) 1px, transparent 1px),
      rgba(255, 253, 242, 0.84);
    background-size: 100% 100%, 100% 27px, auto;
    box-shadow:
      inset 4px 0 0 rgba(159, 53, 43, 0.76),
      inset 0 0 0 1px rgba(255, 255, 255, 0.72),
      0 8px 18px rgba(40, 43, 33, 0.08);
  }

  .scene-scroll {
    padding-top: 13px;
  }

  .scene-text {
    font-size: 16px;
    line-height: 1.7;
  }

  .scene-coin {
    width: 82px;
    height: 82px;
  }

  .choices button {
    min-height: 49px;
    border-left-width: 3px;
    padding: 7px 8px;
  }

  .choice-index {
    width: 27px;
    height: 27px;
  }

  .choice-title {
    font-size: 14px;
  }

  .tool-overlay {
    backdrop-filter: blur(3px);
  }
}

/* Game motion layer */
.topbar::after {
  animation: header-coin-turn 28s linear infinite;
  transform-origin: center;
}

.stat-row {
  animation: stat-ink-in 420ms var(--stat-delay, 0ms) cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.progression-summary > span {
  animation: progress-mark-in 460ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.progression-summary > span:nth-child(2) {
  animation-delay: 55ms;
}

.progression-summary > span:nth-child(3) {
  animation-delay: 110ms;
}

.story-card::after {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: -32%;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(255, 249, 215, 0.15), transparent);
  content: "";
  pointer-events: none;
  transform: skewX(-14deg);
  animation: parchment-light-pass 9s 2s ease-in-out infinite;
}

.story-card.is-event-entering {
  animation: event-card-open 520ms cubic-bezier(0.2, 0.86, 0.3, 1) both;
  transform-origin: 12% 50%;
}

.story-meta.is-event-entering .encounter-seal {
  animation: encounter-stamp-in 480ms 80ms cubic-bezier(0.2, 1.35, 0.4, 1) backwards;
}

.story-meta.is-event-entering .encounter-heading-copy {
  animation: encounter-title-in 420ms 120ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.story-meta.is-event-entering .encounter-context {
  animation: encounter-context-in 420ms 170ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.scene-text.is-entering {
  animation: scene-ink-spread 560ms 90ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.choice-go {
  animation: choice-arrow-idle 1.8s ease-in-out infinite;
}

.choices button:hover .choice-go {
  animation-duration: 720ms;
}

.story-card.has-result {
  box-shadow:
    inset 5px 0 0 rgba(36, 79, 67, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 14px 32px rgba(31, 66, 54, 0.12);
  transition: box-shadow 320ms ease;
}

.result-panel {
  overflow: hidden;
}

.result-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c4a14f, #39715f, transparent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
}

.result-panel:not([hidden])::before {
  animation: result-line-draw 680ms 100ms ease-out forwards;
}

#continueBtn {
  position: relative;
  overflow: hidden;
}

#continueBtn::after {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -28%;
  width: 16%;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 196, 0.28), transparent);
  content: "";
  pointer-events: none;
  transform: skewX(-18deg);
  animation: command-button-shine 4.2s 1.4s ease-in-out infinite;
}

#continueBtn:disabled::after {
  display: none;
}

.tool-overlay:not([hidden]) .album-entry,
.tool-overlay:not([hidden]) .album-set,
.tool-overlay:not([hidden]) .exchange-route,
.tool-overlay:not([hidden]) .route-entry,
.tool-overlay:not([hidden]) .pawn-row,
.tool-overlay:not([hidden]) .collection-window-list > li,
.tool-overlay:not([hidden]) .journal-window-list > li {
  animation: tool-item-unfold 360ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.tool-overlay:not([hidden]) :is(.album-entry, .album-set, .exchange-route, .route-entry, .pawn-row, .collection-window-list > li, .journal-window-list > li):nth-child(2) {
  animation-delay: 35ms;
}

.tool-overlay:not([hidden]) :is(.album-entry, .album-set, .exchange-route, .route-entry, .pawn-row, .collection-window-list > li, .journal-window-list > li):nth-child(3) {
  animation-delay: 70ms;
}

.tool-overlay:not([hidden]) :is(.album-entry, .album-set, .exchange-route, .route-entry, .pawn-row, .collection-window-list > li, .journal-window-list > li):nth-child(4) {
  animation-delay: 105ms;
}

.tool-overlay:not([hidden]) :is(.album-entry, .album-set, .exchange-route, .route-entry, .pawn-row, .collection-window-list > li, .journal-window-list > li):nth-child(5) {
  animation-delay: 140ms;
}

.tool-overlay:not([hidden]) :is(.album-entry, .album-set, .exchange-route, .route-entry, .pawn-row, .collection-window-list > li, .journal-window-list > li):nth-child(n + 6) {
  animation-delay: 175ms;
}

.travel-overlay.is-closing {
  animation: overlay-curtain-out 320ms ease-in both;
}

.travel-overlay.is-closing .travel-panel {
  animation: travel-panel-away 320ms cubic-bezier(0.55, 0, 0.75, 0.2) both;
}

@keyframes header-coin-turn {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@keyframes stat-ink-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress-mark-in {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes parchment-light-pass {
  0%,
  66% {
    left: -32%;
  }
  84%,
  100% {
    left: 118%;
  }
}

@keyframes event-card-open {
  from {
    opacity: 0.5;
    transform: perspective(900px) rotateY(-1.8deg) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: perspective(900px) rotateY(0) translateX(0);
  }
}

@keyframes encounter-stamp-in {
  from {
    opacity: 0;
    transform: rotate(7deg) scale(1.28);
  }
  to {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
  }
}

@keyframes encounter-title-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes encounter-context-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scene-ink-spread {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes choice-arrow-idle {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(3px);
  }
}

@keyframes result-line-draw {
  to {
    transform: scaleX(1);
  }
}

@keyframes command-button-shine {
  0%,
  58% {
    left: -28%;
  }
  78%,
  100% {
    left: 116%;
  }
}

@keyframes tool-item-unfold {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes overlay-curtain-out {
  to {
    opacity: 0;
  }
}

@keyframes travel-panel-away {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(1.025);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-card::after,
  #continueBtn::after {
    display: none;
  }

  .story-card.is-event-entering,
  .story-meta.is-event-entering *,
  .stat-row,
  .progression-summary > span,
  .choice-go,
  .tool-overlay:not([hidden]) * {
    filter: none !important;
    transform: none !important;
  }
}

/* Final scene-stage overrides */
.scene-scroll {
  display: block;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(69, 78, 61, 0.18);
  border-radius: 5px;
  padding: 0;
  background: rgba(247, 242, 222, 0.76);
  box-shadow: 0 8px 18px rgba(35, 42, 31, 0.08);
}

.scene-scroll > .scene-visual {
  position: absolute;
  inset: 0;
  height: auto;
  min-height: 0;
}

.scene-narrative {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 76px;
  max-height: 126px;
  padding: 10px 16px 11px;
}

.scene-text {
  max-width: none;
  margin: 0;
  font-size: 17px;
  line-height: 1.62;
}

.scene-text::first-letter {
  font-size: 27px;
}

@media (max-width: 820px) {
  .scene-scroll {
    padding: 0;
  }

  .scene-narrative {
    min-height: 68px;
    max-height: 112px;
    padding: 8px 11px 9px;
  }

  .scene-text {
    max-width: none;
    font-size: 15px;
    line-height: 1.56;
  }

  .scene-text::first-letter {
    font-size: 24px;
  }
}
