:root {
  --page-bg: #eef3e4;
  --mist: #f7f1e4;
  --sage: #8faa77;
  --moss: #658057;
  --soil: #b48e62;
  --wood: #855d42;
  --roof: #9d6b59;
  --ink: #2f241b;
  --paper: rgba(250, 245, 232, 0.92);
  --paper-edge: rgba(131, 97, 72, 0.22);
  --accent: #d68d74;
  --water: #5a88a9;
  --gold: #f0bf6d;
  --shadow: rgba(43, 30, 19, 0.16);
  --shadow-soft: rgba(43, 30, 19, 0.08);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 252, 245, 0.95), transparent 32%),
    radial-gradient(circle at bottom right, rgba(214, 141, 116, 0.16), transparent 28%),
    linear-gradient(180deg, #f8f6ec 0%, #edf4e3 56%, #e3ecdb 100%);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  gap: 24px;
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 24px;
}

.hero-copy {
  flex: 1;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: rgba(47, 36, 27, 0.62);
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
  color: #453124;
}

.lede {
  width: min(62ch, 100%);
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(47, 36, 27, 0.82);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(250, 245, 232, 0.82);
  border: 1px solid rgba(133, 93, 66, 0.16);
  box-shadow: 0 10px 24px rgba(31, 23, 17, 0.06);
  font-size: 0.9rem;
  color: rgba(47, 36, 27, 0.78);
}

.hud-card,
.poster-card,
.paper,
.dialogue-card,
.day-note-card,
.title-card,
.ending-card {
  border: 1px solid var(--paper-edge);
  border-radius: 22px;
  background: var(--paper);
  box-shadow:
    0 18px 40px var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hud-card {
  width: min(300px, 100%);
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.92), rgba(244, 235, 218, 0.92)),
    var(--paper);
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(133, 93, 66, 0.2);
  font-size: 0.95rem;
}

.hud-row:last-child {
  border-bottom: 0;
}

.hud-row span {
  color: rgba(47, 36, 27, 0.65);
}

.release-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

.poster-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 253, 247, 0.86), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 235, 0.88), rgba(232, 240, 224, 0.9));
}

.cover-poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 7 / 5;
  border-radius: 24px;
  border: 1px solid rgba(93, 68, 49, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 20px 40px rgba(31, 23, 17, 0.12);
}

.cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  filter: saturate(1.02) contrast(1.02);
}

.cover-image-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(35, 24, 16, 0.2), rgba(35, 24, 16, 0.06) 34%, rgba(35, 24, 16, 0.02) 72%);
}

.poster-title-band {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: min(72%, 240px);
  margin: -6px 0 0 18px;
  padding: 7px 11px 8px;
  border: 1px solid rgba(249, 229, 197, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(132, 95, 68, 0.97), rgba(89, 62, 45, 0.98)),
    linear-gradient(90deg, rgba(245, 214, 160, 0.08), rgba(245, 214, 160, 0));
  color: #fff7e8;
  box-shadow:
    0 10px 20px rgba(43, 30, 19, 0.1),
    inset 0 1px 0 rgba(255, 251, 240, 0.14),
    inset 0 0 0 1px rgba(73, 50, 35, 0.24);
}

.poster-title-band::before,
.poster-title-band::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 244, 216, 0.95), rgba(235, 193, 121, 0.9) 48%, rgba(113, 77, 48, 0.95) 100%);
  box-shadow: 0 0 0 1px rgba(72, 49, 33, 0.3);
  z-index: 1;
}

.poster-title-band::before {
  left: 8px;
}

.poster-title-band::after {
  right: 8px;
}

.poster-title-band strong {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(0.78rem, 1.45vw, 0.98rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(57, 39, 26, 0.32);
}

.poster-title-band span {
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 244, 223, 0.78);
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: 24px;
  row-gap: 16px;
  align-items: start;
}

.game-main-column {
  display: contents;
}

.canvas-frame {
  position: relative;
  padding: 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255, 252, 246, 0.86), transparent 32%),
    linear-gradient(180deg, rgba(255, 250, 239, 0.84), rgba(231, 242, 225, 0.92));
  border: 1px solid rgba(133, 93, 66, 0.18);
  box-shadow: 0 24px 60px var(--shadow-soft);
}

