:root {
  --bg: #f6ead6;
  --paper: #fff8e8;
  --paper2: #fff1cf;
  --ink: #4b3527;
  --muted: #8e7059;
  --soft: #c89d5b;
  --brown: #7c4b2a;
  --dark: #2c1b13;
  --green: #6d8c5a;
  --red: #b65a45;
  --blue: #587aa4;
  --gold: #d7a642;
  --shadow: rgba(73, 43, 20, .18);
  --font-song: "LXGW WenKai", "STKaiti", "KaiTi", "Songti SC", serif;
  --font-ui: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 232, 162, .65), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(183, 131, 75, .22), transparent 28%),
    linear-gradient(135deg, #ecd0a4, #fff7df 42%, #d7b17c);
}

body {
  overflow-x: hidden;
}

button, input, textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.site-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.site-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .32;
  background-image:
    linear-gradient(rgba(122, 73, 36, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 73, 36, .08) 1px, transparent 1px);
  background-size: 34px 34px;
}

.osmanthus {
  position: absolute;
  width: 15px;
  height: 15px;
  background: #f0be46;
  clip-path: polygon(50% 0, 62% 35%, 100% 35%, 70% 58%, 82% 100%, 50% 74%, 18% 100%, 30% 58%, 0 35%, 38% 35%);
  opacity: .55;
  animation: drift 14s linear infinite;
}

.petal-a { top: -20px; left: 10%; animation-delay: 0s; }
.petal-b { top: -30px; left: 42%; animation-delay: 4s; transform: scale(.75); }
.petal-c { top: -15px; left: 70%; animation-delay: 2s; transform: scale(1.15); }
.petal-d { top: -10px; left: 88%; animation-delay: 7s; transform: scale(.8); }

@keyframes drift {
  0% { transform: translateY(-30px) rotate(0deg); opacity: 0; }
  10% { opacity: .7; }
  100% { transform: translateY(110vh) rotate(280deg); opacity: 0; }
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(36, 22, 12, .52), rgba(36, 22, 12, .52)),
    radial-gradient(circle at center, #70451f, #1d120b 70%);
}

.boot-window {
  width: min(720px, 94vw);
  border: 3px double #8d633b;
  background: #fff5db;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .45), inset 0 0 0 8px rgba(255, 255, 255, .42);
  border-radius: 18px;
  overflow: hidden;
}

.boot-title {
  padding: 13px 18px;
  background: linear-gradient(90deg, #71431f, #b47c42);
  color: #fff4d5;
  letter-spacing: 2px;
  font-weight: 700;
}

.boot-body {
  padding: 34px 30px 30px;
  text-align: center;
}

.typing {
  font-family: var(--font-song);
  font-size: 20px;
  min-height: 32px;
}

.boot-progress {
  height: 14px;
  border: 1px solid #b78a58;
  background: #f4dfb8;
  border-radius: 999px;
  overflow: hidden;
  margin: 24px auto;
  max-width: 480px;
}

.boot-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(45deg, #7ba15d 0 12px, #9abe79 12px 24px);
  animation: loadbar 1.2s ease both;
}

@keyframes loadbar {
  from { width: 0; }
  to { width: 100%; }
}

.boot-start {
  opacity: 0;
  animation: showStart .6s ease 1.25s forwards;
}

@keyframes showStart {
  to { opacity: 1; }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
  border: 2px solid rgba(112, 70, 32, .24);
  border-radius: 24px;
  background: rgba(255, 249, 229, .85);
  box-shadow: 0 14px 46px var(--shadow);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 6vw, 56px);
  font-family: var(--font-song);
  letter-spacing: 8px;
  color: #5a3219;
  text-shadow: 1px 1px 0 #fff, 3px 3px 0 rgba(214, 164, 77, .22);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.tiny {
  font-size: 12px;
  letter-spacing: 2px;
  color: #af854d;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary, .ghost, .mini, .soft-btn, .choice-btn, .key-btn, .note-control button, .chapter-next {
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  color: #fff;
  background: linear-gradient(135deg, #8a542e, #d89f4a);
  box-shadow: 0 8px 18px rgba(124, 75, 42, .22);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary:hover, .ghost:hover, .mini:hover, .soft-btn:hover, .choice-btn:hover, .key-btn:hover, .note-control button:hover, .chapter-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(124, 75, 42, .28);
}

.ghost {
  color: #70451f;
  background: rgba(255, 250, 236, .8);
  border: 1px solid rgba(117, 76, 34, .22);
  box-shadow: none;
}

.ghost.danger {
  color: #a64438;
}

.mini {
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 999px;
}

.status-panel {
  display: grid;
  grid-template-columns: 1.3fr 1fr .8fr;
  gap: 14px;
  margin: 18px 0;
}

.status-card {
  padding: 14px 16px;
  background: rgba(255, 248, 231, .82);
  border: 1px solid rgba(112, 70, 32, .18);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(98, 61, 29, .12);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-card span {
  color: var(--muted);
  font-size: 13px;
}

.status-card strong {
  font-size: 18px;
}

.meter {
  flex: 1;
  min-width: 160px;
  height: 10px;
  background: rgba(124, 75, 42, .14);
  border-radius: 999px;
  overflow: hidden;
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #75a565, #e2b34f);
  transition: width .45s ease;
}

.keepsake-dots {
  display: flex;
  gap: 7px;
}

.keepsake-dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(124, 75, 42, .18);
  box-shadow: inset 0 0 0 1px rgba(124, 75, 42, .24);
}

.keepsake-dots i.found {
  background: radial-gradient(circle at 35% 35%, #fff6bd, #e7a43c 72%);
}

.chapter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(111, 65, 25, .1);
  border-radius: 18px;
  border: 1px solid rgba(111, 65, 25, .18);
}

.chapter-tabs button {
  flex: 1;
  min-width: 150px;
  padding: 12px 14px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 249, 232, .68);
  color: #725038;
}

