/* AeroKids
   Colors come from the logo: the navy lettering, the sky-blue circle, the
   orbit's red-orange for small accents, and grass green for the main button.
   Font: Lexend, designed to make reading easier (OFL, in /fonts).
   Spacing uses one scale: 4, 8, 12, 16, 24, 32, 48. */

@font-face {
  font-family: "Lexend";
  src: url("./fonts/Lexend.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #0e1a26; /* AERO */
  --ink-soft: #4b5e71;
  --slate: #2f5180; /* Kids */
  --sky: #a4c6f7; /* the circle */
  --sky-pale: #e8f1fd;
  --orbit: #c9441f; /* the orbit, a shade darker so white text on it is easy to read */
  --orbit-dark: #9e3416;
  --go: #2a7d3a; /* the main button on each screen: grass green, dark enough for white text */
  --go-dark: #1b5626;
  --go-hover: #236c31;
  --paper: #ffffff;
  --line: #d3deea;
  --horizon: #cfe5f5; /* matches the 3D sky at the horizon */
  --sun: #ffc53d;
  --coral: #d9502a;
  --grass: #23874a;
  --grass-pale: #e3f3e8;
  --night: #0f2234;
  --hud: rgba(13, 30, 46, 0.84);
  --hud-line: rgba(255, 255, 255, 0.14);
  --hud-mute: #dfe8ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.55);
  --head: "Lexend", "Trebuchet MS", sans-serif;
  --body: "Lexend", Verdana, sans-serif;
  --menu-height: clamp(270px, 44vh, 360px);
  /* Keep clear of the notch and the home bar on phones. */
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  /* Distance from the bottom edge to just above the instrument panel. */
  --above-panel: calc(clamp(96px, 26vh, 150px) + var(--sb));
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--horizon);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
}
body {
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
:focus-visible {
  outline: 3px solid var(--slate);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}
h1 {
  font-size: clamp(30px, 5.4vh, 44px);
}
h2 {
  font-size: clamp(22px, 3.8vh, 28px);
}
h3 {
  font-size: 19px;
}
p {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hidden {
  display: none !important;
}

#sim-shell {
  position: fixed;
  inset: 0;
}
#sim-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.world-ready #sim-canvas {
  opacity: 1;
}
.cloud-veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: rgba(244, 248, 252, 0.96);
  transition: opacity 0.25s linear;
}

/* buttons */

/* The one main action on a screen: solid green with a darker bottom edge, like a real push button. */
.go {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  border: 0;
  border-bottom: 5px solid var(--go-dark);
  border-radius: 0;
  background: var(--go);
  color: #fff;
  font-family: var(--head);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.go:hover:not(:disabled) {
  background: var(--go-hover);
}
.go:active:not(:disabled) {
  border-bottom-width: 1px;
  margin-top: 3px;
}
.go:disabled {
  background: #c9d3dd;
  border-bottom-color: #aebac6;
  color: #5d6c7a;
}
/* Everything else: outlined. */
.plain {
  min-height: 52px;
  padding: 10px 18px;
  font-size: 18px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-weight: 700;
}
.plain:hover {
  background: var(--sky-pale);
}
.text-button {
  border: 0;
  background: none;
  padding: 8px 0;
  font-weight: 700;
  color: var(--slate);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.back-link {
  border: 0;
  background: none;
  padding: 4px 0;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--slate);
}
.back-link::before {
  content: "‹ ";
  font-size: 1.2em;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.button-row .go {
  width: auto;
  flex: 1 1 100%;
}
.button-row .plain {
  flex: 1 1 auto;
}
.inline {
  display: flex;
  gap: 8px;
}
input {
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-size: 20px;
}
input::placeholder {
  color: #93a2b1;
}
.note {
  color: var(--ink-soft);
  font-size: 15px;
}
.stack {
  display: grid;
  gap: 8px;
}
.stack label {
  font-weight: 700;
}

/* menu panel along the bottom, with the 3D plane above it */

.menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: var(--menu-height);
  display: grid;
  grid-template-columns: clamp(180px, 20vw, 270px) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
  padding: 20px calc(32px + var(--sr)) calc(20px + var(--sb)) calc(32px + var(--sl));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.menu-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
}
/* The logo rises out of the panel, over the 3D view. */
.menu-logo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: calc(-0.38 * clamp(180px, 20vw, 270px));
}
.hello {
  display: none;
  font-family: var(--head);
  font-size: clamp(28px, 4.6vh, 40px);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
}
.menu[data-view="home"] .hello {
  display: block;
}
.menu-body {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}
.menu .view {
  display: none;
  gap: 12px;
  align-content: start;
}
.menu[data-view="name"] [data-for="name"],
.menu[data-view="grade"] [data-for="grade"],
.menu[data-view="paint"] [data-for="paint"],
.menu[data-view="home"] [data-for="home"],
.menu[data-view="pilot"] [data-for="pilot"],
.menu[data-view="pilots"] [data-for="pilots"],
.menu[data-view="standings"] [data-for="standings"] {
  display: grid;
}
.menu-list {
  border-top: 1px solid var(--line);
}
.menu-list li {
  border-bottom: 1px solid var(--line);
}
.menu-list button {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 14px 4px;
  border: 0;
  background: none;
  font-family: var(--head);
  font-size: 24px;
  font-weight: 600;
  text-align: left;
}
.menu-list button::after {
  content: "›";
  color: var(--ink-soft);
}
.menu-list button:hover {
  color: var(--slate);
}
.menu-list button span {
  margin-left: auto;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-soft);
}
.menu-list button[aria-current="true"] {
  color: var(--slate);
}
.menu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.load-line {
  position: absolute;
  left: calc(32px + var(--sl));
  right: 32px;
  bottom: calc(12px + var(--sb));
  font-size: 14px;
  color: var(--ink-soft);
}
.load-line.waiting {
  color: var(--ink);
  font-weight: 700;
}
.load-line.problem {
  color: var(--orbit-dark);
  font-weight: 700;
}

