/* Layout for the 320x200 canvas and the on-screen touch controls.
   Landscape phones keep the controls in the black margins beside the picture; portrait phones put
   the picture on top and the controls underneath. */

:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --ink: #f4f1e6;
  --accent: #ffd36b;
  --glass: rgba(16, 20, 30, 0.52);
  --glass-edge: rgba(255, 255, 255, 0.4);
  --font: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --edge: max(var(--safe-l), var(--safe-r), 14px);
  --fire: clamp(68px, 20vmin, 112px);
  --btn: clamp(46px, 12.5vmin, 68px);
  --chip: clamp(28px, 7.4vmin, 42px);
  --small: clamp(36px, 9vmin, 48px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: var(--font);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ---- the picture: the largest 8:5 box that fits, never cropped ---- */
#stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}

#wrap {
  position: relative;
  aspect-ratio: 8 / 5;
  width: min(100%, calc((100vh - var(--safe-t) - var(--safe-b)) * 1.6));
}

@supports (height: 100dvh) {
  #wrap {
    width: min(100%, calc((100dvh - var(--safe-t) - var(--safe-b)) * 1.6));
  }
}

#screen {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#screen:focus-visible {
  outline: 2px solid #7de1d3;
  outline-offset: -2px;
}

/* GPU world and pixel UI are separate surfaces, composited by the browser without readback. */
#world {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 82%;
  display: block;
  pointer-events: none;
}

#world[hidden] {
  display: none;
}
#screen {
  position: relative;
  z-index: 1;
}
#screen[data-renderer='three'] {
  background: transparent;
}
#wrap:has(#screen[data-filter='blocky']) #world {
  image-rendering: pixelated;
}

/* "blocky" asks the browser for nearest-neighbour scaling; "sharp" is handled in src/engine/display.js */
#screen[data-filter='blocky'] {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#err {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 24px;
  overflow: auto;
  color: #ffb4a8;
  background: #200;
  white-space: pre-wrap;
  font-size: 13px;
}

noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

/* ---- touch controls ---- */
.touch {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch[hidden] {
  display: none;
}

/* "lefty" mirrors everything: all horizontal placement uses logical (inline) properties */
.touch.lefty {
  direction: rtl;
}

.zone {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: auto;
  touch-action: none;
}

.zone-move {
  inset-inline-start: 0;
  top: 22%;
  width: 46%;
}

.zone-look {
  inset-inline-end: 0;
  width: 54%;
}

/* a faint ghost stick shows where the left thumb belongs until it is used */
.zone-move::after {
  content: '';
  position: absolute;
  inset-inline-start: calc(var(--edge) + 8px);
  bottom: calc(var(--safe-b) + 22px);
  width: calc(var(--fire) * 1.15);
  height: calc(var(--fire) * 1.15);
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.stick {
  --r: 56px;
  --ox: 0px;
  --oy: 0px;
  --kx: 0px;
  --ky: 0px;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.stick.active {
  opacity: 1;
}

.stick-base,
.stick-knob {
  position: absolute;
  border-radius: 50%;
}

.stick-base {
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  left: calc(var(--ox) - var(--r));
  top: calc(var(--oy) - var(--r));
  border: 2px solid var(--glass-edge);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(16, 20, 30, 0.4));
}

.stick-knob {
  width: calc(var(--r) * 0.95);
  height: calc(var(--r) * 0.95);
  left: calc(var(--ox) + var(--kx) - var(--r) * 0.475);
  top: calc(var(--oy) + var(--ky) - var(--r) * 0.475);
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.28);
}

.btn,
.chip {
  position: absolute;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 2px solid var(--glass-edge);
  color: var(--ink);
  background: var(--glass);
  font: 700 clamp(11px, 2.7vmin, 14px) / 1 var(--font);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.btn {
  border-radius: 50%;
}

.btn.down,
.chip.down {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.3);
}

.btn-fire {
  inset-inline-end: var(--edge);
  bottom: calc(var(--safe-b) + 14px);
  width: var(--fire);
  height: var(--fire);
  border-color: rgba(255, 120, 108, 0.85);
  background: rgba(196, 22, 28, 0.46);
  font-size: clamp(13px, 3.4vmin, 18px);
}

.btn-use {
  inset-inline-end: calc(var(--edge) + var(--fire) + 6px);
  bottom: calc(var(--safe-b) + 14px + var(--fire) * 0.62);
  width: var(--btn);
  height: var(--btn);
}

.btn-use.ready {
  border-color: var(--accent);
  background: rgba(255, 211, 107, 0.3);
  animation: pulse 0.9s ease-in-out infinite;
}

/* optional second fire button on the move side (Options > Controls) */
.btn-fire2 {
  display: none;
  inset-inline-start: var(--edge);
  top: 26%;
  width: var(--btn);
  height: var(--btn);
  border-color: rgba(255, 120, 108, 0.85);
  background: rgba(196, 22, 28, 0.38);
}

.dual-fire .btn-fire2 {
  display: grid;
}

.rail {
  position: absolute;
  inset-inline-end: var(--edge);
  top: calc(var(--safe-t) + 10px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.chip {
  position: static;
  width: var(--chip);
  height: var(--chip);
  border-radius: 8px;
  font-size: clamp(13px, 3.2vmin, 17px);
}

.chip.owned {
  background: rgba(24, 30, 44, 0.6);
}

.chip:disabled {
  opacity: 0.28;
}

.chip.current {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 211, 107, 0.2);
}

.corner {
  position: absolute;
  inset-inline-start: var(--edge);
  top: calc(var(--safe-t) + 10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.btn.small {
  position: static;
  width: var(--small);
  height: var(--small);
  font-size: clamp(10px, 2.3vmin, 12px);
}

.rotate-hint {
  display: none;
  position: absolute;
  inset-inline: 0;
  top: 46%;
  margin: 0;
  text-align: center;
  color: var(--accent);
  font: 700 12px / 1.2 var(--font);
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 #000;
  pointer-events: none;
}

.hint-done .rotate-hint {
  display: none !important;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 9px rgba(255, 211, 107, 0.28);
  }
}

/* ---- portrait: picture on top, controls in the space below ---- */
@media (orientation: portrait) {
  body.touch-ui #stage {
    place-items: start center;
  }

  body.touch-ui .touch {
    top: calc(var(--safe-t) + (100vw - var(--safe-l) - var(--safe-r)) * 0.625);
  }

  .zone-move {
    top: 0;
    width: 50%;
  }

  .zone-look {
    width: 50%;
  }

  .rail {
    inset-inline: var(--edge);
    top: 8px;
    flex-direction: row;
    justify-content: center;
    gap: 6px;
  }

  .corner {
    top: calc(var(--chip) + 20px);
    flex-direction: row;
  }

  .btn-fire2 {
    top: 30%;
  }

  .rotate-hint {
    display: block;
    top: 30%;
    animation: fade 9s ease-in forwards;
  }
}

@keyframes fade {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-use.ready,
  .rotate-hint {
    animation: none;
  }
}

/* Native presentation: crisp menus and telemetry at every render resolution. */
#wrap {
  container-type: inline-size;
}
.game-menu[hidden],
.game-hud[hidden],
.game-hud [hidden] {
  display: none !important;
}
.game-menu {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: auto;
  color: #f1f5f9;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(26, 32, 42, 0.96) 0%, rgba(11, 14, 19, 0.98) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0px, rgba(0, 0, 0, 0.18) 1px, transparent 1px, transparent 3px);
  font-family: 'Segoe UI', system-ui, sans-serif;
  touch-action: pan-y;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
}
.menu-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4cqw, 56px);
  box-sizing: border-box;
}