#game {
  display: block;
  width: 100%;
  max-width: 864px;
  height: auto;
  aspect-ratio: 288 / 224;
  image-rendering: pixelated;
  border-radius: 22px;
  border: 1px solid rgba(76, 55, 39, 0.28);
  background: linear-gradient(180deg, #dfe6d7, #e8eedf);
}

.overlay {
  position: absolute;
  pointer-events: none;
}

.hint {
  left: 34px;
  bottom: 30px;
  max-width: min(70%, 520px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(250, 245, 232, 0.84);
  border: 1px solid rgba(133, 93, 66, 0.15);
  box-shadow: 0 8px 24px rgba(31, 23, 17, 0.12);
  color: rgba(47, 36, 27, 0.86);
  font-size: 0.92rem;
  line-height: 1.4;
}

.toast {
  top: 32px;
  right: 32px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 249, 236, 0.94);
  border: 1px solid rgba(133, 93, 66, 0.18);
  box-shadow: 0 12px 28px rgba(31, 23, 17, 0.12);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease;
  color: #4d3829;
  font-size: 0.92rem;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.side-panel {
  display: contents;
}

.canvas-frame {
  grid-column: 1;
  grid-row: 1 / span 4;
}

.progress-panel {
  grid-column: 2;
  grid-row: 1;
}

.objective-panel {
  grid-column: 2;
  grid-row: 2;
}

.inventory-panel {
  grid-column: 2;
  grid-row: 3;
}

.shared-traces-panel {
  grid-column: 1 / -1;
  grid-row: 5;
}

.controls-panel {
  grid-column: 2;
  grid-row: 4;
}

.paper {
  padding: 18px;
}

.paper h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.1rem;
  color: #503a2a;
}

.paper p,
.paper li {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.65;
  color: rgba(47, 36, 27, 0.82);
}

.paper-note {
  margin-top: 12px;
}

.release-paper h2 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: #4f3929;
}

.release-paper-hero {
  display: grid;
  align-content: start;
}

.release-copy {
  margin-top: 14px;
  font-size: 0.98rem;
  line-height: 1.72;
  color: rgba(47, 36, 27, 0.84);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.fact-chip {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 249, 239, 0.76);
}

.fact-chip span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(76, 55, 39, 0.6);
}

.fact-chip strong {
  font-size: 1rem;
  color: #463224;
}

.store-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.store-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(133, 93, 66, 0.2);
  text-decoration: none;
  font-size: 0.95rem;
  box-shadow: 0 12px 24px rgba(31, 23, 17, 0.06);
}

.store-cta.primary {
  background: linear-gradient(180deg, rgba(242, 206, 143, 0.98), rgba(216, 157, 96, 0.96));
  color: #47311f;
}

.store-cta.secondary {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(239, 230, 214, 0.96));
  color: #4c3728;
}

.store-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.store-mini-meta span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 248, 233, 0.76);
  border: 1px solid rgba(133, 93, 66, 0.14);
  font-size: 0.86rem;
  color: rgba(47, 36, 27, 0.74);
}

.paper ul {
  margin: 0;
  padding-left: 18px;
}

.showcase-shell {
  margin-bottom: 24px;
}

.chapter-showcase {
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 252, 246, 0.9), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 235, 0.92), rgba(232, 240, 224, 0.9));
}

.chapter-showcase-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.chapter-showcase-kicker {
  margin: 0;
  color: rgba(47, 36, 27, 0.68);
  font-size: 0.94rem;
}

.chapter-showcase-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  margin-top: 18px;
}

.chapter-intro,
.chapter-board {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 249, 239, 0.78);
}

.chapter-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.chapter-pane-label {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(76, 55, 39, 0.64);
}

.chapter-showcase-copy {
  margin-top: 0;
  font-size: 1rem;
  line-height: 1.72;
  color: rgba(47, 36, 27, 0.84);
}

.chapter-reset-btn {
  margin-top: auto;
}

.chapter-jump-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.day-pill {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 16px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 251, 243, 0.72);
  text-align: center;
}

.day-pill strong {
  font-size: 0.88rem;
  color: #4e3829;
}

.day-pill span {
  font-size: 0.72rem;
  color: rgba(47, 36, 27, 0.58);
}