.grade-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.grade-choice {
  min-height: 72px;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-family: var(--head);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}
.grade-choice:hover:not(:disabled) {
  background: var(--sky-pale);
}
.grade-choice[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.grade-choice:disabled:not([aria-pressed="true"]) {
  opacity: 0.45;
}
.class-box {
  margin-top: 8px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}
.swatch {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
}
.swatch::before {
  content: "";
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18);
}
.swatch[aria-checked="true"]::before {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}

/* Flight school: a numbered list, the next lesson's number filled in. */
.lesson-list {
  border-top: 1px solid var(--line);
}
.lesson-list li {
  border-bottom: 1px solid var(--line);
}
.lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 4px;
  border: 0;
  background: none;
  text-align: left;
}
.lesson:hover .name {
  color: var(--slate);
}
.lesson .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--head);
  font-weight: 700;
  font-size: 22px;
}
.lesson.next .num {
  border-color: var(--go);
  background: var(--go);
  color: #fff;
}
.lesson.done .num {
  border-color: var(--grass);
  color: var(--grass);
}
.lesson .name {
  flex: 1;
  font-family: var(--head);
  font-size: 24px;
  font-weight: 600;
}
.lesson .tick {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--grass);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}
.lesson.done .tick {
  visibility: visible;
}
.check-row {
  padding: 12px;
  border: 2px dashed var(--slate);
  border-radius: 0;
  background: var(--sky-pale);
  font-family: var(--head);
  font-size: 20px;
  font-weight: 700;
  color: var(--slate);
}

.facts {
  margin: 0;
  display: grid;
  border-top: 1px solid var(--line);
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  color: var(--ink-soft);
}
.facts dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.standings {
  counter-reset: place;
  border-top: 1px solid var(--line);
}
.standings li {
  counter-increment: place;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.standings li::before {
  content: counter(place);
  grid-row: span 2;
  font-family: var(--head);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-soft);
}
.standings li.you {
  background: var(--sky-pale);
}
.standings .who {
  font-weight: 700;
}
.standings .score {
  font-weight: 700;
  text-align: right;
}
.standings .lessons {
  grid-column: 2 / span 2;
  font-size: 14px;
  color: var(--ink-soft);
}

.fine {
  font-size: 13px;
  color: var(--ink-soft);
}
.fine a {
  color: inherit;
}

/* dialogs over the 3D view */

.dialog-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(14, 26, 38, 0.4);
  overflow-y: auto;
}
.dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 2px 0 rgba(14, 26, 38, 0.3);
}
.dialog.wide {
  width: min(680px, 100%);
}
.dialog > .back-link {
  justify-self: start;
  margin-bottom: 0;
}
.dialog-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.dialog-foot .go {
  width: auto;
  flex: 1;
}
.dialog-foot .count {
  flex: none;
  min-width: 72px;
  color: var(--ink-soft);
  font-weight: 700;
}
.question {
  font-family: var(--head);
  font-size: clamp(20px, 3.4vh, 24px);
  font-weight: 600;
  line-height: 1.2;
}
.tip {
  padding: 8px 12px;
  border-radius: 0;
  background: var(--sky-pale);
  font-weight: 700;
}
.result {
  min-height: 1.45em;
  font-weight: 700;
}
.result:empty {
  display: none;
}

.choices {
  display: grid;
  gap: 8px;
}
.choice {
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  text-align: left;
  font-size: 18px;
}
.choice:hover:not(:disabled) {
  border-color: var(--ink);
}
.choice.correct {
  border-color: var(--grass);
  background: var(--grass-pale);
  font-weight: 700;
}
.choice.wrong {
  border-color: var(--orbit);
  text-decoration: line-through;
  color: var(--ink-soft);
}
.choice.picked {
  border-color: var(--ink);
  background: var(--sky-pale);
}
.choice:disabled:not(.correct):not(.wrong):not(.picked) {
  color: var(--ink-soft);
}

