:root {
  --ink: #28231c;
  --paper-ink: #342c22;
  --muted: #74695b;
  --line: rgba(52, 44, 34, 0.2);
  --paper: #eee3ce;
  --paper-deep: #dcc9a9;
  --cover: #26362f;
  --cover-deep: #17251f;
  --gold: #c7953f;
  --green: #507a62;
  --red: #a74c42;
  --shadow: rgba(0, 0, 0, 0.38);
  --radius: 8px;
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #10130f;
  color: #f3ead7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell,
.tabletop {
  min-height: 100vh;
}

.site-record {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 4;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.site-record a {
  border-radius: 999px;
  background: rgba(16, 19, 15, 0.52);
  color: rgba(246, 236, 218, 0.74);
  font-size: 0.76rem;
  line-height: 1;
  padding: 7px 10px;
  text-decoration: none;
  pointer-events: auto;
}

.site-record a:hover,
.site-record a:focus-visible {
  color: #f6ecda;
  outline: none;
}

.tabletop {
  position: relative;
  overflow: hidden;
  padding: 42px 20px 54px;
}

.room-image,
.room-shade {
  position: fixed;
  inset: 0;
}

.room-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.04) brightness(1.16);
}

.room-shade {
  background: linear-gradient(180deg, rgba(8, 9, 7, 0.02) 0%, rgba(8, 9, 7, 0.18) 100%);
}

.scene-art-note {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  display: grid;
  gap: 3px;
  border: 1px dashed rgba(246, 232, 202, 0.42);
  border-radius: var(--radius);
  background: rgba(16, 19, 15, 0.76);
  color: #f6ecda;
  padding: 10px 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.scene-art-note strong {
  color: var(--gold);
  font-size: 0.84rem;
}

.scene-art-note span {
  color: rgba(246, 232, 202, 0.78);
  font-size: 0.76rem;
}

.scene {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(520px, 1fr);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 96px);
  width: min(1280px, 100%);
  margin: 0 auto;
  transition: grid-template-columns 280ms ease, gap 280ms ease;
}

.brand {
  max-width: 560px;
}

.brand__eyebrow,
.brand__meta,
.paper-header__kicker,
.resume-panel__label {
  margin: 0;
  color: rgba(243, 234, 215, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand h1 {
  margin: 10px 0 12px;
  color: #f6ecda;
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 0.94;
  letter-spacing: 0;
  font-weight: 760;
  text-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.brand__meta {
  color: rgba(243, 234, 215, 0.88);
  font-size: 1rem;
}

.book-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 520px);
  align-items: center;
  justify-content: end;
  gap: 0;
  min-width: 0;
  perspective: 1400px;
  transition: grid-template-columns 300ms ease, gap 300ms ease;
}

.tabletop.is-open .scene {
  grid-template-columns: minmax(0, 960px);
  justify-content: center;
  gap: 0;
}

.tabletop.is-open .brand {
  display: none;
}

.tabletop.is-open .brand h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.tabletop.is-open .book-workspace {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: 0;
  width: 100%;
}

.notebook {
  position: relative;
  display: block;
  width: min(100%, 560px);
  aspect-ratio: 1049 / 1340;
  margin-left: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f5e8ca;
  transform: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.notebook:hover,
.notebook:focus-visible {
  transform: translateY(-8px);
  box-shadow: none;
  outline: none;
}

.notebook__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 34px 44px rgba(0, 0, 0, 0.42));
}

.notebook__spine {
  display: none;
  position: absolute;
  inset: 0 auto 0 13%;
  width: 2px;
  background: rgba(246, 232, 202, 0.18);
}

