:root {
  color-scheme: dark;
  --bg: #0c0b0a;
  --text: #e6ded1;
  --muted: #9b9287;
  --accent: #b48a69;
  --border: #c9bca320;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}
body {
  user-select: none;
}
button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #ccb294;
  outline-offset: 5px;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
[hidden] {
  display: none !important;
}
#viewport {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#edge-shade {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at 58% 45%,
    transparent 38%,
    #06040342 80%,
    #0302029c
  );
  z-index: 1;
}
#hurt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 3;
  box-shadow: inset 0 0 150px #8b271400;
  transition: box-shadow 0.4s;
}
#header {
  z-index: 7;
  position: fixed;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 4%;
  gap: 24px;
}
.brand {
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 6px;
  text-decoration: none;
  color: #eee5d8;
  display: flex;
  align-items: center;
  gap: 15px;
}
.brand-ii {
  color: #a89a89;
  font: 9px var(--mono);
  letter-spacing: 0;
  align-self: flex-end;
  margin: 0 0 4px -6px;
}
.brand-divider {
  height: 16px;
  width: 1px;
  background: var(--border);
  margin-left: 2px;
}
.brand small {
  font: 9px var(--sans);
  letter-spacing: 2.6px;
  color: #a89a89;
}
.location {
  font-size: 8px;
  color: #8d8275;
  letter-spacing: 2.5px;
}
.location i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #a67c5b;
  margin-right: 10px;
}
.location b {
  color: #5c5147;
  margin: 0 11px;
}
.header-actions {
  display: flex;
  gap: 10px;
}
.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #100e0b50;
  color: #c5b9a7;
  font: 16px var(--mono);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.icon:hover {
  background: #c0a38313;
  border-color: #c0a38350;
  color: #f1e7d9;
}
.icon svg {
  width: 17px;
  height: 17px;
}
#sound-toggle.muted {
  opacity: 0.35;
}
#menu {
  position: fixed;
  inset: 0;
  z-index: 4;
}
.menu-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      #0a0807fc 0%,
      #0a0807eb 22%,
      #0a0807b0 40%,
      #0907062b 70%
    ),
    linear-gradient(
      0deg,
      #070605df,
      transparent 30%,
      transparent 85%,
      #0706055c
    );
}
.menu-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.83' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.19' filter='url(%23n)'/%3E%3C/svg%3E");
}
.menu-layout {
  position: absolute;
  left: 8.5%;
  top: 49%;
  transform: translateY(-44%);
  width: 610px;
  max-width: 73%;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.4px;
  color: #a49582;
  line-height: 1.6;
}
.eyebrow > span:first-child:not([id]) {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 12px;
}
.eyebrow b {
  color: #66584a;
  margin: 0 10px;
  font-weight: 400;
}
h1 {
  font: 400 clamp(78px, 8.7vw, 132px) / 0.85 var(--serif);
  letter-spacing: -6px;
  margin: 31px 0 29px;
  text-transform: uppercase;
  text-shadow: 0 4px 36px #0008;
}
h1 em {
  font-style: normal;
  color: #c5ac91;
}
.tagline {
  font-size: 14px;
  line-height: 1.8;
  color: #c3b6a6;
  margin: 0 0 13px;
}
.menu-description {
  font-size: 12px;
  line-height: 1.8;
  color: #8e8072;
  margin: 0 0 30px;
}
.menu-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  min-height: 54px;
  padding: 0 22px;
  background: #c2ac90;
  color: #211a14;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  border: 1px solid #ddcbb24d;
  transition:
    background 0.2s,
    transform 0.2s;
}
.primary:hover {
  background: #dbccb7;
  transform: translateY(-1px);
}
.primary > b {
  font: 24px var(--sans);
  font-weight: 400;
}
.menu-buttons > .primary {
  min-width: 260px;
}
.outline {
  padding: 16px 19px;
  background: #a68f7006;
  border: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 0.7px;
  color: #bbad9c;
}
.outline:hover {
  background: #c9b49310;
  color: #eee2d2;
}
#continue-game {
  font-size: 9px;
  line-height: 1.7;
  min-height: 54px;
}
#continue-game span {
  display: block;
  color: #94836e;
  font-size: 8px;
  letter-spacing: 0.4px;
}
.difficulty {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #756859;
}
.difficulty > div {
  display: flex;
  gap: 5px;
}
.difficulty button {
  background: transparent;
  font-size: 10px;
  color: #a69682;
  padding: 7px 10px;
  border-bottom: 1px solid transparent;
}
.difficulty button.selected {
  border-color: #b49879;
  color: #e3d6c5;
}
.menu-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
}
.menu-links > span {
  height: 10px;
  width: 1px;
  background: var(--border);
}
.text-button {
  padding: 9px 0;
  background: transparent;
  font-size: 11px;
  color: #a29481;
  text-align: left;
  line-height: 1.7;
}
.text-button:hover {
  color: #e8dccc;
}
.text-button span {
  margin-left: 9px;
}
.menu-stamp {
  position: absolute;
  right: 7%;
  bottom: 20%;
  color: #c1aa8d7a;
  width: 245px;
  border-left: 1px solid #b49b7e35;
  padding-left: 25px;
}
.menu-stamp > span {
  font-size: 7px;
  letter-spacing: 2.2px;
  color: #af987c6b;
}
.menu-stamp strong {
  display: block;
  font: italic 36px/1.2 var(--serif);
  letter-spacing: -0.6px;
  color: #ceb08b85;
  margin: 15px 0 14px;
}
.menu-stamp p {
  font-size: 10px;
  line-height: 1.85;
  color: #b5a18b6b;
}
.menu-stamp > i {
  height: 1px;
  width: 40px;
  display: block;
  background: #c2ac9033;
  margin: 20px 0;
}
.menu-stamp small {
  font-size: 7px;
  letter-spacing: 1.4px;
  color: #a08a735e;
}
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px 4%;
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #8a7c6a;
  border-top: 1px solid #c3ac890d;
}
.headphone-icon {
  font-size: 16px;
  color: #a58e73;
}
.footer-keys {
  margin: auto;
  color: #b6a58f;
  font: 8px var(--mono);
  letter-spacing: 0;
}
.footer-keys b {
  font-weight: 400;
  color: #796b5b;
  font: 9px var(--sans);
}
.build-label {
  color: #7d6c58;
  font-size: 7px;
}
.build-label i {
  display: inline-block;
  width: 3px;
  height: 3px;
  background: #a88e6e;
  margin: 0 9px;
  vertical-align: middle;
}
#loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0b0908;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 27px;
}
.loader-logo {
  font-weight: 400;
  font-size: 33px;
  letter-spacing: 12px;
  text-indent: 12px;
  text-align: center;
}
.loader-logo span {
  display: block;
  color: #9a846e;
  font: 9px var(--sans);
  letter-spacing: 4px;
  text-indent: 4px;
  margin-top: 15px;
}
.loader-line {
  width: 160px;
  height: 1px;
  background: #b6a1801f;
  overflow: hidden;
}
.loader-line i {
  display: block;
  width: 60px;
  height: 100%;
  background: var(--accent);
  animation: loading 1.6s infinite ease-in-out;
}
#loading p {
  font-size: 7px;
  letter-spacing: 2px;
  color: #8a7863;
}
#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.objective {
  position: absolute;
  left: 4%;
  top: 112px;
  max-width: 290px;
  text-shadow: 0 2px 10px #000;
}
.objective .eyebrow {
  font-size: 7px;
  letter-spacing: 1.8px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  opacity: 0.8;
}
#stage-label {
  display: none;
}
.objective h2 {
  font: 400 20px/1.25 var(--serif);
  letter-spacing: 0.1px;
  margin: 10px 0 8px;
}
.objective p {
  font-size: 10px;
  line-height: 1.6;
  color: #ae9d88;
  margin: 0;
  max-width: 245px;
}
.stage-track {
  display: none;
}
#objective-progress {
  font: 9px var(--mono);
  color: #b7a286;
  display: inline-block;
  margin-top: 12px;
}
#pause-open {
  pointer-events: auto;
  position: absolute;
  right: 4%;
  top: 100px;
  border-color: transparent;
}
#compass {
  display: none;
}
.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #e1d5bf75;
  transition:
    width 0.15s,
    height 0.15s;
}
.crosshair.active {
  width: 9px;
  height: 9px;
  background: transparent;
  border: 1px solid #cbb599;
}
#use-prompt {
  position: absolute;
  left: 50%;
  top: 59%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  white-space: nowrap;
  padding: 10px 15px;
  background: #100c09b8;
  border: 1px solid #c2a78024;
  box-shadow: 0 4px 25px #0004;
}
kbd {
  font: 10px var(--mono);
  display: inline-block;
  background: #c3ac8d08;
  border: 1px solid #c2a98939;
  padding: 5px 7px;
  color: #dbccb6;
}
#toast {
  position: absolute;
  left: 50%;
  bottom: 25%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 80%;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  padding: 12px 21px;
  background: #120e0bcf;
  border-bottom: 1px solid #b48a6959;
  opacity: 0;
  transition: opacity 0.25s;
  text-shadow: 0 1px 4px #000;
}
#toast.visible {
  opacity: 1;
}
#subtitle {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  color: #d8cbb7;
  background: #080605bd;
  padding: 7px 13px;
  font-size: 11px;
  line-height: 1.7;
  opacity: 0;
  text-align: center;
  max-width: 80%;
  transition: opacity 0.3s;
}
#subtitle.visible {
  opacity: 1;
}
#save-indicator {
  position: absolute;
  right: 4%;
  top: 150px;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #b6a080;
  opacity: 0;
  transition: opacity 0.5s;
}
#save-indicator.visible {
  opacity: 0.8;
}
.hud-bottom {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.vitals {
  display: flex;
  gap: 25px;
}
.meter {
  width: 125px;
}
.meter label {
  font-size: 7px;
  letter-spacing: 1.1px;
  color: #ac9c87;
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  text-shadow: 0 2px 7px #000;
}
.meter label b {
  font-weight: 400;
  color: #817361;
}
.meter > div {
  height: 2px;
  background: #bca98c20;
}
.meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: #c7b391;
  transition: width 0.12s linear;
}
.meter:last-child i {
  background: #ac9780;
}
.noise-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #9e8b73;
  text-shadow: 0 2px 7px #000;
}
.noise-status b {
  font-weight: 400;
}
#noise-bars {
  font-size: 15px;
  letter-spacing: 2px;
  line-height: 1;
}
.inventory {
  display: flex;
  gap: 19px;
  pointer-events: auto;
}
.inventory button {
  display: flex;
  gap: 7px;
  align-items: center;
  background: none;
  font-size: 7px;
  letter-spacing: 1px;
  color: #a38f74;
}
.inventory button:hover {
  color: #ded0b7;
}
.inventory kbd {
  font-size: 8px;
  padding: 4px 6px;
}
.inventory b {
  color: #c3ac89;
  font: 10px var(--mono);
}
.key-hint {
  position: absolute;
  bottom: 21px;
  left: 50%;
  transform: translateX(-50%);
  font: 7px var(--mono);
  color: #9a886f;
  white-space: nowrap;
  opacity: 0.65;
}
.key-hint span {
  color: #887862;
  font: 8px var(--sans);
}
.playing .brand small,
.playing .brand-divider,
.playing .brand-ii,
.playing .location {
  display: none;
}
.playing .brand {
  font-size: 17px;
  letter-spacing: 4px;
  opacity: 0.6;
}
.playing #header {
  pointer-events: none;
}
.playing .header-actions {
  pointer-events: auto;
}
.playing #settings-open,
.playing #fullscreen {
  display: none;
}
.playing #sound-toggle {
  border-color: transparent;
  opacity: 0.65;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: #090706e3;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px;
  overflow: auto;
}
.modal-card {
  position: relative;
  width: 500px;
  max-height: 94dvh;
  overflow: auto;
  padding: 38px;
  background: linear-gradient(145deg, #211a14, #100d0a);
  border: 1px solid #b39a742b;
  box-shadow: 0 25px 100px #0008;
  scrollbar-width: thin;
  scrollbar-color: #5b4835 #110d0a;
}
.modal-card h2 {
  font: 400 42px/1.03 var(--serif);
  letter-spacing: -1.7px;
  margin: 23px 0 21px;
}
.modal-card p {
  font-size: 12px;
  line-height: 1.85;
  color: #bfae98;
}
.modal-card p.muted,
.muted {
  font-size: 10px;
  line-height: 1.8;
  color: #94816a;
}
.close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  font: 25px var(--sans);
  color: #a48e71;
  z-index: 2;
}
.modal-card .primary {
  margin-top: 25px;
  width: 100%;
}
.modal-card .outline {
  display: block;
  width: 100%;
  margin-top: 11px;
  text-align: center;
}
.pause-card {
  width: 420px;
}
.pause-card h2 {
  font-size: 64px;
  letter-spacing: -2.8px;
}
.pause-card .text-button {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 17px;
}
.settings-list {
  margin-top: 26px;
}
.settings-list > label {
  display: block;
  margin-top: 22px;
  font-size: 11px;
  color: #c4b199;
}
.settings-list > label > span {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.settings-list output {
  color: #bda17d;
  font: 9px var(--mono);
}
.settings-list input[type="range"] {
  width: 100%;
  height: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.settings-list .select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.select-row > span {
  margin: 0 !important;
}
.select-row select {
  color: #c9b69b;
  background: #17110c;
  border: 1px solid var(--border);
  font-size: 10px;
  padding: 8px;
}
.settings-list .checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}
.checkbox > span {
  margin: 0 !important;
}
.checkbox input {
  accent-color: var(--accent);
  height: 14px;
  width: 14px;
}
.help-card {
  width: 590px;
}
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
  margin: 25px 0;
}
.control-grid > div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: #b7a184;
}
.control-grid kbd {
  font-size: 9px;
  white-space: nowrap;
}
.survival-tip {
  padding: 16px;
  border-left: 1px solid var(--accent);
  background: #b7a07e06;
}
.survival-tip b {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #c9ac86;
}
.survival-tip p {
  font-size: 11px;
  margin-bottom: 0;
}
.map-card {
  width: 635px;
  padding: 30px;
}
.map-card h2 {
  font-size: 34px;
  margin: 17px 0;
}
#map-canvas {
  width: 100%;
  height: auto;
  background: #14100b;
  display: block;
  border: 1px solid #b6986e24;
}
.map-legend {
  display: flex;
  gap: 17px;
  flex-wrap: wrap;
  margin-top: 17px;
  font-size: 7px;
  letter-spacing: 1px;
  color: #a58e70;
}
.map-legend span:first-child {
  color: #c5a57b;
}
.journal-card {
  width: 570px;
}
.journal-entry {
  padding: 19px 0;
  border-bottom: 1px solid var(--border);
}
.journal-entry h3 {
  font: 400 19px var(--serif);
  color: #c5ab86;
  margin: 0 0 10px;
}
.journal-entry p {
  font-size: 11px;
  margin: 0;
}
#journal-objective {
  padding: 16px;
  border-left: 1px solid var(--accent);
  background: #b6a17e08;
  font-size: 11px;
  line-height: 1.8;
  color: #c3ae8e;
}
.note-card {
  background: linear-gradient(135deg, #c5b99e, #a99675);
  color: #2c2116;
  box-shadow:
    0 18px 100px #000b,
    inset 0 0 75px #68482726;
}
.note-card .eyebrow {
  color: #6c553b;
}
.note-card h2 {
  font-family: var(--serif);
  font-size: 34px;
}
.note-card p {
  font: 14px/1.9 var(--serif);
  color: #3a2a1b;
  white-space: pre-line;
}
.note-card .close {
  color: #624a2e;
}
.note-card .primary {
  background: #473222;
  color: #e3d5bb;
  border: 0;
}
#closet {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}
.closet-slats {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      #030201 0%,
      #050301e8 25%,
      transparent 38%,
      transparent 62%,
      #050301e8 75%,
      #030201 100%
    ),
    repeating-linear-gradient(
      0deg,
      #060302fa 0px,
      #060302fa 39px,
      #140b0420 40px,
      #140b0420 52px,
      #060302fa 53px
    );
}
.closet-copy {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  text-align: center;
  background: #100b07db;
  padding: 22px 30px;
  min-width: 330px;
  border: 1px solid #ac8a5f28;
}
.closet-copy h3 {
  font: 400 25px var(--serif);
  margin: 11px 0;
  color: #cbbb9f;
}
.closet-copy p {
  font-size: 10px;
  color: #b09875;
}
.closet-copy p span {
  margin: 0 8px;
  color: #6c5234;
}
.closet-copy kbd {
  font-size: 8px;
}
.breath-meter {
  height: 2px;
  background: #c4a67722;
  margin: 18px auto 0;
  width: 180px;
}
.breath-meter i {
  display: block;
  height: 100%;
  background: #c4a67d;
  width: 100%;
}
#touch-breath {
  display: none;
  pointer-events: auto;
  background: #322317;
  border: 1px solid #b59b7340;
  color: #d4b991;
  font-size: 9px;
  padding: 13px;
  margin: 15px auto 0;
  touch-action: none;
}
/* The attacker is rendered in 3D. Keep this layer transparent. */
#scare {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}
.scare-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 46%,
    transparent 25%,
    #28050017 62%,
    #160100ad 100%
  );
  box-shadow: inset 0 0 14vw #0009;
  animation: attack-vignette 2.6s ease-out both;
}
.scare-noise {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    #15080233 4px
  );
  pointer-events: none;
  mix-blend-mode: multiply;
}
body.effects-off .scare-vignette {
  animation: none;
}
body.effects-off .scare-noise {
  display: none;
}
.ending-background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 65% 30%, #6a34243d, transparent 60%),
    repeating-linear-gradient(
      93deg,
      #17100b88 0,
      #17100b88 11%,
      #070504cc 11.2%,
      #070504cc 12%
    ),
    linear-gradient(#160e09, #030201);
  opacity: 0.65;
}
.ending-card {
  width: 530px;
  text-align: center;
  background: #160e09cf;
  z-index: 1;
}
.ending-card h2 {
  font-size: 66px;
  line-height: 0.96;
  letter-spacing: -3px;
  color: #c7a17e;
  white-space: pre-line;
}
.ending-card .text-button {
  margin-top: 17px;
}
#ending-stats {
  display: flex;
  justify-content: center;
  gap: 35px;
  margin: 26px 0;
  font: 20px var(--mono);
  color: #d1b99a;
}
#ending-stats span {
  display: block;
  font-size: 7px;
  letter-spacing: 1px;
  margin-top: 8px;
  color: #987c5c;
}
.won .ending-background {
  background: radial-gradient(ellipse at 50% 0%, #b7a17c3d, #100c08 65%);
}
.won .ending-card h2 {
  color: #dac5a1;
}
#touch {
  display: none;
}
.fps-note {
  position: fixed;
  left: 10px;
  bottom: 10px;
  font: 9px var(--mono);
  color: #917858;
}
@keyframes loading {
  from {
    transform: translateX(-60px);
  }
  to {
    transform: translateX(160px);
  }
}
@keyframes attack-vignette {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 0.5;
  }
  58% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}