/* flight plan: the stops of the flight, in order, on a dashed line */
.route {
  display: flex;
  justify-content: space-between;
  counter-reset: stop;
  padding: 12px 0 4px;
  background: linear-gradient(var(--ink), var(--ink)) 0 26px / 100% 2px no-repeat;
}
.route li {
  counter-increment: stop;
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
}
.route li::before {
  content: counter(stop);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 14px;
}

/* walkaround and control check: a panel along the bottom, so the plane stays in view */
.walk {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  justify-items: center;
  padding: 0 16px calc(16px + var(--sb));
  pointer-events: none;
}
.walk-panel {
  pointer-events: auto;
  width: min(720px, 100%);
  display: grid;
  gap: 8px;
  padding: 16px 24px 20px;
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 2px 0 rgba(14, 26, 38, 0.3);
}
.walk-panel .choices {
  grid-template-columns: repeat(3, 1fr);
}
.walk-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.walk-steps li.done {
  color: var(--grass);
}
.walk-steps li.done::before {
  content: "✓ ";
}
.walk-steps li.now {
  color: var(--ink);
}
.ccheck-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ccheck-list li {
  padding: 10px 8px;
  border: 2px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-weight: 700;
}
.ccheck-list li.done {
  border-color: var(--grass);
  background: var(--grass-pale);
}
.ccheck-list li.done::before {
  content: "✓ ";
  color: var(--grass);
}

/* pre- and post-flight check results */
.compare {
  display: grid;
  gap: 8px;
}
.compare div {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

/* Controls */
.controls-dialog {
  width: min(640px, 100%);
}
.device-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.device-list li {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.device-list .plain {
  justify-self: start;
}
.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 15px;
}
kbd {
  display: inline-block;
  min-width: 26px;
  margin-right: 3px;
  padding: 1px 6px;
  border: 1.5px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 0;
  font: 700 14px var(--body);
  text-align: center;
}
.meters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}
.meters.big {
  grid-template-columns: 1fr;
}
.meters div {
  display: grid;
  gap: 4px;
}
.bar {
  position: relative;
  display: block;
  height: 14px;
  border-radius: 0;
  background: var(--sky-pale);
  overflow: hidden;
}
.bar:not(.power)::after {
  content: "";
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink-soft);
}
.bar b {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  background: var(--slate);
}
.bar.power b {
  background: var(--orbit);
}
.raw-bars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.raw {
  display: block;
  height: 12px;
  border-radius: 0;
  background: var(--sky-pale);
  overflow: hidden;
}
.raw b {
  display: block;
  height: 100%;
  background: var(--slate);
  transform-origin: left;
}
.raw.button b {
  background: var(--orbit);
}

/* fly a real airplane */
.link-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.link-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.link-list a {
  font-family: var(--head);
  font-size: 21px;
  font-weight: 700;
  color: var(--slate);
  text-underline-offset: 3px;
}
.link-list a::after {
  content: " ↗";
  font-size: 0.8em;
}

/* Flashcard pictures (drawings.js) */
.flash-visual {
  padding: 8px;
  border-radius: 0;
  background: var(--sky-pale);
}
.flash-art {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
}
.flash-art .fa-plane,
.flash-art .fa-body {
  fill: var(--sky);
  stroke: var(--ink);
}
.flash-art .fa-plane {
  stroke-width: 0.6;
}
.flash-art .fa-body {
  stroke-width: 3;
}
.flash-art .fa-body-fill {
  fill: var(--sky);
  stroke: var(--ink);
  stroke-width: 3;
}
.flash-art .fa-horizon {
  fill: none;
  stroke: #8fb6d8;
  stroke-width: 2;
  stroke-dasharray: 6 6;
}
.flash-art .fa-ground {
  stroke: #6aa84f;
  stroke-width: 8;
}
.flash-art .fa-runway {
  stroke: #59616b;
  stroke-width: 8;
}
.flash-art .fa-center {
  stroke: #fff;
  stroke-width: 2;
  stroke-dasharray: 8 8;
}
.flash-art .fa-accent,
.flash-art .fa-down,
.flash-art .fa-wind,
.flash-art .fa-path,
.flash-art .fa-dash,
.flash-art .fa-wing,
.flash-art .fa-tick,
.flash-art .fa-tickmark,
.flash-art .fa-ring,
.flash-art .fa-needle-line {
  fill: none;
  stroke-linecap: round;
}
.flash-art .fa-accent {
  stroke: var(--coral);
  stroke-width: 4;
}
.flash-art .fa-accent-fill {
  fill: var(--coral);
}
.flash-art .fa-down {
  stroke: var(--slate);
  stroke-width: 4;
}
.flash-art .fa-down-fill {
  fill: var(--slate);
}
.flash-art .fa-ring {
  stroke: var(--coral);
  stroke-width: 3.5;
}
.flash-art .fa-box {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 1.5;
}
.flash-art .fa-tickmark {
  stroke: var(--grass);
  stroke-width: 2.5;
}
.flash-art .fa-wind {
  stroke: #5a9bd4;
  stroke-width: 3;
}
.flash-art .fa-path {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-dasharray: 7 6;
}
.flash-art .fa-dash {
  stroke: var(--ink-soft);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}