.day-pill.current {
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.96), rgba(242, 227, 195, 0.9));
  border-color: rgba(214, 141, 116, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.day-pill.done {
  background: linear-gradient(180deg, rgba(240, 247, 233, 0.94), rgba(223, 238, 212, 0.9));
}

.day-pill.locked {
  background: rgba(233, 227, 214, 0.56);
}

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

.chapter-btn,
.panel-btn {
  border: 1px solid rgba(133, 93, 66, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(239, 230, 214, 0.96));
  color: #4c3728;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  box-shadow: 0 12px 24px rgba(31, 23, 17, 0.06);
}

.chapter-btn {
  display: grid;
  gap: 4px;
  padding: 12px 10px;
  text-align: left;
}

.chapter-btn strong {
  font-size: 0.92rem;
}

.chapter-btn span {
  font-size: 0.8rem;
  color: rgba(47, 36, 27, 0.68);
}

.chapter-btn.current {
  border-color: rgba(214, 141, 116, 0.36);
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.98), rgba(244, 231, 205, 0.95));
}

.chapter-btn:disabled {
  opacity: 0.48;
  box-shadow: none;
}

.panel-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px 18px;
  font-size: 0.95rem;
}

.panel-btn.primary {
  background: linear-gradient(180deg, rgba(242, 206, 143, 0.98), rgba(216, 157, 96, 0.96));
  color: #47311f;
}

.panel-btn.secondary {
  background: linear-gradient(180deg, rgba(242, 241, 232, 0.98), rgba(224, 236, 222, 0.96));
}

.panel-btn:active,
.chapter-btn:active {
  transform: translateY(1px);
}

.controls-list li + li {
  margin-top: 8px;
}

.shared-traces-panel {
  display: grid;
  gap: 12px;
}

.shared-traces-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shared-traces-kicker {
  color: rgba(47, 36, 27, 0.66);
}

.shared-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(133, 93, 66, 0.16);
  background: rgba(255, 248, 233, 0.82);
  font-size: 0.78rem;
  color: rgba(76, 55, 39, 0.72);
  white-space: nowrap;
}

.shared-mode-pill.live {
  background: rgba(227, 239, 214, 0.9);
  color: #46613b;
}

.shared-mode-pill.fallback {
  background: rgba(248, 234, 214, 0.9);
  color: #7d5b3f;
}

.shared-traces-count {
  font-size: 0.9rem;
  color: rgba(47, 36, 27, 0.66);
}

.shared-traces-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shared-trace-item,
.shared-trace-empty {
  padding: 12px 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(133, 93, 66, 0.12);
  background: rgba(255, 250, 241, 0.76);
}

.shared-trace-item {
  position: relative;
  overflow: hidden;
}

.shared-trace-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(214, 141, 116, 0.42);
}

.shared-trace-item.color-sky::before {
  background: rgba(112, 159, 199, 0.8);
}

.shared-trace-item.color-ivory::before {
  background: rgba(237, 228, 207, 0.9);
}

.shared-trace-item.color-gold::before {
  background: rgba(240, 191, 109, 0.86);
}

.shared-trace-item.color-moss::before {
  background: rgba(130, 160, 118, 0.84);
}

.shared-trace-item.color-rose::before {
  background: rgba(213, 143, 115, 0.82);
}

.shared-trace-message {
  margin: 0;
  padding-left: 8px;
  font-size: 0.96rem;
  line-height: 1.66;
  color: #493426;
}

.shared-trace-meta {
  margin-top: 8px;
  padding-left: 8px;
  font-size: 0.82rem;
  color: rgba(47, 36, 27, 0.6);
}

.shared-traces-actions {
  display: grid;
  gap: 10px;
}

.shared-traces-actions .panel-btn {
  margin-top: 0;
}

@media (min-width: 981px) {
  .shared-traces-panel {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.8fr);
    grid-template-areas:
      "head actions"
      "status actions"
      "count actions"
      "list actions";
    gap: 14px 18px;
    align-items: start;
  }

  .shared-traces-head {
    grid-area: head;
    align-items: center;
  }

  .shared-traces-status {
    grid-area: status;
  }

  #shared-traces-status {
    grid-area: status;
    margin-top: 0;
    max-width: 58ch;
  }

  #shared-traces-count {
    grid-area: count;
  }

  .shared-traces-list {
    grid-area: list;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shared-trace-empty {
    grid-column: 1 / -1;
    min-height: 100%;
    display: flex;
    align-items: center;
  }

  .shared-traces-actions {
    grid-area: actions;
    align-self: stretch;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(133, 93, 66, 0.12);
    background: rgba(255, 249, 239, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

.guide-shell {
  margin-top: 24px;
}

.guide-panel {
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 252, 246, 0.88), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 235, 0.9), rgba(233, 241, 226, 0.9));
}

.guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 18px;
}

.guide-kicker {
  max-width: 44ch;
  color: rgba(47, 36, 27, 0.7);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.guide-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 249, 239, 0.78);
}

.guide-card h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1rem;
  color: #4f3929;
}

.guide-emphasis {
  font-size: 1.08rem;
  line-height: 1.72;
  color: #4b3425;
}

.guide-list {
  margin: 0;
  padding-left: 18px;
}

.guide-list li + li {
  margin-top: 8px;
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(133, 93, 66, 0.24);
  background: rgba(255, 250, 241, 0.85);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.82rem;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 248, 233, 0.9);
  border: 1px solid rgba(133, 93, 66, 0.14);
  font-family: "SFMono-Regular", "Consolas", monospace;
  font-size: 0.86em;
}

.touch-panel {
  display: none;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 0;
}

.controls-panel {
  display: grid;
  gap: 6px;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(2, 58px);
  gap: 8px;
  grid-template-areas:
    ". up ."
    "left down right";
}

.touch-btn {
  border: 1px solid rgba(133, 93, 66, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(240, 231, 216, 0.94));
  color: #4c3728;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(31, 23, 17, 0.08);
}

.touch-btn:active,
.dialogue-next:active {
  transform: translateY(1px);
}

.touch-btn.up {
  grid-area: up;
}

.touch-btn.left {
  grid-area: left;
}

.touch-btn.right {
  grid-area: right;
}

.touch-btn.down {
  grid-area: down;
}

.touch-btn.interact {
  padding: 14px 22px;
}

.dialogue,
.day-note,
.shared-trace-modal,
.title-screen,
.ending {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  background: rgba(35, 25, 18, 0.28);
  backdrop-filter: blur(6px);
}

.day-note {
  align-items: center;
}

.shared-trace-modal {
  z-index: 22;
  align-items: center;
}

.title-screen,
.ending {
  z-index: 24;
  align-items: center;
  justify-content: center;
}

.dialogue-card,
.day-note-card,
.shared-trace-modal-card,
.title-card,
.ending-card {
  width: min(840px, 100%);
  padding: 22px 24px 24px;
}

.shared-trace-modal-card {
  width: min(760px, 100%);
  border: 1px solid rgba(133, 93, 66, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 252, 246, 0.94), transparent 32%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.95), rgba(234, 242, 226, 0.92));
  box-shadow:
    0 24px 60px rgba(31, 23, 17, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.shared-trace-modal-card h2 {
  margin: 8px 0 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: #463224;
}

.shared-modal-lede {
  margin: 12px 0 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(47, 36, 27, 0.76);
}

.shared-trace-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.shared-field,
.shared-color-field {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 249, 239, 0.78);
}

.shared-field {
  display: grid;
  gap: 10px;
}

.shared-field span,
.shared-color-field legend {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(76, 55, 39, 0.66);
}

.shared-field textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid rgba(133, 93, 66, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 253, 247, 0.94);
  color: #473224;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1rem;
  line-height: 1.7;
}

.shared-field textarea:focus {
  outline: 2px solid rgba(214, 141, 116, 0.34);
  outline-offset: 2px;
}

.shared-color-field {
  margin: 0;
}

.shared-color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.shared-color-option {
  position: relative;
  display: block;
}

.shared-color-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.shared-color-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 8px;
  border-radius: 16px;
  border: 1px solid rgba(133, 93, 66, 0.18);
  box-shadow: 0 10px 20px rgba(31, 23, 17, 0.04);
  font-size: 0.92rem;
  color: #4c3728;
}

.shared-color-option-sky span {
  background: linear-gradient(180deg, rgba(206, 225, 242, 0.96), rgba(185, 211, 236, 0.92));
}

.shared-color-option-ivory span {
  background: linear-gradient(180deg, rgba(252, 247, 236, 0.96), rgba(241, 233, 214, 0.94));
}

.shared-color-option-gold span {
  background: linear-gradient(180deg, rgba(249, 223, 156, 0.98), rgba(238, 194, 116, 0.94));
}

