/* Building controls, circa 1968–1994. Layout and input ownership live in
   style.css; these surfaces retain the portrait game's existing hit areas. */
:root {
  --bone: #ece4c9;
  --muted: #c2bba3;
  --amber: #e3b96d;
  --office-ink: #302f25;
  --office-paper: #d4c9a8;
  --office-metal: #33362e;
  --office-green: #a4bd77;
  --key-light: linear-gradient(165deg, #e7dec2 0%, #d5caab 48%, #b6aa8d 100%);
  --key-dark: linear-gradient(165deg, #4d5145 0%, #353a30 51%, #252a23 100%);
  --raised-key: inset 0 1px 0 #fff4d477, inset 1px 0 0 #fff4d426,
    inset 0 -3px 0 #161b1577, 0 2px 0 #10150ed9, 0 3px 6px #0005;
}

button { -webkit-tap-highlight-color: transparent; }
button:not(:disabled):active { filter: brightness(.94); }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #f1c782;
  outline-offset: 3px;
}

/* The title and menus sit on a scratched, screwed-down control plate. */
.menu-screen { background: linear-gradient(0deg, #10140dc7, #10140d12 50%, transparent 73%); }
.game-start, .panel {
  position: relative;
  padding: 23px 20px 14px;
  border: 1px solid #a39b7e;
  border-radius: 3px;
  background:
    radial-gradient(circle at 8px 8px, #151a13 0 1px, #9c9d83 1.4px 2.3px, #3d4434 2.6px 3.4px, transparent 3.8px),
    radial-gradient(circle at calc(100% - 8px) 8px, #151a13 0 1px, #9c9d83 1.4px 2.3px, #3d4434 2.6px 3.4px, transparent 3.8px),
    radial-gradient(circle at 8px calc(100% - 8px), #151a13 0 1px, #9c9d83 1.4px 2.3px, #3d4434 2.6px 3.4px, transparent 3.8px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), #151a13 0 1px, #9c9d83 1.4px 2.3px, #3d4434 2.6px 3.4px, transparent 3.8px),
    repeating-linear-gradient(178deg, #d9d0ab05 0 1px, transparent 1px 5px),
    linear-gradient(150deg, #4d5041f5, #30372af5 47%, #292f25f5);
  box-shadow: inset 0 0 0 3px #252b22, inset 0 0 0 4px #c5c1a633,
    inset 0 1px 0 #e4dcc680, 0 7px 0 #12190f99, 0 14px 38px #0008;
  text-shadow: none;
}
.game-start { width: min(304px, 100%); }
.game-start h1 {
  margin: 0 0 20px;
  padding: 13px 1px 12px;
  border: 1px solid #171e17;
  border-radius: 1px;
  background: linear-gradient(175deg, #d8cfb3, #c4b99b);
  color: #34332a;
  box-shadow: inset 0 0 0 2px #ede2c077, 0 1px 0 #c7c6ad44;
  font: 800 28px/1.08 'Arial Narrow', Arial, sans-serif;
  letter-spacing: -.025em;
  text-shadow: 0 1px #ede5c8;
}
.menu-actions { gap: 10px; }
.button {
  position: relative;
  border: 1px solid #151c14;
  border-radius: 3px;
  background: var(--key-dark);
  box-shadow: var(--raised-key);
  color: #ded5b7;
  font: 700 13px/1.4 'Courier New', monospace;
  letter-spacing: .09em;
  text-shadow: 0 1px #1b2119;
}
.button.primary {
  background: var(--key-light);
  border-color: #a39779 #77745f #1c2418;
  color: var(--office-ink);
  text-shadow: 0 1px #f8efd455;
}
.button.secondary, .button.dark { background: var(--key-dark); border-color: #6d7360 #373f30 #131a10; }
.button:not(:disabled):hover { border-color: #b4b497; }
.button:disabled { opacity: .57; }
.button:not(:disabled):active, .hud-button:active, .quickslot:active, .touch-button:not(:disabled):active {
  box-shadow: inset 0 2px 4px #12180f66, inset 0 0 0 1px #1a21144d, 0 1px 0 #c2baa13b;
}
.text-button {
  color: #d6cdb0;
  font: 700 12px/1.4 'Courier New', monospace;
  letter-spacing: .085em;
  text-decoration: underline;
  text-decoration-color: #9b9d7c;
  text-underline-offset: 4px;
}
.load-status { color: #b2ba96; font: 11px/1.5 'Courier New', monospace; }
.panel h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid #a3a58a70;
  font: 700 22px/1.2 'Courier New', monospace;
  letter-spacing: .09em;
  color: #e1dac0;
}
.panel p { color: #d5cfb8; }
.panel .panel-footnote { color: #a6af91; font-family: 'Courier New', monospace; }
.modal-screen { background: #0d130cd1; }
.build-number { color: #a4ab90; font-size: 10px; }

/* Navigation is an old smoked-acrylic instrument with paper-strip labels. */
.minimap-frame {
  border: 2px solid #7f8067;
  border-radius: 2px;
  background: #1c291cef;
  box-shadow: inset 0 0 0 2px #080f09, 0 1px 0 #ddd2a944, 0 3px 8px #0004;
}
.minimap-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, #d0ddae12, transparent 36%);
  box-shadow: inset 0 0 14px #06100980;
  pointer-events: none;
}
.map-north { color: #b8c6a0; font-weight: bold; }
.objective-block { padding-top: 2px; }
.objective-block .eyebrow {
  display: table;
  padding: 3px 5px 2px;
  background: #cac09fde;
  border: 1px solid #fff0c22e;
  box-shadow: 0 1px 2px #111a10b3;
  color: #34362b;
  text-shadow: 0 1px #eee2be44;
  font-size: 10px;
  letter-spacing: .09em;
}
#objective { color: #f1e9cf; text-shadow: 0 1px 2px #0c140b, 0 0 7px #10170c; }
.progress-row { margin-top: 6px; color: #d3ccb0; }
.progress-row .circuit { background: #172115; border-color: #778268; border-radius: 1px; }
.progress-row .circuit.complete { background: #acbe78; border-color: #dae5a8; box-shadow: 0 0 4px #9cc17655; }
.health-readout { color: #e0d7b4; font-weight: bold; }
.health-label { color: #c9c6a9; }
.health-meter { background: #1b2518; box-shadow: inset 0 1px #050c07; }
#health-fill { background: #b8be86; }
.hud-button {
  border: 1px solid #afa689;
  border-radius: 3px;
  background: var(--key-light);
  color: #34372c;
  box-shadow: var(--raised-key);
}
.sound-control { width: 44px; min-width: 44px; height: 44px; color: transparent; }
.sound-control::before, .sound-control[aria-pressed='true']::after, .sound-control[aria-label='Enable sound']::after { background: #3a3d30; opacity: 1; }
#signal-caption { color: #e0c691; text-shadow: 0 1px 2px #11170b, 0 0 6px #11170b; }
#subtitle {
  border-left: 2px solid #aba782;
  border-radius: 1px;
  background: #172014d9;
  color: #f0e7cd;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}
#interaction {
  background: #192215e8;
  border: 1px solid #b2ab8277;
  color: #f0d69f;
  padding: 5px 9px;
  font: 700 12px/1.4 'Courier New', monospace;
  letter-spacing: .025em;
}
kbd { border-color: #9fa183; background: #c4bb9a; color: #323929; text-shadow: none; box-shadow: inset 0 -2px #8b876c; }
#action-progress { background: #192315; border: 1px solid #797b5f; height: 5px; }
#action-progress-fill { background: #b9c480; }
#pickup-toast { border: 1px solid #a5a07a; border-left: 3px solid #b6c984; background: #202b1cef; font: 700 12px/1.5 'Courier New', monospace; }

/* Ribbed bakelite keys: muted at rest, small pilot lamps show latched states. */
.quickbar { padding: 4px; border: 1px solid #797e61; border-radius: 3px; background: #2c3426ed; box-shadow: inset 0 1px #d6cfa743, 0 3px 7px #0007; }
.quickslot {
  border: 1px solid #6d745c;
  border-radius: 3px;
  background: var(--key-dark);
  color: #c7c6a7;
  box-shadow: var(--raised-key);
  text-shadow: none;
}
.quickslot.selected, .quickslot[aria-pressed='true'] {
  border-color: #ddd1ac #a99c7f #736c52;
  background: var(--key-light);
  color: #30382a;
  box-shadow: var(--raised-key);
}
.quickslot::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border: 1px solid #161f12;
  border-radius: 50%;
  background: #414d31;
}
.quickslot.selected::after, .quickslot[aria-pressed='true']::after { background: #bddb78; border-color: #45532b; box-shadow: 0 0 4px #c5f27a80; }
.quickslot.empty { opacity: .63; background: linear-gradient(165deg,#373e30,#252d20); color: #9da58b; box-shadow: inset 0 1px #adb39022, inset 0 -2px #11190e; }
.quickslot kbd { background: none; box-shadow: none; color: #babd9d; }
.quickslot.selected kbd { color: #5c614c; }
.item-count { color: inherit; }
.weapon-readout { color: #e0d7b6; font-size: 10px; padding: 0 5px; text-shadow: 0 1px 2px #111b0e; }
#ammo-count { color: #e4c693; }
#stamina { height: 4px; background: #263320ce; border: 1px solid #a7ad8170; }
#stamina-fill { background: #c2c79b; }

.touch-button {
  border: 1px solid #9da186;
  border-radius: 5px;
  background: linear-gradient(160deg, #525a48de, #303b2bdd 57%, #222e1fe8);
  color: #e5dfc1;
  box-shadow: var(--raised-key);
  text-shadow: 0 1px #192315;
}
.control-name { font-family: 'Courier New', monospace; font-weight: bold; letter-spacing: .04em; }
.touch-button[aria-pressed='true'], .touch-button.active {
  border-color: #d6cea5;
  background: linear-gradient(160deg, #92996b, #65754a);
  color: #f4edcc;
}
#touch-run::after, #touch-light::after, #touch-crouch::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border: 1px solid #182110;
  border-radius: 50%;
  background: #465533;
}
#touch-run[aria-pressed='true']::after, #touch-light[aria-pressed='true']::after, #touch-crouch[aria-pressed='true']::after { background: #d8e29b; box-shadow: 0 0 4px #bfdf84; }
#touch-use {
  background: var(--key-light);
  border-color: #eee0b6 #a59b7d #797a5c;
  color: #323a2b;
  text-shadow: 0 1px #f0e8ca55;
}
#touch-use-label { font-family: 'Courier New', monospace; }
#touch-use:disabled {
  background: linear-gradient(155deg, #536048a6, #303d29c9);
  border-color: #89937691;
  color: #ced2b1;
  opacity: .65;
  box-shadow: inset 0 1px #c5d0a229, 0 2px 3px #0003;
  text-shadow: 0 1px #12200c;
}
#touch-fire {
  background: linear-gradient(160deg, #805949ef, #593d32f2 56%, #412e25f2);
  border-color: #bb9f7d #927452 #4d3f28;
  color: #efdbb7;
}
#touch-fire.active { background: linear-gradient(160deg, #a2714b, #785538); border-color: #dab17e; }
#joystick-home, #joystick {
  border: 2px solid #a3a286a8;
  background: radial-gradient(circle, #27362466 0 27%, #1f2c1e99 28% 44%, #72826735 45% 47%, #283a2399 48% 64%, #a4b18b33 65% 66%, #283423ad 67%);
  box-shadow: inset 0 1px 0 #e1dfb93b, inset 0 -3px 5px #0c180c80, 0 3px 7px #0004;
}
#joystick-home { opacity: .82; }
#joystick-home::before { border-color: #b3c29b33; }
#joystick-home > span, #joystick-thumb {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 1px solid #d3cdb0;
  background: radial-gradient(circle at 40% 33%, #d0c9aa, #a4a186 58%, #747e60 61%, #505e42);
  box-shadow: inset 0 1px #f0eacd9c, 0 3px 0 #182412bd, 0 5px 7px #0006;
}
.stick-mark { background: #c6c8a0; }

/* Office controls: recessed fields, slider tracks, square rocker switches. */
.setting-row { border-color: #a7ad873d; color: #e4dec4; font-family: 'Courier New', monospace; }
.setting-row small { color: #b1baa0; font: 12px/1.5 Arial, sans-serif; }
.setting-row input[type='range'] { appearance: none; -webkit-appearance: none; height: 25px; margin: 0; background: transparent; accent-color: #c9b78a; }
.setting-row input[type='range']::-webkit-slider-runnable-track { height: 6px; border: 1px solid #111d10; background: #182314; box-shadow: 0 1px #a3ad8055; }
.setting-row input[type='range']::-moz-range-track { height: 4px; border: 1px solid #111d10; background: #182314; box-shadow: 0 1px #a3ad8055; }
.setting-row input[type='range']::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 17px; height: 24px; margin-top: -10px; border: 1px solid #a89d76; border-radius: 2px; background: repeating-linear-gradient(0deg,transparent 0 3px,#343b2d55 3px 4px), var(--key-light); box-shadow: 0 2px 3px #0006; }
.setting-row input[type='range']::-moz-range-thumb { width: 15px; height: 22px; border: 1px solid #a89d76; border-radius: 2px; background: repeating-linear-gradient(0deg,transparent 0 3px,#343b2d55 3px 4px), var(--key-light); box-shadow: 0 2px 3px #0006; }
.setting-row select { border-color: #9b9e79; background-color: #212e1b; color: #e3d9b3; box-shadow: inset 0 2px 4px #0e190b; font: 13px 'Courier New', monospace; }
.setting-row input[type='checkbox'] { border-radius: 2px; height: 26px; border-color: #a19c7c; background: linear-gradient(90deg,#172312,#34472a); box-shadow: inset 0 2px 3px #101b0a, 0 1px #c1c79d33; }
.setting-row input[type='checkbox']::before { width: 16px; height: 20px; left: 2px; top: 2px; border: 1px solid #a69e78; border-radius: 1px; background: var(--key-light); box-shadow: 1px 1px 2px #101b0a; }
.setting-row input[type='checkbox']:checked { background: linear-gradient(90deg,#6e8a48,#2f4226); border-color: #bec394; }
.setting-row input[type='checkbox']:checked::before { left: 21px; background: var(--key-light); }
.coop-name-label { color: #cfcaad; }
.coop-name-label input, #coop-link { border: 1px solid #929b76; background: #172415; color: #e0deb9; box-shadow: inset 0 2px 5px #0c1809; font: 16px/1.4 'Courier New', monospace; }
.coop-panel-content #coop-message { color: #c4cdb1; }
#coop-status, #partner-presence { text-shadow: 0 1px 3px #0b1807; }
.credits-panel dt { color: #e1c594; }
.credits-panel dd { color: #c9cbb1; }
.paper .button { background: #3b4230; color: #ebe4c7; }
.note-screen { background: #0d130c88; }

/* A vending faceplate, rather than a shop page. Payment is a separate USE. */
.bargain-screen { background: #15191088; padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); }
.bargain-machine { width: min(370px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background-color: #374438; border-color: #b1b3a2; }
.machine-maker { font: 9px/1.3 'Courier New', monospace; color: #b1b5a0; letter-spacing: .12em; text-align: center; }
.bargain-machine h2 { margin: 8px 0 12px; padding: 0; border: 0; color: #e6cc80; font: italic 700 33px/1.1 Georgia, serif; letter-spacing: -.04em; text-align: center; }
.machine-display { padding: 10px; border: 2px inset #79836a; background: #15201b; color: #b4e49b; font: bold 23px/1 'Courier New', monospace; text-align: center; letter-spacing: .13em; text-shadow: 0 0 6px #91c98c66; }
.bargain-machine .machine-warning, .bargain-machine .machine-terms { font: 11px/1.5 'Courier New', monospace; color: #d6d2ba; margin: 11px 0; }
.machine-choice { display: flex; gap: 10px; width: 100%; margin: 9px 0; padding: 12px 10px; text-align: left; border: 1px solid #aaac90; border-radius: 2px; background: var(--key-light); color: #2c3328; box-shadow: var(--raised-key); cursor: pointer; }
.machine-choice:disabled { opacity: .5; cursor: default; }
.machine-number { flex: 0 0 28px; height: 32px; padding-top: 7px; background: #323b2c; color: #dbcf9f; font: bold 14px/1.2 'Courier New', monospace; text-align: center; box-shadow: inset 0 2px 4px #0e180b; }
.machine-choice strong, .machine-price, .machine-effect, .machine-choice small { display: block; }
.machine-choice strong { font: bold 14px/1.3 'Courier New', monospace; letter-spacing: .08em; }
.machine-price { margin-top: 5px; color: #692d22; font: bold 11px/1.3 'Courier New', monospace; }
.machine-effect { margin-top: 4px; font: 12px/1.4 Arial, sans-serif; }
.machine-choice small { margin-top: 8px; font: bold 9px/1.4 'Courier New', monospace; }
.bargain-machine > .button { width: 100%; margin-top: 3px; }
#transaction-strip { position: absolute; left: 50%; bottom: max(155px, 23dvh); transform: translateX(-50%); width: min(340px, 82vw); padding: 8px 10px; background: #1b2819e8; border: 1px solid #a0a47a; color: #e4d9ad; font: 10px/1.45 'Courier New', monospace; text-align: center; pointer-events: none; z-index: 8; }
#transaction-strip strong, #transaction-strip span { display: block; }
#transaction-strip strong { margin-bottom: 4px; letter-spacing: .12em; }
#transaction-cancel { margin-top: 6px; padding: 7px 9px; border: 1px solid #a2a98c; background: #343f2e; color: #e2ddbd; font: bold 10px/1.3 'Courier New', monospace; pointer-events: auto; cursor: pointer; }
#bargain-flash { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0; background: #caae3f; }
#bargain-flash[data-kind='red'] { background: #a72c22; }
@media (max-height: 740px) and (orientation: portrait) {
  .bargain-machine { padding: 16px 14px 12px; }
  .bargain-machine h2 { font-size: 28px; margin: 5px 0 9px; }
  .machine-choice { padding: 9px 8px; margin: 7px 0; }
  .bargain-machine .machine-warning, .bargain-machine .machine-terms { font-size: 10px; margin: 8px 0; }
  #transaction-strip { bottom: 145px; }
}

@media (max-width: 360px) {
  .game-start, .panel { padding: 22px 16px 14px; }
  .game-start h1 { font-size: 26px; }
  .setting-row { gap: 12px; }
  .setting-row input[type='range'] { min-width: 88px; }
  .setting-row select { min-width: 102px; padding-left: 7px; font-size: 12px; }
  .quickbar { padding: 3px; }
}
@media (max-height: 700px) and (orientation: portrait) {
  .game-start { padding-top: 20px; }
  .game-start h1 { margin-bottom: 16px; }
  .panel { padding-top: 20px; }
  #subtitle { font-size: 12px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .game-start { width: 274px; padding: 17px 17px 8px; }
  .game-start h1 { font-size: 25px; padding: 9px 0; margin-bottom: 12px; }
  .menu-actions { gap: 7px; }
  .panel { padding: 19px 19px 12px; }
  .quickbar { padding: 3px; }
}