.notebook__band {
  display: none;
  position: absolute;
  top: 0;
  right: 20%;
  width: 9%;
  height: 100%;
  background: rgba(14, 17, 14, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.notebook__mark {
  display: none;
  position: absolute;
  top: 11%;
  left: 19%;
  border: 1px solid rgba(246, 232, 202, 0.42);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.76rem;
}

.art-stamp {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(246, 232, 202, 0.5);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(246, 232, 202, 0.08) 25%, transparent 25% 50%, rgba(246, 232, 202, 0.08) 50% 75%, transparent 75%),
    rgba(17, 28, 23, 0.72);
  background-size: 18px 18px;
  color: rgba(246, 232, 202, 0.82);
  padding: 12px;
  text-align: left;
}

.art-stamp strong {
  color: var(--gold);
  font-size: 1rem;
}

.art-stamp span {
  font-size: 0.78rem;
  line-height: 1.25;
}

.art-stamp--notebook {
  display: none;
  position: absolute;
  top: 22%;
  right: 11%;
  width: 34%;
  min-height: 28%;
}

.notebook__title {
  display: none;
  position: absolute;
  left: 19%;
  bottom: 22%;
  font-size: clamp(2.2rem, 6vw, 4.1rem);
  font-weight: 760;
  letter-spacing: 0;
  writing-mode: vertical-rl;
}

.notebook__hint {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(16, 19, 15, 0.56);
  padding: 7px 11px;
  color: rgba(246, 232, 202, 0.72);
  font-size: 0.88rem;
  white-space: nowrap;
}

.tabletop.is-open .notebook {
  display: none;
}

.tabletop.is-open .notebook:hover,
.tabletop.is-open .notebook:focus-visible {
  transform: none;
}

.paper-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  animation: paper-slide-in 300ms ease-out both;
}

.paper-stage[hidden],
.resume-panel[hidden],
.case-intro[hidden],
.case-dossier[hidden],
.notebook-brief[hidden],
.game-entry[hidden] {
  display: none;
}

.paper-sheet {
  position: relative;
  min-height: min(620px, calc(100vh - 132px));
  max-height: calc(100vh - 112px);
  overflow: auto;
  border-radius: 6px;
  background: #efe0c5 url("../public/assets/paper.jpg?v=20260713-3") center / cover no-repeat;
  box-shadow:
    0 30px 88px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(92, 68, 39, 0.18);
  color: var(--paper-ink);
  padding: 44px 46px 42px 98px;
  transform: rotate(0.4deg);
}

.paper-sheet::after {
  content: "";
  position: absolute;
  inset: auto 30px 20px auto;
  width: 150px;
  height: 44px;
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(-8deg);
  filter: blur(0.2px);
}

.paper-sheet.is-credits-sheet {
  min-height: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  color: var(--cream);
  padding: 0;
  transform: none;
}

.paper-sheet.is-credits-sheet::after {
  display: none;
}

.paper-sheet__holes {
  position: absolute;
  left: 28px;
  top: 74px;
  display: grid;
  gap: 62px;
}

.paper-sheet__holes span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(77, 64, 47, 0.22);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
}

.paper-header,
.resume-panel,
.game-entry__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.paper-header__kicker,
.resume-panel__label {
  color: var(--muted);
}

.paper-header h2,
.game-entry h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 4vw, 1.5rem);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-header__kicker[hidden] + h2 {
  margin-top: 0;
}