.flash-art .fa-wing {
  stroke: var(--ink);
  stroke-width: 7;
}
.flash-art .fa-face {
  fill: var(--night);
  stroke: var(--ink);
  stroke-width: 3;
}
.flash-art rect.fa-face {
  fill: #fff;
  stroke-width: 2;
}
.flash-art .fa-tick,
.flash-art .fa-needle-line {
  stroke: #fff;
  stroke-width: 2.5;
}
.flash-art .fa-needle {
  fill: #fff;
}
.flash-art .fa-label {
  font: 700 13px var(--body);
  fill: var(--ink);
}
.flash-art .fa-big {
  font: 800 20px var(--head);
  fill: var(--ink);
}

/* flight hud */
.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.hud button {
  pointer-events: auto;
}

.hud-actions {
  position: absolute;
  top: calc(10px + var(--st));
  left: calc(10px + var(--sl));
  max-width: 45%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hud-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: clamp(5px, 1.2vh, 8px) 12px;
  background: var(--hud);
  color: #fff;
  font-weight: 700;
  font-size: clamp(13px, 3vh, 16px);
}
.hud-button:hover {
  background: rgba(13, 30, 46, 0.95);
}
.hud-button svg {
  flex: none;
  width: 16px;
  height: 16px;
}
.pause-button svg {
  fill: currentColor;
}

/* text over the flight view: no boxes, just white text with a shadow */
.lesson-card,
.feedback,
.target-card,
.mission-progress,
.panel {
  color: #fff;
  text-shadow: var(--shadow);
}

.hud-left {
  position: absolute;
  top: calc(clamp(44px, 10vh, 56px) + var(--st));
  left: calc(10px + var(--sl));
  width: min(320px, 36%);
  display: grid;
}
.lesson-card {
  padding: 4px 2px 2px;
}
.lesson-card h2 {
  font-size: clamp(17px, 4vh, 22px);
}
.feedback {
  padding: 0 2px;
  font-weight: 700;
  font-size: clamp(13px, 3vh, 15px);
  color: var(--sun);
}

.hud-right {
  position: absolute;
  top: calc(10px + var(--st));
  right: calc(10px + var(--sr));
  width: min(290px, 34%);
  display: grid;
  gap: 6px;
}
.target-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px;
}
.target-text {
  flex: 1;
  display: grid;
}
.target-text span {
  font-weight: 700;
  font-size: 13px;
  color: var(--hud-mute);
}
#target-main {
  font-family: var(--head);
  font-size: clamp(17px, 4vh, 22px);
  line-height: 1.1;
}
#target-sub {
  font-size: 13px;
  color: var(--hud-mute);
}
.target-arrow {
  flex: 0 0 clamp(38px, 9vh, 52px);
  width: clamp(38px, 9vh, 52px);
  height: clamp(38px, 9vh, 52px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}
.target-arrow path {
  fill: var(--sun);
  stroke: rgba(0, 0, 0, 0.5);
  stroke-width: 1;
}
#target-arrow-needle {
  transition: transform 0.15s linear;
}
.mission-progress {
  padding: 2px;
}
.mission-progress-top {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
}
.mission-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.mission-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.mission-dot.current {
  border-color: var(--sun);
}
.mission-dot.done {
  border-color: var(--grass);
  background: var(--grass);
}

.skill-toast {
  position: absolute;
  left: 50%;
  bottom: var(--above-panel);
  transform: translateX(-50%);
  max-width: min(460px, 50%);
  padding: 4px 8px;
  color: #fff;
  text-shadow: var(--shadow);
  font-weight: 700;
  font-size: clamp(13px, 3vh, 16px);
  text-align: center;
}
.skill-toast.education-toast {
  color: #b9f5c9;
}
.ground-warning {
  position: absolute;
  left: 50%;
  bottom: var(--above-panel);
  transform: translateX(-50%);
  display: grid;
  padding: 8px 18px;
  border-radius: 0;
  background: var(--coral);
  color: #fff;
  text-align: center;
}
.ground-warning strong {
  font-family: var(--head);
  font-size: 22px;
}