.shared-color-option-moss span {
  background: linear-gradient(180deg, rgba(214, 230, 207, 0.98), rgba(181, 204, 171, 0.94));
}

.shared-color-option-rose span {
  background: linear-gradient(180deg, rgba(244, 214, 206, 0.98), rgba(222, 170, 151, 0.94));
}

.shared-color-option input:checked + span {
  border-color: rgba(214, 141, 116, 0.42);
  box-shadow:
    0 12px 26px rgba(31, 23, 17, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.shared-trace-feedback {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(47, 36, 27, 0.68);
}

.shared-trace-feedback.error {
  color: #8a4f3b;
}

.shared-trace-actions {
  margin-top: 20px;
}

.title-card,
.ending-card {
  width: min(960px, 100%);
  padding: 28px 28px 30px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(245, 237, 219, 0.94)),
    var(--paper);
}

.title-card h2,
.ending-card h2 {
  margin: 8px 0 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  color: #453124;
}

.title-lede {
  margin: 14px 0 0;
  width: min(68ch, 100%);
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(47, 36, 27, 0.82);
}

.title-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.title-panel {
  padding: 16px 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 249, 239, 0.78);
}

.title-panel h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1rem;
  color: #4f3929;
}

.title-panel p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.title-actions .panel-btn {
  width: auto;
  min-width: 220px;
  margin-top: 0;
}

.title-save-note {
  margin: 14px 0 0;
  font-size: 0.92rem;
  color: rgba(47, 36, 27, 0.64);
}

.ending-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.ending-stat {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(133, 93, 66, 0.14);
  background: rgba(255, 249, 239, 0.78);
}

.ending-stat span {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(76, 55, 39, 0.62);
}

.ending-stat strong {
  font-size: 1.2rem;
  color: #483426;
}

.dialogue-speaker,
.day-note-kicker {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(76, 55, 39, 0.68);
}

.dialogue-text,
.day-note-text {
  margin: 10px 0 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.7;
  color: #463224;
}

.dialogue-next {
  margin-top: 18px;
  padding: 11px 18px;
  border: 1px solid rgba(133, 93, 66, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.98), rgba(236, 223, 201, 0.98));
  color: #4c3728;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.96rem;
}

@media (max-width: 980px) {
  .hero,
  .release-deck,
  .game-shell {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hud-card {
    width: 100%;
  }

  .touch-panel {
    display: flex;
    flex-wrap: wrap;
  }

  .game-main-column {
    display: grid;
    gap: 16px;
  }

  .side-panel {
    display: grid;
    gap: 16px;
  }

  .canvas-frame,
  .progress-panel,
  .objective-panel,
  .inventory-panel,
  .shared-traces-panel,
  .controls-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .title-grid,
  .ending-stats {
    grid-template-columns: 1fr;
  }

  .chapter-showcase-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .page {
    width: min(100% - 18px, 100%);
    padding-top: 18px;
  }

  .canvas-frame {
    padding: 12px;
  }

  .game-main-column {
    gap: 14px;
  }

  .hint {
    left: 20px;
    right: 20px;
    max-width: none;
    bottom: 20px;
    font-size: 0.86rem;
  }

  .toast {
    left: 20px;
    right: 20px;
    top: 20px;
  }

  .dialogue,
  .day-note,
  .shared-trace-modal,
  .title-screen,
  .ending {
    padding: 14px;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span {
    font-size: 0.82rem;
  }

  .store-cta-row {
    flex-direction: column;
  }

  .store-cta {
    width: 100%;
  }

  .store-mini-meta {
    gap: 8px;
  }

  .poster-title-band {
    margin-left: 0;
    margin-top: -2px;
    max-width: 100%;
  }

  .poster-title-band span {
    font-size: 0.5rem;
  }

  .fact-grid,
  .chapter-jump-grid {
    grid-template-columns: 1fr;
  }

  .chapter-showcase-head {
    align-items: flex-start;
  }

  .guide-head {
    align-items: flex-start;
  }

  .day-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .title-actions {
    flex-direction: column;
  }

  .title-actions .panel-btn {
    width: 100%;
    min-width: 0;
  }

  .touch-panel {
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
  }

  .dpad {
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(2, 52px);
    gap: 7px;
  }

  .touch-btn {
    font-size: 0.88rem;
  }

  .touch-btn.interact {
    min-width: 136px;
    padding: 13px 18px;
  }
}
