:root {
  color-scheme:dark;
  --bg:#111a23;
  --panel:#18242e;
  --line:#34434a;
  --ink:#f5eedf;
  --muted:#a6b9bc;
  --gold:#f7cf77;
  --mint:#7eebce;
  --red:#ef806e;
  font-family:'Courier New',monospace;
  font-synthesis:none
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:radial-gradient(ellipse at 80% 0,#263d42 0,transparent 55%),var(--bg);
  color:var(--ink)
}
button,a {
  -webkit-tap-highlight-color:transparent
}
button {
  font:700 12px 'Courier New',monospace;
  cursor:pointer;
  color:var(--ink);
  background:transparent;
  border:1px solid var(--line);
  border-radius:4px;
  min-height:44px;
  padding:0 13px
}
button:hover {
  border-color:var(--gold);
  color:var(--gold)
}
button:disabled {
  opacity:.4;
  cursor:default
}
button:focus-visible,a:focus-visible,canvas:focus-visible {
  outline:3px solid var(--gold);
  outline-offset:3px
}
a {
  color:inherit;
  text-underline-offset:4px
}
button[hidden],[hidden] {
  display:none!important
}
.shell {
  max-width:1280px;
  margin:auto;
  padding:0 36px
}
.masthead {
  min-height:84px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:30px;
  justify-content:space-between
}
/* The box was only as tall as its text (11px at 10px on a phone), under the
   24px touch target site-audit.mjs requires; 24px fits the top bar beside the
   44px buttons. */
.back {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  text-decoration:none;
  font-weight:bold;
  font-size:12px;
  letter-spacing:1.5px
}
.edition {
  font-size:10px;
  color:var(--muted);
  letter-spacing:1px
}
.edition b {
  color:var(--gold);
  padding-left:10px
}
.utility {
  display:flex;
  gap:7px
}
.title-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:31px 0 25px
}
.eyebrow {
  font-size:10px;
  font-weight:bold;
  letter-spacing:1.7px;
  color:var(--mint);
  margin:0 0 12px
}
h1 {
  font-family:Impact,'Arial Black',sans-serif;
  font-size:clamp(42px,6.4vw,78px);
  font-weight:900;
  line-height:.95;
  letter-spacing:1px;
  margin:0
}
h1 span {
  color:var(--gold)
}
.tag {
  font-family:system-ui,sans-serif;
  font-size:14px;
  line-height:1.8;
  color:var(--muted);
  margin:0
}
.tag strong {
  color:var(--ink);
  font-weight:500
}
.cabinet {
  display:grid;
  grid-template-columns:minmax(0,1fr) 242px;
  gap:22px
}
.play-area {
  min-width:0;
  border:1px solid #546060;
  border-radius:7px;
  overflow:hidden;
  box-shadow:0 18px 60px #0005;
  background:#0b141f
}
.hud {
  height:65px;
  padding:12px 22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:2px solid #59625b;
  background:#1c2b33
}
.hud div {
  display:flex;
  flex-direction:column;
  gap:5px
}
.hud span {
  font-size:9px;
  letter-spacing:1.5px;
  color:#a5bfc4
}
.hud strong {
  font-size:20px;
  letter-spacing:1px;
  color:var(--gold)
}
.hud .vitals strong {
  color:var(--red);
  font-size:18px
}
.screen {
  position:relative;
  height:clamp(360px,calc(100dvh - 310px),560px);
  min-height:350px;
  overflow:hidden;
  background:#0b1421
}
canvas {
  display:block;
  width:100%;
  height:100%;
  image-rendering:pixelated;
  touch-action:none
}
.overlay {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:20px;
  background:#07111c99;
  backdrop-filter:blur(2px);
  z-index:2
}
.panel {
  width:min(400px,100%);
  padding:28px;
  background:#16252bed;
  border:1px solid #69766d;
  box-shadow:8px 8px 0 #07111c70;
  border-radius:4px
}
.panel h2 {
  font-family:Impact,'Arial Black',sans-serif;
  letter-spacing:1px;
  font-size:43px;
  margin:0 0 13px;
  color:var(--gold);
  line-height:1
}
.panel p:not(.eyebrow) {
  font:14px/1.6 system-ui,sans-serif;
  color:#c3d1cf;
  margin:0 0 18px
}
.intro-steps {
  display:flex;
  flex-direction:column;
  gap:9px;
  font-size:10px;
  letter-spacing:.8px;
  margin:0 0 22px
}
.intro-steps b {
  color:var(--mint);
  margin-right:12px
}
.primary {
  background:var(--gold);
  color:#18242e;
  border:1px solid var(--gold);
  width:100%;
  font-size:14px;
  min-height:49px;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 17px
}
.primary:hover {
  background:#ffe1a0;
  color:#18242e
}
.primary span {
  font-size:24px
}
.secondary {
  width:100%;
  margin-top:8px
}
.panel p.panel-note {
  font-size:11px;
  margin:12px 0 0;
  text-align:center;
  color:#a6b9bc
}
.mission-strip {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:7px 14px;
  background:#1c2b33;
  border-top:1px solid var(--line)
}
.mission-strip p {
  flex:1;
  font-size:10px;
  line-height:1.5;
  letter-spacing:.25px;
  margin:0
}
.mission-strip>span:last-child {
  font-size:13px;
  color:var(--gold)
}
.live-dot {
  height:6px;
  width:6px;
  background:var(--mint);
  flex-shrink:0;
  border-radius:50%;
  box-shadow:0 0 7px #7eebce66
}
.dossier {
  border:1px solid var(--line);
  padding:21px;
  border-radius:5px;
  background:#17252bd1
}
.dossier-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:10px;
  color:var(--muted);
  letter-spacing:1px
}
.dossier-heading b {
  font-size:17px;
  color:var(--gold)
}
.dossier h2 {
  font:italic 28px Georgia,serif;
  margin:20px 0 10px
}
.dossier p {
  font:13px/1.65 system-ui,sans-serif;
  color:var(--muted);
  margin:0 0 18px
}
.building-map {
  display:flex;
  flex-direction:column;
  gap:3px;
  margin:18px 0 10px
}
.map-floor {
  height:13px;
  display:flex;
  align-items:center;
  gap:6px;
  font-size:9px;
  color:var(--muted)
}
.map-floor .track {
  display:flex;
  align-items:center;
  gap:6px;
  flex:1;
  height:12px;
  border:1px solid #35434a;
  background:#101a22;
  padding:0 8px
}
.map-floor.current .track {
  border-color:var(--mint);
  background:#24483f
}
.map-floor .marker {
  height:5px;
  width:5px;
  background:var(--red)
}
.map-floor .taken {
  background:var(--gold)
}
.map-floor .you {
  height:5px;
  width:5px;
  background:var(--mint);
  margin-left:auto
}
.legend {
  display:flex;
  gap:12px;
  font-size:8px;
  color:var(--muted)
}
.legend i {
  display:inline-block;
  width:5px;
  height:5px;
  margin-right:4px
}
.file-dot {
  background:var(--red)
}
.agent-dot {
  background:var(--mint)
}
.instructions {
  margin:22px 0 18px;
  padding-left:18px;
  font:12px/1.6 system-ui,sans-serif;
  color:var(--muted)
}
.instructions li {
  padding-left:3px;
  margin:0 0 11px
}
.instructions b {
  color:var(--ink);
  font-weight:600
}
.dossier p.tip {
  border-top:1px solid var(--line);
  padding-top:13px;
  margin:0;
  font-size:11px;
  color:var(--gold)
}
.keyboard-guide {
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  font-size:10px;
  color:var(--muted);
  padding:19px 0 10px
}
.keyboard-guide span {
  display:flex;
  gap:4px;
  align-items:center
}
kbd {
  background:#1e2c34;
  border:1px solid #46575c;
  border-bottom-width:3px;
  border-radius:3px;
  padding:4px 5px;
  color:var(--ink);
  font:10px monospace
}
.support {
  font:11px/1.6 system-ui,sans-serif;
  color:var(--muted);
  margin:6px 0 22px
}
.touch-controls {
  display:none;
  padding:10px 14px 12px;
  justify-content:space-between;
  align-items:center;
  background:#14212b;
  gap:14px;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none
}
.dpad {
  display:grid;
  grid-template-columns:repeat(3,48px);
  grid-template-rows:repeat(2,44px);
  gap:4px
}
.dpad button {
  padding:0;
  font-size:18px;
  background:#273942;
  border-color:#52646a;
  touch-action:none
}
.up {
  grid-column:2
}
.left {
  grid-column:1;
  grid-row:2
}
.down {
  grid-column:2;
  grid-row:2
}
.right {
  grid-column:3;
  grid-row:2
}
.action-pad {
  display:grid;
  grid-template-columns:repeat(2,57px);
  grid-template-rows:repeat(2,44px);
  gap:5px
}
.action-pad button {
  padding:0;
  touch-action:none
}
.use {
  grid-column:1;
  grid-row:1;
  background:#223c3b;
  border-color:#588279;
  color:var(--mint)
}
.jump {
  grid-column:1;
  grid-row:2;
  background:#323c42
}
.fire {
  grid-column:2;
  grid-row:1/3;
  background:#c56355;
  color:white;
  border-color:#f2957f;
  border-radius:50%;
  align-self:center;
  height:63px
}
.touch-controls button.held {
  background:var(--gold);
  color:#18242e;
  transform:translateY(2px)
}
footer {
  border-top:1px solid var(--line);
  padding:22px 0 28px;
  display:flex;
  gap:18px;
  align-items:center;
  font-size:9px;
  color:var(--muted)
}
footer>span:first-child {
  letter-spacing:1.2px;
  color:var(--mint)
}
footer>span:nth-child(2) {
  margin-right:auto
}
.skip {
  position:absolute;
  left:12px;
  top:-100px;
  background:#fff;
  color:#000;
  padding:15px;
  z-index:5
}
.skip:focus {
  top:12px
}
.nojs {
  padding:15px;
  color:var(--gold)
}
@media(max-width:1000px) {
  .shell {
    padding:0 22px
  }
  .cabinet {
    grid-template-columns:minmax(0,1fr) 210px;
    gap:16px
  }
  .dossier {
    padding:16px
  }
  .edition {
    display:none
  }
  .screen {
    height:480px
  }
  .title-row {
    padding-top:25px
  }
}
@media(pointer:coarse),(max-width:700px) {
  .touch-controls {
    display:flex
  }
  .keyboard-guide {
    display:none
  }
  .screen {
    height:clamp(300px,calc(100dvh - 294px),510px);
    min-height:300px
  }
  .cabinet {
    display:block
  }
  .dossier {
    margin-top:18px
  }
  .building-map,.legend {
    display:none
  }
  .instructions {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px 24px
  }
  .dossier h2 {
    margin-top:14px
  }
  .dossier>p:not(.tip) {
    display:none
  }
  .dossier-heading {
    float:right
  }
  .dossier p.tip {
    padding-top:10px
  }
  .support {
    margin:15px 0
  }
  .title-row {
    padding:20px 0 17px
  }
  h1 {
    font-size:52px
  }
  .tag {
    display:none
  }
  .hud {
    height:58px;
    padding:10px 16px
  }
  .hud strong {
    font-size:18px
  }
  .masthead {
    min-height:68px;
    gap:12px
  }
  .utility {
    gap:5px
  }
  .utility button {
    padding:0 10px;
    font-size:11px
  }
  .edition {
    display:none
  }
  footer {
    flex-wrap:wrap;
    gap:12px
  }
}
@media(max-width:500px) {
  .shell {
    padding:0 max(12px,env(safe-area-inset-left)) 0 max(12px,env(safe-area-inset-right))
  }
  .back {
    font-size:10px;
    letter-spacing:.5px
  }
  .masthead {
    min-height:62px;
    gap:6px
  }
  .utility button {
    padding:0 8px;
    font-size:10px
  }
  .utility {
    gap:3px
  }
  .eyebrow {
    font-size:8px;
    letter-spacing:1.2px;
    margin-bottom:10px
  }
  .title-row {
    padding:15px 0 14px
  }
  h1 {
    font-size:45px
  }
  .hud {
    height:54px;
    padding:8px 12px
  }
  .hud strong {
    font-size:17px
  }
  .hud span {
    font-size:8px;
    letter-spacing:1px
  }
  .hud .vitals strong {
    font-size:14px
  }
  .screen {
    min-height:285px;
    height:clamp(285px,calc(100dvh - 300px),480px)
  }
  .panel {
    padding:20px
  }
  .panel h2 {
    font-size:35px
  }
  .panel p:not(.eyebrow) {
    font-size:12px;
    line-height:1.5;
    margin-bottom:12px
  }
  .intro-steps {
    font-size:9px;
    gap:6px;
    margin-bottom:15px
  }
  .panel p.panel-note {
    font-size:10px
  }
  .mission-strip {
    min-height:42px;
    padding:6px 10px;
    gap:7px
  }
  .mission-strip p {
    font-size:9px
  }
  .touch-controls {
    padding:9px 10px 12px;
    gap:8px
  }
  .dpad {
    grid-template-columns:repeat(3,44px);
    gap:3px
  }
  .action-pad {
    grid-template-columns:repeat(2,51px);
    gap:5px
  }
  .instructions {
    font-size:12px
  }
  .dossier {
    padding:16px
  }
  .support {
    font-size:11px
  }
  footer {
    padding-bottom:calc(20px + env(safe-area-inset-bottom))
  }
}
@media(max-height:520px) and (min-width:600px) {
  .masthead {
    min-height:48px
  }
  .title-row {
    padding:8px 0
  }
  h1 {
    font-size:32px
  }
  .eyebrow,.tag {
    display:none
  }
  .cabinet {
    display:block
  }
  .hud {
    height:43px
  }
  .screen {
    height:calc(100dvh - 165px);
    min-height:220px
  }
  .dossier,.support {
    display:none
  }
  .touch-controls {
    position:absolute;
    left:0;
    right:0;
    bottom:44px;
    z-index:1;
    background:transparent;
    pointer-events:none;
    opacity:.7
  }
  .touch-controls button {
    pointer-events:auto
  }
  .play-area {
    position:relative
  }
  .touch-controls .dpad,.touch-controls .action-pad {
    transform:scale(.85);
    transform-origin:bottom
  }
  .touch-controls .dpad {
    transform-origin:bottom left
  }
  .touch-controls .action-pad {
    transform-origin:bottom right
  }
  .keyboard-guide,footer {
    display:none
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto
  }
  .live-dot {
    box-shadow:none
  }
}
/* Keep mission dialogs usable on short landscape screens. */
@media(max-height:520px) and (min-width:600px) {
  .overlay {
    padding:10px
  }
  .panel {
    width:min(560px,100%);
    padding:12px 20px
  }
  .panel h2 {
    font-size:28px;
    margin-bottom:8px
  }
  .panel p:not(.eyebrow) {
    font-size:12px;
    line-height:1.4;
    margin-bottom:10px
  }
  .intro-steps {
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px 16px;
    margin-bottom:12px;
    font-size:8px
  }
  .intro-steps b {
    margin-right:5px
  }
  .panel .primary {
    min-height:44px
  }
  .panel p.panel-note {
    display:none
  }
  .secondary {
    min-height:36px;
    margin-top:5px
  }
}
/* Budget the full cabinet, including thumb controls, inside a phone viewport. */
@media(max-width:500px) {
  .screen {
    min-height:260px;
    height:clamp(260px,calc(100dvh - 365px),480px)
  }
  .overlay {
    padding:12px
  }
  .panel {
    padding:16px
  }
  .panel h2 {
    font-size:30px;
    margin-bottom:10px
  }
  .panel p:not(.eyebrow) {
    line-height:1.4
  }
  .intro-steps {
    display:none
  }
  .panel .primary {
    min-height:44px
  }
  .panel p.panel-note {
    margin-top:8px
  }
}
@media(max-height:520px) and (min-width:600px) {
  .screen {
    height:calc(100dvh - 185px);
    min-height:200px
  }
}
/* Where Impact is missing (most Android phones) the title is drawn in a much
   wider fallback: at 45px it needs 325px, so on a 320px screen "'86" wrapped
   to a second line and pushed the thumb controls 41px past a 700px screen.
   38px is 276px wide, one line in the 296px a phone gives it and in the
   281px left when a scrollbar takes 15px (the test harness's frame). 40px
   fits the first and wraps in the second. */
@media(max-width:340px) {
  h1 {
    font-size:38px
  }
}
/* On a phone 600px tall or less (320x568 is the original iPhone SE) the game
   screen cannot shrink below 260px, because the mission briefing has to fit
   inside it, so the thumb controls ended 49px below the screen. The title row
   (84px) is hidden there, visually only: the h1 and the tagline stay in the
   page for screen readers, so the page keeps its h1. */
@media(max-width:500px) and (max-height:600px) {
  .title-row {
    position:absolute;
    width:1px;
    height:1px;
    margin:-1px;
    padding:0;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
    border:0
  }
}