.chapter-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #6a3b1e, #c78735);
  font-weight: 700;
}

.chapter-tabs button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.notice-board {
  position: relative;
  margin: 16px auto;
  padding: 17px 22px 16px 52px;
  border-radius: 8px 20px 18px 20px;
  background: #fff2bd;
  color: #6c4a2f;
  box-shadow: 4px 8px 0 rgba(116, 74, 32, .12);
  transform: rotate(-.4deg);
  font-family: var(--font-song);
  line-height: 1.9;
}

.pin {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #bf3f35 65%);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}

.notice-board p { margin: 0; }

.scene-shell {
  min-height: 560px;
  border: 3px double rgba(98, 58, 24, .28);
  border-radius: 26px;
  background:
    linear-gradient(rgba(255, 249, 230, .92), rgba(255, 249, 230, .92)),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(124,75,42,.05) 38px 39px);
  box-shadow: 0 18px 60px rgba(72, 41, 18, .18);
  overflow: hidden;
}

.scene {
  padding: 24px;
}

.chapter-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  align-items: flex-start;
}

.chapter-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-song);
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 3px;
}

.chapter-head p {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(117, 165, 101, .15);
  color: #597849;
  font-size: 13px;
  white-space: nowrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 22px;
}

.panel {
  padding: 18px;
  background: rgba(255, 250, 235, .76);
  border: 1px solid rgba(112, 70, 32, .16);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 10px 28px rgba(82, 50, 24, .08);
}

.wood-counter {
  position: relative;
  min-height: 440px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 25%),
    repeating-linear-gradient(90deg, #8a542e 0 35px, #7b4627 35px 72px);
  box-shadow: inset 0 0 0 6px rgba(63, 35, 19, .2), 0 18px 38px rgba(72, 39, 18, .24);
}

.glass {
  position: absolute;
  inset: 28px 28px auto;
  min-height: 225px;
  border: 2px solid rgba(255,255,255,.42);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,255,255,.1));
  box-shadow: inset 0 0 28px rgba(255,255,255,.25);
}

.old-calendar, .ticket, .glasses, .banknote, .ledger {
  position: absolute;
  user-select: none;
}

.old-calendar {
  left: 46px;
  top: 48px;
  width: 132px;
  height: 150px;
  background: #fff2d2;
  border: 1px solid #c99b66;
  border-radius: 8px;
  transform: rotate(-6deg);
  padding: 10px;
  box-shadow: 4px 7px 15px rgba(0,0,0,.12);
}