/* ---- Title & Skill Screens: Classic Windows 98 Desktop & Application Window ---- */
.game-menu[data-screen='title'],
.game-menu[data-screen='skill'] {
  background: #008080; /* Windows 98 Default Teal Desktop */
  padding: clamp(12px, 2.5cqw, 32px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
}
.game-menu[data-screen='title'] .menu-shell,
.game-menu[data-screen='skill'] .menu-shell {
  position: relative;
  flex: 0 1 auto;
  width: min(94%, 900px);
  min-height: 0;
  background: #c0c0c0; /* Standard Win98 Silver/Gray */
  border: 2px solid;
  border-color: #dfdfdf #0a0a0a #0a0a0a #dfdfdf;
  box-shadow:
    1px 1px 0 #ffffff inset,
    -1px -1px 0 #808080 inset,
    4px 6px 16px rgba(0, 0, 0, 0.6);
  padding: 3px;
  box-sizing: border-box;
  border-radius: 0;
}
.game-menu[data-screen='title'] .menu-top,
.game-menu[data-screen='skill'] .menu-top {
  display: none; /* Replaced by win98-titlebar and win98-menubar */
}

/* Windows 98 Title Bar */
.win98-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px;
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: #ffffff;
  font:
    700 12px/1 'Tahoma',
    'Segoe UI',
    system-ui,
    sans-serif;
  letter-spacing: 0.02em;
  user-select: none;
}
.win98-title-icon {
  font-size: 13px;
  margin-right: 5px;
  line-height: 1;
}
.win98-title-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  text-shadow: 1px 1px 0 #000040;
}
.win98-title-buttons {
  display: flex;
  gap: 2px;
}
.win98-title-buttons button {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 1px 1px 0 #000000;
  color: #000000;
  font:
    700 9px/12px 'Marlett',
    'Tahoma',
    sans-serif;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
  cursor: default;
  border-radius: 0;
}
.win98-title-buttons button:active {
  border-color: #808080 #ffffff #ffffff #808080;
  box-shadow: none;
  padding: 1px 0 0 1px;
}
.win98-btn-close {
  font-weight: 800;
}

/* Windows 98 Menu Bar */
.win98-menubar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  font:
    400 11px/1 'Tahoma',
    'Segoe UI',
    sans-serif;
  color: #000000;
}
.win98-menu-item {
  position: relative;
  cursor: pointer;
  padding: 2px 5px;
  user-select: none;
}
.win98-menu-item:hover,
.win98-menu-item.active {
  background: #000080;
  color: #ffffff;
}
.win98-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
  padding: 2px;
  z-index: 100;
  color: #000000;
  box-sizing: border-box;
}
.win98-dropdown.open {
  display: flex;
  flex-direction: column;
}
.win98-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  font:
    400 11px/1.2 'Tahoma',
    'Segoe UI',
    sans-serif;
  color: #000000;
  cursor: pointer;
  white-space: nowrap;
}
.win98-dropdown-item:hover {
  background: #000080;
  color: #ffffff;
}
.win98-dropdown-item kbd {
  font-family: inherit;
  font-size: 10px;
  color: #555555;
  margin-left: 12px;
}
.win98-dropdown-item:hover kbd {
  color: #ffffff;
}

/* Windows 98 Inner Client Area */
.game-menu[data-screen='title'] .menu-body,
.game-menu[data-screen='skill'] .menu-body {
  background: #ffffff;
  color: #000000;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  margin: 4px 2px;
  padding: clamp(14px, 2.5cqw, 28px);
  box-sizing: border-box;
}
.game-menu[data-screen='title'] .menu-shell::before,
.game-menu[data-screen='skill'] .menu-shell::before {
  display: none;
}
.game-menu[data-screen='title'] .eyebrow,
.game-menu[data-screen='skill'] .eyebrow {
  color: #000080;
  font:
    700 11px/1.3 'Tahoma',
    sans-serif;
  letter-spacing: 0.08em;
}
.game-menu[data-screen='title'] .menu-heading,
.game-menu[data-screen='skill'] .menu-heading {
  color: #000000;
  font-family: 'Times New Roman', Times, serif;
}
.game-menu[data-screen='title'] .menu-heading > span,
.game-menu[data-screen='skill'] .menu-heading > span {
  color: #000080;
}
.game-menu[data-screen='title'] .menu-heading > strong,
.game-menu[data-screen='skill'] .menu-heading > strong {
  color: #800000;
  text-shadow: none;
}
.game-menu[data-screen='title'] .menu-description,
.game-menu[data-screen='skill'] .menu-description {
  color: #202020;
  font-family: 'Times New Roman', Georgia, serif;
  font-size: clamp(13px, 1.4cqw, 16px);
  line-height: 1.5;
}

/* Windows 98 Document Info & Clippy/Dossier Card */
.game-menu[data-screen='title'] .title-dossier {
  background: #ffffcc;
  border: 1px solid #808080;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  border-radius: 0;
  padding: 10px 12px;
  color: #000000;
}
.game-menu[data-screen='title'] .title-dossier::before {
  display: none;
}
.game-menu[data-screen='title'] .title-dossier::after {
  content: '📎 Word 98 Memo';
  position: static;
  display: block;
  font:
    700 10.5px/1 'Tahoma',
    sans-serif;
  color: #000080;
  text-align: left;
  background: none;
  border: none;
  margin-bottom: 6px;
  width: auto;
  height: auto;
}
.game-menu[data-screen='title'] .title-dossier .dossier-emp,
.game-menu[data-screen='title'] .title-dossier .dossier-target,
.game-menu[data-screen='title'] .title-dossier .dossier-route {
  background: #ffffff;
  border: 1px solid #c0c0c0;
  border-left: 3px solid #000080;
  box-shadow: none;
  border-radius: 0;
  font:
    700 10px/1.4 'Courier New',
    monospace;
  margin-top: 4px;
}

/* Windows 98 Action Buttons */
.game-menu[data-screen='title'] .menu-button,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card) {
  position: relative;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 1px 1px 0 #000000;
  border-radius: 0;
  color: #000000;
  font:
    700 12px/1.2 'Tahoma',
    'Segoe UI',
    sans-serif;
  letter-spacing: 0.02em;
  padding: 9px 14px;
  min-height: 38px;
  transition: none;
}
.game-menu[data-screen='title'] .menu-button:hover,
.game-menu[data-screen='title'] .menu-button.selected,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card):hover,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card).selected {
  background: #d4d4d4;
  outline: 1px dotted #000000;
  outline-offset: -4px;
  color: #000000;
  transform: none;
  box-shadow: 1px 1px 0 #000000;
}
.game-menu[data-screen='title'] .menu-button:active,
.game-menu[data-screen='title'] .menu-button:focus-visible,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card):active,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card):focus-visible {
  border-color: #808080 #ffffff #ffffff #808080;
  box-shadow: 1px 1px 0 #000000 inset;
  background: #c0c0c0;
  transform: none;
}
.game-menu[data-screen='title'] .menu-button.primary,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card).primary {
  border: 2px solid;
  border-color: #ffffff #000000 #000000 #ffffff;
  outline: 1px solid #000000;
  background: #c0c0c0;
  color: #000000;
  font-weight: 800;
  box-shadow: none;
}
.game-menu[data-screen='title'] .menu-button.primary:hover,
.game-menu[data-screen='title'] .menu-button.primary.selected,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card).primary:hover,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card).primary.selected {
  background: #d4d4d4;
  outline: 1px dotted #000000;
  outline-offset: -4px;
  color: #000000;
  transform: none;
}
.game-menu[data-screen='title'] .menu-button .row-label,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card) .row-label {
  font-weight: 700;
}
.game-menu[data-screen='title'] .menu-button .row-value,
.game-menu[data-screen='skill'] .menu-button:not(.difficulty-card) .row-value {
  color: #000080;
  font-weight: 700;
}

