.mission-window {
  padding: 4.5%;
}

.mission-window h3 {
  margin: 7px;
  font-size: clamp(22px, 3.2vw, 43px);
}

.mission-window > p {
  margin-bottom: 11px;
}

.mission-window > nav,
.modal-window nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.ai-button {
  border-color: #438197 !important;
  color: var(--ice) !important;
  box-shadow: inset 0 0 12px #72ddff12;
}

.dossier {
  width: min(760px, 97%);
  margin: auto;
  display: grid;
  grid-template-columns: 2fr .62fr .7fr .75fr .9fr;
  border: 1px solid #3b5347;
  background: #07100d;
}

.dossier > span {
  padding: 8px;
  border-right: 1px solid #314238;
  text-align: left;
}

.dossier > span:last-child {
  border: 0;
}

.dossier small,
.dossier b {
  display: block;
}

.dossier small {
  color: #62766b;
  font: 6px Consolas, monospace;
}

.dossier b {
  margin-top: 3px;
  color: var(--amber2);
  font: 9px Consolas, monospace;
}

.result article {
  border-color: #39654f;
  background: #15271e;
}

.result article a {
  grid-row: 2 / 4;
  grid-column: 2;
  align-self: center;
  padding: 8px;
  border: 1px solid var(--green);
  background: #0d1d16;
  color: var(--green);
  font: 7px Consolas, monospace;
  text-decoration: none;
}

.modal-window {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 180;
  place-items: center;
  padding: 20px;
  background: #010403e8;
  backdrop-filter: blur(7px);
}

.modal-window.show {
  display: grid;
}

