:root {
  --paper: #f3efe4;
  --paper-deep: #e4ddce;
  --ink: #182820;
  --muted: #68756e;
  --forest: #20372f;
  --forest-2: #34574c;
  --coral: #c96853;
  --gold: #d2a743;
  --blue: #5f7e8a;
  --clay: #aa785a;
  --white: #fffdf6;
  --line: rgba(24, 40, 32, 0.18);
  --soft-line: rgba(255, 253, 246, 0.2);
  --shadow: 0 24px 70px rgba(19, 33, 27, 0.2);
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--forest);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--white);
  border-radius: 4px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.screen {
  width: 100%;
  min-height: 100svh;
}

[hidden] {
  display: none !important;
}

.boot-screen {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  color: var(--white);
  background: #2e443c;
  isolation: isolate;
}

.boot-room,
.boot-overlay,
.boot-grain {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
}

.boot-room {
  object-fit: cover;
  object-position: center;
  filter: saturate(0.72) contrast(1.05);
  transform: scale(1.03);
}

.boot-overlay {
  z-index: -2;
  background: rgba(16, 35, 29, 0.74);
}

.boot-grain {
  z-index: -1;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Ccircle cx='10' cy='13' r='1' fill='%23fff' opacity='.22'/%3E%3Ccircle cx='52' cy='44' r='.8' fill='%23fff' opacity='.14'/%3E%3Ccircle cx='69' cy='19' r='.7' fill='%23fff' opacity='.18'/%3E%3Ccircle cx='31' cy='69' r='.9' fill='%23fff' opacity='.16'/%3E%3C/svg%3E");
}