/* Windows 98 Status Bar */
.win98-statusbar {
  display: flex;
  gap: 3px;
  padding: 3px 4px 1px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  font:
    400 10.5px/1.3 'Tahoma',
    sans-serif;
  color: #000000;
}
.win98-status-cell {
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 2px 6px;
  flex: 0 0 auto;
}
.win98-status-cell.status-ready {
  flex: 1 1 auto;
  color: #800000;
  font-weight: 700;
}
.game-menu[data-screen='title'] .menu-footer {
  background: #c0c0c0;
  color: #404040;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 3px 6px;
  margin: 2px;
  font:
    400 10px/1 'Tahoma',
    sans-serif;
  text-align: left;
}

.menu-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(180deg, #2d3440 0%, #1e242d 100%);
  border: 1px solid #3f4958;
  border-bottom: 2px solid #11151a;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.5);
}
.brand-mark {
  font:
    700 11px/1 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.15em;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
  border: 1px solid #4b5563;
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.5);
}
.brand-mark::before {
  content: 'SYNERGEX-386DX';
  font-weight: 800;
  color: #38e1cf;
  font-size: 9.5px;
  padding-right: 8px;
  border-right: 1px solid #4b5563;
}
.system-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font:
    700 9.5px/1 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.1em;
  background: #11161d;
  padding: 5px 12px;
  border-radius: 2px;
  border: 1px solid #1f2937;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}