.modal-window > section {
  position: relative;
  width: min(700px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 26px;
  border: 1px solid #527061;
  background: linear-gradient(145deg, #1c2923, #080e0b);
  box-shadow: inset 0 0 0 4px #050806, 0 20px 80px #000;
}

.modal-window section > small {
  color: var(--green);
  font: 8px Consolas, monospace;
  letter-spacing: .2em;
}

.modal-window h2 {
  margin: 7px 0;
  color: var(--amber2);
  font-size: 28px;
}

.modal-window p {
  color: #91a299;
  font-size: 12px;
  line-height: 1.5;
}

.modal-window label {
  display: block;
  margin: 15px 0;
  color: #819188;
  font: 8px Consolas, monospace;
}

.modal-window select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px;
  border: 1px solid #40564a;
  background: #050a08;
  color: var(--cream);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 34px;
  height: 34px;
  border: 1px solid #71887c;
  background: #111915;
  color: #e2e9e5;
  font-size: 20px;
}

.training-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.training-rules span {
  padding: 12px;
  border: 1px solid #365044;
  background: #09120e;
  color: #80938a;
  text-align: center;
  font: 7px Consolas, monospace;
}

.training-rules b {
  display: block;
  color: var(--green);
  font-size: 20px;
}

.help-sheet {
  width: min(900px, 95vw) !important;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.help-grid article {
  padding: 10px;
  border: 1px solid #31483d;
  background: #09110e;
}

.help-grid h3 {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 11px;
}

.help-grid p {
  margin: 0;
  font-size: 10px;
}

.help-grid code {
  color: var(--green);
}

.mode-banner {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 9px;
  border: 1px solid #5b8a75;
  background: #07130fe8;
  color: var(--green);
  font: 8px Consolas, monospace;
  letter-spacing: .1em;
}

.demo-mode .main-display {
  box-shadow: inset 0 0 0 4px #071116, 0 0 28px #72ddff2b;
}

.practice-mode .main-display {
  box-shadow: inset 0 0 0 4px #07130e, 0 0 28px #5cff9a24;
}

@media (max-width: 650px) {
  .dossier,
  .help-grid,
  .training-rules {
    grid-template-columns: 1fr;
  }
}

/* One-screen command layout: Document Fullscreen always fits the entire cockpit. */
:is(html:fullscreen, html.fullscreen-fit),
:is(html:fullscreen, html.fullscreen-fit) body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

:is(html:fullscreen, html.fullscreen-fit) .shell {
  width: 100vw;
  max-width: none;
  height: 100vh;
  min-height: 0;
  padding: 5px 8px 3px;
  display: grid;
  grid-template-rows: 58px 44px minmax(0, 1fr) 18px;
  gap: 4px;
  overflow: hidden;
}

:is(html:fullscreen, html.fullscreen-fit) .masthead {
  height: auto;
  min-height: 0;
  padding: 0 3px 6px;
}

:is(html:fullscreen, html.fullscreen-fit) .masthead h1 {
  margin: 3px 0;
  font-size: 32px;
}

:is(html:fullscreen, html.fullscreen-fit) .masthead p,
:is(html:fullscreen, html.fullscreen-fit) .overline {
  font-size: 6px;
}

:is(html:fullscreen, html.fullscreen-fit) .system {
  gap: 5px;
}

:is(html:fullscreen, html.fullscreen-fit) .system button {
  padding: 5px 7px;
  font-size: 6px;
}

:is(html:fullscreen, html.fullscreen-fit) .missions {
  height: auto;
  min-height: 0;
  margin: 0;
}

:is(html:fullscreen, html.fullscreen-fit) .missions > b {
  padding: 0 9px;
  font-size: 7px;
}

:is(html:fullscreen, html.fullscreen-fit) .mission-tab {
  min-width: 0;
  padding: 4px 7px;
}

:is(html:fullscreen, html.fullscreen-fit) .mission-tab b {
  font-size: 8px;
}

:is(html:fullscreen, html.fullscreen-fit) .mission-tab span {
  font-size: 5px;
}

:is(html:fullscreen, html.fullscreen-fit) .cockpit-grid {
  height: 100%;
  min-height: 0;
  grid-template-columns: 210px minmax(500px, 1fr) 210px;
  gap: 5px;
}

:is(html:fullscreen, html.fullscreen-fit) .column {
  min-height: 0;
  gap: 4px;
}

:is(html:fullscreen, html.fullscreen-fit) .left-column {
  display: grid;
  grid-template-rows: 142px minmax(245px, 1fr) 145px;
}

:is(html:fullscreen, html.fullscreen-fit) .right-column {
  display: grid;
  grid-template-rows: repeat(3, minmax(92px, .8fr)) minmax(130px, 1fr) minmax(110px, .85fr);
}

:is(html:fullscreen, html.fullscreen-fit) .centre-column {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 26px 130px;
}

:is(html:fullscreen, html.fullscreen-fit) .main-display {
  min-height: 0;
  padding: 5px;
  display: grid;
  grid-template-rows: 23px minmax(0, 1fr) 48px;
}

:is(html:fullscreen, html.fullscreen-fit) .battlefield {
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
}

:is(html:fullscreen, html.fullscreen-fit) .hud {
  height: auto;
}

:is(html:fullscreen, html.fullscreen-fit) .hud label {
  padding: 4px;
}

:is(html:fullscreen, html.fullscreen-fit) .hud b,
:is(html:fullscreen, html.fullscreen-fit) .hud label:nth-child(n+3) b {
  font-size: 11px;
}

:is(html:fullscreen, html.fullscreen-fit) .message-strip {
  margin: 3px 0;
  padding: 4px 7px;
}

:is(html:fullscreen, html.fullscreen-fit) .lower-console {
  min-height: 0;
  gap: 4px;
}

:is(html:fullscreen, html.fullscreen-fit) .module {
  min-height: 0;
  padding: 6px;
  overflow: hidden;
}

:is(html:fullscreen, html.fullscreen-fit) .module h2 {
  margin-bottom: 4px;
  padding-bottom: 4px;
  font-size: 6px;
}

:is(html:fullscreen, html.fullscreen-fit) .gauge > div {
  height: 42px;
}

:is(html:fullscreen, html.fullscreen-fit) .digital-row {
  margin-top: 4px;
}

:is(html:fullscreen, html.fullscreen-fit) .digital-row strong {
  font-size: 14px;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-selector {
  margin-bottom: 3px;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-selector select {
  padding: 4px;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-module canvas {
  height: 102px;
  aspect-ratio: auto;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-meta strong {
  margin-top: 3px;
  font-size: 11px;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-meta p {
  min-height: 0;
  margin: 2px;
  font-size: 7px;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-quick-spec {
  margin: 3px 0;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-quick-spec span {
  padding: 3px 1px;
}

:is(html:fullscreen, html.fullscreen-fit) .drone-module .steel {
  padding: 5px;
  font-size: 6px;
}

:is(html:fullscreen, html.fullscreen-fit) .payload-module label,
:is(html:fullscreen, html.fullscreen-fit) .sensor-module label,
:is(html:fullscreen, html.fullscreen-fit) .altitude-control label {
  margin: 4px 0;
}

:is(html:fullscreen, html.fullscreen-fit) .payload-module p {
  min-height: 0;
  margin: 3px 0;
  font-size: 7px;
}

:is(html:fullscreen, html.fullscreen-fit) .front-view-module canvas,
:is(html:fullscreen, html.fullscreen-fit) .radar-module canvas {
  height: calc(100% - 28px);
  min-height: 55px;
  aspect-ratio: auto;
}

:is(html:fullscreen, html.fullscreen-fit) .radar-legend,
:is(html:fullscreen, html.fullscreen-fit) .front-view-data {
  margin-top: 2px;
  font-size: 5px;
}

:is(html:fullscreen, html.fullscreen-fit) .sensor-module select {
  margin-top: 2px;
  padding: 3px;
}

:is(html:fullscreen, html.fullscreen-fit) .sensor-module label strong {
  font-size: 10px;
}

:is(html:fullscreen, html.fullscreen-fit) .matrix {
  grid-template-columns: repeat(25, 1fr);
  gap: 2px;
  padding: 3px;
}

:is(html:fullscreen, html.fullscreen-fit) .matrix-module dl {
  margin-top: 3px;
}

:is(html:fullscreen, html.fullscreen-fit) .matrix-module dl div {
  padding: 2px 1px;
  font-size: 5px;
}

:is(html:fullscreen, html.fullscreen-fit) .joystick {
  width: 105px;
  height: 69px;
}

:is(html:fullscreen, html.fullscreen-fit) .altitude-readouts span {
  padding: 3px;
}

:is(html:fullscreen, html.fullscreen-fit) .altitude-readouts b {
  font-size: 11px;
}

:is(html:fullscreen, html.fullscreen-fit) .altitude-buttons {
  margin-bottom: 3px;
}

:is(html:fullscreen, html.fullscreen-fit) footer {
  min-height: 0;
  margin: 0;
  padding-top: 3px;
  overflow: hidden;
}
