.room-interaction {
  position: absolute; transform: translate(-50%, -100%);
  display: inline-flex; align-items: center; gap: .55em; width: max-content; min-height: 44px;
  padding: 6px 11px; border: 1px solid #9ba68a; border-radius: 2px;
  box-shadow: 2px 3px #0b1422a8; background: #172320f5; color: #edead5;
  font: bold 13px/1.1 Consolas, monospace;
}
.room-interaction::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; width: 7px; height: 7px;
  transform: rotate(45deg); background: #172320; border: solid #9ba68a; border-width: 0 1px 1px 0;
}
.room-interaction kbd { padding: 0 5px; border: 1px solid #c4d6a4; color: #d9edb5; }
#sit-at-desk { left: 24.1%; top: 52.8%; }
#go-to-bed { left: 79%; top: 62%; }
#sit-at-desk[data-incoming] { background: #352419; border-color: #d59562; color: #ffe3ba; }
#sit-at-desk[data-incoming]::after { background: #352419; border-color: #d59562; }
.room-interaction:focus-visible, #leave-desk:focus-visible { outline: 2px solid #e3ecb6; outline-offset: 2px; }
#desk-terminal {
  position: fixed; inset: var(--desk-top, 0px) 0 auto; width: 100%; height: var(--desk-height, 100dvh);
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: #081218;
}
#desk-terminal::backdrop { background: #070e17; }
.desk-view {
  --desk-width: min(100vw, calc(var(--desk-height, 100dvh) * 1.6));
  position: relative; display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden;
}
.desk-art {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: var(--desk-width); aspect-ratio: 3 / 2;
}
.desk-art > img { display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.crt-glass {
  position: absolute; left: 22.7%; top: 20.7%; width: 54.1%; height: 42%;
  overflow: hidden; border-radius: 4% / 8%; background: #102a1c;
  background-image: repeating-linear-gradient(0deg, #091e152e 0 1px, transparent 1px 3px),
    radial-gradient(ellipse, #173926, #0d271b 84%);
  color: #b2ec9c; font: clamp(14px, 1.5vw, 22px)/1.35 Consolas, "Courier New", monospace;
  text-shadow: 0 0 3px #99f09940;
}
.crt-scroll { height: 100%; padding: 3% 4%; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4e7859 transparent; }
#burn-screen {
  position: absolute; inset: 0; container-type: inline-size; isolation: isolate;
  background: #04080b; color: #efe1c6; font: 14px/1.25 Consolas, "Courier New", monospace;
}
#burn-screen [hidden], #burn-screen[hidden] { display: none; }
#burn-picture { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#burn-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 2.6cqw 1cqw #010204ae;
  background: repeating-linear-gradient(0deg, #0305093c 0 1px, transparent 1px 3px);
}
#burn-screen[data-phase="trace"] { background: transparent; }
#burn-screen[data-phase="trace"] #burn-picture { visibility: hidden; }
.burn-trace {
  position: absolute; left: 5%; top: 7%; color: #bdd4aa;
  font-size: clamp(8px, 1.45cqw, 13px); letter-spacing: .11em;
  text-shadow: 0 0 5px #a9d99285;
}
#burn-screen[data-phase="trace"] .burn-trace { background: #142a1f; }
.burn-challenge {
  position: absolute; inset: 13% 5% 7%; display: grid;
  align-content: center; justify-items: center; gap: .55em;
  visibility: hidden; color: #ec642f; text-align: center;
  font: 700 clamp(16px, 5.65cqw, 55px)/.95 "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  letter-spacing: .12em; text-shadow: 1px 0 #bd3e22, 0 0 11px #fd5a2f81;
}
.burn-challenge strong {
  color: #f4dcab; font-size: 1.17em; font-weight: inherit;
  text-shadow: 0 0 13px #f2a84e98;
}
#burn-screen[data-phase="reveal"] .burn-challenge { visibility: visible; animation: burn-resolve .45s ease-out both; }
#burn-screen[data-phase="reveal"] strong { animation: burn-resolve .38s .32s both; }
#burn-screen[data-phase="message"] .burn-challenge {
  visibility: visible; inset: 13% 5% 36%; font-size: clamp(14px, 4.4cqw, 39px);
}
@keyframes burn-resolve {
  from { opacity: 0; transform: translateY(4px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
#burn-conversation {
  position: absolute; inset: auto 7% 8%;
  font-size: clamp(12px, 2.65cqw, 22px);
}
#burn-screen[data-phase="warning"] #burn-conversation { inset: 0 5%; display: grid; place-items: center; }
#burn-screen[data-phase="warning"] .burn-trace { visibility: hidden; }
#burn-warning { display: grid; justify-items: center; text-align: center; gap: .65em; }
#burn-heading, #burn-message {
  color: #fa7039; font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  font-weight: 700; line-height: .95; letter-spacing: .14em; text-shadow: 0 0 8px #e958395e;
}
#burn-heading { font-size: clamp(24px, 7cqw, 64px); }
#burn-message { margin: 0; font-size: clamp(17px, 4.5cqw, 39px); }
#burn-terminated {
  position: absolute; inset: 0; display: grid; justify-items: center;
  background: radial-gradient(ellipse at 43% 36%, #fafbff 0%, #e9eaf4 58%, #c5cade 100%);
  color: #181a26; font: 700 clamp(16px, 7cqw, 65px)/1 "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  letter-spacing: .035em; white-space: nowrap;
}
#burn-terminated span { position: absolute; top: 41%; transform: translateY(-50%) scaleX(1.1); }
#burn-terminated[data-blank] { background: #f6f6fc; color: transparent; }
#burn-screen[data-phase="terminated"]::after {
  box-shadow: inset 0 0 2cqw #8188a443;
  background: repeating-linear-gradient(0deg, #515b8915 0 1px, transparent 1px 3px);
}
#burn-warning:focus, #burn-terminated:focus { outline: none; }
#burn-reply { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .4em .65em; }
#burn-reply label { grid-column: 1 / -1; color: #e0a77d; font-size: .85em; }
#burn-answer, #burn-screen button {
  min-width: 0; width: auto; height: auto; min-height: 2.1em; padding: .23em .5em;
  border: 1px solid #a56748; border-radius: 0; color: #ffe1bc; background: #2a1b14; font: inherit;
}
#burn-screen button { justify-self: start; }
#burn-screen :is(input, button):focus-visible { outline: 2px solid #fed69e; outline-offset: 2px; }
@media (pointer: coarse) { #burn-answer { font-size: 16px; } }
#shell-output { white-space: pre-wrap; overflow-wrap: anywhere; }
.shell-echo { color: #83bd83; }
#shell-form { display: flex; align-items: baseline; gap: .5ch; }
#shell-command {
  min-width: 0; flex: 1; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0;
  background: transparent; color: inherit; caret-color: #d2ffb2; caret-shape: block; font: inherit; text-shadow: inherit;
}
#shell-prompt { color: #bfe6a7; max-width: 75%; overflow-wrap: anywhere; }
.offair-receiver {
  position: absolute; right: calc((100% - var(--desk-width)) / 2);
  top: calc(50% - var(--desk-width) * .045); width: calc(var(--desk-width) * .19);
  padding: .65% .65% 1.8%; border: 2px solid #493c32; border-radius: 7% 6% 5% 7%;
  background: linear-gradient(145deg, #a18c70, #675a47 60%, #544839);
  box-shadow: inset 2px 2px 1px #beaa87, inset -3px -4px 2px #342e26, 0 5px 9px #0b1014b5;
  pointer-events: none;
}
#otv-picture {
  display: block; width: 100%; height: auto; border: 4px solid #292923;
  border-radius: 7% / 9%; background: #273039;
}
#leave-desk {
  position: absolute; top: max(12px,env(safe-area-inset-top)); right: max(12px,env(safe-area-inset-right));
  display: flex; gap: .5em; align-items: center; width: auto; min-height: 44px; padding: 0 12px;
  color: #e3e5ce; background: #111c21ed; border: 1px solid #808b7d; border-radius: 2px;
  font: 14px/1.15 Consolas, monospace;
}
#open-modem-book { position: absolute; left: 12px; bottom: 12px; width: auto; padding: 10px; background: #302c24; color: #f1e4c4; border: 1px solid #b4a886; font: 14px Consolas, monospace; }
#open-modem-book:disabled { visibility: hidden; }
#scanner-status { position: absolute; left: 12px; top: 12px; max-width: 45%; margin: 0; padding: 7px; background: #172320ed; color: #d5e5c5; font: 12px/1.3 Consolas, monospace; }
#scanner-status[hidden] { display: none; }
#modem-book { position: absolute; inset: 10% max(12px, 20%) auto; max-height: 75%; overflow: auto; padding: 1.5em; background: #e2d6b6; color: #30281e; border: 5px solid #594734; box-shadow: 0 8px 30px #0009; font: 16px/1.5 Georgia, serif; }
#modem-book[hidden] { display: none; }
.modem-book-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#modem-book .modem-book-actions button { width: auto; height: auto; min-height: 44px; padding: .6em; }
@media (max-aspect-ratio: 4/5) {
  .desk-art { width: min(165vw, calc(var(--desk-height, 100dvh) * 2.1)); }
  .offair-receiver {
    right: 3%; top: auto; bottom: 2%; width: min(44vw, calc(var(--desk-height, 100dvh) * .33));
    padding: 4px 4px 8px;
  }
}
@media (pointer: coarse) {
  .room-interaction kbd { display: none; }
  .crt-glass { font-size: 16px; }
}