.paper-header__meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.gate__status {
  flex: 0 0 auto;
  min-width: 76px;
  border: 1px solid rgba(52, 44, 34, 0.22);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.day-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(52, 44, 34, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.header-save-button,
.header-back-button,
.header-next-button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(52, 44, 34, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  padding: 0 11px;
  font-size: 0.78rem;
  font-weight: 760;
}

.header-save-button:hover,
.header-save-button:focus-visible,
.header-back-button:hover,
.header-back-button:focus-visible,
.header-next-button:hover,
.header-next-button:focus-visible {
  border-color: rgba(199, 149, 63, 0.68);
  background: rgba(199, 149, 63, 0.14);
  outline: none;
}

.gate__status.is-valid {
  border-color: rgba(80, 122, 98, 0.5);
  color: #345f45;
}

.gate__status.is-error {
  border-color: rgba(167, 76, 66, 0.48);
  color: var(--red);
}

.resume-panel button {
  height: 50px;
  border: 0;
  border-radius: var(--radius);
  background: var(--gold);
  color: #24190a;
  font-weight: 760;
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-message.is-error {
  color: var(--red);
}

.form-message.is-success {
  color: #43684e;
}

.notice-copy {
  margin: 2px 0 0;
  border-left: 3px solid rgba(199, 149, 63, 0.58);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.58;
  padding: 8px 0 8px 12px;
}

.view-root {
  position: relative;
  margin-top: 30px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.restore-form,
.save-panel {
  display: grid;
  gap: 12px;
}

.stack-form label {
  color: var(--muted);
  font-size: 0.92rem;
}

.inline-fields,
.signature-row,
.date-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: end;
}

.signature-row {
  grid-template-columns: 112px 104px;
  justify-content: start;
}

.date-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 104px;
}

.stack-form input,
.restore-form textarea,
.progress-code-output,
.date-fields input {
  min-width: 0;
  min-height: 50px;
  border: 0;
  border-bottom: 2px solid rgba(52, 44, 34, 0.45);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

.stack-form input,
.date-fields input {
  height: 50px;
  padding-top: 0;
  padding-bottom: 0;
}

.restore-form textarea,
.progress-code-output {
  width: 100%;
  resize: vertical;
  overflow-wrap: anywhere;
}

.signature-row input {
  font-size: 1.7rem;
  font-weight: 760;
  text-align: center;
  text-transform: uppercase;
}

.stack-form input:focus,
.restore-form textarea:focus,
.progress-code-output:focus,
.date-fields input:focus {
  border-color: var(--gold);
  box-shadow: inset 0 -4px 0 rgba(199, 149, 63, 0.16);
}

.stack-form button,
.toolbar button,
.chapter-bottom-nav button,
.chapter-toolbar button,
.result-panel button,
.ending-panel button,
.archive-row,
.relationship-grid button {
  border: 0;
  border-radius: var(--radius);
  font-weight: 760;
}

.stack-form button,
.toolbar button,
.chapter-bottom-nav button,
.result-panel button,
.ending-panel button {
  min-height: 44px;
  background: var(--green);
  color: #f6ecda;
  padding: 0 18px;
}

.archive-cover,
.result-panel,
.choice-panel,
.ending-panel,
.summary-panel {
  border: 1px dashed rgba(80, 122, 98, 0.36);
  border-radius: var(--radius);
  background: rgba(80, 122, 98, 0.08);
  padding: 16px;
}

.archive-cover p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.archive-owner {
  margin: 0;
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 760;
}

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

.score-strip {
  display: grid;
  grid-template-columns: auto auto auto auto;
  gap: 8px 12px;
  align-items: center;
  width: fit-content;
  margin-top: 14px;
  border-top: 1px solid rgba(52, 44, 34, 0.14);
  padding-top: 12px;
}

.score-strip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.score-strip strong {
  color: var(--ink);
}

.archive-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(52, 44, 34, 0.16);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  padding: 14px 12px;
  text-align: left;
}

.archive-row:hover,
.archive-row:focus-visible {
  background: rgba(199, 149, 63, 0.15);
  outline: none;
}

.archive-row:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.archive-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.archive-row strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.archive-row small,
.archive-row em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.chapter-shell {
  display: grid;
  gap: 22px;
}

.chapter-toolbar,
.toolbar,
.chapter-bottom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.chapter-bottom-nav {
  border-top: 1px solid rgba(52, 44, 34, 0.18);
  padding-top: 18px;
}

.ghost-button {
  min-height: 40px;
  border: 1px solid rgba(52, 44, 34, 0.28) !important;
  border-radius: var(--radius);
  background: transparent !important;
  color: var(--ink) !important;
  padding: 0 16px;
}

.sound-button {
  background: rgba(80, 122, 98, 0.1) !important;
  color: #345f45 !important;
}

.chapter-sound-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -2px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px !important;
  border: 1px solid rgba(80, 122, 98, 0.22) !important;
  border-radius: 8px !important;
  padding: 0 !important;
  box-shadow: none;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(80, 122, 98, 0.18) !important;
  outline: none;
}

.story-copy {
  display: grid;
  gap: 13px;
  color: var(--paper-ink);
  line-height: 1.78;
}

.story-copy p {
  margin: 0;
}

.story-copy strong {
  color: #6d4023;
  font-size: 1.06em;
}

.story-image {
  margin: 0;
}

.story-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 12px 34px rgba(52, 44, 34, 0.18);
}