.system-status::before {
  content: '● PWR';
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.75);
}
.system-status::after {
  content: '● FDD 3.5"';
  color: #34d399;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.75);
  animation: fddBlink 2.4s infinite steps(1);
}
@keyframes fddBlink {
  0%,
  15%,
  35%,
  55%,
  100% {
    opacity: 1;
  }
  20%,
  40%,
  60% {
    opacity: 0.2;
  }
}
.menu-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 5cqw, 70px);
  flex: 1;
  padding: 24px 0;
}
.menu-copy,
.menu-content {
  min-width: 0;
}
.eyebrow {
  margin: 0 0 12px;
  color: #5eead4;
  font:
    700 10.5px/1.5 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.16em;
}
.menu-heading {
  margin: 0 0 18px;
  font-size: clamp(28px, 4.4cqw, 62px);
  font-weight: 650;
  line-height: 1.07;
  letter-spacing: -0.045em;
  color: #f8fafc;
}
.game-menu[data-screen='title'] .menu-heading {
  font-size: clamp(40px, 6.9cqw, 100px);
}
.menu-heading > span,
.menu-heading > strong {
  display: block;
}
.menu-heading > span {
  font-size: 0.62em;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  color: #94a3b8;
}
.menu-heading > strong {
  color: #ff6b57;
  letter-spacing: -0.065em;
  font-weight: 800;
  text-shadow: 0 0 24px rgba(255, 107, 87, 0.35);
}
.menu-description {
  max-width: 38ch;
  color: #cbd5e1;
  font-size: clamp(14px, 1.5cqw, 19px);
  line-height: 1.65;
  margin: 0;
}
.title-dossier {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  padding: 34px 16px 14px;
  background: #202630;
  border: 2px solid #374151;
  border-radius: 6px 6px 3px 3px;
  position: relative;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #1f2937;
  box-sizing: border-box;
}
/* Top sliding metal shutter (aluminum/steel) */
.title-dossier::before {
  content: '3.5" 2HD  ▲ INSERT  [WRITE-PROTECT OFF]';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 22px;
  background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 45%, #6b7280 100%);
  border: 1px solid #4b5563;
  border-top: none;
  border-radius: 0 0 3px 3px;
  font:
    700 8px/22px 'Courier New',
    Consolas,
    monospace;
  color: #111827;
  text-align: center;
  letter-spacing: 0.1em;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3);
}
/* Corner write-protect tab */
.title-dossier::after {
  content: '2HD';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 10px;
  background: #111827;
  border: 1px solid #4b5563;
  border-radius: 1px;
  font: 700 6px/10px var(--font);
  color: #9ca3af;
  text-align: center;
}
.title-dossier .dossier-emp,
.title-dossier .dossier-target,
.title-dossier .dossier-route {
  display: block;
  background: #fdfbf7;
  padding: 5px 10px;
  border-left: 4px solid #ea580c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  font:
    700 10.5px/1.4 'Courier New',
    Consolas,
    monospace;
  border-radius: 2px;
}
.title-dossier .dossier-emp {
  color: #991b1b;
  border-left-color: #ef4444;
}
.title-dossier .dossier-target {
  color: #854d0e;
  border-left-color: #eab308;
}
.title-dossier .dossier-route {
  color: #0f766e;
  border-left-color: #14b8a6;
}
.menu-content {
  display: grid;
  gap: 10px;
}
.menu-content > .eyebrow {
  margin-bottom: 4px;
}
.menu-button {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  padding: 13px 18px;
  border: 1px solid #475569;
  border-top: 1px solid #64748b;
  border-bottom: 4px solid #161c24;
  border-radius: 5px;
  color: #e2e8f0;
  background: linear-gradient(180deg, #374151 0%, #293240 100%);
  box-shadow:
    0 4px 0 #11151c,
    0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font:
    600 14px/1.3 'Segoe UI',
    system-ui,
    sans-serif;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.08s,
    box-shadow 0.08s;
  box-sizing: border-box;
}
.menu-button:hover,
.menu-button.selected {
  background: linear-gradient(180deg, #434e61 0%, #313a4a 100%);
  border-color: #5eead4;
  border-bottom-color: #134e4a;
  color: #ffffff;
  transform: translateY(1px);
  box-shadow:
    0 3px 0 #0d3835,
    0 6px 16px rgba(94, 234, 212, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.menu-button:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
  box-shadow:
    0 1px 0 #0d3835,
    0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.menu-button:focus-visible,
.menu-button input:focus-visible,
.btn:focus-visible,
.chip:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 3px;
}
.menu-button.primary {
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%);
  border-color: #2dd4bf;
  border-top-color: #5eead4;
  border-bottom: 4px solid #115e59;
  color: #f0fdfa;
  font-weight: 750;
  box-shadow:
    0 4px 0 #042f2e,
    0 6px 16px rgba(20, 184, 166, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.menu-button.primary:hover,
.menu-button.primary.selected {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  border-color: #99f6e4;
  color: #ffffff;
  transform: translateY(1px);
  box-shadow:
    0 3px 0 #042f2e,
    0 8px 20px rgba(45, 212, 191, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.menu-button.primary:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
  box-shadow:
    0 1px 0 #042f2e,
    0 2px 8px rgba(0, 0, 0, 0.6);
}
.menu-button.primary .row-value {
  color: #ccfbf1;
}
.menu-button:disabled {
  opacity: 0.45;
  cursor: default;
}
.row-label {
  flex: 1;
}
.row-value {
  color: #5eead4;
  font:
    700 12px/1 'Courier New',
    Consolas,
    monospace;
}
.menu-button small {
  flex-basis: 100%;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}
.difficulty-card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  padding: 25px 14px 9px;
  border-radius: 4px 4px 2px 2px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: 3px solid #94a3b8;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.08),
    0 1px 0 #ffffff inset;
  font-family: 'Segoe UI', system-ui, sans-serif;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.1s,
    transform 0.08s,
    box-shadow 0.08s;
}
/* Metal shutter at the top of the floppy disk */
.difficulty-card::before {
  content: '3.5" DISKETTE // 2HD · 1.44MB';
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 17px;
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 48%, #94a3b8 100%);
  border: 1px solid #94a3b8;
  border-top: none;
  border-radius: 0 0 3px 3px;
  font:
    700 7.5px/17px 'Courier New',
    Consolas,
    monospace;
  color: #1e293b;
  text-align: center;
  letter-spacing: 0.12em;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}
/* Corner write protect notch */
.difficulty-card::after {
  content: '2HD';
  position: absolute;
  top: 3px;
  right: 3px;
  font: 700 6px/9px var(--font);
  padding: 0 3px;
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 1px;
}
.difficulty-card:nth-child(1) {
  background: #f8fafc;
  border-left: 6px solid #475569;
}
.difficulty-card:nth-child(2) {
  background: #f0fdf4;
  border-left: 6px solid #059669;
}
.difficulty-card:nth-child(3) {
  background: #fffbeb;
  border-left: 6px solid #d97706;
}
.difficulty-card:nth-child(4) {
  background: #fef2f2;
  border-left: 6px solid #dc2626;
}
.difficulty-card:hover,
.difficulty-card.selected,
.difficulty-card:focus-visible {
  outline: 1px dotted #000080;
  outline-offset: -3px;
  transform: translateY(-1px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 128, 0.08);
}
.difficulty-card:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.difficulty-card .row-label {
  font:
    700 13px/1.2 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.04em;
  color: #0f172a;
  flex-basis: 100%;
}
.difficulty-card small {
  color: #334155;
  font:
    500 11.5px/1.35 'Segoe UI',
    system-ui,
    sans-serif;
  flex-basis: 100%;
}
.difficulty-meta {
  color: #475569;
  font:
    700 9px/1.3 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  margin-top: 1px;
  flex-basis: 100%;
}
.difficulty-card:nth-child(2) .difficulty-meta {
  color: #047857;
}
.difficulty-card:nth-child(3) .difficulty-meta {
  color: #b45309;
}
.difficulty-card:nth-child(4) .difficulty-meta {
  color: #b91c1c;
}
.settings-row input {
  width: 34%;
  accent-color: #2dd4bf;
  cursor: pointer;
}
.menu-note,
.checkpoint-note {
  color: #94a3b8;
  font:
    11px/1.6 'Courier New',
    Consolas,
    monospace;
}
.checkpoint-note {
  margin-top: 26px;
  color: #34d399;
}
.briefing {
  color: #cbd5e1;
  font:
    13.5px/1.7 'Courier New',
    Consolas,
    monospace;
  white-space: pre-line;
  margin: 0 0 16px;
  background: #11161d;
  padding: 14px 18px;
  border-radius: 4px;
  border: 1px solid #1f2937;
  border-left: 4px solid #38e1cf;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}
.menu-footer {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #334155;
  color: #94a3b8;
  font:
    700 9.5px/1.6 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
}
.control-tabs {
  display: flex;
  gap: 6px;
}
.control-tabs .menu-button {
  padding: 8px 12px;
  font:
    700 11px/1 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  flex: 1;
  justify-content: center;
}
.control-tabs [aria-pressed='true'] {
  background: linear-gradient(180deg, #1f4340 0%, #132a28 100%);
  border-color: #2dd4bf;
  border-bottom-color: #0d3835;
  color: #f0fdfa;
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #061f1d,
    inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.controls-list,
.run-report {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  font:
    11.5px/1.5 'Courier New',
    Consolas,
    monospace;
  color: #cbd5e1;
  margin: 12px 0;
  background: #11161d;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid #1f2937;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}
.controls-list dt,
.run-report dd {
  color: #5eead4;
  font-weight: 700;
}
.controls-list dd,
.run-report dd {
  margin: 0;
}
.run-report dd {
  text-align: right;
}

/* About Screen / Developer Dossier */
.game-menu[data-screen='about'] .menu-body {
  align-items: start;
}

.about-dossier::before {
  content: '3.5" 2HD  ▲ NVINDUSTRIES ARCHIVE  [CREATOR FILE]';
  background: linear-gradient(180deg, #5eead4 0%, #2dd4bf 45%, #0d9488 100%);
  color: #042f2e;
}
.about-dossier .dossier-emp {
  border-left-color: #0d9488;
}
.about-dossier .dossier-target {
  border-left-color: #f59e0b;
}
.about-dossier .dossier-route {
  border-left-color: #3b82f6;
}

.about-card {
  position: relative;
  background: #11161d;
  border: 1px solid #1f2937;
  border-radius: 4px;
  padding: 16px 20px;
  margin: 0 0 16px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.7),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.about-card.about-story {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(17, 22, 29, 0.96) 100%);
}

.about-card.about-mission {
  border-left: 4px solid #2dd4bf;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.06) 0%, rgba(17, 22, 29, 0.96) 100%);
}

.about-card-title {
  margin: 0 0 10px 0;
  font:
    700 12.5px/1.3 'Courier New',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  color: #5eead4;
  text-transform: uppercase;
}

.about-story .about-card-title {
  color: #fbbf24;
}

.about-card-body {
  margin: 0 0 10px 0;
  font:
    13px/1.7 'Courier New',
    Consolas,
    monospace;
  color: #cbd5e1;
}

.about-card-body:last-child {
  margin-bottom: 0;
}

.about-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.about-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #141b24;
  border: 1px solid #222f3e;
  border-radius: 4px;
  text-decoration: none;
  color: #f1f5f9;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.about-link-card.web-link {
  border-left: 4px solid #2dd4bf;
}

.about-link-card.linkedin-link {
  border-left: 4px solid #38bdf8;
}

.about-link-card:hover,
.about-link-card:focus-visible {
  background: #1e293b;
  border-color: #5eead4;
  transform: translateY(-2px);
  box-shadow:
    0 0 16px rgba(94, 234, 212, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.5);
  outline: none;
}

.about-link-card.linkedin-link:hover,
.about-link-card.linkedin-link:focus-visible {
  border-color: #38bdf8;
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

.about-link-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.about-link-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.about-link-label {
  font:
    700 13px/1.3 'Segoe UI',
    system-ui,
    sans-serif;
  color: #f8fafc;
}

.about-link-sub {
  font:
    700 10px/1 'Courier New',
    Consolas,
    monospace;
  color: #94a3b8;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.about-link-card:hover .about-link-label,
.about-link-card:focus-visible .about-link-label {
  color: #ffffff;
}

.about-link-card:hover .about-link-sub,
.about-link-card:focus-visible .about-link-sub {
  color: #5eead4;
}

.about-link-card.linkedin-link:hover .about-link-sub,
.about-link-card.linkedin-link:focus-visible .about-link-sub {
  color: #38bdf8;
}

.about-back-btn {
  width: 100%;
}

@media (max-width: 760px) {
  .about-links-grid {
    grid-template-columns: 1fr;
  }
}
/* Telemetry never intercepts aim or touch input. */
.game-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #ecf6f1;
  text-shadow: 0 1px 3px #000;
}
/* Carbon copy and retention case sit at the edges of the combat view. */
.hud-top {
  position: absolute;
  inset: 12px 16px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.hud-objective {
  position: relative;
  width: 300px;
  flex: 0 0 300px;
  padding: 8px 12px;
  color: #242c2d;
  background: #ded8bf;
  border-left: 5px solid #988b67;
  box-shadow: 3px 3px 0 #191c20;
  text-shadow: none;
  transform: rotate(-0.5deg);
}
.hud-objective::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  border: 6px solid transparent;
  border-top-color: #292d2d;
  border-right-color: #292d2d;
}
.objective-header {
  display: flex;
  border-bottom: 1px solid #ada78f;
  padding-bottom: 4px;
}
.objective-tag {
  font:
    700 9px/1.2 'Courier New',
    monospace;
  letter-spacing: 0.12em;
}
.objective-body {
  margin: 5px 0;
  font:
    700 13px/1.3 'Courier New',
    monospace;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hud-objective.expanded .objective-body {
  display: block;
  overflow: visible;
}
.objective-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font:
    700 10px/1.25 'Courier New',
    monospace;
}
.objective-loc {
  display: none;
  color: #53584e;
}
.hud-objective.expanded .objective-loc {
  display: block;
}
.objective-stamp {
  border-top: 1px dashed #aba48c;
  padding-top: 4px;
  color: #2d5148;
}
.hud-boss {
  position: relative;
  width: 330px;
  padding: 10px 12px;
  background: #272a2b;
  border-top: 4px solid #b8674b;
  box-shadow: 3px 3px 0 #111718;
  font:
    700 15px/1.2 'Courier New',
    monospace;
}
.hud-boss .boss-case-label {
  margin: 0 0 5px;
  color: #c9bda3;
  font-size: 9px;
  letter-spacing: 0.13em;
}
.hud-boss small {
  display: block;
  font-size: 12px;
  color: #f2d9a4;
  margin-top: 6px;
}
.hud-boss progress {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 6px;
  accent-color: #ce795c;
}
.hud-boss.shielded progress {
  accent-color: #d8b25f;
}
.boss-object {
  float: right;
  margin-top: 3px;
}
.boss-object .supply-icon {
  width: 28px;
  height: 28px;
  color: #eed49a;
}
.hud-notifications {
  position: absolute;
  top: 116px;
  right: 16px;
  max-width: min(40%, 400px);
}
.notification {
  margin: 0;
  padding: 7px 10px;
  background: #e0dac6;
  border-left: 5px solid #9d8153;
  color: #292d2e;
  font:
    700 12px/1.35 'Courier New',
    monospace;
  text-shadow: none;
  box-shadow: 3px 3px 0 #171c1d;
}
.notification.good {
  border-color: #4c806e;
}
.notification.warn,
.notification.bad {
  border-color: #a74939;
}
.hud-crosshair,
.hud-hit {
  position: absolute;
  top: 41%;
  left: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
}
.hud-crosshair {
  border: 1px solid #072128;
  background: #ecfff4;
  box-shadow:
    0 -8px 0 -1px #ecfff4,
    0 8px 0 -1px #ecfff4,
    -8px 0 0 -1px #ecfff4,
    8px 0 0 -1px #ecfff4;
}
.hud-crosshair.firing {
  box-shadow:
    0 -11px 0 -1px #ecfff4,
    0 11px 0 -1px #ecfff4,
    -11px 0 0 -1px #ecfff4,
    11px 0 0 -1px #ecfff4;
}
.hud-hit {
  width: 25px;
  height: 25px;
}
.hud-hit::before,
.hud-hit::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 25px;
  height: 2px;
  background: #d9fff4;
  transform: rotate(45deg);
}
.hud-hit::after {
  transform: rotate(-45deg);
}
.hud-hit.kill::before,
.hud-hit.kill::after {
  background: #ffb07d;
}
/* Salvaged enamel time clock: hard edges, mechanical meters, no illuminated panels. */
.hud-target,
.hud-use {
  position: absolute;
  left: 50%;
  top: 43%;
  transform: translateX(-50%);
  padding: 4px 8px;
  color: #e5dfcb;
  background: #202729dc;
  font:
    12px/1.35 'Courier New',
    monospace;
  text-align: center;
}
.hud-use {
  top: 54%;
  border-bottom: 2px solid #d3b96c;
}
.hud-subtitle {
  position: absolute;
  left: 50%;
  bottom: 152px;
  transform: translateX(-50%);
  width: min(620px, 64%);
  margin: 0;
  padding: 8px 14px 9px 53px;
  background: repeating-linear-gradient(0deg, #252c2e 0 2px, #293133 2px 4px);
  border-left: 5px solid #a09d83;
  border-right: 5px solid #a09d83;
  box-shadow: 0 3px 0 #101719;
  box-sizing: border-box;
}
.hud-subtitle > .supply-icon {
  position: absolute;
  left: 9px;
  top: 15px;
  width: 29px;
  height: 29px;
  color: #c8c8ad;
}
.intercom-label {
  display: block;
  color: #aaa992;
  font:
    700 9px/1 'Courier New',
    monospace;
  letter-spacing: 0.16em;
  margin-bottom: 5px;
}
.intercom-text {
  margin: 0;
  color: #f4eed9;
  font:
    700 15px/1.35 'Courier New',
    monospace;
}
.hud-status,
.hud-tips {
  position: absolute;
  bottom: 119px;
  right: 16px;
  max-width: 65%;
  padding: 4px 8px;
  background: #222b2dec;
  border-bottom: 2px solid #7c927b;
  color: #dbdfc4;
  font:
    700 11px/1.3 'Courier New',
    monospace;
}
.hud-tips {
  top: auto;
  bottom: 152px;
  left: 16px;
  right: auto;
  max-width: 280px;
  border-color: #c9ad73;
  color: #eee0bc;
}
.hud-subtitle:not([hidden]) ~ .hud-tips {
  max-width: 200px;
}
.hud-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 112px;
  padding: 9px 22px 7px;
  box-sizing: border-box;
  background:
    linear-gradient(174deg, transparent 0 19%, #c5c0a41a 19% 19.4%, transparent 19.4%),
    linear-gradient(4deg, transparent 0 72%, #d8d2b211 72% 72.3%, transparent 72.3%), #303637;
  border-top: 4px solid #a7a48f;
  box-shadow:
    inset 0 2px #171e20,
    0 -3px #1a2224;
  text-shadow: none;
}
.hud-dock::before,
.hud-dock::after {
  content: '+';
  position: absolute;
  top: 5px;
  width: 12px;
  height: 12px;
  color: #171c1c;
  background: #949787;
  border-radius: 50%;
  text-align: center;
  font: bold 12px/12px monospace;
  box-shadow: 0 1px #151b1c;
}
.hud-dock::before {
  left: 5px;
}
.hud-dock::after {
  right: 5px;
}
.hud-dock-main {
  display: grid;
  height: 100%;
  grid-template-columns: minmax(285px, 1.2fr) minmax(180px, 0.8fr) minmax(300px, 1.3fr) 155px;
  gap: 18px;
  align-items: center;
  max-width: 1600px;
  margin: auto;
}
.hud-vitals {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.hud-face-wrap {
  flex: 0 0 64px;
  order: -1;
  height: 94px;
  box-sizing: border-box;
  position: relative;
  padding: 11px 4px 4px;
  background: #d9d5bb;
  color: #253d38;
  transform: rotate(-3deg);
  border: 1px solid #858977;
  box-shadow: 2px 2px #172021;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.hud-face-clip {
  position: absolute;
  top: -6px;
  left: 25px;
  width: 12px;
  height: 13px;
  background: #aaa998;
  border: 2px solid #626d68;
  box-shadow: 1px 1px #1a2020;
}
.hud-face-badge,
.hud-face-status {
  font:
    700 7px/1.1 'Courier New',
    monospace;
  white-space: nowrap;
}
.hud-face {
  display: block;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  background: #172424;
  border: 1px solid #6f796c;
}
.hud-face-barcode {
  width: 42px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #34433b 0 2px, transparent 2px 3px, #34433b 3px 4px, transparent 4px 6px);
}
.vital {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  background: #1b2526;
  border: 1px solid #111c1d;
  box-shadow: inset 0 -1px #69756a;
}
.vital-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vital-label {
  color: #c3c6ae;
  font:
    700 11px/1 'Courier New',
    monospace;
  letter-spacing: 0.1em;
}
.vital-indicator {
  color: #a1bda7;
  white-space: nowrap;
  font:
    700 8px/1 'Courier New',
    monospace;
}
.vital strong {
  display: block;
  font:
    700 clamp(30px, 3cqw, 43px)/1.05 'Courier New',
    monospace;
  font-variant-numeric: tabular-nums;
  color: #d6e2bd;
}
.vital.armor strong {
  color: #e3c995;
}
.vital.armor .vital-indicator {
  color: #d8bb88;
}
.vital.critical strong,
.vital.critical .vital-indicator {
  color: #ee977e;
}
.vital.hyperfocus {
  border-color: #dec177;
}
.vital.hyperfocus .vital-indicator {
  color: #f1d894;
}
.vital progress {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 4px;
  accent-color: #bed0a5;
}
.vital.armor progress {
  accent-color: #c9b37a;
}
.hud-weapon {
  position: relative;
  min-width: 0;
  height: 83px;
  box-sizing: border-box;
  padding: 6px 8px 5px 50px;
  display: grid;
  grid-template-columns: 1fr;
  background: #20292a;
  border: 1px solid #172022;
  border-bottom: 3px solid #7f8a77;
}
.weapon-drawer-label {
  font:
    700 8px/1.15 'Courier New',
    monospace;
  letter-spacing: 0.1em;
  color: #abb39e;
}
.weapon-name {
  font:
    700 11px/1.2 'Courier New',
    monospace;
  color: #ece2c8;
  white-space: nowrap;
}
.equipped-icon {
  position: absolute;
  left: 7px;
  top: 25px;
  color: #bcc6ab;
}
.equipped-icon .supply-icon {
  width: 36px;
  height: 36px;
}
.ammo-value {
  color: #e4dab6;
  font:
    700 34px/1 'Courier New',
    monospace;
  font-variant-numeric: tabular-nums;
}
.ammo-type {
  font:
    700 8px/1 'Courier New',
    monospace;
  color: #b7bda9;
}
.hud-weapon.critical {
  border-color: #c47760;
}
.hud-weapon.critical .ammo-value {
  color: #ed977a;
}
.hud-weapon.new-weapon-flare {
  border-top: 3px solid #e4cf8f;
}
.hud-slots {
  display: flex;
  gap: 3px;
  min-width: 0;
  align-items: flex-end;
  height: 76px;
  padding: 0 0 5px;
  border-bottom: 3px solid #172122;
}
.hud-slot {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 62px;
  padding: 10px 3px 3px;
  box-sizing: border-box;
  color: #737e72;
  background: #343e3c;
  border: 1px solid #182522;
  border-top: 3px solid #59655c;
  clip-path: polygon(0 7px, 20% 7px, 20% 0, 83% 0, 100% 7px, 100% 100%, 0 100%);
}
.hud-slot.owned {
  background: #929783;
  border-color: #525d50;
  border-top-color: #b4b59b;
  color: #29362f;
}
.hud-slot.current {
  height: 72px;
  background: #d5c69a;
  border-top-color: #f1e0b1;
  color: #263a30;
}
.slot-number {
  position: absolute;
  left: 4px;
  top: 6px;
  font: 700 10px/1 monospace;
}
.slot-variant {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font: 700 8px/1 monospace;
}
.hud-slot > .supply-icon {
  width: 100%;
  height: 36px;
  margin-top: 5px;
}
.hud-slot.current > .supply-icon {
  margin-top: 13px;
}
.supply-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  display: block;
}
.hud-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}
.badge {
  position: relative;
  width: 45px;
  height: 65px;
  box-sizing: border-box;
  padding: 22px 3px 4px;
  color: #a2a999;
  background: #27322e;
  border: 1px dashed #667166;
  font:
    700 9px/1.3 'Courier New',
    monospace;
  text-align: center;
  clip-path: polygon(5px 0, 40px 0, 45px 7px, 45px 100%, 0 100%, 0 7px);
}
.badge::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 17px;
  width: 11px;
  height: 4px;
  background: #202a27;
}
.badge.collected {
  border-style: solid;
  border-color: #a2c8cf;
  background: #6c9faa;
  color: #102e36;
}
.badge.yellow.collected {
  background: #d7c46b;
  color: #393516;
  border-color: #eee2a3;
}
.badge.gold.collected {
  background: #bc9257;
  color: #352514;
  border-color: #e8c08a;
}
.pause-task-memo {
  padding: 14px;
  margin: 20px 0 0;
  color: #2b3930;
  background: #e2dbc1;
  border-left: 5px solid #a6a181;
  box-shadow: 3px 3px #151c22;
  text-shadow: none;
  transform: rotate(-1deg);
}
.pause-task-memo small {
  font:
    700 10px/1.2 'Courier New',
    monospace;
  letter-spacing: 0.12em;
}
.pause-task-memo p {
  margin: 8px 0 0;
  font:
    700 15px/1.4 'Courier New',
    monospace;
}
.map-open .hud-objective {
  margin-top: 48px;
}
.map-open .hud-dock,
.map-open .hud-status {
  display: none;
}
@container (max-width:1100px) {
  .hud-dock {
    padding-left: 17px;
    padding-right: 17px;
    height: 102px;
  }
  .hud-dock-main {
    grid-template-columns: 280px 180px minmax(225px, 1fr) 125px;
    gap: 10px;
  }
  .hud-vitals {
    gap: 8px;
  }
  .hud-face-wrap {
    flex-basis: 54px;
    height: 84px;
  }
  .hud-face {
    width: 34px;
    height: 34px;
  }
  .vital {
    padding: 5px;
  }
  .vital-label {
    font-size: 10px;
  }
  .vital-indicator {
    font-size: 7px;
  }
  .hud-weapon {
    height: 78px;
  }
  .hud-badges {
    gap: 3px;
  }
  .badge {
    width: 39px;
    font-size: 8px;
  }
  .hud-slot > .supply-icon {
    height: 30px;
  }
  .hud-status {
    bottom: 109px;
  }
  .hud-subtitle {
    bottom: 142px;
    width: 55%;
  }
  .hud-tips {
    bottom: 142px;
    max-width: 185px;
    font-size: 10px;
  }
  .intercom-text {
    font-size: 13px;
  }
}
@container (max-width:760px) {
  .hud-dock {
    height: 90px;
    padding: 7px 10px;
  }
  .hud-dock-main {
    grid-template-columns: minmax(170px, 1fr) minmax(125px, 0.8fr) 110px;
    gap: 8px;
  }
  .hud-slots {
    display: none;
  }
  .hud-face-wrap {
    flex-basis: 45px;
    height: 72px;
    padding-top: 8px;
  }
  .hud-face {
    width: 29px;
    height: 29px;
  }
  .hud-face-badge,
  .hud-face-status {
    font-size: 6px;
  }
  .hud-face-clip {
    left: 16px;
  }
  .hud-face-barcode {
    width: 32px;
  }
  .vital strong {
    font-size: 27px;
  }
  .vital-label {
    font-size: 8px;
  }
  .vital-indicator {
    display: none;
  }
  .hud-weapon {
    height: 72px;
    padding-left: 35px;
  }
  .equipped-icon {
    left: 3px;
  }
  .equipped-icon .supply-icon {
    width: 28px;
    height: 28px;
  }
  .weapon-name {
    font-size: 8px;
  }
  .weapon-drawer-label,
  .ammo-type {
    font-size: 7px;
  }
  .ammo-value {
    font-size: 28px;
  }
  .badge {
    width: 34px;
    height: 59px;
    font-size: 7px;
    padding-top: 21px;
  }
  .badge::before {
    left: 11px;
  }
  .hud-top {
    inset: 8px 10px auto;
    gap: 14px;
  }
  .hud-objective {
    width: 230px;
    flex-basis: 230px;
    padding: 6px 9px;
  }
  .objective-body {
    font-size: 11px;
  }
  .objective-tag {
    font-size: 8px;
  }
  .objective-footer {
    font-size: 9px;
  }
  .hud-boss {
    width: 235px;
    padding: 7px 9px;
    font-size: 12px;
  }
  .hud-boss small {
    font-size: 10px;
  }
  .hud-notifications {
    top: 112px;
    max-width: 43%;
  }
  .notification {
    font-size: 10px;
  }
  .hud-status {
    bottom: 96px;
    font-size: 9px;
  }
  .hud-subtitle {
    bottom: 128px;
    width: 70%;
    padding-left: 41px;
  }
  .hud-subtitle > .supply-icon {
    left: 5px;
    width: 25px;
  }
  .intercom-text {
    font-size: 12px;
  }
  .hud-tips {
    bottom: 200px;
    font-size: 9px;
  }
  .hud-target,
  .hud-use {
    font-size: 10px;
  }
}
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .game-menu *,
  .game-hud *,
  .btn,
  .chip {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 760px), (max-height: 500px) {
  .game-menu {
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse at 50% 45%, rgba(26, 32, 42, 0.98) 0%, rgba(11, 14, 19, 0.99) 100%),
      repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px);
  }
  .menu-shell {
    padding: max(18px, var(--safe-t)) max(22px, var(--safe-r)) max(18px, var(--safe-b)) max(22px, var(--safe-l));
  }
  .menu-body {
    gap: 25px;
  }
  .menu-heading {
    font-size: 30px;
  }
  .game-menu[data-screen='title'] .menu-heading {
    font-size: 48px;
  }
  .menu-description {
    font-size: 13px;
  }
  .menu-top {
    padding-bottom: 12px;
  }
  .menu-footer {
    font-size: 9px;
  }
  .title-dossier {
    margin-top: 20px;
    font-size: 9px;
  }
  .game-menu[data-screen='title'] {
    border-width: 3px;
    padding: 3px;
  }
  .settings-row {
    padding: 10px 12px;
  }
}
@media (max-width: 540px) and (orientation: portrait) {
  .menu-body {
    grid-template-columns: 1fr;
    gap: 24px;
    align-content: center;
  }
  .menu-shell {
    min-height: 100dvh;
  }
  .menu-description {
    max-width: 100%;
  }
  .system-status {
    font-size: 8px;
  }
  .title-dossier {
    display: none;
  }
  .game-menu[data-screen='title'] .menu-heading {
    font-size: 64px;
  }
  .menu-content > .eyebrow {
    font-size: 9px;
  }
}

/* Combat abilities stay reachable on phones, including mirrored layouts. */
.btn-shield,
.btn-kick,
.btn-jump {
  width: var(--btn);
  height: var(--btn);
  font-size: clamp(9px, 2.3vmin, 12px);
}
.btn-shield {
  inset-inline-end: var(--edge);
  bottom: calc(var(--safe-b) + 14px + var(--fire) + 8px);
  border-color: #f59e0b;
  background: #3d2810b3;
}
.btn-kick {
  inset-inline-end: calc(var(--edge) + var(--fire) + 8px);
  bottom: calc(var(--safe-b) + 14px);
}
.btn-use {
  bottom: calc(var(--safe-b) + 14px + var(--btn) + 8px);
}
.btn-jump {
  inset-inline-end: calc(var(--edge) + var(--fire) + var(--btn) + 16px);
  bottom: calc(var(--safe-b) + 14px);
}
.vital progress,
.hud-boss progress {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: #171d24;
}
.vital progress::-webkit-progress-bar,
.hud-boss progress::-webkit-progress-bar {
  background: #171d24;
  border-radius: 0;
}
.vital progress::-webkit-progress-value {
  background: #bed0a5;
}
.vital.armor progress::-webkit-progress-value {
  background: #c9b37a;
}
.vital.critical progress::-webkit-progress-value {
  background: #ce795c;
}
.hud-boss progress::-webkit-progress-value {
  background: #ce795c;
}
.hud-boss.shielded progress::-webkit-progress-value {
  background: #c9b37a;
}
.vital progress::-moz-progress-bar {
  background: #bed0a5;
}
.vital.armor progress::-moz-progress-bar {
  background: #c9b37a;
}
.hud-boss progress::-moz-progress-bar {
  background: #ce795c;
}
.vital.critical progress::-moz-progress-bar {
  background: #ce795c;
}
.hud-boss.shielded progress::-moz-progress-bar {
  background: #c9b37a;
}
.boss-intro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: auto;
  cursor: pointer;
  font-family: 'Segoe UI', system-ui, sans-serif;
  user-select: none;
  overflow: hidden;
}
.boss-intro[hidden] {
  display: none;
}
/* Widescreen Letterboxing */
.boss-letterbox-top {
  position: relative;
  z-index: 4;
  width: 100%;
  height: clamp(38px, 7vh, 64px);
  background: #020509;
  border-bottom: 2px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 36px);
  box-sizing: border-box;
}
.boss-cctv-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ef4444;
  font-family: 'Courier New', Consolas, monospace;
  font-size: clamp(11px, 1.5cqw, 14px);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.boss-cctv-rec-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #ef4444;
  animation: cctvBlink 1s infinite alternate;
}
@keyframes cctvBlink {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}
.boss-cctv-info {
  color: #64748b;
  font-family: 'Courier New', Consolas, monospace;
  font-size: clamp(10px, 1.3cqw, 13px);
  letter-spacing: 1px;
}
.boss-letterbox-bottom {
  position: relative;
  z-index: 4;
  width: 100%;
  height: clamp(40px, 8vh, 70px);
  background: #020509;
  border-top: 2px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 36px);
  box-sizing: border-box;
}
.boss-skip-hint {
  color: #94a3b8;
  font-family: 'Courier New', Consolas, monospace;
  font-size: clamp(10px, 1.3cqw, 13px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.boss-cinematic-timer {
  color: #f59e0b;
  font-family: 'Courier New', Consolas, monospace;
  font-size: clamp(10px, 1.3cqw, 13px);
  letter-spacing: 1px;
}

/* CCTV Scanlines & Security Overlay */
.boss-cctv-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0px, rgba(0, 0, 0, 0.25) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at center, rgba(0, 20, 10, 0.03) 0%, rgba(0, 0, 0, 0.55) 100%);
  mix-blend-mode: multiply;
}

/* Dramatic Boss Title & Quote Banner */
.boss-banner {
  position: absolute;
  bottom: clamp(24px, 5.5vh, 60px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 580px);
  max-width: calc(100vw - 24px);
  z-index: 3;
  padding: clamp(10px, 1.8vh, 16px) clamp(14px, 2.8vw, 24px);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(20, 27, 45, 0.92) 70%, rgba(10, 15, 30, 0.97) 100%);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-left: 5px solid #ef4444;
  border-radius: 4px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.85),
    0 0 24px rgba(239, 68, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  pointer-events: auto;
}
.boss-banner.ceo-counter-offer {
  width: min(94%, 620px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border-color: rgba(245, 158, 11, 0.6);
  border-left-color: #f59e0b;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.85),
    0 0 24px rgba(245, 158, 11, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.ceo-contract-block {
  margin: 6px 0 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px dashed rgba(245, 158, 11, 0.5);
  border-radius: 4px;
  font-family: 'Courier New', Consolas, monospace;
}
.ceo-contract-header {
  font-size: clamp(10px, 1.3vw, 12px);
  font-weight: 700;
  letter-spacing: 1px;
  color: #fbbf24;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}
.ceo-contract-terms {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ceo-contract-clause {
  font-size: clamp(9.5px, 1.2vw, 11.5px);
  line-height: 1.35;
  color: #e2e8f0;
  padding-left: 6px;
  border-left: 2px solid rgba(245, 158, 11, 0.4);
}
.boss-banner .eyebrow {
  margin: 0 0 3px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: clamp(10px, 1.2cqw, 12px);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #f87171;
  text-transform: uppercase;
}
.boss-banner.ceo-counter-offer .eyebrow {
  color: #fbbf24;
}
.boss-banner h2 {
  font-size: clamp(16px, 2.8vw, 26px);
  margin: 0 0 4px;
  line-height: 1.15;
  font-family: 'Courier New', Consolas, monospace;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  overflow-wrap: break-word;
  word-break: break-word;
}
.boss-banner blockquote {
  font-size: clamp(11px, 1.6vw, 13.5px);
  font-style: italic;
  margin: 4px 0 8px;
  line-height: 1.35;
  color: #fef08a;
  border-left: 2px solid rgba(254, 240, 138, 0.4);
  padding-left: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.boss-banner-progress {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.boss-banner-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width 0.08s linear;
}
.boss-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.boss-choice-group .menu-button {
  flex: 1 1 160px;
  min-height: 36px;
  font-weight: 700;
  font-size: clamp(10px, 1.4vw, 12.5px);
  padding: 6px 10px;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}
.boss-choice-group .choice-fight {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border: 1px solid #f87171;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}
.boss-choice-group .choice-fight:hover,
.boss-choice-group .choice-fight:focus {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.8);
}
.boss-choice-group .choice-sellout {
  background: linear-gradient(180deg, #166534 0%, #14532d 100%);
  border: 1px solid #4ade80;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(22, 101, 52, 0.4);
}
.boss-choice-group .choice-sellout:hover,
.boss-choice-group .choice-sellout:focus {
  background: linear-gradient(180deg, #15803d 0%, #166534 100%);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.8);
}

/* Keep spoken captions clear of the aim area on phones and touch devices. */
@media (pointer: coarse), (max-width: 760px) {
  .hud-subtitle {
    bottom: 120px;
    width: min(440px, calc(100% - 24px));
    padding: 4px 10px;
    border-left-width: 3px;
    border-right-width: 3px;
  }
  .hud-subtitle > .supply-icon,
  .intercom-label {
    display: none;
  }
  .intercom-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.3;
  }
  .hud-status {
    bottom: 144px;
  }
  @container (max-width:760px) {
    .hud-subtitle {
      bottom: 96px;
    }
  }
  @container (max-width:360px) {
    .hud-subtitle {
      bottom: 90px;
    }
    .intercom-text {
      -webkit-line-clamp: 1;
    }
  }
}
@media (pointer: coarse) and (orientation: portrait) {
  .hud-status {
    top: calc(100% + 108px);
    bottom: auto;
    right: 12px;
    max-width: calc(100% - 24px);
  }
}

/* Give touch pickups their own corner without covering the objective or boss. */
body.touch-ui .game-hud {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: auto auto;
  align-content: start;
  align-items: start;
  gap: 6px 8px;
  padding: 8px 10px;
}
body.touch-ui .hud-top {
  display: contents;
}
body.touch-ui .hud-objective {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  max-width: 230px;
  min-width: 0;
}
body.touch-ui .hud-notifications {
  position: static;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: fit-content;
  max-width: min(100%, 180px);
}
body.touch-ui .notification {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 0 6px;
  /* Border gutters keep clamped text from drawing into vertical padding. */
  border-block: 4px solid #e0dac6;
  border-left-width: 3px;
  font-size: 10px;
  line-height: 1.25;
  box-shadow: 2px 2px 0 #171c1d;
}
body.touch-ui .hud-boss {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  max-width: 230px;
  min-width: 0;
  padding: 6px 7px;
  font-size: 10px;
  line-height: 1.2;
}
body.touch-ui .hud-top:has(.hud-boss:not([hidden])) .hud-objective,
body.touch-ui .hud-boss .boss-case-label {
  display: none;
}
body.touch-ui .hud-boss small {
  font-size: 9px;
  line-height: 1.2;
}
body.touch-ui .boss-object .supply-icon {
  width: 18px;
  height: 18px;
}
@media (orientation: landscape) {
  body.touch-ui .game-hud {
    /* Reserve room only when the side controls extend inside the picture. */
    padding-inline: max(10px, calc(var(--edge) + max(var(--chip), var(--small)) + 8px - 50vw + 50cqw));
  }
}