.old-calendar b {
  display: block;
  font-size: 34px;
  color: var(--red);
  text-align: center;
  margin-top: 10px;
}

.old-calendar span {
  display: block;
  text-align: center;
  color: var(--muted);
}

.ticket {
  right: 42px;
  top: 78px;
  width: 146px;
  height: 62px;
  background: #eecb85;
  border: 1px dashed #8e673b;
  transform: rotate(8deg);
  padding: 10px;
  font-size: 12px;
}

.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  top: 22px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #7f4929;
}

.ticket::before { left: -10px; }
.ticket::after { right: -10px; }

.glasses {
  right: 68px;
  top: 170px;
  width: 120px;
  height: 46px;
}

.glasses::before, .glasses::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 34px;
  border: 4px solid rgba(80,52,37,.72);
  border-radius: 50%;
}

.glasses::before { left: 5px; }
.glasses::after { right: 5px; }

.glasses i {
  position: absolute;
  width: 26px;
  height: 4px;
  background: rgba(80,52,37,.72);
  top: 17px;
  left: 47px;
}

.banknote {
  left: 85px;
  bottom: 42px;
  width: 178px;
  height: 76px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 25% 50%, rgba(255,255,255,.35), transparent 22%),
    linear-gradient(135deg, #90b777, #d3e0a3);
  border: 1px solid #789b5c;
  transform: rotate(7deg);
  box-shadow: 5px 10px 20px rgba(0,0,0,.18);
  display: grid;
  place-items: center;
  color: #486334;
  font-size: 30px;
  font-weight: 800;
}

.ledger {
  left: 50%;
  top: 175px;
  width: min(540px, calc(100% - 58px));
  min-height: 220px;
  transform: translateX(-50%) rotate(-1deg);
  background: #f3dbaf;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 14px 28px rgba(0,0,0,.22);
  border-left: 12px solid #765038;
}

.ledger h3, .panel h3 {
  margin: 0 0 12px;
  font-family: var(--font-song);
  font-size: 22px;
}

.ledger table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-song);
  font-size: 15px;
}

.ledger td {
  padding: 7px 4px;
  border-bottom: 1px dashed rgba(111, 69, 38, .32);
}

.circled {
  color: var(--red);
  font-weight: 700;
  border: 2px solid var(--red);
  border-radius: 50%;
  padding: 1px 5px;
}

.puzzle-box {
  background: linear-gradient(180deg, #fff9e9, #f6dfb8);
  border: 1px solid rgba(117, 76, 34, .24);
  border-radius: 18px;
  padding: 18px;
}

.password-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.password-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(117, 76, 34, .28);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
}

.feedback {
  min-height: 26px;
  margin-top: 10px;
  line-height: 1.8;
  color: var(--muted);
}