.story-image--portrait {
  width: min(280px, 100%);
}

.story-image--portrait img {
  aspect-ratio: 1;
}

.story-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ending-illustration {
  margin: 0;
  width: min(360px, 100%);
}

.ending-illustration img {
  display: block;
  width: 100%;
  max-height: 430px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 28px rgba(52, 44, 34, 0.16);
}

.result-panel,
.choice-panel,
.ending-panel,
.summary-panel,
.credits-panel {
  display: grid;
  gap: 12px;
  color: var(--paper-ink);
  line-height: 1.62;
}

.result-panel h3,
.choice-panel h3,
.ending-panel h3,
.summary-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.28;
}

.result-panel p,
.choice-panel p,
.ending-panel p {
  margin: 0;
}

.diary-pages {
  display: grid;
  gap: 12px;
}

.diary-entry {
  display: grid;
  gap: 10px;
  border-left: 3px solid rgba(52, 44, 34, 0.24);
  border-radius: 4px;
  background: rgba(255, 250, 228, 0.36);
  padding: 12px 14px;
  font-family: "Kaiti SC", "STKaiti", KaiTi, "楷体", serif;
  font-size: 1.04rem;
  line-height: 1.82;
}

.diary-entry p {
  margin: 0;
}

.diary-entry + .diary-entry {
  border-top: 1px solid rgba(52, 44, 34, 0.18);
  border-left-color: rgba(52, 44, 34, 0.24);
  background: rgba(255, 250, 228, 0.3);
  padding-top: 16px;
}

.mumu-choice-form {
  display: grid;
  gap: 12px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.mumu-choice-form fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.mumu-choice-form legend {
  margin-bottom: 10px;
  color: var(--paper-ink);
  font-weight: 760;
}

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

.mumu-choice-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(52, 44, 34, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  font-weight: 760;
}

.mumu-choice-option input {
  margin: 0 6px 0 0;
  accent-color: var(--green);
}

.mumu-choice-form button {
  width: fit-content;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #f6ecda;
  padding: 0 20px;
  font-weight: 760;
}

.mumu-photo-slot {
  margin: 0;
  width: min(320px, 100%);
}

.mumu-photo-slot img {
  display: block;
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(52, 44, 34, 0.16);
}

.achievement-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(199, 149, 63, 0.38);
  border-radius: 6px;
  background: rgba(199, 149, 63, 0.1);
  padding: 13px 14px;
}

.achievement-card__label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.achievement-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.3;
}

.achievement-card p,
.achievement-card small {
  margin: 0;
}

.achievement-card small {
  color: var(--muted);
}

.result-note,
.warning-copy {
  color: var(--red);
  font-size: 0.92rem;
}

.name-candidates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.name-candidates li {
  border: 1px solid rgba(52, 44, 34, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
  padding: 11px 12px;
  color: var(--ink);
  font-weight: 760;
}

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

.relationship-grid button,
.answer-actions button {
  min-height: 48px;
  border: 1px solid rgba(52, 44, 34, 0.2);
  background: rgba(255, 255, 255, 0.2);
  color: var(--ink);
  padding: 0 12px;
}

.relationship-grid button:hover,
.relationship-grid button:focus-visible {
  border-color: rgba(199, 149, 63, 0.7);
  background: rgba(199, 149, 63, 0.16);
  outline: none;
}

.summary-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.summary-grid div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgba(52, 44, 34, 0.16);
  padding: 10px 0;
}