/* Instrument panel: attitude, airspeed, altitude, heading and vertical speed. */
.panel {
  --gauge: clamp(64px, 17vh, 100px);
  position: absolute;
  left: 50%;
  bottom: calc(8px + var(--sb));
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 4px;
}
.instrument-strip {
  display: flex;
  gap: 10px;
}
.gauge {
  position: relative;
  width: var(--gauge);
  display: grid;
  justify-items: center;
  gap: 2px;
}
.gauge svg {
  display: block;
  width: var(--gauge);
  height: var(--gauge);
}
.gauge .face {
  fill: #0b1d2b;
  stroke: #6d8191;
  stroke-width: 2;
}
.gauge .tick {
  stroke: #c7d3dd;
  stroke-width: 1.2;
}
.gauge .tick.major {
  stroke: #fff;
  stroke-width: 2.4;
}
.gauge .num {
  fill: #fff;
  font: 700 9px var(--body);
  text-anchor: middle;
}
.gauge .num.cardinal {
  fill: var(--sun);
  font-size: 11px;
}
.gauge .tiny {
  fill: #9fb2c2;
  font: 700 6px var(--body);
}
.gauge .arc-green {
  fill: none;
  stroke: #3fbf6a;
  stroke-width: 5;
}
.gauge .arc-yellow {
  fill: none;
  stroke: #f2c230;
  stroke-width: 5;
}
.gauge .redline {
  stroke: #e4572e;
  stroke-width: 3;
}
.gauge .needle {
  fill: #fff;
  stroke: #0b1d2b;
  stroke-width: 0.8;
}
.gauge .hub,
.gauge .lubber {
  fill: var(--coral);
}
.gauge .hdg-plane {
  fill: #fff;
}
.gauge-label {
  display: none;
  font-weight: 700;
  font-size: 12px;
  color: var(--hud-mute);
}
.needle-group {
  transform-origin: 0 0;
  transition: transform 0.1s linear;
}
.readout {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
}
.readout strong {
  font-family: var(--head);
  font-size: 18px;
  line-height: 1.2;
}
.readout small {
  font-size: 11px;
  color: var(--hud-mute);
}

.att-clip {
  position: relative;
  width: var(--gauge);
  height: var(--gauge);
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--hud-line);
}
.att-horizon {
  position: absolute;
  left: -60%;
  top: -60%;
  width: 220%;
  height: 220%;
  transition: transform 0.1s linear;
}
.att-sky {
  position: absolute;
  inset: 0 0 50% 0;
  background: #4a90d9;
}
.att-ground {
  position: absolute;
  inset: 50% 0 0 0;
  background: #8b5a2b;
}
.att-lines {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  border-top: 2px solid #fff;
  transform: translate(-50%, -1px);
  box-shadow:
    0 -16px 0 rgba(255, 255, 255, 0.6),
    0 16px 0 rgba(255, 255, 255, 0.6);
}
.att-face {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--gauge);
  height: var(--gauge);
}
.att-face .bank {
  stroke: #fff;
  stroke-width: 2;
}
.att-face .att-pointer,
.att-face .att-dot {
  fill: var(--sun);
}
.att-face .att-plane {
  fill: none;
  stroke: var(--sun);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Power lever: tick marks every 25%, a sun-yellow fill and a white handle on top of it. */
.power-lever {
  position: absolute;
  left: calc(10px + var(--sl));
  bottom: calc(10px + var(--sb));
  width: clamp(56px, 12vh, 70px);
  height: clamp(130px, 40vh, 220px);
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: 6px;
  padding: 7px 0 12px;
  border-radius: 0;
  background: var(--hud);
  color: #fff;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.power-lever span {
  font-weight: 700;
  font-size: 13px;
  color: var(--hud-mute);
}
.power-lever-track {
  position: relative;
  width: 28px;
  height: 100%;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08)
    repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--hud-line) calc(25% - 1px) 25%);
}
#power-lever-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  border-radius: 0;
  background: var(--sun);
}
#power-lever-fill::before {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  top: -3px;
  height: 6px;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Cockpit view (C key) */
.cockpit-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.windshield-post {
  position: absolute;
  top: -10%;
  bottom: 20%;
  width: 46px;
  border-radius: 0;
  background: #1c2a36;
}
.windshield-post.left {
  left: 6%;
  transform: rotate(12deg);
}
.windshield-post.right {
  right: 6%;
  transform: rotate(-12deg);
}
.cockpit-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
}
.reticle-wing {
  width: 46px;
  height: 4px;
  border-radius: 0;
  background: var(--sun);
}
.reticle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sun);
}
.cockpit-dash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 168px;
  border-top: 4px solid #0e1821;
  background: #1c2a36;
}
/* The dash readouts are a fallback; the gauge panel sits on the dashboard. */
.cockpit-dash > div {
  display: none;
}
body.cockpit-view .panel {
  background: #0e1821;
}

