:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --paper: #d8d4cb;
  --muted: #9b998e;
  --green: #61bb7f;
  --dim-green: #23372b;
  --red: #e47767;
  --border: #33382f;
  --surface: #111411;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: #1b241d;
  border-color: var(--green);
}
button:disabled {
  cursor: default;
  opacity: 0.53;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
a {
  color: var(--green);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-weight: 500;
  letter-spacing: -0.05em;
}
h2 {
  font-weight: 500;
}
p {
  line-height: 1.65;
}
em {
  color: var(--green);
  font-style: normal;
}
.muted,
.quiet {
  color: var(--muted);
}
.quiet {
  font-size: 12px;
}
.danger-text {
  color: var(--red) !important;
}
.sprite {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  image-rendering: pixelated;
  vertical-align: middle;
  fill: currentColor;
}
button .sprite {
  pointer-events: none;
}
button > * {
  pointer-events: none;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.24' filter='url(%23n)'/%3E%3C/svg%3E");
}
.loading {
  margin: 15vh 10vw;
  color: var(--green);
}
#app {
  max-width: 1600px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 4.5vw, 72px);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 30px;
  height: 80px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wordmark {
  font-size: 21px;
  font-weight: 700;
  border: 0;
  padding: 0;
  letter-spacing: -2px;
  display: flex;
  align-items: center;
  gap: 1px;
}
.wordmark span {
  color: var(--green);
}
.wordmark i {
  width: 5px;
  height: 5px;
  background: var(--green);
  margin: 0 0 15px 4px;
}
.building-label {
  font-size: 10px;
  letter-spacing: 0.1em;
}
.topbar nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.text-button {
  border: 0;
  padding: 9px 0;
  font-size: 12px;
}
.key,
kbd {
  font: 10px var(--mono);
  padding: 2px 5px;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-left: 6px;
}
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.bottom-bar kbd {
  font-size: 9px;
}
.sound-toggle {
  border: 0;
  font-size: 10px;
  padding: 10px 0;
  color: var(--green);
}
main {
  flex: 1;
  outline: none;
}
.primary,
.secondary,
.danger-button {
  padding: 15px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 48px;
  font-size: 12px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: #08110b;
  font-weight: 600;
}
.primary:hover:not(:disabled) {
  background: #85d79d;
  border-color: #85d79d;
}
.secondary {
  background: #141914;
}
.danger-button {
  color: var(--red);
  border-color: var(--red);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--green);
}
.status-dot {
  display: inline-block;
  background: var(--green);
  width: 5px;
  height: 5px;
  margin-right: 7px;
  box-shadow: 0 0 10px #61bb7f40;
}
.title-screen {
  min-height: calc(100svh - 130px);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 48px 0 75px;
  overflow: hidden;
}
.title-copy {
  z-index: 1;
}
.title-copy h1 {
  font-size: clamp(40px, 5.6vw, 86px);
  line-height: 1;
  letter-spacing: -0.055em;
  margin: 36px 0 27px;
  font-weight: 600;
}
.title-number {
  display: block;
  font-size: clamp(130px, 17vw, 245px);
  font-weight: 400;
  line-height: 0.89;
  letter-spacing: -0.1em;
  margin-left: -0.04em;
}
.title-period {
  color: var(--green);
  font-size: 0.65em;
  margin-left: 0.08em;
}
.title-intro {
  display: flex;
  gap: 20px;
  margin: 25px 0 28px;
}
.vertical-line {
  width: 1px;
  background: var(--green);
  margin: 5px 0;
}
.title-intro p {
  font-family: Georgia, serif;
  font-size: clamp(17px, 1.65vw, 23px);
  line-height: 1.5;
}
.title-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.title-actions .primary {
  min-width: 240px;
}
.title-note {
  margin-top: 22px;
  font-size: 11px;
}
.building-scene {
  position: relative;
  align-self: center;
  margin-left: -20px;
}
.building-scene:before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 47% 45%, #54794e19, transparent 66%);
  pointer-events: none;
}
.building-scene img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 580px;
  opacity: 0.9;
}
.scene-caption {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 15px 18px;
  border-top: 1px solid var(--border);
}
.scene-crosshair {
  position: absolute;
  color: #545c4d;
  font-size: 19px;
  font-weight: 300;
}
.crosshair-top {
  left: 12px;
  top: 10px;
}
.crosshair-bottom {
  right: 12px;
  bottom: 50px;
}
.title-bottom {
  position: absolute;
  bottom: 25px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.screen-page {
  padding: 40px 0;
  max-width: 1180px;
  margin: auto;
}
.page-heading {
  margin-bottom: 30px;
}
.page-heading h1 {
  font-size: clamp(25px, 3vw, 42px);
  margin: 12px 0 9px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
}
.section-label span {
  letter-spacing: 0;
  color: var(--green);
}
.prepare-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
}
.character-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.character-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  min-height: 132px;
  padding: 18px 12px;
}
.character-card .character-sprite {
  width: 40px;
  height: 67px;
}
.character-card strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 9px;
}
.character-card small {
  font-size: 10px;
  line-height: 1.55;
  display: block;
  color: var(--muted);
}
.selected {
  border-color: var(--green) !important;
  background: #16251b !important;
}
.selection-mark {
  position: absolute;
  top: 9px;
  right: 9px;
  color: var(--green);
  font-size: 9px;
}
.locked .character-sprite {
  filter: brightness(0.25);
}
.zone-list {
  display: grid;
  gap: 8px;
}
.zone-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 15px;
  min-height: 72px;
}
.zone-card > span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}
.zone-number {
  font-size: 20px;
  color: var(--green);
}
.zone-card strong {
  font-size: 12px;
  font-weight: 500;
}
.zone-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
  line-height: 1.45;
}
.start-panel {
  margin-top: 24px;
}
.start-panel p {
  font-size: 11px;
  color: var(--muted);
}
.start-panel strong {
  color: var(--paper);
  font-weight: 500;
}
.start-panel .primary {
  width: 100%;
  margin: 15px 0 10px;
}
.run-screen {
  padding: 24px 0 18px;
}
.collapse-panel {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 0 21px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.collapse-panel label {
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.collapse-track {
  height: 5px;
  background: #242820;
  flex: 1;
  overflow: hidden;
}
.collapse-track > div {
  width: 100%;
  height: 100%;
  background: var(--green);
  transform-origin: left;
  transition: transform 0.22s;
}
.collapse-panel > strong {
  font-size: 25px;
  font-weight: 400;
  min-width: 86px;
  text-align: right;
}
.collapse-panel > strong span {
  font-size: 11px;
  color: var(--muted);
  margin-left: 5px;
}
.run-layout {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) 215px;
  gap: 30px;
  align-items: start;
}
.portrait-frame {
  height: 123px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(0deg, #121712 0px, #121712 3px, #111510 3px, #111510 4px);
  position: relative;
}
.portrait-frame:before,
.portrait-frame:after {
  position: absolute;
  content: '+';
  color: var(--muted);
  font-size: 11px;
  top: 4px;
  left: 5px;
}
.portrait-frame:after {
  top: auto;
  left: auto;
  bottom: 4px;
  right: 5px;
}
.portrait {
  width: 60px;
  height: 100px;
}
.character-name {
  font-size: 12px;
  line-height: 1.4;
  margin: 12px 0 24px;
}
.hearts {
  display: flex;
  gap: 7px;
  color: var(--green);
  margin-bottom: 28px;
}
.hearts .sprite {
  width: 21px;
  height: 21px;
}
.hearts .lost {
  color: #43473e;
}
.run-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.run-details > span {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 12px;
}
.run-details > strong {
  font-size: 12px;
  font-weight: 400;
}
.protocol {
  font-size: 10px !important;
  overflow-wrap: anywhere;
}
.help-button {
  margin-top: 22px;
  text-align: left;
  font-size: 10px;
  color: var(--green);
}
.board {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 24px;
  min-width: 0;
}
.board-heading {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-bottom: 13px;
}
.board-heading > span:first-child {
  color: var(--paper);
}
.column-labels {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 9px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 9px;
}
.radio-column {
  color: var(--green);
  font-size: 8px;
}
.door-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(55px, 1fr));
  gap: 10px;
  height: clamp(300px, 46vh, 480px);
}
.door {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  border: 1px solid #292d26;
  color: #8f9486;
  background: #0d100d;
  padding: 16px 4px 10px;
}
.door:before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid #21271f;
  pointer-events: none;
}
.door-label {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 10px;
  color: var(--muted);
  z-index: 1;
}
.door-icon .sprite {
  width: 27px;
  height: 27px;
  opacity: 0.4;
}
.door-content {
  font-size: 9px;
  text-align: center;
  line-height: 1.3;
  padding: 0 2px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.door.reachable {
  border-color: #737b66;
  color: var(--paper);
  background: linear-gradient(180deg, #181e17, #11160f);
}
.door.reachable:before {
  border-color: #3b4634;
}
.door.reachable .door-icon .sprite {
  opacity: 1;
  color: var(--green);
}
.door.reachable:hover {
  border-color: var(--green);
  background: #1b291c;
}
.door[aria-disabled='true']:hover {
  border-color: #505947;
}
.door.opened {
  border-style: dashed;
  background: #18201a;
  color: #b3bcac;
  border-color: #44513e;
}
.door.opened:before {
  display: none;
}
.door.opened .door-icon .sprite {
  opacity: 0.7;
}
.door.calling {
  border-color: var(--green);
  background: #213f2a;
  color: var(--paper);
}
.door.calling .sprite {
  color: var(--green);
  opacity: 1;
}
.door.hazard {
  color: var(--red);
  background: #241b17;
}
.door-cost {
  position: absolute;
  right: 9px;
  top: 8px;
  color: var(--muted);
  font-size: 8px;
}
.truth-mark {
  font-size: 7px;
  position: absolute;
  bottom: 3px;
  right: 5px;
  color: var(--green);
}
.false-signal .lie-label {
  text-decoration: line-through;
  font-size: 7px;
  color: var(--red);
}
.targeting .door.reachable {
  border-color: var(--green);
  box-shadow: inset 0 0 24px #61bb7f13;
}
.atrium {
  padding: 16px 0 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.1em;
}
.atrium .sprite {
  height: 18px;
  width: 18px;
  color: var(--green);
}
.signal-readout {
  min-height: 45px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}
.inventory-slots {
  display: grid;
  gap: 9px;
}
.inventory-item {
  position: relative;
  min-height: 82px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 20px 10px 12px;
  background: #111610;
}
.inventory-item > .sprite {
  color: var(--green);
  width: 25px;
  height: 25px;
}
.inventory-item strong {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}
.inventory-item small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}
.item-key {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 9px;
  color: var(--muted);
}
.empty-slot {
  border: 1px dashed var(--border);
  font-size: 10px;
  color: var(--muted);
}
.slot-square {
  font-size: 20px;
  color: #636e5c;
  width: 25px;
  text-align: center;
}
.inventory-note {
  font-size: 10px;
  line-height: 1.7;
  margin-top: 17px;
}
.inventory .secondary {
  font-size: 10px;
  padding: 10px;
  margin-top: 15px;
  width: 100%;
}
.item-description {
  margin-top: 16px;
  color: var(--green);
  font-size: 11px;
}
.log-panel {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 15px;
  border-top: 1px solid var(--border);
  padding-top: 17px;
  margin-top: 16px;
  position: relative;
}
.log-title {
  font-size: 9px;
  padding-top: 4px;
  letter-spacing: 0.08em;
}
.log-title .muted {
  display: block;
  margin: 10px 0 0 12px;
}
.recent-log p {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.recent-log p:last-child {
  color: var(--paper);
}
.log-panel details {
  grid-column: 2;
  font-size: 10px;
}
.log-panel summary {
  cursor: pointer;
  color: var(--muted);
}
.full-log {
  max-height: 220px;
  overflow: auto;
  margin-top: 12px;
}
.full-log p {
  font-size: 10px;
  color: var(--muted);
}
.end-banner {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid var(--border);
  background: #141a14;
}
.end-banner h1 {
  font-size: 26px;
  margin: 7px 0;
}
.end-banner p:not(.eyebrow) {
  font-size: 11px;
}
.end-banner.dead {
  border-color: #62433a;
  background: #1c1512;
}
.end-banner.dead .eyebrow {
  color: var(--red);
}
.end-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.end-actions button {
  font-size: 10px;
  padding: 10px 14px;
  white-space: nowrap;
}
.unlock {
  color: var(--green);
  margin-top: 6px;
}
.dropped {
  font-size: 10px;
  color: var(--muted);
  padding: 12px 0;
}
.dropped summary {
  cursor: pointer;
}
.dropped button {
  margin-right: 20px;
  color: var(--green);
}
dialog {
  color: var(--paper);
  background: #111610;
  border: 1px solid #5e7156;
  padding: 35px;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100svh - 50px);
  overflow: auto;
  box-shadow: 0 20px 100px #000b;
}
dialog::backdrop {
  background: #030604db;
  backdrop-filter: blur(3px);
}
dialog .eyebrow {
  margin-bottom: 12px;
}
dialog h2 {
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 20px;
}
.dialog-mark {
  position: absolute;
  right: 30px;
  top: 28px;
  color: var(--green);
}
.dialog-mark .sprite {
  width: 36px;
  height: 36px;
}
.narrative {
  font-family: Georgia, serif;
  line-height: 1.65;
  font-size: 18px;
}
.choices {
  display: grid;
  gap: 9px;
  margin-top: 25px;
}
.choice-button {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
}
.choice-button small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.choices .choice-button:last-child {
  color: var(--muted);
}
.figure-scene {
  height: 135px;
  position: relative;
  background: radial-gradient(ellipse at 50% 90%, #354c3530, transparent 65%);
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.figure {
  width: 60px;
  height: 100px;
  filter: brightness(0.5);
}
.figure-desk {
  position: absolute;
  width: 140px;
  height: 6px;
  background: #404b38;
  bottom: 27px;
  left: calc(50% - 70px);
  box-shadow: 0 28px 0 -2px #404b38;
}
.figure-scene:after {
  content: '';
  position: absolute;
  left: calc(50% - 55px);
  right: calc(50% - 55px);
  height: 27px;
  bottom: 0;
  border-left: 3px solid #404b38;
  border-right: 3px solid #404b38;
}
.scene-text {
  font-family: Georgia, serif;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  font-style: italic;
}
.fragment-dialog blockquote {
  margin: 25px 0;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--green);
  white-space: pre-line;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
}
.fragment-dialog .primary {
  width: 100%;
  margin-top: 10px;
}
.diary-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
}
.diary-tabs button {
  padding: 16px 24px;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 12px;
}
.diary-tabs button span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 10px;
}
.diary-content {
  margin-bottom: 30px;
  max-width: 850px;
}
.diary-entry {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.entry-number {
  font-size: 20px;
  min-width: 38px;
  color: var(--green);
  font-weight: 300;
}
.diary-entry h2 {
  font-family: Georgia, serif;
  font-size: 21px;
  margin-bottom: 12px;
}
.diary-entry .fragment-text {
  white-space: pre-line;
  font-family: Georgia, serif;
  font-size: 17px;
  margin-top: 16px;
  line-height: 1.7;
}
.unremembered h2 {
  color: var(--muted);
  font-size: 18px;
}
.unremembered .entry-number {
  color: #5e6757;
}
.death-stamp {
  color: var(--red);
  font-size: 12px;
  padding: 5px 0;
}
.empty-message {
  font-family: Georgia, serif;
  font-size: 24px;
  color: var(--muted);
  padding: 60px 0;
}
.options-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  margin: 40px 0;
}
.option-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  font-size: 13px;
}
.option-row small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}
.option-row > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.option-row input[type='range'] {
  width: 130px;
  accent-color: var(--green);
}
input[type='checkbox'] {
  accent-color: var(--green);
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.options-layout .secondary {
  margin-top: 18px;
}
.save-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin: 22px 0 10px;
}
textarea,
select {
  border: 1px solid var(--border);
  background: #111610;
  color: var(--paper);
  padding: 12px;
}
textarea {
  width: 100%;
  resize: vertical;
  font-size: 10px;
}
.inline-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
#save-message {
  margin: 16px 0;
  min-height: 20px;
  color: var(--green);
}
.controls-reference {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.controls-reference p {
  line-height: 2.6;
  font-size: 11px;
}
.controls-reference kbd {
  margin-left: 0;
}
.credits {
  font-size: 10px;
  line-height: 1.8;
  margin: 26px 0;
}
.signal-guide {
  display: grid;
  gap: 13px;
  margin: 25px 0;
}
.signal-guide > div {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 11px;
}
.signal-guide .sprite {
  color: var(--green);
}
.signal-guide small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.signal-guide ~ .primary {
  margin-top: 20px;
}
.notice {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 600px;
  width: calc(100vw - 40px);
  padding: 12px 18px;
  border: 1px solid var(--green);
  background: #18251a;
  z-index: 50;
  font-size: 11px;
  pointer-events: none;
}
.debug-panel {
  margin-top: 30px;
  border: 1px dashed #7e7250;
  padding: 15px;
  color: #c2b77c;
  font-size: 11px;
}
.debug-panel summary {
  cursor: pointer;
}
.debug-panel button {
  padding: 8px;
  font-size: 10px;
  margin: 10px 0;
}
.debug-panel label {
  margin-right: 10px;
}
.debug-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.unstable .board {
  animation: tremor 2.5s linear infinite;
}
.unstable .collapse-track > div {
  background: var(--red);
}
.unstable .board:after {
  content: '';
  position: fixed;
  width: 2px;
  height: 3px;
  background: #b4ac8d;
  top: 15%;
  left: 34%;
  box-shadow:
    170px -50px #b4ac8d,
    70px -20px #6d735d,
    320px 70px #8f9474,
    230px 40px #969779;
  animation: dust 3s linear infinite;
  pointer-events: none;
  z-index: 5;
  opacity: 0.35;
}
.title-period {
  animation: dim-light 9s step-end infinite;
}
.reduce-shake .unstable .board {
  animation: none;
}
.reduce-shake .unstable .board:after {
  display: none;
}
.reduce-flicker .title-period {
  animation: none;
}
@keyframes tremor {
  0%,
  92%,
  100% {
    transform: translate(0);
  }
  93% {
    transform: translate(1px, 0);
  }
  95% {
    transform: translate(-1px, 1px);
  }
  97% {
    transform: translate(0, -1px);
  }
}
@keyframes dust {
  from {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.35;
  }
  to {
    transform: translateY(280px);
    opacity: 0;
  }
}
@keyframes dim-light {
  0%,
  95%,
  98%,
  100% {
    opacity: 1;
  }
  96%,
  99% {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  .unstable .board:after {
    display: none;
  }
}
@media (min-width: 1500px) {
  .door-grid {
    height: 510px;
  }
  .title-screen {
    padding-top: 70px;
    padding-bottom: 110px;
  }
}
@media (max-width: 1100px) {
  #app {
    padding: 0 25px;
  }
  .run-layout {
    grid-template-columns: 110px minmax(0, 1fr) 170px;
    gap: 18px;
  }
  .board {
    padding: 0 15px;
  }
  .board-heading {
    font-size: 8px;
  }
  .inventory-item {
    padding: 18px 8px 10px;
    gap: 7px;
  }
  .inventory-item strong {
    font-size: 10px;
  }
  .prepare-layout {
    gap: 25px;
  }
  .character-card {
    gap: 9px;
    padding: 15px 9px;
  }
  .character-card .character-sprite {
    width: 32px;
    height: 55px;
  }
  .bottom-bar {
    font-size: 8px;
  }
  .building-label {
    font-size: 9px;
  }
  .topbar {
    gap: 20px;
  }
  .topbar nav {
    gap: 15px;
  }
}
@media (max-width: 850px) {
  :root {
    font-size: 12px;
  }
  .topbar {
    height: 60px;
  }
  .building-label {
    font-size: 8px;
  }
  .topbar nav {
    gap: 12px;
  }
  .text-button {
    font-size: 11px;
  }
  .topbar .key {
    display: none;
  }
  .run-layout {
    grid-template-columns: 88px minmax(0, 1fr) 143px;
    gap: 13px;
  }
  .board {
    padding: 0 10px;
  }
  .door-grid {
    gap: 7px;
    height: clamp(265px, 49vh, 390px);
  }
  .door {
    gap: 4px;
  }
  .door-content {
    font-size: 8px;
  }
  .door-label {
    left: 7px;
    top: 6px;
    font-size: 9px;
  }
  .door-cost {
    right: 5px;
    top: 7px;
    font-size: 7px;
  }
  .door-icon .sprite {
    width: 23px;
    height: 23px;
  }
  .inventory-item {
    min-height: 70px;
    gap: 6px;
  }
  .inventory-item > .sprite {
    width: 20px;
    height: 20px;
  }
  .inventory-item small {
    font-size: 8px;
  }
  .inventory-note {
    font-size: 9px;
  }
  .portrait-frame {
    height: 103px;
  }
  .portrait {
    width: 48px;
    height: 80px;
  }
  .character-name {
    font-size: 10px;
    margin-bottom: 18px;
  }
  .run-details strong {
    font-size: 10px;
  }
  .hearts {
    gap: 5px;
  }
  .hearts .sprite {
    width: 17px;
    height: 17px;
  }
  .collapse-panel {
    gap: 14px;
    padding-bottom: 14px;
  }
  .collapse-panel label {
    font-size: 8px;
  }
  .collapse-panel label .muted {
    display: none;
  }
  .log-panel {
    grid-template-columns: 115px 1fr;
    gap: 10px;
  }
  .log-title {
    font-size: 8px;
  }
  .recent-log p {
    font-size: 10px;
  }
  .bottom-bar > span:nth-child(2) {
    font-size: 7px;
    letter-spacing: 0;
  }
  .bottom-bar kbd {
    font-size: 8px;
    padding: 1px 3px;
    margin-left: 3px;
  }
  .title-screen {
    min-height: calc(100svh - 110px);
    padding-top: 35px;
  }
  .title-copy h1 {
    margin-top: 30px;
  }
  .title-intro {
    gap: 15px;
  }
  .title-note {
    font-size: 10px;
  }
  .title-actions .primary {
    min-width: 215px;
  }
  .scene-caption {
    font-size: 6px;
    padding: 12px 2px;
  }
  .title-bottom {
    font-size: 7px;
  }
  .page-heading {
    margin-bottom: 25px;
  }
  .screen-page {
    padding: 30px 0;
  }
  .character-grid {
    gap: 8px;
  }
  .character-card {
    min-height: 115px;
    padding: 18px 8px;
    gap: 6px;
  }
  .character-card .character-sprite {
    width: 25px;
    height: 45px;
  }
  .character-card strong {
    font-size: 10px;
  }
  .character-card small {
    font-size: 9px;
  }
  .zone-card {
    padding: 12px;
    gap: 12px;
  }
  .options-layout {
    gap: 35px;
  }
  .end-banner {
    padding: 15px;
    gap: 15px;
  }
  .end-banner h1 {
    font-size: 22px;
  }
  .end-actions .primary,
  .end-actions .secondary {
    min-height: 36px;
  }
  .end-actions {
    max-width: 260px;
  }
}
@media (max-height: 650px) and (min-width: 720px) {
  .topbar {
    height: 53px;
  }
  .bottom-bar {
    min-height: 36px;
  }
  .run-screen {
    padding-top: 14px;
  }
  .collapse-panel {
    padding-bottom: 10px;
    margin-bottom: 12px;
  }
  .collapse-panel > strong {
    font-size: 21px;
  }
  .door-grid {
    height: 260px;
    grid-template-rows: repeat(var(--rows), minmax(32px, 1fr));
  }
  .door {
    padding: 12px 2px 5px;
    gap: 3px;
  }
  .door-icon .sprite {
    width: 21px;
    height: 21px;
  }
  .door-grid[style*='--rows:6'] .door-icon {
    display: none;
  }
  .door-grid[style*='--rows:6'] .door-content {
    font-size: 9px;
    margin-top: 4px;
  }
  .door-grid[style*='--rows:6'] .door-label {
    font-size: 8px;
    top: 3px;
  }
  .door-grid[style*='--rows:6'] .door-cost {
    top: 4px;
  }
  .signal-readout {
    min-height: 30px;
    font-size: 9px;
  }
  .atrium {
    padding: 10px 0;
  }
  .portrait-frame {
    height: 90px;
  }
  .portrait {
    height: 75px;
  }
  .character-name {
    margin: 8px 0 15px;
  }
  .hearts {
    margin-bottom: 12px;
  }
  .run-details > span {
    margin-top: 7px;
  }
  .help-button {
    margin-top: 12px;
  }
  .inventory-item {
    min-height: 66px;
  }
  .inventory-note {
    font-size: 9px;
    margin-top: 10px;
  }
  .log-panel {
    margin-top: 6px;
    padding-top: 10px;
  }
  .log-panel details {
    font-size: 9px;
  }
  .recent-log p {
    font-size: 9px;
  }
  .title-screen {
    min-height: calc(100svh - 90px);
    padding: 22px 0 48px;
  }
  .title-copy h1 {
    font-size: 40px;
    margin: 17px 0;
  }
  .title-number {
    font-size: 125px;
  }
  .title-intro {
    margin: 15px 0;
    gap: 13px;
  }
  .title-intro p {
    font-size: 16px;
  }
  .title-note {
    margin-top: 12px;
    font-size: 9px;
  }
  .title-actions .primary {
    min-height: 42px;
    padding: 10px 16px;
  }
  .title-bottom {
    bottom: 17px;
  }
  .building-scene img {
    max-height: 360px;
  }
  .screen-page {
    padding: 24px 0;
  }
  .prepare .page-heading {
    margin-bottom: 20px;
  }
  .prepare .page-heading h1 {
    font-size: 27px;
  }
  .character-card {
    min-height: 102px;
  }
  .zone-card {
    min-height: 62px;
    padding: 10px;
  }
  .start-panel {
    margin-top: 16px;
  }
  .start-panel .primary {
    margin: 10px 0;
    min-height: 40px;
  }
  .end-banner {
    margin-bottom: 15px;
    padding: 12px;
  }
}
@media (max-width: 719px) {
  #app {
    padding: 0 16px;
  }
  .building-label {
    display: none;
  }
  .topbar {
    gap: 12px;
  }
  .topbar nav {
    gap: 16px;
  }
  .title-screen {
    grid-template-columns: 1fr;
    padding: 35px 0 70px;
    min-height: calc(100svh - 110px);
  }
  .title-copy h1 {
    font-size: 50px;
  }
  .title-number {
    font-size: 160px;
  }
  .building-scene {
    position: absolute;
    right: -100px;
    top: 85px;
    width: 340px;
    opacity: 0.42;
    z-index: 0;
    pointer-events: none;
  }
  .title-copy {
    position: relative;
  }
  .title-intro p {
    font-size: 18px;
  }
  .title-bottom {
    font-size: 7px;
    flex-direction: column;
    gap: 8px;
  }
  .title-actions {
    max-width: 260px;
  }
  .title-note {
    max-width: 220px;
  }
  .scene-caption,
  .scene-crosshair {
    display: none;
  }
  .prepare-layout,
  .options-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .character-card {
    min-height: 120px;
  }
  .character-card .character-sprite {
    width: 35px;
    height: 60px;
  }
  .character-card strong {
    font-size: 11px;
  }
  .character-card small {
    font-size: 10px;
  }
  .run-layout {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 12px;
  }
  .inventory {
    grid-column: 1/-1;
    border-top: 1px solid var(--border);
    padding-top: 15px;
  }
  .inventory-slots {
    display: flex;
    gap: 7px;
  }
  .inventory-item {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 18px 5px 8px;
    min-height: 94px;
    gap: 6px;
  }
  .inventory-item small {
    font-size: 8px;
  }
  .inventory-item strong {
    font-size: 9px;
  }
  .inventory-item > .sprite {
    height: 21px;
    width: 21px;
  }
  .inventory-note {
    margin-top: 10px;
  }
  .board {
    border-right: 0;
    padding-right: 0;
    padding-left: 12px;
  }
  .board-heading {
    font-size: 7px;
  }
  .board-heading > span:last-child {
    display: none;
  }
  .door-grid {
    height: 330px;
    gap: 6px;
  }
  .door-label {
    font-size: 8px;
  }
  .door-cost {
    font-size: 6px;
    right: 4px;
  }
  .door-content {
    font-size: 7px;
  }
  .door-icon .sprite {
    width: 20px;
    height: 20px;
  }
  .door:before {
    inset: 4px;
  }
  .run-status .section-label {
    font-size: 8px;
  }
  .run-details > span {
    font-size: 8px;
  }
  .hearts {
    gap: 3px;
  }
  .hearts .sprite {
    height: 16px;
    width: 16px;
  }
  .portrait-frame {
    height: 85px;
  }
  .portrait {
    height: 70px;
    width: 42px;
  }
  .character-name {
    font-size: 9px;
  }
  .collapse-panel label {
    font-size: 7px;
  }
  .collapse-panel {
    gap: 12px;
  }
  .collapse-panel > strong {
    font-size: 22px;
    min-width: 65px;
  }
  .collapse-panel > strong span {
    font-size: 9px;
  }
  .bottom-bar > span:nth-child(2) {
    display: none;
  }
  .diary-entry {
    gap: 18px;
  }
  .diary-tabs button {
    padding: 14px 12px;
  }
  .diary-tabs button span {
    margin-left: 5px;
  }
  .end-banner {
    display: block;
  }
  .end-actions {
    max-width: none;
    justify-content: flex-start;
    margin-top: 16px;
  }
  .log-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .log-title .muted {
    display: inline;
    margin-left: 8px;
  }
  .log-panel details {
    grid-column: 1;
  }
  .debug-grid {
    grid-template-columns: 1fr;
  }
  .notice {
    font-size: 10px;
  }
  .character-name {
    overflow-wrap: anywhere;
  }
  .signal-readout {
    font-size: 9px;
  }
  .end-banner h1 {
    font-size: 24px;
  }
  .help-button {
    font-size: 9px;
  }
}
/* Compact desktop embeds retain the complete board and controls at 800×500. */
@media (max-height: 650px) and (min-width: 720px) {
  .door-grid {
    height: clamp(175px, calc(100svh - 310px), 260px);
    grid-template-rows: repeat(var(--rows), minmax(20px, 1fr));
  }
  .portrait-frame {
    height: 65px;
  }
  .portrait {
    height: 55px;
    width: 33px;
  }
  .character-name {
    font-size: 10px;
    margin: 6px 0 10px;
  }
  .run-status .section-label {
    margin-bottom: 8px;
  }
  .hearts {
    margin-bottom: 8px;
  }
  .hearts .sprite {
    height: 17px;
    width: 17px;
  }
  .run-details {
    gap: 4px;
  }
  .run-details > span {
    margin-top: 5px;
    font-size: 8px;
  }
  .run-details > strong {
    font-size: 10px;
  }
  .help-button {
    margin-top: 9px;
    padding: 5px 0;
  }
  .inventory-item {
    min-height: 54px;
    padding-top: 15px;
  }
  .inventory-item small {
    font-size: 8px;
    margin-top: 2px;
  }
  .inventory-item > .sprite {
    width: 20px;
    height: 20px;
  }
  .inventory-note {
    font-size: 9px;
    line-height: 1.5;
    margin-top: 10px;
  }
  .log-panel {
    padding-top: 9px;
    margin-top: 8px;
    gap: 7px;
  }
  .atrium {
    padding: 8px 0;
  }
  .signal-readout {
    min-height: 28px;
    font-size: 9px;
  }
  .recent-log p {
    font-size: 9px;
    line-height: 1.5;
  }
  .door-grid[style*='--rows:6'] {
    gap: 6px;
  }
  .door-grid[style*='--rows:6'] .door-content {
    font-size: 8px;
    margin-top: 0;
  }
  .door-grid[style*='--rows:6'] .truth-mark {
    font-size: 6px;
  }
  .door-grid[style*='--rows:6'] .door-cost {
    font-size: 7px;
  }
}
@media (max-height: 550px) and (min-width: 720px) {
  .door-grid {
    height: clamp(150px, calc(100svh - 340px), 210px);
  }
  .run-details {
    gap: 2px;
  }
  .run-details > span {
    margin-top: 3px;
  }
  .help-button {
    margin-top: 3px;
    padding: 4px 0;
  }
}
.last-call-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 35px;
  min-height: 360px;
  color: var(--green);
}
.last-call-scene .final-phone {
  width: 135px;
  height: 135px;
  opacity: 0.65;
}
.last-call-scene > span {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
@media (max-width: 719px) {
  .last-call-scene {
    position: absolute;
    right: -55px;
    top: 180px;
    width: 250px;
    opacity: 0.25;
    pointer-events: none;
  }
  .last-call-scene > span {
    display: none;
  }
}

/* Third-person play uses the same palette and rules, with HUD above the scene. */
.view-switch {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.view-switch button {
  padding: 5px 7px;
  font-size: 9px;
  white-space: nowrap;
  line-height: 1.2;
}
.spatial-run {
  position: relative;
}
.spatial-run .run-layout {
  display: block;
  position: relative;
}
.spatial-run .board {
  border: 0;
  padding: 0;
}
.spatial-run .board-heading {
  padding: 0 0 9px;
  min-height: 20px;
}
.world-viewport {
  position: relative;
  height: clamp(280px, calc(100svh - 260px), 800px);
  overflow: hidden;
  background: #111b14;
  border: 1px solid #3a4838;
}
.world-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline-offset: -3px;
}
.world-canvas:active {
  cursor: grabbing;
}
.world-canvas:focus-visible {
  outline: 1px solid #61bb7f;
  outline-offset: -2px;
}
.player-location {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  padding: 7px 12px;
  background: #0b110ce8;
  border: 1px solid #3a4838;
  color: var(--paper);
  font-size: 10px;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.world-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: #cad8be80;
  pointer-events: none;
}
.world-prompt {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 30px);
  padding: 10px 15px;
  background: #0b110cf2;
  border: 1px solid #607254;
  color: var(--paper);
  font-size: 11px;
  text-align: center;
  line-height: 1.5;
  pointer-events: none;
}
.world-hud {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.world-hud button {
  width: 34px;
  height: 34px;
  padding: 0;
  background: #0b110cf2;
  border: 1px solid #607254;
  color: var(--paper);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.world-hud button:hover,
.world-hud button:focus-visible {
  border-color: var(--green);
  color: var(--green);
}
/* Beside the status panel, clear of the inventory and of the centred location label. */
.signal-legend {
  position: absolute;
  left: 165px;
  top: 12px;
  z-index: 3;
  max-width: 230px;
  padding: 7px 10px;
  background: #0b110ce8;
  border: 1px solid #3a4838;
  color: var(--paper);
  font-size: 9px;
  letter-spacing: 0.06em;
}
.signal-legend summary {
  cursor: pointer;
  color: var(--muted);
  text-transform: uppercase;
}
.signal-legend ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}
.signal-legend li {
  display: flex;
  align-items: center;
  gap: 5px;
}
.signal-legend .sprite {
  width: 16px;
  height: 16px;
  flex: none;
}
.spatial-run .run-status,
.spatial-run .inventory {
  position: absolute;
  top: 32px;
  z-index: 3;
  background: #0c130eed;
  border: 1px solid #3a4838;
  padding: 12px;
}
.spatial-run .run-status {
  left: 12px;
  width: 125px;
}
.spatial-run .portrait-frame {
  height: 75px;
}
.spatial-run .portrait {
  width: 39px;
  height: 65px;
}
.spatial-run .character-name {
  font-size: 10px;
  margin: 8px 0 14px;
}
.spatial-run .run-details {
  display: none;
}
.spatial-run .hearts {
  margin-bottom: 8px;
  gap: 5px;
}
.spatial-run .hearts .sprite {
  width: 18px;
  height: 18px;
}
.spatial-run .run-status .section-label {
  font-size: 8px;
  margin-bottom: 9px;
}
.spatial-run .help-button {
  font-size: 9px;
  margin-top: 7px;
  padding: 3px 0;
}
.spatial-run .inventory {
  right: 12px;
  width: 185px;
}
.spatial-run .inventory .section-label {
  margin-bottom: 10px;
  font-size: 9px;
}
.spatial-run .inventory-item {
  min-height: 61px;
  padding: 17px 8px 8px;
  gap: 8px;
}
.spatial-run .inventory-item strong {
  font-size: 10px;
}
.spatial-run .inventory-item small {
  font-size: 8px;
  line-height: 1.4;
}
.spatial-run .inventory-item > .sprite {
  width: 22px;
  height: 22px;
}
.spatial-run .inventory-note {
  font-size: 9px;
  line-height: 1.5;
  margin-top: 10px;
}
.spatial-run .log-panel {
  position: absolute;
  left: 23px;
  bottom: 78px;
  z-index: 3;
  width: min(42%, 440px);
  padding: 10px 12px;
  background: #0c130eed;
  border: 1px solid #3a4838;
  display: block;
  margin: 0;
}
.spatial-run .log-title {
  font-size: 8px;
  padding: 0;
  margin-bottom: 6px;
}
.spatial-run .log-title .muted {
  display: inline;
  margin: 0 0 0 5px;
}
.spatial-run .recent-log p {
  font-size: 10px;
  line-height: 1.5;
}
.spatial-run .recent-log p:not(:last-child) {
  display: none;
}
.spatial-run .log-panel details {
  font-size: 9px;
  margin-top: 6px;
}
.spatial-run .full-log {
  max-height: 160px;
}
.spatial-run .dropped {
  position: absolute;
  bottom: 23px;
  left: 23px;
  z-index: 4;
  background: #0c130e;
  padding: 4px 8px;
  max-width: 40%;
}
@media (max-width: 1000px) {
  .signal-legend {
    left: 140px;
    max-width: 210px;
  }
  .spatial-run .inventory {
    width: 155px;
    right: 10px;
    padding: 9px;
  }
  .spatial-run .run-status {
    width: 108px;
    left: 10px;
    padding: 9px;
  }
  .spatial-run .inventory-item {
    min-height: 54px;
    gap: 5px;
    padding-right: 5px;
    padding-left: 5px;
  }
  .spatial-run .inventory-item strong {
    font-size: 9px;
  }
  .spatial-run .inventory-note {
    font-size: 8px;
  }
  .world-prompt {
    font-size: 10px;
  }
  .view-switch button {
    font-size: 8px;
    padding: 5px;
  }
}
@media (max-height: 600px) and (min-width: 720px) {
  .world-viewport {
    height: calc(100svh - 190px);
    min-height: 240px;
  }
  .spatial-run .run-status,
  .spatial-run .inventory {
    top: 29px;
  }
  .spatial-run .portrait-frame {
    height: 48px;
  }
  .spatial-run .portrait {
    height: 43px;
    width: 26px;
  }
  .spatial-run .character-name {
    font-size: 9px;
    margin: 5px 0 9px;
  }
  .spatial-run .inventory-item {
    min-height: 45px;
    padding-top: 14px;
    padding-bottom: 5px;
  }
  .spatial-run .inventory-item small {
    font-size: 7px;
    margin-top: 2px;
  }
  .spatial-run .inventory-note {
    font-size: 8px;
    line-height: 1.35;
    margin-top: 7px;
  }
  .spatial-run .inventory-slots {
    gap: 6px;
  }
  .spatial-run .log-panel {
    bottom: 69px;
    width: 38%;
    padding: 8px;
    left: 21px;
  }
  .spatial-run .log-title {
    font-size: 7px;
  }
  .spatial-run .recent-log p {
    font-size: 9px;
  }
  .world-prompt {
    font-size: 9px;
    padding: 8px 10px;
    bottom: 12px;
  }
  .player-location {
    top: 8px;
    font-size: 8px;
    padding: 5px 8px;
  }
}
@media (max-width: 719px) {
  .spatial-run .world-viewport {
    height: 65svh;
    min-height: 380px;
  }
  .spatial-run .run-status {
    width: 84px;
    padding: 7px;
    top: 29px;
    left: 7px;
  }
  .spatial-run .inventory {
    width: 108px;
    padding: 7px;
    right: 7px;
    top: 29px;
  }
  .spatial-run .inventory-slots {
    display: grid;
  }
  .spatial-run .inventory-item {
    min-height: 59px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    font-size: 8px;
  }
  .spatial-run .inventory-item .sprite {
    width: 16px;
    height: 16px;
  }
  .spatial-run .inventory-item strong {
    font-size: 8px;
  }
  .spatial-run .inventory-item small {
    font-size: 7px;
  }
  .spatial-run .inventory-note {
    display: none;
  }
  .spatial-run .character-name {
    font-size: 8px;
  }
  .spatial-run .log-panel {
    left: 12px;
    bottom: 90px;
    width: calc(100% - 24px);
  }
  .world-prompt {
    max-width: calc(100% - 20px);
    font-size: 9px;
  }
  .spatial-run .board-heading span:last-child {
    display: none;
  }
  .view-switch button {
    font-size: 7px;
    padding: 5px 4px;
  }
  .collapse-panel {
    gap: 7px;
  }
  .collapse-panel label {
    font-size: 7px;
  }
}

/* Final map: rooms never entered stay dark. */
.door.unvisited {
  opacity: 0.28;
  border-style: dashed;
}
.door.unvisited .door-icon {
  visibility: hidden;
}

/* Maze walls on the map: sides of an open room without a door. */
.door.opened.wall-n {
  border-top: 3px solid #8b9a80;
}
.door.opened.wall-e {
  border-right: 3px solid #8b9a80;
}
.door.opened.wall-s {
  border-bottom: 3px solid #8b9a80;
}
.door.opened.wall-w {
  border-left: 3px solid #8b9a80;
}

/* An open room with something to touch. */
.door.opened.touchable {
  cursor: pointer;
  border-color: var(--green);
  color: var(--paper);
}

/* The secret floor: a separate strip, shown once the elevator has reached it. */
.secret-floor {
  margin-top: 12px;
}
.secret-floor .door-grid {
  height: 80px;
  margin-top: 6px;
}

/* Short darkness while crawling through the tunnel or riding the elevator. */
.world-viewport.travel-fade::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
  pointer-events: none;
  animation: travel-fade 0.6s ease-out forwards;
}
@keyframes travel-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Death on the map: the board pulses red before the end banner (steady with reduced flicker). */
.board.dying {
  animation: dying 1s ease-in-out 3;
}
@keyframes dying {
  50% {
    box-shadow: inset 0 0 70px #e47767b0;
  }
}
.reduce-flicker .board.dying {
  animation: none;
  box-shadow: inset 0 0 50px #e4776790;
}