.summary-grid dt {
  color: var(--muted);
}

.summary-grid dd {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.credits-panel {
  justify-items: center;
  width: 100%;
}

.credits-image {
  margin: 0 auto;
  width: min(560px, 100%);
}

.credits-image img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 172px);
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.3);
}

.resume-panel {
  margin-top: 30px;
  border: 1px dashed rgba(80, 122, 98, 0.42);
  border-radius: var(--radius);
  background: rgba(80, 122, 98, 0.09);
  padding: 15px;
}

.resume-panel__code {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 760;
}

.resume-panel__detective {
  margin: 6px 0 0;
  color: #345f45;
  font-size: 0.95rem;
  font-weight: 760;
}

.resume-panel button {
  min-width: 86px;
  background: var(--green);
  color: #f6ecda;
}

.case-intro,
.case-dossier,
.notebook-brief {
  margin-top: 34px;
  border-top: 1px solid rgba(52, 44, 34, 0.18);
  padding-top: 24px;
}

.case-intro h3,
.case-dossier h3,
.notebook-brief h3 {
  margin: 5px 0 18px;
  color: var(--ink);
  font-size: 1.42rem;
  line-height: 1.2;
}

.art-placeholder {
  margin: 0 0 20px;
}

.art-placeholder__frame {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px dashed rgba(52, 44, 34, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(52, 44, 34, 0.08) 25%, transparent 25% 50%, rgba(52, 44, 34, 0.08) 50% 75%, transparent 75%),
    rgba(255, 255, 255, 0.18);
  background-size: 22px 22px;
  color: var(--muted);
  min-height: 180px;
  padding: 20px;
  text-align: center;
}

.art-placeholder__frame::before,
.art-placeholder__frame::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 120%;
  height: 1px;
  background: rgba(52, 44, 34, 0.16);
  transform-origin: center;
}

.art-placeholder__frame::before {
  transform: translate(-50%, -50%) rotate(28deg);
}

.art-placeholder__frame::after {
  transform: translate(-50%, -50%) rotate(-28deg);
}

.art-placeholder__frame strong,
.art-placeholder__frame span {
  position: relative;
  z-index: 1;
}

.art-placeholder__frame strong {
  color: var(--ink);
  font-size: 1.18rem;
}

.art-placeholder__frame span {
  font-size: 0.9rem;
  line-height: 1.3;
}

.art-placeholder figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.art-placeholder--wide .art-placeholder__frame {
  aspect-ratio: 16 / 9;
}

.art-placeholder--portrait {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  align-items: end;
  gap: 14px;
}

.art-placeholder--portrait .art-placeholder__frame {
  aspect-ratio: 3 / 4;
  min-height: 0;
}

.art-placeholder--portrait figcaption {
  margin: 0 0 8px;
}

.art-placeholder--evidence .art-placeholder__frame {
  aspect-ratio: 14 / 9;
  min-height: 160px;
}

.case-intro__copy {
  display: grid;
  gap: 13px;
  color: var(--paper-ink);
  line-height: 1.78;
}

.case-intro__copy p {
  margin: 0;
}

.case-intro button,
.case-dossier button,
.notebook-brief button {
  height: 44px;
  margin-top: 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #f6ecda;
  padding: 0 18px;
  font-weight: 760;
}

.dossier-fields,
.decoded-fields {
  display: grid;
  gap: 10px;
  margin: 0;
}

.dossier-fields div,
.decoded-fields div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgba(52, 44, 34, 0.16);
  padding: 12px 0;
}

.dossier-fields dt,
.decoded-fields dt {
  color: var(--muted);
  font-size: 0.86rem;
}

.dossier-fields dd,
.decoded-fields dd {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
}

.decoded-fields {
  margin-top: 20px;
}

.decoded-fields dd span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
}

.game-entry {
  margin-top: 34px;
}