/* camera yoke */
.camera-dialog {
  width: min(560px, 100%);
  gap: 10px;
}
.camera-dialog h2 {
  font-size: 30px;
}
.cam-step {
  min-height: 2.8em;
  font-size: 18px;
}
.cam-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 46vh;
  overflow: hidden;
  border-radius: 0;
  background: var(--night);
}
.cam-stage video,
.cam-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.cam-stage video.mirrored {
  transform: scaleX(-1);
}
.cam-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--head);
  font-weight: 800;
  font-size: 96px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(13, 30, 46, 0.6);
  pointer-events: none;
}
.cam-warning {
  padding: 8px 12px;
  border-radius: 0;
  background: #fdeae3;
  color: #8a2a10;
  font-weight: 700;
}
.cam-meters {
  display: grid;
  gap: 6px;
}
.cam-meters > div {
  display: grid;
  grid-template-columns: 52px 1fr 92px;
  align-items: center;
  gap: 10px;
}
.cam-meters span {
  font-weight: 700;
  color: var(--ink-soft);
}
.cam-meters strong {
  font-family: var(--head);
  font-size: 19px;
}
.cam-meter {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 0;
  background: var(--line);
}
.cam-meter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line-strong);
}
.cam-meter i {
  position: absolute;
  left: 25%;
  width: 50%;
  top: 0;
  bottom: 0;
}
.cam-meter i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1px;
  bottom: 1px;
  width: 14px;
  margin-left: -7px;
  border-radius: 0;
  background: var(--ink);
}
.cam-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cam-options .secondary-button {
  padding: 8px 12px;
  font-size: 16px;
}
.cam-options:not(:has(:not(.hidden))) {
  display: none;
}
.cam-privacy {
  font-size: 14px;
  color: var(--ink-soft);
}

/* The small camera view in flight. A green dot means the camera sees the object; coral means it lost it. */
.cam-mini {
  position: absolute;
  right: calc(10px + var(--sr));
  bottom: calc(10px + var(--sb));
  width: clamp(140px, 30vh, 170px);
  overflow: hidden;
  border-radius: 0;
  background: var(--hud);
  pointer-events: auto;
}
.cam-mini canvas {
  display: block;
  width: 100%;
  height: auto;
}
.cam-mini-status {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  background: none;
  padding: 5px 8px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}
.cam-mini-status::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4fd07a;
}
.cam-mini.lost .cam-mini-status::before {
  background: var(--coral);
}

/* turn your phone sideways */
.rotate-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: #8ec3ee;
  color: var(--ink);
  text-align: center;
}
.rotate-screen h2 {
  font-size: 32px;
}
.rotate-screen p {
  max-width: 300px;
  font-size: 18px;
}
.rotate-phone {
  width: 140px;
  height: 140px;
  animation: rotate-hint 2.4s ease-in-out infinite;
}
.rotate-phone .phone {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 3;
}
.rotate-phone .dot {
  fill: var(--ink);
}
.rotate-phone .turn {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes rotate-hint {
  0%,
  25% {
    transform: rotate(0);
  }
  55%,
  100% {
    transform: rotate(-90deg);
  }
}


/* screen sizes */
@media (orientation: portrait) and (pointer: coarse), (orientation: portrait) and (max-width: 600px) {
  .rotate-screen {
    display: grid;
  }
}

@media (max-width: 820px) {
  .instrument-strip .gauge:nth-child(4) {
    display: none;
  }
  .menu {
    padding-left: calc(16px + var(--sl));
    padding-right: 16px;
  }
}

/* Short screens (phones held sideways, small laptops): tighter spacing. */
@media (max-height: 560px) {
  .menu {
    padding-top: 12px;
  }
  .menu .view {
    gap: 8px;
  }
  .dialog {
    padding: 16px;
    gap: 8px;
  }
  .go {
    min-height: 44px;
    font-size: 19px;
  }
  .choice {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 16px;
  }
  .flash-art {
    max-height: 120px;
  }
  .walk-panel .choices {
    grid-template-columns: 1fr;
  }
  .pause-button {
    gap: 0;
    padding: 8px 10px;
    font-size: 0;
  }
  .pause-button svg {
    width: 18px;
    height: 18px;
  }
  .hud-left {
    top: calc(10px + var(--st));
    left: calc(56px + var(--sl));
    width: min(280px, 34%);
  }
  .lesson-card h2 {
    font-size: 16px;
  }
  .feedback {
    font-size: 13px;
  }
  .hud-right {
    width: min(240px, 30%);
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.menu .back-link {
  justify-self: start;
}
.yoke-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Plain scrolling pages: results (admin.html) and privacy.html */
html:has(body.page),
body.page {
  height: auto;
  overflow: auto;
}
body.page {
  background: var(--paper);
}
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.page-head img {
  display: block;
  width: 88px;
  height: auto;
}
.page-head > div {
  flex: 1;
}
.page-body {
  max-width: 900px;
  padding: 24px;
  display: grid;
  gap: 32px;
}
.page-body section {
  display: grid;
  gap: 12px;
}
.page-body.prose {
  max-width: 680px;
  gap: 16px;
}
.prose h2 {
  margin-top: 16px;
}
.prose ul {
  list-style: disc;
  padding-left: 24px;
}
.narrow {
  max-width: 360px;
}
.wrap {
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
  align-items: center;
}
select {
  min-height: 44px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font: inherit;
}
.inline input {
  flex: 1 1 220px;
  min-height: 44px;
  font-size: 17px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.table th,
.table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th {
  font-size: 14px;
  color: var(--ink-soft);
}
.table tr.off td {
  color: var(--ink-soft);
}
.table code {
  font: 700 18px var(--body);
  letter-spacing: 0.08em;
}
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 24px;
}
.summary div {
  display: grid;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.summary span {
  font-size: 14px;
  color: var(--ink-soft);
}
.summary strong {
  font-family: var(--head);
  font-size: 26px;
}
#signed-in {
  display: grid;
  gap: 40px;
}
.raw-bars div {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-soft);
}
#wizard,
#wiz-test {
  display: grid;
  gap: 12px;
}

.school-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
}
.school-head h2 {
  font-size: clamp(24px, 4vh, 30px);
}