@media (max-width: 1050px) {
  .location {
    display: none;
  }
  .menu-layout {
    left: 7%;
  }
  h1 {
    font-size: 100px;
  }
  .menu-stamp {
    right: 5%;
    width: 210px;
    padding-left: 18px;
  }
  .hud-bottom {
    gap: 20px;
  }
  .vitals {
    gap: 16px;
  }
  .meter {
    width: 110px;
  }
  .inventory {
    gap: 11px;
  }
  .inventory button {
    font-size: 6px;
  }
  .footer-keys {
    display: none;
  }
  .build-label {
    margin-left: auto;
  }
}
@media (max-width: 720px) {
  #header {
    padding: 22px;
  }
  .brand {
    font-size: 20px;
    letter-spacing: 5px;
  }
  .brand small,
  .brand-divider {
    display: none;
  }
  .header-actions {
    gap: 8px;
  }
  .icon {
    width: 32px;
    height: 32px;
  }
  .menu-layout {
    top: 47%;
    transform: translateY(-44%);
    max-width: 89%;
    width: 89%;
    left: 7%;
  }
  h1 {
    font-size: clamp(69px, 16vw, 105px);
    letter-spacing: -4.5px;
    margin: 24px 0;
  }
  .tagline {
    font-size: 12px;
    line-height: 1.75;
  }
  .menu-description {
    font-size: 11px;
    margin-bottom: 23px;
  }
  .menu-stamp {
    display: none;
  }
  .menu-buttons {
    gap: 10px;
  }
  .menu-buttons > .primary {
    min-width: 225px;
    min-height: 50px;
  }
  .primary {
    font-size: 9px;
    min-height: 50px;
    padding: 0 18px;
  }
  .menu-buttons .outline {
    font-size: 8px;
    padding: 9px 14px;
    min-height: 50px;
  }
  .difficulty {
    gap: 10px;
    margin-top: 21px;
  }
  .difficulty button {
    font-size: 9px;
    padding: 6px 9px;
  }
  .menu-links {
    margin-top: 11px;
  }
  .menu-links .text-button {
    font-size: 10px;
  }
  footer {
    padding: 20px 22px;
    font-size: 6px;
    gap: 8px;
  }
  .build-label {
    font-size: 6px;
    letter-spacing: 0.7px;
  }
  .objective {
    left: 22px;
    top: 90px;
    max-width: 230px;
  }
  .objective h2 {
    font-size: 18px;
    margin-top: 8px;
  }
  .objective p {
    font-size: 9px;
    max-width: 190px;
  }
  .objective .eyebrow {
    font-size: 6px;
  }
  #objective-progress {
    font-size: 8px;
    margin-top: 9px;
  }
  #pause-open {
    right: 22px;
    top: 88px;
  }
  .playing .brand {
    font-size: 16px;
  }
  .hud-bottom {
    left: 22px;
    right: 22px;
    bottom: 30px;
  }
  .vitals {
    gap: 13px;
  }
  .meter {
    width: 85px;
  }
  .meter label {
    font-size: 6px;
  }
  .noise-status {
    font-size: 6px;
    gap: 5px;
  }
  #noise-bars {
    font-size: 13px;
  }
  .inventory {
    gap: 10px;
  }
  .inventory button span {
    display: none;
  }
  .inventory kbd {
    font-size: 7px;
  }
  .key-hint {
    display: none;
  }
  #save-indicator {
    right: 22px;
    top: 137px;
    font-size: 6px;
  }
  #toast {
    font-size: 10px;
    bottom: 28%;
    padding: 11px 15px;
  }
  #subtitle {
    font-size: 10px;
    bottom: 21%;
  }
  #use-prompt {
    font-size: 10px;
    padding: 10px 13px;
  }
  .modal-card {
    padding: 28px;
    width: 100%;
  }
  .modal-card h2 {
    font-size: 36px;
  }
  .pause-card {
    width: 380px;
  }
  .pause-card h2 {
    font-size: 53px;
  }
  .control-grid {
    gap: 14px 12px;
  }
  .control-grid > div {
    font-size: 9px;
  }
  .control-grid kbd {
    font-size: 8px;
  }
  .ending-card h2 {
    font-size: 54px;
  }
  .map-card {
    padding: 24px;
  }
  .map-card h2 {
    font-size: 30px;
  }
  .map-legend {
    font-size: 6px;
    gap: 10px;
  }
  .closet-copy {
    padding: 18px 20px;
    min-width: 300px;
  }
  .closet-copy p {
    font-size: 9px;
  }
  .closet-copy h3 {
    font-size: 22px;
  }
}
@media (pointer: coarse) {
  #touch {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 80px;
    height: 160px;
    pointer-events: none;
  }
  #joystick {
    pointer-events: auto;
    touch-action: none;
    position: absolute;
    bottom: 10px;
    left: 25px;
    width: 110px;
    height: 110px;
    border: 1px solid #c0a77e40;
    border-radius: 50%;
    background: #b5a08008;
  }
  #stick {
    position: absolute;
    display: block;
    left: 35px;
    top: 35px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #c9b18b6b;
    background: #c0a67e3b;
  }
  .touch-buttons {
    position: absolute;
    bottom: 15px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 9px;
  }
  .touch-buttons button {
    pointer-events: auto;
    touch-action: none;
    width: 43px;
    height: 43px;
    border-radius: 50%;
    border: 1px solid #c7ac8449;
    background: #21180eb8;
    font-size: 9px;
    color: #dac29e;
  }
  .touch-buttons button:last-child {
    width: 59px;
    height: 59px;
    color: #e0c7a4;
    font-size: 14px;
  }
  .touch-buttons button:active,
  .touch-buttons button.active {
    background: #ac8b584d;
  }
  #touch > p {
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 5px;
    letter-spacing: 1px;
    white-space: nowrap;
    color: #a28a66;
  }
  .noise-status {
    display: none;
  }
  .inventory {
    gap: 9px;
  }
  #touch-breath {
    display: block;
  }
  #closet .closet-copy {
    bottom: 13%;
  }
  #use-prompt {
    top: 55%;
  }
}
@media (max-height: 740px) and (min-width: 721px) {
  h1 {
    font-size: 94px;
    margin: 22px 0;
  }
  .menu-layout {
    top: 50%;
    transform: translateY(-44%);
  }
  .tagline {
    font-size: 12px;
  }
  .menu-description {
    font-size: 11px;
    margin-bottom: 22px;
  }
  .primary {
    min-height: 49px;
  }
  .difficulty {
    margin-top: 18px;
  }
  .menu-links {
    margin-top: 8px;
  }
  .menu-stamp {
    bottom: 21%;
  }
}
@media (max-height: 570px) {
  #header {
    padding: 16px 25px;
  }
  .brand {
    font-size: 17px;
  }
  .menu-layout {
    top: 51%;
    max-width: 85%;
    transform: translateY(-43%);
  }
  h1 {
    font-size: 66px;
    letter-spacing: -3.5px;
    margin: 15px 0;
  }
  .tagline {
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  .menu-description {
    font-size: 9px;
    line-height: 1.5;
    margin-bottom: 15px;
  }
  .menu-layout .eyebrow {
    font-size: 7px;
  }
  .menu-buttons > .primary,
  .primary {
    min-height: 40px;
    font-size: 8px;
  }
  .menu-buttons .outline {
    min-height: 40px;
    font-size: 7px;
    padding: 7px 13px;
  }
  .difficulty {
    margin-top: 11px;
  }
  .difficulty button {
    font-size: 8px;
    padding: 4px 8px;
  }
  .menu-links {
    margin-top: 2px;
  }
  .menu-links .text-button {
    font-size: 9px;
  }
  .menu-stamp {
    display: none;
  }
  footer {
    padding: 12px 25px;
    font-size: 6px;
  }
  .objective {
    top: 73px;
  }
  .objective h2 {
    font-size: 17px;
    margin: 8px 0 6px;
  }
  .objective p {
    font-size: 8px;
  }
  #objective-progress {
    margin-top: 8px;
  }
  #pause-open {
    top: 72px;
  }
  .hud-bottom {
    bottom: 24px;
  }
  .key-hint {
    bottom: 8px;
  }
  .playing #header {
    padding: 18px 25px;
  }
  #touch {
    bottom: 53px;
    height: 105px;
  }
  #joystick {
    width: 83px;
    height: 83px;
    left: 26px;
  }
  #stick {
    width: 31px;
    height: 31px;
    left: 26px;
    top: 26px;
  }
  .touch-buttons {
    bottom: 12px;
  }
  .touch-buttons button {
    width: 36px;
    height: 36px;
    font-size: 8px;
  }
  .touch-buttons button:last-child {
    width: 49px;
    height: 49px;
  }
  #touch > p {
    display: none;
  }
}
@media (max-width: 380px) {
  .menu-layout {
    left: 6%;
    width: 90%;
    max-width: 90%;
  }
  h1 {
    font-size: 66px;
  }
  .menu-buttons > .primary {
    min-width: 206px;
  }
  .difficulty {
    gap: 5px;
  }
  .difficulty button {
    padding: 6px 7px;
  }
  .build-label {
    display: none;
  }
  .control-grid {
    grid-template-columns: 1fr;
  }
  .meter {
    width: 75px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
  .scare-vignette {
    animation: none;
  }
  .primary,
  .meter i,
  .crosshair {
    transition: none;
  }
}

/* Version 3: the room stays in focus; menus remain usable on short screens. */
#menu {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 96px 8.5% 0;
  scrollbar-width: thin;
  scrollbar-color: #5b4835 #0a0807;
  overscroll-behavior: contain;
}
.menu-layout {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  flex: 0 0 auto;
  margin: auto 0;
  padding: 32px 0;
}
.menu-gradient {
  position: fixed;
  pointer-events: none;
}
#menu footer {
  position: relative;
  flex: 0 0 auto;
  margin-left: -8.5vw;
  width: 100vw;
}
.menu-stamp {
  pointer-events: none;
}
.menu-stamp kbd {
  padding: 3px 5px;
  font-size: 8px;
  color: #b7a184;
  border-color: #baa18129;
  margin: 0 5px 5px 0;
}
.menu-stamp p.menu-stamp-note {
  color: #ae94766b;
  font-size: 9px;
}
body:not(.playing) #header {
  background: linear-gradient(#080605ba, transparent);
}
#inventory-items {
  position: absolute;
  bottom: 88px;
  left: 4%;
  max-width: min(58vw, 540px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 13px;
  font: 10px/1.6 var(--sans);
  color: #c3b194;
  text-shadow: 0 2px 8px #000;
  letter-spacing: 0.1px;
}
#inventory-items:empty {
  display: none;
}
#inventory-items > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 2px;
  border-bottom: 1px solid #baa07833;
}
#inventory-items b {
  color: #e0c9a4;
  font-size: inherit;
  font-weight: 400;
}
#inventory-items small {
  color: #9e886c;
  font-size: 9px;
}
#use-prompt {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  max-width: min(80vw, 440px);
  white-space: normal;
}
#use-prompt > kbd {
  grid-row: 1 / 3;
  align-self: center;
}
#use-prompt > span {
  line-height: 1.5;
}
#interaction-detail {
  display: block;
  grid-column: 2;
  color: #a79377;
  font: 10px/1.5 var(--sans);
  letter-spacing: 0;
}
#interaction-detail:empty {
  display: none;
}
.lock-card {
  width: 410px;
}
.lock-card h2 {
  margin-bottom: 14px;
}
.lock-card #lock-hint {
  margin-bottom: 26px;
}
#lock-form label {
  display: block;
  font: 9px var(--sans);
  letter-spacing: 1px;
  color: #a48d6f;
  margin-bottom: 12px;
}
#lock-code {
  display: block;
  width: 100%;
  max-width: 236px;
  min-height: 75px;
  border: 1px solid #b49a7240;
  border-radius: 0;
  background:
    linear-gradient(
      90deg,
      transparent 32.8%,
      #b49a7226 33%,
      transparent 33.4%,
      transparent 66.1%,
      #b49a7226 66.4%,
      transparent 66.8%
    ),
    #090604a6;
  box-shadow: inset 0 3px 15px #0007;
  color: #e5d1af;
  padding: 10px 0 10px 21px;
  font: 35px var(--mono);
  text-align: center;
  letter-spacing: 24px;
  caret-color: #ba9d75;
  user-select: text;
  -webkit-user-select: text;
}
#lock-code::placeholder {
  color: #65513b;
  opacity: 1;
}
#lock-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #c89172;
  font-size: 11px;
}
.lock-card #lock-submit {
  margin-top: 14px;
}
.lock-card > .text-button {
  display: block;
  margin: 16px auto 0;
  text-align: center;
}
@media (max-width: 1050px) {
  #menu {
    padding-left: 7%;
    padding-right: 7%;
  }
  #menu footer {
    margin-left: -7vw;
  }
}
@media (max-width: 720px) {
  #menu {
    padding: 86px 7% 0;
  }
  .menu-layout {
    left: auto;
    top: auto;
    transform: none;
    max-width: 100%;
    width: 100%;
    padding: 24px 0 28px;
  }
  #menu footer {
    margin-left: -7vw;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  #inventory-items {
    left: 22px;
    bottom: 69px;
    max-width: 64vw;
    font-size: 9px;
    gap: 4px 10px;
  }
  #interaction-detail {
    font-size: 9px;
  }
  #lock-code {
    max-width: 220px;
  }
  .lock-card {
    width: min(100%, 390px);
  }
}
@media (max-height: 740px) and (min-width: 721px) {
  #menu {
    padding-top: 84px;
  }
  .menu-layout {
    top: auto;
    transform: none;
    padding: 21px 0;
  }
}
@media (max-height: 570px) {
  #menu {
    padding-top: 65px;
  }
  .menu-layout {
    top: auto;
    left: auto;
    transform: none;
    padding: 18px 0;
  }
  .menu-description {
    max-width: 410px;
  }
  #inventory-items {
    bottom: 60px;
  }
  .modal {
    padding: 12px;
  }
  .modal-card {
    max-height: calc(100dvh - 24px);
  }
  .lock-card {
    padding: 23px 28px;
  }
  .lock-card h2 {
    font-size: 32px;
    margin: 14px 0 10px;
  }
  .lock-card #lock-hint {
    margin-bottom: 16px;
  }
  #lock-code {
    min-height: 61px;
    font-size: 30px;
  }
}
@media (pointer: coarse) {
  #use-prompt {
    max-width: min(76vw, 350px);
  }
  #inventory-items {
    pointer-events: none;
  }
}
