body {
  background: radial-gradient(ellipse at 10% 12%, #dcd6e9, transparent 45%), #f1eddd;
  color: #363447;
  font:
    650 16px/1.44 Nunito,
    sans-serif;
}
header {
  background: #302b46;
  border-bottom: 3px solid #9f8869;
}
.top,
main,
footer {
  max-width: 1270px;
}
.top nav a {
  color: #fff2d0;
}
main {
  padding-top: 21px;
}
a {
  color: #4b5075;
}
footer {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid #b7b1b6;
  margin-top: 20px;
  padding-block: 17px;
}
.night-poster {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  border: 2px solid #514459;
  border-radius: 13px 48px 13px 13px;
  overflow: hidden;
  box-shadow: 0 5px #bcaf9e;
  background: #39334c;
  color: #fff0c9;
}
.night-poster > img {
  width: 100%;
  height: 100%;
  max-height: 440px;
  object-fit: cover;
}
.night-poster > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(20px, 3vw, 44px);
  background: radial-gradient(ellipse at 95% 4%, #5b516c, transparent 70%);
}
.school-star {
  color: #ffd480;
  font: 2.6rem Georgia;
}
.night-poster h1,
.school-heading h1 {
  font:
    750 clamp(42px, 5vw, 72px)/0.94 Pixel,
    monospace;
  letter-spacing: -0.04em;
  margin: 0;
}
.night-poster p {
  color: #f6e6ce;
  max-width: 35ch;
}
.night-poster > a,
.night-poster > div > a + a {
  color: #f4d99f;
  margin-top: 13px;
}
.fly-go,
#flight button {
  border-radius: 7px;
  padding: 8px 13px;
  font:
    850 0.93rem Nunito,
    sans-serif;
  min-height: 39px;
  text-decoration: none;
  background: #504967;
  color: #fff0cb;
  border: 1px solid #40394f;
  box-shadow: 0 2px #383349;
}
.night-poster .fly-go {
  background: #f7d58c;
  color: #44384d;
  border-color: #ac956d;
}
.stations {
  margin: 25px 0;
}
.stations > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stations h2,
.flight-guide h2,
.race-desk h2,
.field h3,
.race-desk h3 {
  font:
    700 1.8rem/1.06 Pixel,
    monospace;
  color: #45445a;
  margin: 0 0 12px;
}
.stations a {
  padding: 13px;
  background: #fff9e9;
  border: 1px solid #b1a4a1;
  border-bottom: 3px solid #ae9c94;
  border-radius: 11px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: #3f3b50;
}
.stations i {
  font: 1.6rem Georgia;
  color: #ffd788;
  background: #514863;
  width: 40px;
  height: 44px;
  border-radius: 18px 18px 8px 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stations small,
.stations strong,
.stations em {
  display: block;
}
.stations strong {
  font:
    700 1.25rem/1.05 Pixel,
    monospace;
}
.stations em {
  font-size: 0.8rem;
  color: #655770;
  font-style: normal;
  margin-top: 3px;
}
.stations small,
.school-heading small {
  color: #795c47;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.flight-nav,
.ff-controls,
.wing-badge,
.ff-instruments,
.policy-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.flight-nav a {
  border: 1px solid #ada4b3;
  background: #fbf8ef;
  color: #514961;
  text-decoration: none;
  border-radius: 18px;
  padding: 5px 11px;
  font-size: 0.87rem;
}
.flight-nav a[aria-current='page'] {
  background: #514863;
  color: #ffedc8;
}
.school-heading {
  margin: 18px 0 16px;
}
.school-heading h1 {
  font-size: clamp(34px, 4vw, 56px);
  margin: 5px 0;
  color: #343748;
}
.school-heading p {
  max-width: 85ch;
  margin: 6px 0;
}
.flight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}
.field,
.race-desk,
.flight-guide {
  border: 1px solid #afa7ae;
  background: #fffaf0;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 3px #c8c1b1;
}
.field,
.race-desk,
.flight-guide > div {
  padding: clamp(14px, 2vw, 23px);
}
.flight-window {
  position: relative;
  width: 100%;
  height: clamp(200px, 21.5vw, 300px);
  border: 2px solid #887b86;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(#3b3652, #495776);
  margin-bottom: 9px;
}
.flight-window canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.flight-guide > img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  object-position: center 52%;
  display: block;
}
.flight-guide a,
.hint {
  font-size: 0.87rem;
}
.ff-controls,
.ff-instruments,
.policy-strip,
.ff-roll,
.result-tapes {
  margin: 10px 0;
}
.ff-instruments,
.policy-strip {
  align-items: stretch;
}
.ff-instruments span,
.policy-strip span,
.spools span {
  background: #e9e5eb;
  border: 1px solid #cac1c8;
  border-radius: 7px;
  padding: 6px 9px;
  flex: 1;
  font-size: 0.8rem;
  min-width: 77px;
}
.ff-instruments b,
.policy-strip b,
.spools b {
  display: block;
  font-size: 1rem;
  color: #45455a;
  font-variant-numeric: tabular-nums;
}
.ff-roll,
.result-tapes {
  display: grid;
  gap: 4px;
}
.ff-roll span,
.result-tapes span {
  background: #e9eada;
  padding: 5px 8px;
  border-left: 3px solid #9ba485;
  font-size: 0.86rem;
}
.flight-note {
  background: #f5e5b4;
  color: #474434;
  padding: 9px 12px;
  border-radius: 6px;
}
.flight-note:empty {
  display: none;
}
.wing-badge {
  margin-top: 12px;
  background: #e5ead6;
  border: 1px solid #b8bba6;
  padding: 10px;
  border-radius: 8px;
  justify-content: space-between;
}
.flight-grid + button {
  margin-top: 15px;
}
#flight button[aria-pressed='true'] {
  background: #f1ce8c;
  color: #4d4046;
  border: 2px solid #977954;
}
#flight button[disabled] {
  opacity: 0.52;
  cursor: default;
}
.tape-choice,
.lamp-option {
  background: #f1e9d7;
  border-radius: 8px;
  border: 1px solid #d1bda3;
  padding: 8px 10px;
  margin: 7px 0;
}
.tape-choice .ff-controls {
  margin: 4px 0 0;
}
.field h3,
.race-desk h3 {
  font-size: 1.42rem;
  margin: 16px 0 7px;
}
.glow-poster {
  background: radial-gradient(ellipse at 50% 70%, #756174, transparent 65%), #3a3550;
  color: #fbe6ac;
  text-align: center;
  padding: 14px;
  border-radius: 42px 42px 9px 9px;
}
.glow-poster span,
.glow-poster b,
.glow-poster small {
  display: block;
}
.glow-poster span {
  font: 2rem Georgia;
}
.glow-bars {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}
.glow-bars > div {
  display: grid;
  grid-template-columns: 67px 1fr 57px;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
}
.glow-bars i {
  height: 13px;
  border-radius: 9px;
  overflow: hidden;
  background: #e5dfd8;
}
.glow-bars em {
  display: block;
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #aea1c1, #8c6f96);
}
.glow-bars > div:nth-child(2) em {
  background: #74a39c;
}
.glow-bars > div:nth-child(3) em {
  background: #d2aa65;
}
.lamp-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lamp-option span {
  font-size: 0.84rem;
}
.spools,
.wind-gates,
.wind-policy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.spools span {
  background: #f4dfb6;
}
.ribbon-made,
.finish-banner {
  background: #eee2c5;
  border: 1px solid #c9b68f;
  border-radius: 7px;
  padding: 10px;
}
.tool-cards {
  display: grid;
  gap: 5px;
}
.tool-cards > div {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
}
.role-agent {
  background: #e7e3ed;
}
.role-tool {
  background: #e3ece0;
}
.role-user {
  background: #f6e8c9;
}
.tool-cards small {
  font-size: 0.73rem;
  color: #605866;
}
.tool-cards span {
  font-size: 0.87rem;
}
.tool-cards button {
  min-height: 31px !important;
  font-size: 0.75rem !important;
  padding: 3px 7px !important;
}
.wind-gates {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.wind-gates button,
.wind-policy button {
  padding: 4px !important;
}
.wind-gates small,
.wind-gates b,
.wind-policy small,
.wind-policy b {
  display: block;
}
.wind-gates b {
  font-size: 1.4rem;
}
.race-desk label {
  display: block;
  margin-top: 14px;
  font-size: 0.86rem;
}
.race-desk input {
  width: 100%;
  display: block;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #b6aeb5;
  border-radius: 6px;
  background: #fffdf4;
  color: #4c4863;
}
.beat-clock {
  background: #ddd9d1;
  border-radius: 8px;
  height: 9px;
  overflow: hidden;
}
.beat-clock i {
  display: block;
  height: 100%;
  background: #af8552;
  transform-origin: left;
  animation: flight-beat var(--time) linear forwards;
}
@keyframes flight-beat {
  to {
    transform: scaleX(0);
  }
}
@media (max-width: 780px) {
  .top {
    gap: 14px;
  }
  .top nav {
    gap: 9px;
  }
  .stations > div {
    grid-template-columns: 1fr 1fr;
  }
  .flight-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  .night-poster,
  .flight-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .night-poster > img {
    height: 228px;
    max-height: none;
  }
  .night-poster > div {
    padding: 17px;
  }
  .school-star {
    display: none;
  }
  .night-poster h1 {
    font-size: 3rem;
  }
  .night-poster h1 br {
    display: none;
  }
  .night-poster p {
    max-width: none;
  }
  .stations a {
    gap: 6px;
    padding: 8px;
    align-items: flex-start;
  }
  .stations i {
    width: 27px;
    height: 34px;
    font-size: 1.1rem;
  }
  .stations strong {
    font-size: 1.07rem;
  }
  .flight-nav {
    gap: 4px;
  }
  .flight-nav a {
    font-size: 0.81rem;
  }
  .flight-guide > img {
    height: 102px;
  }
  .top {
    flex-wrap: wrap;
    padding-block: 8px;
  }
  .brand {
    font-size: 23px;
  }
  .top nav {
    font-size: 0.8rem;
  }
  .tool-cards > div {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }
  .ff-controls button {
    padding: 6px 9px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .beat-clock i {
    animation: none;
  }
}

.dock-swap {
  background: #e9efdf;
  border: 1px solid #adbaa3;
  padding: 11px;
  border-radius: 8px;
  margin-top: 12px;
}
.dock-swap h3 {
  margin: 2px 0 7px;
}