/* Yoke setup: the drawing of the yoke shows each position. */
.controls-dialog:has(#wizard:not(.hidden)) {
  width: min(760px, 100%);
}
.yoke-art {
  background: var(--sky-pale);
  padding: 8px;
  overflow: hidden;
}
.yoke-svg {
  display: block;
  width: 100%;
  max-height: 38vh;
  overflow: visible;
}
.yoke-svg path,
.yoke-svg circle,
.yoke-svg rect {
  stroke: #15191d;
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.ya-top { fill: #c6c6c6; }
.ya-front { fill: #73889a; }
.ya-side { fill: #b6c8d8; }
.ya-rail { fill: none; stroke: #a9c4dc !important; stroke-width: 3 !important; }
.ya-vent { fill: none; stroke-width: 2.2 !important; }
.ya-hole, .ya-screw { fill: #fff; }
.ya-housing { fill: #d8d8d8; }
.ya-slot { fill: #8d8d8d; }
.ya-stick { fill: #8a8a8a; }
.ya-knob { fill: #4a4a4a; }
.ya-knob-line { fill: none; stroke: #2a2a2a !important; }
.ya-plate { fill: #3a55a5; }
.ya-bracket { fill: #c3ccd4; }
.ya-collar { fill: #2e4682; }
.ya-shaft { fill: #a9c7e6; }
.ya-shaft-lines { fill: none; stroke: #7fa3c8 !important; }
.ya-edge { fill: #e0812a; stroke-width: 1.4 !important; }
.ya-face { fill: #7e4a1d; stroke: none !important; }
.ya-name { font: 700 14px var(--body); fill: #2b1607; }
.ya-button { fill: #e9e9e9; }

#ya-wheel,
#ya-lever,
.ya-button {
  transform-box: view-box;
}
#ya-wheel {
  transform-origin: 196px 190px;
}
#ya-lever {
  transform-origin: 300px 158px;
}
/* Each pose eases into position, holds, and goes back, over and over. */
@keyframes ya-move {
  0%, 15% { transform: none; }
  45%, 85% { transform: var(--to); }
  100% { transform: none; }
}
@keyframes ya-press {
  0%, 30% { fill: #e9e9e9; }
  45%, 85% { fill: var(--go); }
  100% { fill: #e9e9e9; }
}
.yoke-art[data-pose="out"] #ya-wheel { --to: translate(-14px, 20px) scale(1.12); }
.yoke-art[data-pose="in"] #ya-wheel { --to: translate(10px, -14px) scale(0.9); }
.yoke-art[data-pose="left"] #ya-wheel { --to: rotate(-28deg); }
.yoke-art[data-pose="right"] #ya-wheel { --to: rotate(28deg); }
.yoke-art[data-pose="full"] #ya-lever { --to: rotate(-40deg); }
.yoke-art[data-pose="idle"] #ya-lever { --to: rotate(32deg); }
.yoke-art:is([data-pose="out"], [data-pose="in"], [data-pose="left"], [data-pose="right"]) #ya-wheel,
.yoke-art:is([data-pose="full"], [data-pose="idle"]) #ya-lever {
  animation: ya-move 2.6s ease-in-out infinite;
}
.yoke-art[data-pose="yawleft"] #ya-btn-left,
.yoke-art[data-pose="yawright"] #ya-btn-right {
  animation: ya-press 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .yoke-art #ya-wheel,
  .yoke-art #ya-lever {
    transform: var(--to, none);
  }
  .yoke-art[data-pose="yawleft"] #ya-btn-left,
  .yoke-art[data-pose="yawright"] #ya-btn-right {
    fill: var(--go);
  }
}
.question.big {
  font-size: clamp(22px, 4vh, 30px);
}
.result.problem {
  color: var(--orbit-dark);
}
.wiz-buttons {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}
.wiz-buttons .go {
  min-height: 76px;
  font-size: 30px;
}
.wiz-buttons .plain {
  min-height: 76px;
  font-size: 22px;
}
.wiz-buttons #wiz-skip {
  grid-column: 1 / -1;
  min-height: 52px;
  font-size: 18px;
}

/* Home: lessons in a 3 by 2 grid, the big Start button and the games on the right. */
.view.home {
  grid-template-columns: minmax(0, 1fr) clamp(220px, 24vw, 300px);
  gap: clamp(16px, 2.5vw, 32px);
  height: 100%;
}
.menu[data-view="home"] .menu-body {
  overflow: visible;
}
.home-school {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}
.school-head {
  margin-top: 0;
}
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}
.lesson-grid li {
  display: grid;
}
.lesson-grid .lesson {
  height: 100%;
  min-height: 0;
  padding: 0 14px;
  border: 2px solid var(--line);
  background: var(--paper);
}
.lesson-grid .lesson:hover {
  border-color: var(--ink);
}
.lesson-grid .lesson.next {
  border: 3px solid var(--go);
  background: var(--grass-pale);
}
.lesson-grid .lesson.done .num {
  border-color: var(--grass);
  background: var(--grass);
}
.lesson-grid .lesson .tick {
  visibility: visible;
  width: 22px;
  height: 22px;
  stroke: #fff;
}
.lesson-grid .lesson .name {
  font-size: clamp(17px, 2.6vh, 22px);
  line-height: 1.15;
}
.home-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.go.start {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 3.6vh, 30px);
}
.go.start span {
  font-size: clamp(16px, 2.4vh, 20px);
  font-weight: 600;
}
.home-side .menu-list button {
  padding: 10px 2px;
  font-size: clamp(17px, 2.6vh, 21px);
}
.home-side .fine {
  margin-top: auto;
}

/* Other views fit the panel's height, side by side where needed. */
.name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 620px;
}
.name-form label {
  grid-column: 1 / -1;
  font-weight: 700;
}
.name-form .go {
  width: auto;
  min-width: 160px;
}
.grade-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.class-box {
  margin-top: 0;
}
.swatches {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  max-width: 760px;
}
.menu [data-for="paint"] .go,
.menu [data-for="grade"] > .go {
  max-width: 360px;
}
.view.pilot {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
}
.pilot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pilot-list button {
  min-height: 52px;
  padding: 8px 18px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font: 600 20px var(--head);
}
.pilot-list button[aria-current="true"] {
  background: var(--sky-pale);
}

/* Controls, the pilot's name and Sound, stacked small in the top right corner. */
.menu-corner {
  position: fixed;
  top: calc(16px + var(--st));
  right: calc(16px + var(--sr));
  display: grid;
  background: var(--paper);
  border: 1px solid var(--line);
}
.menu-corner button {
  min-height: 40px;
  padding: 6px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font-weight: 700;
  font-size: 15px;
  color: var(--slate);
  text-align: left;
}
.menu-corner button:last-child {
  border-bottom: 0;
}
.menu-corner button:hover {
  background: var(--sky-pale);
}
.menu[data-view="name"] .menu-corner,
.menu[data-view="grade"] .menu-corner {
  display: none;
}
.load-line {
  left: auto;
  right: calc(32px + var(--sr));
  bottom: calc(6px + var(--sb));
  text-align: right;
}

@media (max-height: 560px) {
  .menu {
    padding-top: 12px;
    padding-bottom: calc(12px + var(--sb));
  }
  .lesson-grid .lesson .num {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
  .home-side .fine {
    display: none;
  }
}
@media (max-width: 900px) {
  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grade-row,
  .view.pilot {
    grid-template-columns: 1fr;
  }
  .swatches {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
#pause-screen {
  z-index: 35;
}
.walk-panel > .back-link {
  justify-self: start;
  margin-bottom: 0;
}
.yoke-go {
  width: auto;
  min-height: 56px;
  font-size: 22px;
}
#yoke-all-ports {
  justify-self: start;
  font-size: 14px;
}
/* Pause and Controls float above dialog backdrops, but only while the HUD is showing. */
#sim-shell > .hud-actions {
  z-index: 32;
}
#sim-shell > .hud-actions button {
  pointer-events: auto;
}
#hud.hidden + .hud-actions {
  display: none;
}
.menu-body {
  height: 100%;
}
.view.home {
  align-content: stretch;
}
#wiz-message:not(.problem) {
  color: var(--grass);
}

/* Last initial, pilot passcode, and joining a class */
.initial-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.initial-row label {
  font-weight: 700;
}
input.initial {
  flex: none;
  width: 72px;
  text-align: center;
  font-size: 24px;
  text-transform: uppercase;
}
input.passcode {
  width: 96px;
  letter-spacing: 0.1em;
}
.class-found-title {
  font-weight: 700;
  font-size: 20px;
  color: var(--grass);
}
.class-col .inline .go {
  width: auto;
  min-height: 52px;
  font-size: 20px;
}
.pilot-list .dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: -1px;
}
html:has(body.page) {
  background: var(--paper);
}
.owner .page-head {
  border-bottom: 0;
}