.feedback.ok { color: #4f7d44; font-weight: 700; }
.feedback.bad { color: #ad4d3d; font-weight: 700; }

.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.soft-btn {
  color: #6b472c;
  background: linear-gradient(135deg, #fff6d5, #efd09a);
  border: 1px solid rgba(117, 76, 34, .18);
}

.soft-btn.selected {
  color: #fff;
  background: linear-gradient(135deg, #6c8f55, #d3a145);
}

.wall {
  min-height: 530px;
  border-radius: 18px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.15), transparent),
    #d8c6a5;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.18);
}

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

.sticky {
  min-height: 126px;
  padding: 12px;
  border-radius: 8px 18px 10px 18px;
  background: #fff3a8;
  box-shadow: 4px 8px 0 rgba(85, 53, 25, .09);
  transform: rotate(var(--r, 0deg));
  position: relative;
  border: 1px solid rgba(120, 84, 42, .12);
}

.sticky:nth-child(3n+1) { background: #fff0a6; --r: -1.5deg; }
.sticky:nth-child(3n+2) { background: #d9f0c6; --r: 1.2deg; }
.sticky:nth-child(3n+3) { background: #ffd6c8; --r: -.8deg; }

.sticky .date {
  font-size: 12px;
  color: #9f7148;
  margin-bottom: 8px;
}

.sticky .body {
  font-family: var(--font-song);
  line-height: 1.65;
}

.note-sorter {
  display: grid;
  gap: 8px;
  max-height: 470px;
  overflow: auto;
  padding-right: 4px;
}

.note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  background: rgba(255,255,255,.54);
  border: 1px solid rgba(117,76,34,.15);
  border-radius: 14px;
}

.note-row.selected {
  outline: 3px solid rgba(215, 166, 66, .5);
  background: #fff5d3;
}

.note-row button {
  border: 0;
  background: transparent;
  color: #8a542e;
  font-weight: 700;
}

.note-control {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.note-control button {
  padding: 9px 14px;
}

.phrase {
  padding: 12px;
  border-radius: 14px;
  background: rgba(117, 165, 101, .12);
  color: #547945;
  font-family: var(--font-song);
  line-height: 1.8;
}

.shelf-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  gap: 20px;
}

.shelf {
  min-height: 560px;
  padding: 18px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(0deg, transparent 0 150px, rgba(63,35,19,.38) 150px 162px),
    linear-gradient(90deg, #8a552c, #70411f);
  box-shadow: inset 0 0 0 7px rgba(58, 34, 17, .24), 0 15px 35px rgba(79, 45, 17, .25);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: center;
}

.object-card {
  min-height: 190px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 238, 195, .82);
  text-align: center;
  box-shadow: 0 10px 22px rgba(51, 29, 14, .16);
}

.object-card.selected {
  outline: 4px solid rgba(255, 215, 92, .85);
}

.object-card.used {
  opacity: .55;
}

.object-card svg, .photo-card svg, .mailbox svg, .letter-stack svg {
  width: 100%;
  max-height: 124px;
  display: block;
}

.object-card strong {
  display: block;
  margin-top: 8px;
}

.album {
  background: #513225;
  color: #fbe8c1;
  border-radius: 24px;
  padding: 20px;
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.07), 0 16px 36px rgba(67, 38, 20, .25);
}

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

.photo-slot {
  min-height: 174px;
  border-radius: 12px;
  border: 2px dashed rgba(255, 238, 195, .45);
  background: rgba(255, 248, 226, .08);
  color: rgba(255, 238, 195, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}

.photo-slot.filled {
  border-style: solid;
  background: #fff5d9;
  color: var(--ink);
}

.photo-card {
  width: 100%;
  background: #fff8e9;
  border-radius: 8px;
  padding: 8px 8px 12px;
  box-shadow: 0 5px 14px rgba(0,0,0,.2);
}

.radio {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #815534, #3b2518);
  color: #fff0d2;
}

.radio-face {
  height: 74px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 24px 35px, #2b1d15 0 24px, transparent 25px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 4px, transparent 4px 9px),
    #a67a4c;
  border: 2px solid rgba(255,255,255,.15);
}

.collectibles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.collectible {
  min-height: 92px;
  border: 1px dashed rgba(117,76,34,.28);
  border-radius: 14px;
  background: rgba(255, 250, 232, .58);
  display: grid;
  place-items: center;
  padding: 8px;
}

.collectible.found {
  border-style: solid;
  background: rgba(117, 165, 101, .18);
}

.collectible svg {
  max-width: 88px;
  max-height: 72px;
}

.storage {
  min-height: 540px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 62% 25%, rgba(255,255,255,.12), transparent 30%),
    linear-gradient(135deg, #4a3a2e, #211711);
  padding: 24px;
  color: #f6dfb9;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
  gap: 20px;
}

.mailbox {
  min-height: 360px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.04);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
}

.mailbox svg {
  max-width: 360px;
  max-height: 320px;
}

.letters {
  display: grid;
  gap: 12px;
}

.letter {
  padding: 14px;
  border-radius: 12px;
  background: #fff4d7;
  color: var(--ink);
  border-left: 6px solid #d7a642;
  box-shadow: 4px 8px 0 rgba(0,0,0,.12);
  line-height: 1.85;
  font-family: var(--font-song);
}

.reveal {
  padding: 18px;
  border-radius: 18px;
  color: #fff8dc;
  background: linear-gradient(135deg, rgba(179,91,69,.32), rgba(215,166,66,.18));
  border: 1px solid rgba(255, 221, 151, .28);
  line-height: 2;
  font-family: var(--font-song);
}

.chat-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 20px;
}

.chat-window {
  border-radius: 24px;
  overflow: hidden;
  background: #e7f0dd;
  border: 1px solid rgba(76, 108, 72, .22);
  box-shadow: 0 18px 40px rgba(57, 82, 47, .16);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #6b8d5b;
  color: #fff;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,.28) 8px 10px, transparent 10px 18px),
    linear-gradient(135deg, #b85b43, #f0c06a);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28);
}

.chat-body {
  padding: 18px;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  max-width: 84%;
  padding: 13px 15px;
  border-radius: 18px;
  line-height: 1.8;
  box-shadow: 0 5px 14px rgba(74, 102, 62, .12);
}

.bubble.from {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 4px;
}

.bubble.to {
  align-self: flex-end;
  background: #c8edac;
  border-top-right-radius: 4px;
}

.reply-box {
  padding: 15px;
  border-top: 1px solid rgba(76, 108, 72, .16);
  background: rgba(255,255,255,.45);
}

.reply-box textarea {
  width: 100%;
  min-height: 98px;
  resize: vertical;
  border: 1px solid rgba(76, 108, 72, .22);
  border-radius: 14px;
  padding: 13px;
  line-height: 1.7;
  background: rgba(255,255,255,.86);
}

.reply-options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice-btn {
  width: 100%;
  color: #5f4026;
  text-align: left;
  background: linear-gradient(135deg, #fff7db, #eacf95);
}

.choice-btn.selected {
  color: #fff;
  background: linear-gradient(135deg, #6b8d5b, #d7a642);
}

.ending-card {
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 249, 229, .9), rgba(255, 249, 229, .9)),
    radial-gradient(circle at 80% 10%, rgba(240,190,70,.45), transparent 26%);
  border: 2px solid rgba(117,76,34,.16);
  line-height: 2;
}

.ending-card h3 {
  font-family: var(--font-song);
  font-size: 32px;
  margin: 0 0 12px;
  letter-spacing: 4px;
}

.ending-card p {
  margin: 0 0 12px;
}

.stamp {
  display: inline-block;
  color: #b65a45;
  border: 2px solid #b65a45;
  border-radius: 8px;
  padding: 4px 10px;
  transform: rotate(-6deg);
  font-weight: 800;
  letter-spacing: 2px;
}

.hint-drawer {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(39, 22, 12, .38);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.hint-drawer.show {
  display: flex;
}

.hint-card, .modal-card {
  position: relative;
  width: min(620px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  background: #fff7dd;
  border: 2px solid rgba(117,76,34,.24);
  box-shadow: 0 22px 70px rgba(0,0,0,.26);
}

.hint-card h2, .hint-card h3 {
  font-family: var(--font-song);
  margin: 0 0 10px;
}

.hint-sub {
  color: var(--muted);
  line-height: 1.8;
}

.hint-levels {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.hint-levels button {
  border: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #e9c57f;
  color: #5b3b23;
}

.hint-output, .hint-log {
  min-height: 56px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.58);
  line-height: 1.85;
}

.hint-log {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.hint-log small {
  display: block;
  color: var(--muted);
  border-bottom: 1px dashed rgba(117,76,34,.18);
  padding-bottom: 8px;
}

.close-x {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 28px;
  color: #987151;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(39, 22, 12, .46);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

#modalBody {
  line-height: 1.9;
}

#modalBody h2 {
  font-family: var(--font-song);
  margin-top: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  z-index: 30;
  padding: 13px 20px;
  border-radius: 14px;
  color: #fff;
  background: rgba(76, 53, 34, .94);
  box-shadow: 0 10px 26px rgba(0,0,0,.24);
  transition: all .28s ease;
  max-width: min(540px, 90vw);
  text-align: center;
  line-height: 1.6;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@media (max-width: 920px) {
  .topbar, .chapter-head, .grid-2, .shelf-scene, .storage, .chat-scene {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

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

  .shelf {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app {
    padding: 12px;
  }

  .scene {
    padding: 14px;
  }

  .notes-grid, .album-grid, .collectibles {
    grid-template-columns: 1fr;
  }

  .ledger {
    top: 180px;
    font-size: 13px;
  }

  .old-calendar, .ticket, .glasses {
    transform: none;
  }

  .password-row, .choice-row {
    flex-direction: column;
  }
}
