/* Dogfight. The canvas is the page: it covers the window at every size and
   the sector is fitted into whatever is left after the DOM takes its share. */

:root {
  --bg: #070d17;
  --panel: #0f1b2c;
  --panel-2: #16253c;
  --line: #24384f;
  --ink: #e8f3ff;
  --dim: #8ea6bf;
  --accent: #5ce0b4;
  --accent-2: #ffd166;
  --danger: #ff6b6b;
  --blue: #6cb6ff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#board {
  position: fixed;
  inset: 0;
  display: block;
  z-index: 0;
  /* The stick and the throttle are dragged with a finger, and a browser that
     is allowed to pan on the canvas cancels the touch halfway through the
     throw. The canvas itself never scrolls, so it takes every touch whole;
     the screens and the panel above it keep their own scrolling. */
  touch-action: none;
}

/* ---- chrome that only exists during a stage ----------------------------- */

.hud, .panel { display: none; }
body.battle .hud { display: flex; }
body.battle .panel { display: flex; }

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  padding: calc(7px + env(safe-area-inset-top)) 10px 0;
  pointer-events: none;
}
.hud .icon-btn { pointer-events: auto; }

.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  letter-spacing: 0.6px;
  background: rgba(15, 27, 44, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip[hidden] { display: none; }
.chip.hot { color: var(--danger); border-color: #4a2630; }
/* Whose turn it is. It is the one chip that is a state rather than a count,
   and it is the one a player looks for before touching anything. */
.chip.you { color: #9ff0c4; border-color: #1f4c3a; background: rgba(16, 42, 34, 0.9); }
.chip.them { color: #ffb2a0; border-color: #4a2630; background: rgba(44, 20, 22, 0.9); }

.icon-btn {
  margin-left: auto;
  width: 36px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(15, 27, 44, 0.86);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  flex: none;
}

/* The sheet is sized by what is in it, up to a cap. A fixed height meant a
   short phone had to fit the same card, log and buttons into fewer pixels than
   they need, and the row at the bottom was the thing that got pushed off the
   screen. Sized by content, the panel asks for what it needs and the board,
   which is fitted to whatever is left, gives it up. The cap is what stops a
   wide window handing the whole page to a sheet with four lines of text in it. */
.panel {
  position: fixed;
  z-index: 5;
  left: 0; right: 0; bottom: 0;
  height: auto;
  max-height: min(48vh, 340px);
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7,13,23,0.2), rgba(7,13,23,0.92) 26%);
  /* nothing in this sheet is ever allowed to hang off the bottom of it: the
     shortest phone is the one that finds out, and what it finds is a button
     it cannot press */
  overflow: hidden;
}

.panel-mode { display: none; flex-direction: column; gap: 7px; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.panel-mode.on { display: flex; }
/* The briefing gives up its own height so the button under it never does. */
.brief-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.brief-scroll > :last-child { margin-bottom: 0; }

/* ---- shared bits -------------------------------------------------------- */

.pane {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 16px calc(30px + env(safe-area-inset-bottom));
}

h1, h2, h3 { margin: 0 0 8px; line-height: 1.15; }
h2 { font-size: 24px; letter-spacing: 0.4px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--dim); margin-top: 14px; }
p { margin: 0 0 12px; line-height: 1.5; }
ul.tight { margin: 0; padding-left: 18px; }
ul.tight li { margin-bottom: 7px; line-height: 1.42; font-size: 14.5px; }

.muted { color: var(--dim); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

.logo { font-size: 44px; letter-spacing: 2px; margin: 8px 0 6px; font-weight: 800; }
.logo span { color: var(--accent); }
.tagline { color: var(--dim); font-size: 15px; max-width: 46ch; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.4px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--accent); color: #04241b; border-color: transparent; }
.btn.big { width: 100%; padding: 14px; font-size: 15px; letter-spacing: 1px; }
.btn.small { padding: 8px 10px; font-size: 12.5px; }

/* ---- title -------------------------------------------------------------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* no backdrop-filter here: the board keeps animating underneath, so a blur
     would be recomputed every single frame for no visual gain */
  background: radial-gradient(120% 80% at 50% 0%, rgba(8,16,28,0.93), rgba(4,8,14,0.975));
}
.screen.on { display: block; }

/* One button. The screen is the name of the game and the way in, and it is
   centred in whatever window it is given, a held phone or a laptop. */
.title-pane {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
}
.title-pane .logo { font-size: clamp(38px, 13vw, 64px); margin: 0; }
.title-pane .btn.big { width: auto; min-width: min(74vw, 300px); padding: 16px 30px; font-size: 17px; }

/* The briefing, said over the cockpit instead of on a screen before it. It is
   never in the way: it takes no tap, it holds no button, and it is gone a few
   seconds after the stage begins. */
.stage-intro {
  position: fixed;
  z-index: 12;
  left: 50%;
  transform: translateX(-50%);
  top: calc(52px + env(safe-area-inset-top));
  width: min(92vw, 470px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(9, 19, 32, 0.88);
  border: 1px solid rgba(150, 190, 230, 0.32);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.stage-intro[hidden] { display: none; }
.stage-intro.gone { opacity: 0; }
.si-goal {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}
/* Everything the briefing used to hold, folded under the button on the
   debrief: there for a player who wants it, invisible to one who does not. */
.how-more { margin: 14px 0 0; }
.how-more summary {
  cursor: pointer;
  font-size: 12.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--dim);
  padding: 6px 0;
}
.how-more[open] summary { color: var(--accent); }

.brief-text { color: #c3d5e8; font-size: 15px; }

/* The goal of the stage, in the words a player would use for it. It is the
   one line on this screen that says what winning means, so it is set apart
   from the prose instead of being the second sentence of it. */
.brief-goal {
  color: #ffe0a8;
  font-size: 14px;
  line-height: 1.4;
  border-left: 3px solid #7a6231;
  padding-left: 9px;
  margin: 8px 0 10px;
}
.panel .brief-goal { font-size: 12.5px; margin: 6px 0 8px; }
.brief-how { color: var(--dim); font-size: 13.5px; line-height: 1.45; margin-bottom: 4px; }
.panel .brief-how { font-size: 11.5px; }

/* ---- mission briefing ---------------------------------------------------- */

/* The order before the flight. The chart and the words sit one under the other
   on a held phone and side by side on a laptop, so the whole briefing is one
   look rather than a scroll on a screen wide enough to hold it. */
.brief-pane { max-width: 560px; }
.brief-cols { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.brief-map-col, .brief-text-col { min-width: 0; }
.brief-map-wrap {
  width: 100%;
  max-width: min(460px, 54vh);
  margin: 2px auto 10px;
}
#brief-map { display: block; width: 100%; aspect-ratio: 1 / 1; }
.brief-text-col .brief-goal { margin-top: 0; }
.brief-text-col h3:first-of-type { margin-top: 4px; }
.sw.water { background: #3d6f9e; }
.sw.tgt { background: #ffd166; }
.sw.route { background: #ffb347; border-radius: 2px; }

#brief-targets .tgt {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(60, 44, 12, 0.4);
  border: 1px solid #6d4a1c;
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 8px;
}
#brief-targets .tgt.aa { background: rgba(70, 26, 20, 0.34); border-color: #5e2f28; }
#brief-targets .tgt.route { background: rgba(52, 40, 14, 0.4); border-color: #7a5a1e; }
#brief-targets .tgt-mark {
  width: 14px; height: 14px; flex: none; margin-top: 2px;
  border-radius: 50%;
  border: 2px solid #ffd166;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.18);
}
#brief-targets .tgt-mark.aa {
  border-radius: 2px;
  border-color: #ff8f6b;
  box-shadow: 0 0 0 3px rgba(255, 143, 107, 0.16);
}
#brief-targets .tgt-mark.route {
  border-radius: 2px;
  border-color: #ffb347;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.16);
}
#brief-targets .tgt-nm { font-weight: 700; color: #ffe6ad; font-size: 15px; }
#brief-targets .tgt.aa .tgt-nm { color: #ffc3b0; }
#brief-targets .tgt.route .tgt-nm { color: #ffce7a; }
#brief-targets .tgt-sub { color: #d8c49a; font-size: 12.5px; line-height: 1.42; }
#brief-targets .tgt.aa .tgt-sub { color: #d9aca0; }
#brief-targets .tgt.route .tgt-sub { color: #e0c98f; }

@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  .brief-pane { max-width: 940px; }
  .brief-cols { flex-direction: row; align-items: flex-start; gap: 22px; }
  .brief-map-col { flex: 0 0 44%; }
  .brief-map-wrap { max-width: 100%; margin: 0 0 10px; }
}

/* ---- how to play, on the title screen ----------------------------------- */

.how-to {
  margin: 16px 0 4px;
  background: rgba(20, 34, 55, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 6px;
}
.how-to h3 { margin-bottom: 6px; }
.how-to ol { margin: 0; padding-left: 20px; }
.how-to li { margin-bottom: 7px; line-height: 1.42; font-size: 14.5px; color: #c3d5e8; }
.how-to b { color: var(--ink); }
.panel .brief-text { font-size: 13px; margin-bottom: 6px; }
.panel h2 { font-size: 19px; margin-bottom: 4px; }
.budget { font-family: var(--mono); color: var(--accent-2); }

/* ---- briefing rows inside the panel ------------------------------------- */

.brief-row { display: flex; flex-wrap: wrap; gap: 6px; }
.brief-row:empty { display: none; }

.mini {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 37, 60, 0.86);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px 9px 4px 4px;
  font-size: 12px;
  cursor: pointer;
}
.mini img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.mini .nm { font-weight: 600; }
.mini .rl { color: var(--dim); font-size: 10.5px; }
.mini.off { opacity: 0.38; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--dim); }
.legend span { display: flex; align-items: center; gap: 5px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.rock { background: #55636e; }
.sw.cloud { background: #5b7ea3; }
.sw.storm { background: #6a63a8; }
.sw.flak { background: #c05a5a; }
.sw.aa { background: #ff8f6b; }
.sw.home { background: #9fb4c6; }

/* The target chip carries a name and a condition, so it is allowed to be the
   widest thing in the row and to give way first when the row runs out of
   room. On a narrow phone it wraps to its own line rather than pushing the
   pause button off the edge. */
#hud-target { color: #ffe0a8; border-color: #4d4024; }
#hud-target.down { color: #8ee9bd; border-color: #1f4c3a; }

/* ---- battle panel ------------------------------------------------------- */

.card {
  background: rgba(15, 27, 44, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  flex: none;
}

.craft-head { display: flex; align-items: center; gap: 9px; }
.craft-head img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.craft-name { font-weight: 700; font-size: 15px; letter-spacing: 0.3px; }
.craft-role { font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--dim); }

/* Two meters to a row. Four stacked rows of label, bar and count is the
   tallest thing on the card, and the card is what the log and the buttons are
   competing with on a short screen. Paired up, the same four readings take
   half the height and none of them is dropped. */
.meters {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 5px 9px;
  margin-top: 8px;
  align-items: center;
}
.meter-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--dim); }
.meter { height: 8px; background: #0a1424; border-radius: 999px; overflow: hidden; border: 1px solid #1d2f45; flex: 1; }
.meter i { display: block; height: 100%; border-radius: 999px; }
.meter.hp i { background: linear-gradient(90deg, #3fd07f, #7cf0ad); }
.meter.hp.low i { background: linear-gradient(90deg, #d8532f, #ff8f5e); }
.meter.fuel i { background: linear-gradient(90deg, #d8a02f, #ffd166); }
.meter.fuel.low i { background: linear-gradient(90deg, #c0392b, #ff7b6b); }
.meter.ammo i { background: linear-gradient(90deg, #3f9ad0, #7cc6ff); }
.meter.bomb i { background: linear-gradient(90deg, #b8801f, #ffd166); }
.meter.mp i { background: linear-gradient(90deg, #6f7fd0, #a9b6ff); }
.meter-text { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.meter-wrap { display: flex; align-items: center; gap: 7px; }

.alt-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.alt-pips { display: flex; gap: 4px; }
.alt-pip {
  font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: #0d1728; color: var(--dim); cursor: pointer;
}
.alt-pip.on { background: var(--blue); border-color: transparent; color: #05202f; font-weight: 700; }

.log {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.45;
  background: rgba(10, 18, 32, 0.9);
  border: 1px solid #16263a;
  border-radius: 10px;
  padding: 7px 9px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
/* Set by ui.js when a box has more in it than it can show. A line sliced by
   the edge of its own box reads as a fault; a fade reads as more of it below,
   which is the truth, because the box scrolls. */
.log.more, .brief-scroll.more {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 15px), rgba(0, 0, 0, 0.12));
  mask-image: linear-gradient(180deg, #000 calc(100% - 15px), rgba(0, 0, 0, 0.12));
}
.log b { color: var(--ink); font-weight: 600; }
.log .hurt { color: var(--danger); }
.log .good { color: var(--accent); }

.controls { display: flex; flex-wrap: wrap; gap: 7px; flex: none; }
/* One line each, always. Two wrapped lines make every button taller, which is
   how the row grew past the bottom of a 320 pixel wide phone. The child
   selector matters: the readout is handed to this row as a node too, and the
   two buttons inside it must keep their own size rather than being stretched
   to the width of the sheet, which is what pushed them onto a second line. */
.controls > .btn {
  flex: 1 1 auto;
  /* Wide enough to hold its own label and no wider. A label that does not fit
     the space it was given is not truncated on a button, it is written over
     the button next to it, which is what "ANOTHER AIRCRAFT" was doing to
     "END TURN" on a narrow phone. */
  min-width: 0;
  white-space: nowrap;
  padding: 11px 8px;
}

.target-readout {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%;
  background: #22161c; border: 1px solid #4a2630; border-radius: 10px; padding: 6px 9px;
}
.target-readout .odds { font-family: var(--mono); font-size: 19px; color: var(--accent-2); font-weight: 700; flex: none; }
.target-readout .who { flex: 1 1 74px; min-width: 0; line-height: 1.25; }
.target-readout .who-nm { font-size: 13.5px; font-weight: 600; color: #f4d6d6; }
.target-readout .who-sub { font-size: 10.5px; color: #c39a9a; }
.target-readout .target-acts { display: flex; gap: 7px; margin-left: auto; flex: none; }
.target-readout .target-acts .btn { flex: none; padding: 10px 14px; }

/* ---- the narrow end ------------------------------------------------------ */

/* A held phone is the first screen this is opened on and the shortest one it
   has to work at. Nothing here hides anything: the same chips, the same card,
   the same buttons, drawn tighter, because on a 320 by 568 screen the hud was
   three rows of pills and the sheet under it took the rest, which left the
   sector two hundred pixels across. Every pixel given back here is a pixel the
   board gets, and the board is the game. */
@media (max-width: 460px) {
  .hud { gap: 4px; padding: calc(5px + env(safe-area-inset-top)) 7px 0; }
  .chip { font-size: 10px; padding: 3px 7px; letter-spacing: 0.3px; }
  .icon-btn { width: 32px; height: 28px; font-size: 12px; }
  .panel { gap: 6px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); }
  .controls { gap: 6px; }
  .controls > .btn { padding: 10px 6px; min-width: 68px; font-size: 13px; }
  .craft-head img { width: 30px; height: 30px; }
  .craft-name { font-size: 14.5px; }
  .craft-role { font-size: 11px; }
  .log { font-size: 11px; padding: 6px 8px; line-height: 1.38; }
  .meter-text { font-size: 10px; }
}
@media (max-height: 640px) {
  .panel { max-height: 46vh; }
  .log { line-height: 1.34; }
  /* The line that says what to do is worth its two lines the first time and
     nothing after that, and on a screen this short it is the difference
     between a sector you can read and one you cannot. Shorter, not gone. */
  #craft-card > p.muted { font-size: 11.5px; line-height: 1.3; }
}

/* ---- landscape: the panel moves to the side ----------------------------- */

@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  body.battle .panel {
    top: 0; bottom: 0; left: auto; right: 0;
    width: min(360px, 34vw);
    height: auto;
    /* this column is meant to run the whole height: the cap above is for the
       sheet that lies across the bottom of a held phone, not for this */
    max-height: none;
    background: linear-gradient(270deg, rgba(7,13,23,0.92), rgba(7,13,23,0.55));
    padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 12px 12px;
  }
  body.battle .hud { right: min(360px, 34vw); }
  .hud { flex-wrap: wrap; }
  /* the pause card follows its button, which is no longer at the window edge */
  .pause-pop { right: calc(min(360px, 34vw) + 10px); }
  /* This column is as tall as the window and its contents are not. Both the
     prose and the log keep their own height and everything sits under the top
     of the panel, rather than a box of four lines being stretched down 700
     pixels of nothing or a button floating alone at the foot of it. */
  .brief-scroll, .log { flex: 0 1 auto; }
}

/* ---- tables ------------------------------------------------------------- */

.score-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-family: var(--mono); font-size: 13px; }
.score-table td { padding: 7px 4px; border-bottom: 1px solid #16263a; }
.score-table td:last-child { text-align: right; font-weight: 700; }
.score-table tr.total td { border-bottom: none; color: var(--accent); font-size: 15px; }
.score-table td.neg { color: var(--danger); }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.stat b { display: block; color: var(--ink); font-size: 17px; }

.board-table { font-family: var(--mono); font-size: 13px; }
.board-table .row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px;
  padding: 6px 8px; border-bottom: 1px solid #16263a; border-radius: 6px;
}
.board-table .row.me { background: #123024; color: var(--accent); }
.board-table .row .rk { color: var(--dim); }

/* ---- shop --------------------------------------------------------------- */

.shop-grid { display: grid; gap: 10px; margin-top: 8px; }
@media (min-width: 640px) { .shop-grid { grid-template-columns: 1fr 1fr; } }

.shop-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.shop-card h4 { margin: 0; font-size: 15px; }
.shop-card p { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.4; }
.shop-card .cost { font-family: var(--mono); color: var(--accent-2); font-size: 13px; }
.shop-card.sold { opacity: 0.5; }

/* ---- pause -------------------------------------------------------------- */

/* A card under the button that opened it. The page keeps its board, its
   aircraft and its HUD, because a turn based game that is stopped is still a
   game being read, and a sheet over the middle of it is a menu instead. */
.pause-pop {
  position: fixed;
  top: calc(46px + env(safe-area-inset-top));
  right: 10px;
  z-index: 15;
  display: none;
  flex-direction: column;
  gap: 7px;
  width: min(212px, calc(100vw - 20px));
  padding: 11px;
  background: rgba(15, 27, 44, 0.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}
.pause-pop.on { display: flex; }
.pause-pop h2 { font-size: 16px; margin: 0; }
.pause-pop p { margin: 0; line-height: 1.35; }
.pause-pop .row { display: flex; gap: 7px; }
.pause-pop .row .btn { flex: 1; padding: 10px 8px; }
.pause-pop > .btn { padding: 8px 10px; }
/* the button says which way it is: a stopped game should not look like a
   running one behind a card nobody noticed */
.icon-btn.on { background: var(--accent); border-color: transparent; color: #04241b; }

/* The one line under the meters. Quiet when it is telling a player what their
   hand can do, amber when the sortie is running out. */
.card-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--dim);
}
.card-note.warn {
  color: #ffd9a0;
  background: rgba(70, 45, 12, 0.5);
  border: 1px solid #6d4a1c;
  border-radius: 8px;
  padding: 6px 8px;
}
/* The line that says a bomb run is on. It is the most actionable sentence on
   the card while it is showing, so it is the only one that gets a colour. */
.card-note.good {
  color: #bff5db;
  background: rgba(14, 58, 42, 0.5);
  border: 1px solid #1f5c44;
  border-radius: 8px;
  padding: 6px 8px;
}

/* ---- what just happened ------------------------------------------------- */

/* Sits above the panel, under the hud, centred on the board. It never takes a
   tap: a message about a rule is not a thing to press. */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(52vh + 12px);
  transform: translate(-50%, 6px);
  z-index: 12;
  max-width: min(84vw, 340px);
  padding: 8px 12px;
  background: rgba(15, 27, 44, 0.97);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
/* In the side column the panel is not across the bottom, so the message drops
   to where the board actually ends. */
@media (min-aspect-ratio: 1/1) and (min-width: 640px) {
  .toast { bottom: 16px; left: calc((100vw - min(360px, 34vw)) / 2); }
}

/* A shot is being lined up: the odds take the room, and the log is what gives
   it up. The log is the only thing in the sheet that can shrink, and on the
   shortest phone what was left of it after the readout had taken its share was
   a single line sliced through the middle by the edge of its own box. A line
   cut in half reads as a fault, so it stands right down instead, and comes back
   the moment the shot is taken or let go. The sheet is anchored to the bottom,
   so it grows upward and nothing below it moves. */
body.targeting .log { display: none; }
/* and the line under the meters stands down with it: there is nothing it can
   say about a shot that the readout is not already saying, and on the shortest
   screen its height is what the readout needs */
body.targeting .card-note { display: none; }

/* ---- what to do now ------------------------------------------------------ */

/* The strip over the buttons. It is a sentence about the controls directly
   below it and it changes with what those controls can do, so it is drawn
   quiet: a player reads it until the rule is in their head and then stops
   seeing it. */
.hint-strip {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: #9fb6cd;
  min-height: 15px;
}
.hint-strip:empty { display: none; }
.hint-strip.flash { color: #ffe0a8; }

/* ---- flying it through --------------------------------------------------- */

/* Up while a manoeuvre is playing out. A tap anywhere on the board does the
   same thing, but a player who has not worked that out is told. */
.skip-btn {
  /* Under the pause button rather than across the middle of the windscreen:
     it is a control, and the middle of the windscreen is where the pilot is
     looking. */
  position: fixed;
  right: 10px;
  top: calc(74px + env(safe-area-inset-top));
  z-index: 14;
  padding: 9px 16px;
  background: rgba(10, 20, 34, 0.72);
  border: 1px solid rgba(150, 190, 230, 0.34);
  border-radius: 999px;
  color: var(--ink);
  font: 700 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.09em;
  cursor: pointer;
  opacity: 0.9;
}
.skip-btn[hidden] { display: none; }