.boot-content {
  display: flex;
  width: min(1180px, calc(100% - 64px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 110px 0 120px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.system-line {
  display: flex;
  margin: 0 0 34px;
  align-items: center;
  gap: 10px;
  color: rgba(255, 253, 246, 0.7);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #e3bf5d;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(227, 191, 93, 0.13);
  animation: signal 2.2s ease-in-out infinite;
}

@keyframes signal {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.boot-content h1 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 92px;
  font-weight: 500;
  line-height: 1.04;
}

.boot-subtitle {
  margin: 30px 0 10px;
  color: rgba(255, 253, 246, 0.75);
  font-family: "STSong", "SimSun", serif;
  font-size: 18px;
  line-height: 1.9;
}

.boot-message {
  margin: 0 0 38px;
  color: rgba(255, 253, 246, 0.52);
  font-size: 13px;
  line-height: 1.75;
}

.boot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.boot-start,
.boot-demo {
  display: inline-flex;
  min-width: 230px;
  min-height: 56px;
  padding: 0 22px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.boot-demo {
  min-width: 190px;
  justify-content: center;
  gap: 9px;
  color: var(--white);
  background: rgba(255, 253, 246, 0.06);
  border-color: rgba(255, 253, 246, 0.42);
}

.boot-demo:hover {
  background: rgba(255, 253, 246, 0.13);
  transform: translateY(-2px);
}

.boot-start:hover {
  background: #e3be5c;
  transform: translateY(-2px);
}

.continue-save {
  margin-top: 18px;
  padding: 8px 0;
  color: rgba(255, 253, 246, 0.75);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 253, 246, 0.35);
  cursor: pointer;
}

.boot-footer {
  position: absolute;
  right: 32px;
  bottom: 28px;
  left: 32px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 253, 246, 0.45);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.onboarding-screen {
  display: grid;
  min-height: 100svh;
  grid-template-rows: 76px 4px minmax(0, 1fr) 86px;
  color: var(--ink);
  background: var(--paper);
}

.onboarding-header,
.onboarding-nav {
  display: flex;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.game-brand > span:last-child {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-seal {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--white);
  background: var(--coral);
  border-radius: 50%;
  font-size: 16px;
}

.step-counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: Georgia, serif;
}

.step-counter strong {
  font-size: 26px;
  font-weight: 400;
}

.step-counter span {
  color: var(--muted);
  font-size: 12px;
}

.onboarding-progress {
  width: 100%;
  height: 4px;
  background: var(--paper-deep);
}

.onboarding-progress span {
  display: block;
  width: 16.666%;
  height: 100%;
  background: var(--coral);
  transition: width 320ms ease;
}

.onboarding-form {
  display: grid;
  width: min(980px, calc(100% - 64px));
  margin: 0 auto;
  padding: 54px 0 36px;
  align-items: center;
}

.onboarding-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  animation: step-in 340ms ease both;
}

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

.step-label,
.dialog-kicker {
  margin: 0 0 16px;
  color: var(--coral);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.onboarding-step h2 {
  max-width: 840px;
  margin: 0 0 42px;
  font-family: "STSong", "SimSun", serif;
  font-size: 46px;
  font-weight: 500;
  line-height: 1.35;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.field-label > span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.field-label input,
.release-list input {
  width: 100%;
  height: 62px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  font-family: "STSong", "SimSun", serif;
  font-size: 24px;
}

.field-label input:focus,
.release-list input:focus {
  border-bottom-color: var(--coral);
}

.field-label input::placeholder,
.release-list input::placeholder,
textarea::placeholder {
  color: rgba(104, 117, 110, 0.55);
}

.step-quote {
  margin: 52px 0 0;
  padding-left: 18px;
  color: var(--muted);
  border-left: 3px solid var(--gold);
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
  line-height: 1.8;
}

.weather-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.weather-option {
  position: relative;
  display: flex;
  min-height: 260px;
  padding: 24px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.weather-option input,
.trait-option input,
.color-swatch input,
.segmented-control input,
.mood-choice-grid input,
.energy-options input,
.journal-mood-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weather-option:has(input:checked) {
  color: var(--white);
  background: var(--forest);
}

.weather-option strong,
.weather-option small {
  display: block;
}

.weather-option strong {
  margin-bottom: 9px;
  font-family: "STSong", "SimSun", serif;
  font-size: 22px;
}

.weather-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.weather-option:has(input:checked) small {
  color: rgba(255, 253, 246, 0.65);
}

.weather-art {
  position: absolute;
  top: 30px;
  left: 24px;
  display: block;
  width: 84px;
  height: 78px;
}

.weather-art i {
  position: absolute;
  display: block;
  background: currentColor;
}

.weather-fog { color: var(--blue); }
.weather-fog i { right: 0; left: 0; height: 4px; border-radius: 4px; }
.weather-fog i:nth-child(1) { top: 18px; width: 70%; }
.weather-fog i:nth-child(2) { top: 36px; left: 14px; width: 78%; }
.weather-fog i:nth-child(3) { top: 54px; width: 58%; }
.weather-rain { color: var(--blue); }
.weather-rain::before { content: ""; position: absolute; top: 6px; left: 8px; width: 62px; height: 30px; background: currentColor; border-radius: 30px 30px 14px 14px; }
.weather-rain i { top: 49px; width: 3px; height: 20px; transform: rotate(18deg); }
.weather-rain i:nth-child(1) { left: 20px; }.weather-rain i:nth-child(2) { left: 42px; }.weather-rain i:nth-child(3) { left: 64px; }
.weather-cloud { color: #7d8f88; }
.weather-cloud i { height: 33px; border-radius: 50%; }
.weather-cloud i:nth-child(1) { top: 28px; left: 3px; width: 48px; }
.weather-cloud i:nth-child(2) { top: 13px; left: 29px; width: 54px; height: 48px; }
.weather-cloud i:nth-child(3) { top: 40px; left: 16px; width: 64px; height: 22px; border-radius: 4px; }
.weather-sun { color: var(--gold); }
.weather-sun i:nth-child(1) { top: 14px; left: 17px; width: 50px; height: 50px; border-radius: 50%; }
.weather-sun i:nth-child(2) { top: 0; left: 40px; width: 4px; height: 78px; background: transparent; border-top: 8px solid currentColor; border-bottom: 8px solid currentColor; }
.weather-sun i:nth-child(3) { top: 37px; left: 3px; width: 78px; height: 4px; background: transparent; border-right: 8px solid currentColor; border-left: 8px solid currentColor; }

.release-list {
  border-top: 1px solid var(--line);
}

.route-fieldset {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

.route-fieldset legend {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}

.route-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.route-choice-grid label {
  display: block;
  min-height: 84px;
  padding: 15px;
  background: rgba(255, 253, 246, 0.32);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.route-choice-grid label:has(input:checked) {
  color: var(--white);
  background: var(--forest);
  border-color: var(--forest);
}

.route-choice-grid strong,
.route-choice-grid small {
  display: block;
}

.route-choice-grid strong {
  margin-bottom: 7px;
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
}

.route-choice-grid small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.route-choice-grid label:has(input:checked) small {
  color: rgba(255, 253, 246, 0.68);
}

.release-list label {
  display: grid;
  min-height: 86px;
  grid-template-columns: 64px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.release-list label > span {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 13px;
}

.release-list input {
  height: 86px;
  border: 0;
  font-size: 20px;
}

.privacy-note,
.selection-status {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.selection-status {
  margin: -28px 0 22px;
  color: var(--coral);
}

.trait-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.trait-option {
  position: relative;
  display: flex;
  min-height: 110px;
  padding: 22px;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.trait-option:has(input:checked) {
  color: var(--white);
  background: var(--forest);
}

.trait-option b,
.trait-option small {
  display: block;
}

.trait-option b {
  margin-bottom: 7px;
  font-family: "STSong", "SimSun", serif;
  font-size: 21px;
}

.trait-option small {
  color: var(--muted);
  font-size: 11px;
}

.trait-option:has(input:checked) small {
  color: rgba(255, 253, 246, 0.65);
}

.trait-option em {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--forest);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: normal;
}

.trait-vitality em { background: #d9b94f; }
.trait-trust em { background: #7fa18e; }
.trait-courage em { background: #cf735e; }
.trait-boundaries em { background: #7896a1; }
.trait-connection em { background: #ddb184; }

.avatar-builder {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.2fr;
  gap: 64px;
}

.avatar-preview {
  display: grid;
  min-height: 390px;
  place-items: center;
  background: #d6dbcf;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.avatar-svg {
  width: 180px;
  max-height: 320px;
  overflow: visible;
  filter: drop-shadow(0 18px 16px rgba(26, 45, 36, 0.16));
}

.avatar-svg .hair-wave,
.avatar-svg .hair-cap {
  display: none;
}

.avatar-svg.hair-wave .hair-short,
.avatar-svg.hair-cap .hair-short {
  display: none;
}

.avatar-svg.hair-wave .hair-wave,
.avatar-svg.hair-cap .hair-cap {
  display: block;
}

.avatar-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}

.choice-group > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.color-swatch {
  position: relative;
  display: block;
  cursor: pointer;
}

.color-swatch span {
  display: block;
  width: 42px;
  height: 42px;
  background: var(--swatch);
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.color-swatch:has(input:checked) span {
  box-shadow: 0 0 0 2px var(--forest);
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.segmented-control label {
  position: relative;
  cursor: pointer;
}

.segmented-control span {
  display: grid;
  min-width: 86px;
  min-height: 42px;
  padding: 0 14px;
  place-items: center;
  border-right: 1px solid var(--line);
  font-size: 12px;
}

.segmented-control label:last-child span {
  border-right: 0;
}

.segmented-control label:has(input:checked) span {
  color: var(--white);
  background: var(--forest);
}

.future-note-field {
  position: relative;
  display: block;
}

.future-note-field textarea {
  width: 100%;
  min-height: 170px;
  padding: 26px 26px 42px;
  resize: vertical;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-family: "STSong", "SimSun", serif;
  font-size: 20px;
  line-height: 1.8;
}

.future-note-field textarea:focus {
  border-color: var(--coral);
}

.future-note-field small {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: var(--muted);
  font-size: 11px;
}

.guardian-opening {
  margin: 26px 0 0;
  padding: 20px 24px;
  color: var(--forest);
  background: #e8d59d;
  border-left: 4px solid var(--gold);
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
  line-height: 1.8;
}

.onboarding-nav {
  border-top: 1px solid var(--line);
}

.nav-back,
.nav-next {
  min-height: 48px;
  cursor: pointer;
}

.nav-back {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.nav-next {
  min-width: 170px;
  padding: 0 18px;
  color: var(--white);
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 4px;
}

.reboot-screen {
  display: grid;
  min-height: 100svh;
  padding: 32px;
  place-items: center;
  color: var(--white);
  background: #14241e;
}

.reboot-terminal {
  width: min(620px, 100%);
  font-family: Consolas, monospace;
}

.reboot-terminal p {
  margin: 0 0 20px;
  color: rgba(255, 253, 246, 0.7);
  font-size: 13px;
  opacity: 0;
  animation: terminal-line 400ms ease forwards;
}

.reboot-terminal p:nth-child(2) { animation-delay: 700ms; }
.reboot-terminal p:nth-child(3) { animation-delay: 1400ms; }

@keyframes terminal-line {
  to { opacity: 1; }
}

.reboot-line {
  height: 4px;
  margin-top: 42px;
  background: rgba(255, 253, 246, 0.12);
}

.reboot-line span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
}

.reboot-terminal strong {
  display: block;
  margin-top: 12px;
  color: var(--gold);
  font-size: 12px;
  text-align: right;
}

.game-screen {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #2a3f37;
}

.game-hud {
  position: absolute;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  height: 76px;
  padding: 0 24px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--white);
  background: rgba(24, 40, 32, 0.9);
  border-bottom: 1px solid rgba(255, 253, 246, 0.16);
  backdrop-filter: blur(12px);
}

.profile-chip {
  display: inline-flex;
  width: fit-content;
  padding: 0;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.profile-avatar-mini {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  background: #d7d9cc;
  border: 1px solid rgba(255, 253, 246, 0.36);
  border-radius: 50%;
}

.profile-avatar-mini .avatar-svg {
  width: 38px;
  margin-top: 16px;
}

.profile-chip strong,
.profile-chip small {
  display: block;
}

.profile-chip strong {
  margin-bottom: 3px;
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
}

.profile-chip small {
  max-width: 160px;
  overflow: hidden;
  color: rgba(255, 253, 246, 0.55);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 253, 246, 0.62);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.hud-center time {
  color: var(--white);
  font-size: 13px;
}

.hud-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hud-stat {
  display: inline-flex;
  min-width: 64px;
  height: 42px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 253, 246, 0.2);
  border-radius: 21px;
  cursor: pointer;
}

.hud-stat span {
  color: var(--gold);
}

.hud-stat strong {
  font-family: Georgia, serif;
  font-size: 13px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  cursor: pointer;
}

.game-hud .icon-button {
  color: rgba(255, 253, 246, 0.66);
}

.game-room {
  position: absolute;
  inset: 76px 0 74px;
  overflow: hidden;
  background: #8e9b8f;
}

.room-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.room-world {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, calc((100svh - 150px) * 1.6));
  aspect-ratio: 1.6;
  transform: translate(-50%, -50%);
}

.room-art,
.room-night-filter,
.room-light,
.weather-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.room-art {
  object-fit: contain;
}

.room-night-filter {
  z-index: 2;
  background: rgba(17, 32, 45, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}

.game-screen.is-night .room-night-filter {
  opacity: 1;
}

.room-light {
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: rgba(231, 184, 75, 0.1);
  transition: opacity 500ms ease;
}

.game-screen.low-power .room-light,
.game-screen.is-night .room-light {
  opacity: 1;
}

.game-screen.journey-stage-0 .room-light { opacity: 0.12; }
.game-screen.journey-stage-1 .room-light,
.game-screen.journey-stage-2 .room-light { opacity: 0.2; }
.game-screen.journey-stage-3 .room-light,
.game-screen.journey-stage-4 .room-light { opacity: 0.3; }
.game-screen.journey-stage-5 .room-light,
.game-screen.journey-stage-6 .room-light { opacity: 0.42; }
.game-screen.journey-stage-7 .room-light { opacity: 0.72; }
.game-screen.low-power .room-light,
.game-screen.is-night .room-light { opacity: 1; }

.weather-layer {
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.weather-layer.rain::before,
.weather-layer.rain::after {
  content: "";
  position: absolute;
  inset: -30% 0 0;
  background-image: repeating-linear-gradient(105deg, transparent 0, transparent 24px, rgba(219, 235, 235, 0.34) 25px, transparent 27px);
  animation: rain 1.2s linear infinite;
}

.weather-layer.rain::after {
  opacity: 0.45;
  animation-duration: 1.8s;
  animation-delay: -0.7s;
}

@keyframes rain {
  to { transform: translateY(30%); }
}

.weather-layer.fog {
  background: rgba(219, 225, 216, 0.22);
}

.weather-layer.sun {
  background: rgba(240, 195, 89, 0.08);
}

.game-avatar {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 9%;
  width: 11.5%;
  min-width: 98px;
  transform: translateX(-50%);
  animation: avatar-idle 3.8s ease-in-out infinite;
  transform-origin: center bottom;
  transition: left 620ms cubic-bezier(.22,.8,.32,1), bottom 620ms cubic-bezier(.22,.8,.32,1), filter 300ms ease;
  will-change: left, bottom;
}

.game-avatar.is-walking {
  animation: avatar-walk 310ms ease-in-out infinite alternate;
}

.game-avatar.at-window { left: 27%; bottom: 26%; }
.game-avatar.at-mirror { left: 50%; bottom: 27%; }
.game-avatar.at-bed { left: 27%; bottom: 7%; }
.game-avatar.at-desk { left: 69%; bottom: 7%; }
.game-avatar.at-plant { left: 45%; bottom: 7%; }
.game-avatar.at-radio { left: 56%; bottom: 12%; }
.game-avatar.at-mailbox { left: 42%; bottom: 38%; }
.game-avatar.at-door { left: 86%; bottom: 11%; }
.game-avatar.at-luggage { left: 84%; bottom: 5%; }

@keyframes avatar-walk {
  from { translate: 0 0; }
  to { translate: 0 -7px; }
}

.plant-growth {
  position: absolute;
  z-index: 7;
  top: 47%;
  left: 43.4%;
  width: 7%;
  height: 20%;
  pointer-events: none;
}

.plant-growth i {
  position: absolute;
  display: block;
  width: 42%;
  height: 24%;
  background: #8eae79;
  border: 3px solid #2f584a;
  border-radius: 80% 12% 80% 12%;
  opacity: 0;
  transform: scale(0.35) rotate(-25deg);
  transform-origin: right bottom;
  transition: opacity 360ms ease, transform 480ms ease;
}

.plant-growth i:nth-child(1) { top: 48%; left: 1%; }
.plant-growth i:nth-child(2) { top: 28%; right: 4%; transform: scale(0.35) rotate(28deg) scaleX(-1); }
.plant-growth i:nth-child(3) { top: 5%; left: 18%; }
.plant-growth.level-1 i:nth-child(1),
.plant-growth.level-2 i:nth-child(-n+2),
.plant-growth.level-3 i { opacity: 1; transform: scale(1) rotate(-25deg); }
.plant-growth.level-2 i:nth-child(2) { transform: scale(1) rotate(28deg) scaleX(-1); }
.plant-growth.level-3 i:nth-child(2) { transform: scale(1) rotate(28deg) scaleX(-1); }

.journey-sunbeam,
.journey-journal,
.journey-blanket,
.journey-key,
.journey-signal,
.journey-complete-glow,
.luggage-visual {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  animation: item-arrive 620ms ease both;
}

.journey-sunbeam {
  top: 25%;
  left: 18%;
  width: 22%;
  height: 39%;
  background: rgba(247, 211, 111, 0.22);
  clip-path: polygon(0 0, 48% 0, 100% 100%, 18% 100%);
  transform: rotate(-3deg);
}

.journey-journal {
  top: 57%;
  left: 71.5%;
  display: grid;
  width: 4.6%;
  min-width: 44px;
  aspect-ratio: 1.35;
  place-items: center;
  color: #f9ecd0;
  background: #b85f4f;
  border: 3px solid #27483e;
  border-left-width: 7px;
  border-radius: 2px 5px 5px 2px;
  box-shadow: 0 6px 0 rgba(39, 72, 62, 0.2);
  font-family: "STSong", "SimSun", serif;
  font-size: 11px;
  transform: rotate(-5deg);
}

.journey-blanket {
  top: 69%;
  left: 7.5%;
  width: 24%;
  height: 17%;
  background: rgba(202, 104, 83, 0.72);
  border: 3px solid #27483e;
  border-radius: 6px 6px 18px 18px;
  box-shadow: inset 0 -16px 0 rgba(255, 236, 201, 0.18);
  transform: skewX(-7deg);
}

.journey-key {
  top: 41%;
  left: 88.8%;
  display: grid;
  width: 3%;
  min-width: 31px;
  aspect-ratio: 1;
  place-items: center;
  color: #20372f;
  background: #ebc45c;
  border: 3px solid #20372f;
  border-radius: 50%;
  box-shadow: 0 6px 0 rgba(32, 55, 47, 0.18);
  font-family: "STSong", "SimSun", serif;
  font-size: 10px;
}

.journey-signal {
  top: 49%;
  left: 54.6%;
  width: 8%;
  height: 13%;
}

.journey-signal i {
  position: absolute;
  right: 0;
  bottom: 0;
  border: 3px solid #f1d47b;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-45deg);
  animation: signal-pulse 2.2s ease-in-out infinite;
}

.journey-signal i:nth-child(1) { width: 24%; height: 24%; }
.journey-signal i:nth-child(2) { width: 53%; height: 53%; animation-delay: 160ms; }
.journey-signal i:nth-child(3) { width: 82%; height: 82%; animation-delay: 320ms; }

@keyframes signal-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.journey-complete-glow {
  inset: 3%;
  border: 8px solid rgba(241, 212, 123, 0.28);
  box-shadow: inset 0 0 80px rgba(241, 212, 123, 0.22), 0 0 40px rgba(241, 212, 123, 0.18);
}

.luggage-visual {
  z-index: 9;
  top: 74%;
  left: 84.2%;
  width: 8%;
  min-width: 74px;
  height: 10%;
  min-height: 54px;
  background: #8c6650;
  border: 4px solid #27483e;
  border-radius: 4px;
  box-shadow: inset 0 8px 0 rgba(255, 236, 201, 0.15), 0 8px 0 rgba(39, 72, 62, 0.16);
}

.luggage-visual::before {
  content: "";
  position: absolute;
  top: -27%;
  left: 31%;
  width: 38%;
  height: 34%;
  border: 4px solid #27483e;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.luggage-visual span {
  position: absolute;
  top: 38%;
  right: 44%;
  width: 12%;
  aspect-ratio: 1;
  background: #e5bd5d;
  border: 2px solid #27483e;
  border-radius: 50%;
}

.luggage-visual.has-rewrite {
  background: #718c7e;
}

.journey-stage-7 .room-art {
  filter: brightness(1.05) saturate(1.06);
}

.room-unlock {
  position: absolute;
  z-index: 9;
  display: grid;
  width: 2.6%;
  min-width: 28px;
  aspect-ratio: 1;
  place-items: center;
  color: var(--forest);
  background: #f1d47b;
  border: 3px solid var(--forest);
  border-radius: 50%;
  box-shadow: 0 8px 14px rgba(24, 40, 32, 0.18);
  font-family: "STSong", "SimSun", serif;
  font-size: 11px;
  animation: item-arrive 500ms ease both;
}

.decor-mug { top: 54%; left: 69%; }
.decor-key { top: 39%; left: 88%; }
.decor-badge { top: 30%; left: 49%; }

@keyframes item-arrive {
  from { opacity: 0; transform: translateY(-12px) scale(0.6); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.game-avatar .avatar-svg {
  width: 100%;
  max-height: none;
}

.game-screen.low-power .game-avatar {
  animation-duration: 5.5s;
  transform: translateX(-50%) rotate(-2deg) scaleY(0.96);
}

@keyframes avatar-idle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

.room-hotspot {
  position: absolute;
  z-index: 12;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.room-hotspot > span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  background: rgba(255, 253, 246, 0.72);
  border: 2px solid var(--forest);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 253, 246, 0.55);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
}

.room-hotspot:hover > span,
.room-hotspot:focus-visible > span,
.game-room.show-hotspots .room-hotspot > span {
  opacity: 1;
  animation: hotspot-pulse 1.8s ease-out infinite;
}

@keyframes hotspot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 253, 246, 0.6); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(255, 253, 246, 0); }
}

.hotspot-window { top: 9%; left: 5.5%; width: 32%; height: 39%; }
.hotspot-mirror { top: 9%; left: 41%; width: 17%; height: 40%; }
.hotspot-bed { top: 58%; left: 4%; width: 32%; height: 34%; }
.hotspot-desk { top: 49%; left: 64%; width: 19%; height: 41%; }
.hotspot-plant { top: 43%; left: 39%; width: 12%; height: 41%; }
.hotspot-radio { top: 55%; left: 51%; width: 12%; height: 17%; }
.hotspot-mailbox { top: 18%; left: 37.5%; width: 9%; height: 15%; }
.hotspot-door { top: 12%; left: 81%; width: 16%; height: 62%; }
.hotspot-luggage { top: 70%; left: 81%; width: 16%; height: 22%; }

.hotspot-mailbox b {
  position: absolute;
  top: 7%;
  right: 2%;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--white);
  background: var(--coral);
  border-radius: 50%;
  font-size: 10px;
}

.room-caption {
  position: absolute;
  z-index: 18;
  bottom: 24px;
  left: 24px;
  max-width: 380px;
  padding: 15px 18px;
  color: var(--white);
  background: rgba(24, 40, 32, 0.82);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  backdrop-filter: blur(8px);
}

.caption-weather {
  color: rgba(255, 253, 246, 0.54);
  font-size: 9px;
}

.room-caption p {
  margin: 5px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
}

.daily-checkin {
  position: absolute;
  z-index: 18;
  right: 24px;
  bottom: 24px;
  display: grid;
  min-width: 320px;
  min-height: 70px;
  padding: 12px 16px;
  grid-template-columns: 30px 1fr 22px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-align: left;
  background: var(--white);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.daily-checkin strong,
.daily-checkin small {
  display: block;
}

.daily-checkin strong {
  margin-bottom: 4px;
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
}

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

.checkin-pulse {
  width: 16px;
  height: 16px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(201, 104, 83, 0.16);
}

.daily-checkin.checked {
  min-width: 210px;
  grid-template-columns: 24px 1fr;
  background: #e6d59c;
}

.daily-checkin.checked > span:last-child {
  display: none;
}

.room-ceremony {
  position: absolute;
  z-index: 42;
  inset: 0;
  display: grid;
  padding: 32px;
  place-content: center;
  color: var(--white);
  text-align: center;
  background: rgba(18, 37, 31, 0.86);
  backdrop-filter: blur(7px);
  animation: ceremony-enter 420ms ease both;
}

.room-ceremony > span {
  color: var(--gold);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.room-ceremony > strong {
  max-width: 640px;
  margin: 20px auto 34px;
  font-family: "STSong", "SimSun", serif;
  font-size: 40px;
  font-weight: 500;
  line-height: 1.35;
}

.room-ceremony > div {
  width: min(360px, 72vw);
  height: 3px;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 253, 246, 0.18);
}

.room-ceremony i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform-origin: left;
  animation: ceremony-progress 3.2s linear both;
}

@keyframes ceremony-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ceremony-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.game-nav {
  position: absolute;
  z-index: 35;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: 74px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  color: var(--white);
  background: rgba(24, 40, 32, 0.96);
  border-top: 1px solid rgba(255, 253, 246, 0.16);
  backdrop-filter: blur(12px);
}

.game-nav-item {
  position: relative;
  display: flex;
  padding: 8px 0 7px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255, 253, 246, 0.56);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.game-nav-item > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.game-nav-item small {
  font-size: 9px;
}

.game-nav-item.active {
  color: var(--gold);
}

.game-nav-item b {
  position: absolute;
  top: 8px;
  left: calc(50% + 12px);
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  color: var(--white);
  background: var(--coral);
  border-radius: 9px;
  font-size: 9px;
}

.game-panel {
  position: absolute;
  z-index: 28;
  top: 76px;
  right: 0;
  bottom: 74px;
  width: min(480px, 100%);
  color: var(--ink);
  background: var(--paper);
  box-shadow: -20px 0 60px rgba(19, 33, 27, 0.22);
  animation: panel-in 260ms ease both;
}

@keyframes panel-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.panel-header {
  display: flex;
  height: 96px;
  padding: 22px 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  margin: 0 0 4px;
  color: var(--coral);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.panel-header h2 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 25px;
  font-weight: 500;
}

.panel-close {
  color: var(--muted);
}

.panel-content {
  height: calc(100% - 96px);
  padding: 0 24px 32px;
  overflow-y: auto;
}

.panel-empty {
  display: grid;
  min-height: 340px;
  place-content: center;
  text-align: center;
}

.panel-empty span {
  font-family: Georgia, serif;
  font-size: 54px;
}

.panel-empty h3 {
  margin: 20px 0 10px;
  font-family: "STSong", "SimSun", serif;
  font-size: 22px;
  font-weight: 500;
}

.panel-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.panel-action {
  min-height: 44px;
  margin-top: 22px;
  padding: 0 16px;
  color: var(--white);
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.journey-intro {
  display: grid;
  margin: 22px 0 8px;
  padding: 20px;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  color: var(--forest);
  background: #e4ece6;
  border-left: 4px solid var(--forest-2);
}

.journey-intro > span {
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1;
}

.journey-intro strong {
  display: block;
  margin-bottom: 7px;
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
}

.journey-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.journey-intro.compact {
  margin-bottom: 18px;
}

.task-summary {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.task-summary strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
}

.task-list,
.chapter-list,
.inventory-list,
.journal-history,
.letter-menu {
  border-top: 1px solid var(--line);
}

.task-item {
  display: grid;
  min-height: 118px;
  padding: 20px 0;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.task-check {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: transparent;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.task-item.completed .task-check {
  color: var(--white);
  background: var(--forest);
  border-color: var(--forest);
}

.task-item.completed .task-copy {
  opacity: 0.52;
}

.task-copy strong,
.task-copy small {
  display: block;
}

.task-copy strong {
  margin-bottom: 7px;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
}

.task-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.task-reward {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 11px;
}

.low-power-banner {
  margin: 22px 0;
  padding: 16px;
  color: var(--forest);
  background: #e7d69b;
  border-left: 4px solid var(--gold);
  font-size: 11px;
  line-height: 1.7;
}

.day-close-card {
  margin: 26px 0 10px;
  padding: 22px;
  color: var(--forest);
  background: #e7d69b;
  border-top: 4px solid var(--gold);
}

.day-close-card > span,
.day-close-card > strong {
  display: block;
}

.day-close-card > span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.day-close-card > strong {
  font-family: "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 500;
}

.day-close-card .panel-action {
  width: 100%;
}

.day-close-card .panel-action b {
  float: right;
}

.chapter-row {
  position: relative;
  display: grid;
  min-height: 112px;
  padding: 18px 0;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.chapter-row.locked {
  opacity: 0.45;
}

.chapter-index {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--white);
  background: var(--forest);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
}

.chapter-row.locked .chapter-index {
  color: var(--muted);
  background: var(--paper-deep);
}

.chapter-copy strong,
.chapter-copy small {
  display: block;
}

.chapter-copy strong {
  margin-bottom: 6px;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
}

.chapter-copy small,
.chapter-requirement {
  color: var(--muted);
  font-size: 10px;
}

.inventory-row,
.journal-row,
.letter-menu button {
  display: grid;
  width: 100%;
  min-height: 102px;
  padding: 18px 0;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.inventory-symbol,
.journal-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--forest);
  background: #e4cf8d;
  border-radius: 50%;
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
}

.inventory-copy strong,
.inventory-copy small,
.journal-copy strong,
.journal-copy small {
  display: block;
}

.inventory-copy strong,
.journal-copy strong {
  margin-bottom: 6px;
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
}

.inventory-copy small,
.journal-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.inventory-state {
  color: var(--coral);
  font-size: 10px;
}

.locked-item {
  opacity: 0.4;
}

.trait-dashboard {
  padding-top: 18px;
}

.route-summary {
  margin-top: 20px;
  padding: 16px;
  color: var(--forest);
  background: #e4ece6;
  border-left: 4px solid var(--coral);
}

.route-summary span,
.route-summary strong,
.route-summary small {
  display: block;
}

.route-summary span {
  color: var(--coral);
  font-size: 9px;
}

.route-summary strong {
  margin: 6px 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
}

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

.trait-stat {
  display: grid;
  min-height: 58px;
  grid-template-columns: 88px 1fr 34px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.trait-stat span {
  font-size: 11px;
}

.trait-bar {
  height: 7px;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 4px;
}

.trait-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--forest-2);
  border-radius: 4px;
}

.trait-stat strong {
  font-family: Georgia, serif;
  font-size: 12px;
  text-align: right;
}

.self-note {
  margin: 24px 0;
  padding: 20px;
  color: var(--forest);
  background: #e6d89f;
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
  line-height: 1.75;
}

.released-list {
  margin: 24px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.released-list li {
  position: relative;
  padding: 14px 0 14px 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-family: "STSong", "SimSun", serif;
  font-size: 13px;
}

.released-list li > span,
.released-list li > small {
  display: block;
}

.released-list li > span {
  text-decoration: line-through;
  text-decoration-color: var(--coral);
}

.released-list li > small {
  margin-top: 6px;
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 9px;
  line-height: 1.5;
  text-decoration: none;
}

.released-list li.rewritten > small {
  color: var(--forest);
}

.released-list li::before {
  content: "×";
  position: absolute;
  left: 2px;
  color: var(--coral);
  text-decoration: none;
}

.released-list li.rewritten::before {
  content: "✓";
  color: var(--forest-2);
}

.memory-list {
  border-top: 1px solid var(--line);
}

.memory-list article {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.memory-list span,
.memory-list strong,
.memory-list p {
  display: block;
}

.memory-list span {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 9px;
}

.memory-list strong {
  margin: 7px 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
  font-weight: 500;
}

.memory-list p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.archive-card-entry {
  display: flex;
  width: 100%;
  min-height: 72px;
  margin: 26px 0;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.archive-card-entry span {
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
}

.archive-card-entry strong {
  color: var(--gold);
  font-size: 10px;
}

.panel-section-title {
  display: flex;
  margin: 30px 0 14px;
  align-items: center;
  justify-content: space-between;
}

.panel-section-title h3 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 500;
}

.panel-section-title button {
  padding: 0 0 4px;
  color: var(--coral);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 10px;
  cursor: pointer;
}

.game-dialog {
  width: min(660px, calc(100% - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 30px 100px rgba(10, 24, 18, 0.38);
}

.game-dialog::backdrop {
  background: rgba(12, 25, 20, 0.74);
  backdrop-filter: blur(5px);
}

.game-dialog > form,
.simple-dialog-content,
.settings-content {
  padding: 58px 52px 46px;
}

.dialog-close {
  position: sticky;
  z-index: 3;
  top: 14px;
  float: right;
  margin: 14px 14px 0 0;
  color: var(--muted);
  background: rgba(243, 239, 228, 0.92);
}

.game-dialog h2 {
  margin: 0 0 32px;
  font-family: "STSong", "SimSun", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.35;
}

.mood-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.mood-choice-grid label {
  position: relative;
  display: flex;
  min-height: 110px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.mood-choice-grid label:has(input:checked) {
  color: var(--white);
  background: var(--forest);
}

.mood-choice-grid label > span {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 22px;
}

.mood-choice-grid strong {
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
}

.energy-fieldset {
  margin: 34px 0 0;
  padding: 0;
  border: 0;
}

.energy-fieldset legend {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
}

.energy-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.energy-options label {
  position: relative;
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.energy-options label:has(input:checked) {
  color: var(--white);
  background: var(--coral);
  border-color: var(--coral);
}

.energy-options span {
  font-family: Georgia, serif;
  font-size: 18px;
}

.energy-options small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.energy-options label:has(input:checked) small {
  color: rgba(255, 253, 246, 0.72);
}

.dialog-primary {
  display: flex;
  width: 100%;
  min-height: 52px;
  margin-top: 30px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.letter-dialog {
  color: #27342f;
  background: #f6efdf;
}

.letter-paper {
  padding: 70px 72px 58px;
}

.letter-paper > p {
  margin: 0 0 24px;
  color: #aa5f4c;
  font-size: 11px;
}

.letter-paper h2 {
  font-size: 38px;
}

.letter-paper #letterBody p {
  margin: 0 0 18px;
  color: #4e5c56;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
  line-height: 2;
}

.letter-paper footer {
  margin: 34px 0 28px;
  text-align: right;
  font-size: 12px;
  line-height: 1.8;
}

.letter-listen {
  min-height: 42px;
  padding: 0;
  color: var(--forest);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.journal-field {
  position: relative;
  display: block;
}

.journal-field textarea {
  width: 100%;
  min-height: 230px;
  padding: 22px 22px 40px;
  resize: vertical;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.48);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
  line-height: 1.85;
}

.journal-field small {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--muted);
  font-size: 10px;
}

.journal-mood-row {
  display: flex;
  margin-top: 18px;
  gap: 10px;
}

.journal-mood-row label {
  position: relative;
  cursor: pointer;
}

.journal-mood-row span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: "STSong", "SimSun", serif;
}

.journal-mood-row label:has(input:checked) span {
  color: var(--white);
  background: var(--coral);
  border-color: var(--coral);
}

.simple-dialog-content > p:not(.dialog-kicker) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.simple-stat {
  display: flex;
  margin-top: 28px;
  padding: 22px 0;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.simple-stat span {
  color: var(--muted);
  font-size: 11px;
}

.simple-stat strong {
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 400;
}

.simple-actions {
  display: flex;
  margin-top: 24px;
  flex-wrap: wrap;
  gap: 10px;
}

.simple-actions button {
  min-height: 44px;
  padding: 0 16px;
  color: var(--white);
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.simple-actions button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.room-change-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 0 22px;
  place-items: center;
  color: var(--forest);
  background: #e7d69b;
  border: 2px solid var(--forest);
  border-radius: 50%;
  box-shadow: 7px 7px 0 #c96853;
  font-family: "STSong", "SimSun", serif;
  font-size: 24px;
}

.memory-reveal {
  margin: 28px 0 0;
  padding: 20px;
  color: var(--forest);
  background: #e4ece6;
  border-left: 4px solid var(--coral);
}

.memory-reveal > span,
.memory-reveal > strong {
  display: block;
}

.memory-reveal > span {
  color: var(--coral);
  font-size: 9px;
}

.memory-reveal > strong {
  margin: 8px 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
  font-weight: 500;
}

.memory-reveal > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.luggage-list {
  display: grid;
  margin-top: 28px;
  gap: 12px;
}

.luggage-item {
  padding: 18px;
  background: rgba(255, 253, 246, 0.5);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.luggage-item > span,
.luggage-item > strong,
.luggage-item > small {
  display: block;
}

.luggage-item > span {
  margin-bottom: 9px;
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 10px;
}

.luggage-item > strong {
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

.luggage-item > small {
  margin: 9px 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.luggage-item.rewritten > strong {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--coral);
}

.luggage-item.locked {
  opacity: 0.5;
}

.luggage-item button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--forest);
  background: transparent;
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.luggage-item button:disabled {
  cursor: default;
}

.luggage-rewrite-form blockquote {
  margin: 0 0 24px;
  padding: 18px;
  color: var(--muted);
  background: var(--paper-deep);
  border-left: 4px solid var(--coral);
  font-family: "STSong", "SimSun", serif;
  line-height: 1.75;
}

.luggage-rewrite-form label > span {
  display: block;
  margin-bottom: 10px;
  color: var(--forest);
  font-size: 11px;
}

.luggage-rewrite-form textarea {
  width: 100%;
  min-height: 132px;
  padding: 18px;
  resize: vertical;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.56);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
  line-height: 1.75;
}

.archive-card-canvas {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 24px auto 0;
  background: #f3efe3;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(24, 40, 32, 0.16);
}

.archive-style-picker {
  display: grid;
  margin-top: 26px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.archive-style-picker button {
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.archive-style-picker button:last-child {
  border-right: 0;
}

.archive-style-picker button[aria-pressed="true"] {
  color: var(--white);
  background: var(--forest);
}

.ending-voice {
  display: flex;
  min-height: 46px;
  margin-top: 20px;
  padding: 0 14px;
  align-items: center;
  gap: 9px;
  color: var(--forest);
  background: transparent;
  border: 1px solid var(--forest);
  border-radius: 4px;
  cursor: pointer;
}

.privacy-note {
  margin-top: 14px !important;
  text-align: center;
  font-size: 10px !important;
}

.demo-sales-cta {
  display: grid;
  margin-top: 26px;
  padding: 20px 0;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 18px;
  border-top: 4px solid var(--coral);
  border-bottom: 1px solid var(--line);
}

.demo-sales-cta span,
.demo-sales-cta strong {
  display: block;
}

.demo-sales-cta span {
  color: var(--coral);
  font-size: 9px;
}

.demo-sales-cta strong {
  grid-column: 1;
  color: var(--forest);
  font-family: "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.demo-sales-cta button {
  min-height: 44px;
  padding: 0 16px;
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--white);
  background: var(--coral);
  border: 1px solid var(--coral);
  border-radius: 4px;
  cursor: pointer;
}

.settings-list {
  border-top: 1px solid var(--line);
}

.settings-list button,
.settings-list label {
  display: grid;
  width: 100%;
  min-height: 86px;
  padding: 14px 0;
  grid-template-columns: 1fr 32px;
  align-items: center;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.settings-list strong,
.settings-list small {
  display: block;
}

.settings-list strong {
  margin-bottom: 6px;
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
}

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

.settings-list b {
  font-size: 20px;
  font-weight: 400;
  text-align: center;
}

.import-save {
  position: relative;
}

.import-save input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.settings-list .danger-setting {
  color: var(--coral);
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px));
  left: 50%;
  min-width: 220px;
  padding: 13px 18px;
  color: var(--white);
  text-align: center;
  background: var(--forest);
  border: 1px solid rgba(255, 253, 246, 0.18);
  border-radius: 4px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .boot-content h1 {
    font-size: 72px;
  }

  .weather-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-option {
    min-height: 190px;
  }

  .avatar-builder {
    gap: 36px;
  }

  .room-world {
    width: max(920px, calc((100svh - 150px) * 1.6));
  }

  .room-stage {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .room-stage::-webkit-scrollbar {
    display: none;
  }

  .room-world {
    left: 0;
    transform: translateY(-50%);
  }
}

@media (max-width: 620px) {
  .boot-content {
    width: calc(100% - 36px);
    padding: 94px 0 110px;
    justify-content: flex-end;
  }

  .boot-room {
    object-position: 44% center;
  }

  .boot-content h1 {
    font-size: 56px;
    line-height: 1.08;
  }

  .boot-subtitle {
    margin: 24px 0 8px;
    font-size: 15px;
  }

  .boot-message {
    margin-bottom: 28px;
    font-size: 12px;
  }

  .boot-start {
    width: 100%;
  }

  .boot-actions,
  .boot-demo {
    width: 100%;
  }

  .room-ceremony > strong {
    font-size: 30px;
  }

  .boot-footer {
    right: 18px;
    bottom: 16px;
    left: 18px;
  }

  .onboarding-screen {
    grid-template-rows: 66px 4px minmax(0, 1fr) 78px;
  }

  .onboarding-header,
  .onboarding-nav,
  .onboarding-form {
    width: calc(100% - 32px);
  }

  .game-brand {
    font-size: 15px;
  }

  .game-brand > span:last-child {
    max-width: 180px;
  }

  .brand-seal {
    width: 32px;
    height: 32px;
  }

  .onboarding-form {
    padding: 34px 0 26px;
    align-items: start;
    overflow-y: auto;
  }

  .onboarding-step h2 {
    margin-bottom: 30px;
    font-size: 31px;
  }

  .form-grid,
  .trait-options,
  .avatar-builder,
  .route-choice-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    gap: 24px;
  }

  .field-label input,
  .release-list input {
    font-size: 20px;
  }

  .step-quote {
    margin-top: 34px;
  }

  .weather-option {
    min-height: 160px;
    padding: 18px;
  }

  .weather-art {
    top: 18px;
    left: 18px;
    transform: scale(0.72);
    transform-origin: top left;
  }

  .weather-option strong {
    font-size: 19px;
  }

  .trait-option {
    min-height: 86px;
    padding: 16px;
  }

  .trait-option b {
    font-size: 18px;
  }

  .avatar-preview {
    min-height: 290px;
  }

  .avatar-preview .avatar-svg {
    width: 140px;
  }

  .avatar-builder {
    gap: 24px;
  }

  .avatar-controls {
    gap: 20px;
  }

  .nav-next {
    min-width: 140px;
  }

  .game-screen {
    min-height: 540px;
  }

  .game-hud {
    height: 66px;
    padding: 0 12px;
    grid-template-columns: 1fr auto;
  }

  .hud-center {
    display: none;
  }

  .profile-chip small {
    max-width: 105px;
  }

  .profile-avatar-mini {
    width: 38px;
    height: 38px;
  }

  .hud-stat {
    min-width: 54px;
    height: 38px;
    padding: 0 9px;
  }

  .game-hud .icon-button {
    width: 38px;
    height: 38px;
  }

  .game-room {
    inset: 66px 0 68px;
  }

  .room-world {
    width: 880px;
  }

  .room-caption {
    right: 12px;
    bottom: 96px;
    left: 12px;
    max-width: none;
    padding: 12px 14px;
  }

  .room-caption p {
    font-size: 13px;
  }

  .daily-checkin {
    right: 12px;
    bottom: 16px;
    left: 12px;
    min-width: 0;
    min-height: 68px;
  }

  .daily-checkin.checked {
    min-width: 0;
  }

  .game-nav {
    height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .game-panel {
    top: 66px;
    bottom: 68px;
    width: 100%;
  }

  .panel-header {
    height: 82px;
    padding: 16px;
  }

  .panel-content {
    height: calc(100% - 82px);
    padding: 0 16px 26px;
  }

  .game-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .game-dialog > form,
  .simple-dialog-content,
  .settings-content,
  .letter-paper {
    padding: 54px 22px 34px;
  }

  .demo-sales-cta {
    grid-template-columns: 1fr;
  }

  .demo-sales-cta button {
    width: 100%;
    grid-column: 1;
    grid-row: auto;
  }

  .game-dialog h2,
  .letter-paper h2 {
    margin-bottom: 25px;
    font-size: 29px;
  }

  .mood-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mood-choice-grid label {
    min-height: 92px;
  }

  .energy-options {
    gap: 4px;
  }

  .energy-options label {
    min-height: 66px;
  }

  .energy-options small {
    display: none;
  }

  .letter-paper #letterBody p {
    font-size: 16px;
  }

  .journal-field textarea {
    min-height: 210px;
  }
}

@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;
  }
}