.game-entry__toolbar {
  border-top: 1px solid rgba(52, 44, 34, 0.18);
  padding-top: 22px;
}

.ghost-button {
  height: 40px;
  border: 1px solid rgba(52, 44, 34, 0.28);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0 16px;
}

.day-puzzle,
.waiting-panel {
  margin-top: 24px;
}

.day-puzzle h3,
.waiting-panel h3 {
  margin: 5px 0 12px;
  color: var(--ink);
  font-size: 1.32rem;
}

.notebook-brief .day-puzzle {
  border-top: 1px solid rgba(52, 44, 34, 0.18);
  padding-top: 22px;
}

.puzzle-question {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 760;
  line-height: 1.5;
}

.answer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 140px));
  gap: 10px;
  margin-top: 18px;
}

.answer-actions button {
  height: 48px;
  border: 1px solid rgba(52, 44, 34, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.2);
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 760;
}

.answer-actions button:hover,
.answer-actions button:focus-visible {
  border-color: rgba(199, 149, 63, 0.7);
  background: rgba(199, 149, 63, 0.16);
  outline: none;
}

.waiting-panel {
  border: 1px dashed rgba(80, 122, 98, 0.42);
  border-radius: var(--radius);
  background: rgba(80, 122, 98, 0.08);
  padding: 16px;
}

.waiting-panel p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.puzzle-lines {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.puzzle-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid rgba(52, 44, 34, 0.2);
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.puzzle-line--active {
  color: #1d4d35;
}

.puzzle-line span {
  color: var(--gold);
  font-size: 0.82rem;
}

.puzzle-line strong {
  font-size: 1.03rem;
}

@keyframes paper-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes paper-slide-in {
  from {
    opacity: 0;
    transform: translateX(42px) rotate(1.4deg) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@media (max-width: 900px) {
  .tabletop {
    padding: 32px 14px 42px;
  }

  .scene {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: auto;
  }

  .tabletop.is-open .scene {
    grid-template-columns: 1fr;
  }

  .tabletop.is-open .brand {
    display: none;
  }

  .brand h1 {
    font-size: clamp(3rem, 16vw, 5.2rem);
  }

  .notebook {
    width: min(86vw, 370px);
    margin: 0 auto;
  }

  .tabletop.is-open .book-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .tabletop.is-open .notebook {
    width: min(40vw, 180px);
  }

  .paper-stage {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .tabletop {
    overflow-x: hidden;
  }

  .scene {
    width: min(880px, 100%);
  }

  .tabletop.is-open .scene {
    width: min(880px, 100%);
  }

  .tabletop.is-open .brand {
    display: none;
  }

  .tabletop.is-open .book-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .paper-sheet {
    min-height: 560px;
    max-height: calc(100vh - 86px);
    padding: 34px 18px 30px 42px;
  }

  .paper-sheet__holes {
    left: 13px;
    top: 72px;
  }

  .paper-sheet__holes span {
    width: 13px;
    height: 13px;
  }

  .paper-header,
  .resume-panel,
  .game-entry__toolbar {
    align-items: flex-start;
  }

  .inline-fields,
  .signature-row,
  .date-fields,
  .name-candidates,
  .relationship-grid {
    grid-template-columns: 1fr;
  }

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

  .stack-form button,
  .mumu-choice-form button,
  .toolbar button,
  .chapter-bottom-nav button,
  .result-panel button,
  .ending-panel button {
    width: 100%;
  }

  .paper-header__meta {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .header-save-button,
  .header-back-button,
  .header-next-button {
    min-height: 30px;
    padding: 0 9px;
  }

  .scene-art-note {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }

  .art-stamp--notebook {
    top: 20%;
    right: 10%;
    width: 38%;
    min-height: 30%;
  }

  .art-placeholder--portrait {
    grid-template-columns: 1fr;
  }

  .art-placeholder--portrait figcaption {
    margin: 8px 0 0;
  }

  .score-strip,
  .summary-grid div {
    grid-template-columns: 1fr;
  }
}
