:root {
  --ink: #05060f;
  --panel: #0d0f20;
  --raised: #171a31;
  --line: #2b2f4d;
  --text: #eceafb;
  --dim: #8d92b5;
  --cyan: #63f7e0;
  --violet: #a98bff;
  --ember: #ff8a4c;
  --rose: #ff5b93;
  --gold: #ffd58a;
  --gutter: clamp(14px, 3vw, 44px);
  /* Padding inside the arena frame. */
  --inset: clamp(12px, 2vw, 28px);
  --mono:
    ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas,
    monospace;
  --display: "Arial Black", "Helvetica Neue", Impact, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--ink);
  color: var(--text);
  font-family: Arial, "Helvetica Neue", sans-serif;
}
body {
  margin: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ink);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
small {
  display: block;
}
.kicker,
small,
kbd {
  font: 600 10px/1.4 var(--mono);
  letter-spacing: 1.6px;
}

/* Top bar */
header {
  position: relative;
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 var(--gutter);
  background: linear-gradient(#0c0e1e, #080916);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font: italic 900 17px/1 var(--display);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
/* A black disc with a lit rim and a tilted accretion ring. */
.brand i {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #03040b;
  box-shadow:
    0 0 0 1.5px #ffe2b8,
    0 0 12px 2px #ff7a4c;
}
.brand i::after {
  content: "";
  position: absolute;
  inset: 5px -7px 3px;
  border: 2px solid var(--ember);
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-16deg);
}
.online {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 10px/1 var(--mono);
  letter-spacing: 1.6px;
  color: var(--dim);
}
.online em {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
/* Now playing */
#track {
  overflow: hidden;
  font: 600 10px/1 var(--mono);
  letter-spacing: 1.2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--violet);
}
.tools {
  margin-left: auto;
  display: flex;
  gap: 8px;
  font: 600 10px/1 var(--mono);
  letter-spacing: 1.4px;
}
.tools button,
#pause {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #13152a;
}
.tools button:hover,
#pause:hover {
  border-color: #595f8c;
  background: #1b1e39;
}
#audio.off {
  color: var(--dim);
}
/* Audio panel, dropped from the top bar. */
#mixer {
  position: absolute;
  z-index: 4;
  top: calc(100% + 8px);
  right: var(--gutter);
  display: grid;
  grid-template-columns: auto 170px 3ch;
  align-items: center;
  gap: 14px 12px;
  padding: 16px 18px;
  border: 1px solid #5d5488;
  border-radius: 8px;
  background: linear-gradient(140deg, #1b1e38, #110f24 80%);
  box-shadow: 0 12px 40px #05060fcc;
  font: 600 10px/1 var(--mono);
  letter-spacing: 1.6px;
}
#mixer label {
  color: var(--dim);
}
#mixer input {
  width: 100%;
  margin: 0;
  accent-color: var(--cyan);
}
#mixer output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#mixer button {
  grid-column: 1 / -1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #13152a;
  font: inherit;
  letter-spacing: inherit;
}
#mixer button:hover {
  border-color: #595f8c;
  background: #1b1e39;
}
#mixer button[aria-pressed="true"] {
  border-color: var(--rose);
  color: var(--rose);
}
#help {
  width: 32px;
  padding: 0;
  border-radius: 50%;
}

/* Arena: a framed screen with a margin of dark around it, rather than the
   whole window. */
main {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: clamp(8px, 3.2vh, 36px) clamp(10px, 4.6vw, 96px);
}
#arena {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 0 70px #4a2f9a2e;
}
canvas,
.edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.edges,
#glow {
  pointer-events: none;
}
.edges {
  box-shadow: inset 0 0 110px #04050c99;
}

/* Heads-up display */
#hud {
  position: absolute;
  top: 14px;
  left: var(--inset);
  right: var(--inset);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  pointer-events: none;
  font-family: var(--mono);
}
/* The title has no run to show, and game over sums it up in its own panel. */
body[data-state="menu"] #hud,
body[data-state="over"] #hud {
  display: none;
}
.cluster {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  min-width: 0;
}
.cluster.end {
  justify-content: flex-end;
}
.stat small,
#bomb small {
  margin-bottom: 7px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 1.8px;
  color: var(--dim);
}
.stat b {
  display: block;
  font: 700 22px/1 var(--mono);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  text-shadow: 0 0 14px #63f7e066;
}
.stat.quiet b {
  font-size: 13px;
  line-height: 18px;
  color: #c4c7e4;
  text-shadow: none;
}
#chain {
  font: italic 900 21px/1 var(--display);
  color: var(--rose);
  text-shadow: 0 0 14px #ff5b93aa;
}
.bar {
  position: relative;
  width: clamp(140px, 22vw, 300px);
  height: 6px;
  /* 6 + 8 matches the 14px line the pips beside it sit on. */
  margin: 4px 0;
  background: #ffffff14;
  outline: 1px solid #ffffff26;
}
.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
  transition: width 0.25s;
}
.cluster.mid small {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--text);
}
#left {
  color: var(--dim);
}
.bar.short {
  width: 58px;
}
.bar.short i {
  background: #67708f;
  box-shadow: none;
  transition: none;
}
.bar.short.ready i {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
#bomb {
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--mono);
}
#bombs,
#health {
  display: block;
  height: 14px;
  font-size: 13px;
  line-height: 14px;
  letter-spacing: 4px;
}
#bombs {
  color: var(--gold);
  text-shadow: 0 0 10px #ffd58a77;
}
#bomb:hover #bombs {
  color: #fff;
}
#bomb:disabled {
  opacity: 0.45;
  cursor: default;
}
#health {
  color: var(--rose);
  text-shadow: 0 0 10px #ff5b9388;
}
#pause {
  pointer-events: auto;
  align-self: center;
  width: 32px;
  padding: 0;
  font-size: 12px;
}

/* Banners */
#eventLabel {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 1px solid #8b6a4d;
  background: #1a1420e6;
  color: var(--gold);
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.6px;
  text-align: center;
  pointer-events: none;
}
#alert {
  position: absolute;
  top: 112px;
  left: 50%;
  transform: translateX(-50%) skewX(-5deg);
  font: italic 900 clamp(20px, 3.2vw, 38px) / 1 var(--display);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-align: center;
  color: #fff;
  text-shadow:
    0 0 20px #b28cff,
    0 3px 0 #1a1030;
  pointer-events: none;
}
#alert small {
  margin-top: 9px;
  color: #d9d0ee;
  font-size: 11px;
  letter-spacing: 2px;
  text-shadow: 0 1px 0 #000;
}
#alert.good {
  color: #c4fff3;
  text-shadow:
    0 0 22px #36ffd2,
    0 3px 0 #06231f;
}
#alert.crit {
  color: #ffe1e3;
  text-shadow:
    0 0 24px #ff2742,
    0 0 4px #ff2742,
    0 3px 0 #2b0509;
  animation: alarm 0.36s steps(2, jump-none) infinite;
}
/* One meter per open black hole, left to right as they sit in the arena. */
#massMeters {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  pointer-events: none;
}
body[data-state="menu"] #massMeters,
body[data-state="over"] #massMeters {
  display: none;
}
.meter {
  --hole: #b79cff;
  display: flex;
  align-items: center;
  gap: 11px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 1.8px;
  white-space: nowrap;
  color: var(--hole);
  text-shadow: 0 0 10px var(--hole);
}
.meter .track {
  position: relative;
  width: clamp(70px, 11vw, 190px);
  height: 7px;
  background: #ffffff12;
  outline: 1px solid #ffffff30;
}
.meter i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--hole);
  box-shadow: 0 0 14px var(--hole);
  transition: width 0.12s linear;
}
/* What breaking the hole would pay. */
.meter b {
  color: var(--gold);
  text-shadow: 0 0 10px #ffd58a66;
}
.meter em {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: #ffffff8c;
}
.meter.crit {
  animation: alarm 0.36s steps(2, jump-none) infinite;
}
@keyframes alarm {
  to {
    opacity: 0.62;
  }
}

/* Title, pause and game-over screens. The title floats over the arena; the
   other two sit on a panel. */
#menu {
  position: absolute;
  z-index: 1;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
}
#menu:not([data-mode="start"]) {
  top: 50%;
  width: min(600px, calc(100% - 2 * var(--inset)));
  padding: 28px 30px 20px;
  border: 1px solid #5d548880;
  border-radius: 12px;
  background: linear-gradient(160deg, #171a34eb, #0b0c1bf5);
  box-shadow:
    0 0 0 100vmax #05060f8c,
    0 24px 70px #05060fcc;
  pointer-events: auto;
}
#menu:not([data-mode="start"]) :is(h1, .kicker),
#menu[data-mode="start"] #menuTitle {
  display: none;
}
/* A soft scrim keeps the title legible over whatever is behind it. */
#menu[data-mode="start"]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -16% 12%;
  background: radial-gradient(
    closest-side,
    #05060fd9,
    #05060f8c 55%,
    transparent
  );
}
.kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 3px;
}
.kicker s {
  width: 32px;
  height: 1px;
  background: #63f7e099;
}
h1 {
  margin: 22px 0 20px;
  font: italic 900 clamp(54px, min(11vw, 16vh), 168px) / 0.8 var(--display);
  letter-spacing: -0.075em;
  transform: skewX(-5deg);
  filter: drop-shadow(0 5px 0 #160d2c) drop-shadow(0 0 26px #05060f);
}
h1 span,
h1 strong,
#menuTitle {
  display: block;
  width: fit-content;
  margin: auto;
  /* Room for the italic overhang, which the clipped gradient must cover. */
  padding: 0.03em 0.2em 0 0.04em;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1 span,
#menuTitle {
  background-image: linear-gradient(
    #fff 12%,
    #ece5ff 40%,
    #9f95d6 78%,
    #dcd5ff
  );
  -webkit-text-stroke: 1px #e6dcff;
}
/* The second word burns like the disk: gold through ember to rose. */
h1 strong,
#menu[data-mode="over"] #menuTitle {
  background-image: linear-gradient(
    #fffadf 8%,
    #ffd47c 30%,
    #ff8a3c 51%,
    #ff3d7f 57%,
    #ff86b4 80%,
    #ffd9e8
  );
  -webkit-text-stroke: 1px #ffb685;
}
h1 strong {
  font-size: 1.5em;
  line-height: 0.86;
}
#menuTitle {
  margin-bottom: 4px;
  font: italic 900 clamp(34px, 6vw, 58px) / 0.9 var(--display);
  letter-spacing: -0.05em;
  transform: skewX(-5deg);
}
#tag {
  margin: 12px 0 22px;
  font-size: 16px;
  color: #dcd6ee;
  text-shadow: 0 1px 8px #05060f;
}
#menu:not([data-mode="start"]) #tag {
  margin: 10px 0 20px;
  font: 600 12px/1 var(--mono);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--dim);
}
/* The run in numbers, on the game-over screen. */
#summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 12px;
  margin: 0 0 20px;
  padding: 18px 0;
  border-block: 1px solid #ffffff14;
  font-family: var(--mono);
}
#summary b {
  display: block;
  font: 700 20px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
#summary div:first-child b {
  color: var(--cyan);
  text-shadow: 0 0 14px #63f7e066;
}
#summary small {
  margin-top: 7px;
  color: var(--dim);
}
/* The modules the ship is carrying, on the pause and game-over screens. */
#loadout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 22px;
  font: 600 11px/1 var(--mono);
}
#loadout small {
  flex-basis: 100%;
  margin-bottom: 4px;
  color: var(--dim);
}
#loadout span {
  padding: 6px 9px;
  border: 1px solid #40406a;
  border-left: 3px solid var(--kind);
  border-radius: 5px;
  background: #0d0f20b3;
  color: #e6dff5;
}
#loadout span b {
  margin-left: 7px;
  color: var(--kind);
}
#loadout em {
  font-style: normal;
  color: var(--dim);
}
#menuButtons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#menuButtons button {
  pointer-events: auto;
  min-width: 250px;
  padding: 13px 30px;
  border: 0;
  background: #262a4d;
  font-weight: 900;
  letter-spacing: 1px;
  clip-path: polygon(
    9px 0,
    100% 0,
    100% calc(100% - 9px),
    calc(100% - 9px) 100%,
    0 100%,
    0 9px
  );
}
#menuButtons #play {
  padding-block: 15px;
  background: var(--cyan);
  color: #08171c;
}
#play span {
  margin-right: 9px;
}
/* The choice the keyboard or controller is on. */
#menuButtons button.sel {
  background: #3b4072;
  box-shadow: inset 0 0 0 2px #fff;
}
#menuButtons #play.sel {
  background: var(--cyan);
  box-shadow: inset 0 0 0 3px #fff;
}
#record,
#hint {
  margin-top: 13px;
  color: var(--dim);
}
#record:empty {
  display: none;
}
#record {
  color: var(--gold);
}
/* The controls, along the bottom of the title screen. */
#legend {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  margin: 0;
  text-align: center;
  font: 600 10px/2.2 var(--mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}
body:not([data-state="menu"]) #legend {
  display: none;
}
#legend kbd {
  margin: 0 3px 0 14px;
  text-transform: none;
}
#legend kbd + kbd {
  margin-left: 0;
}

/* On the title screen the black hole takes the right of a wide window and
   the title the left; game.js uses the same 1000px breakpoint. */
@media (min-width: 1001px) {
  #menu[data-mode="start"] {
    left: calc(var(--inset) + 3vw);
    width: auto;
    transform: translateY(-50%);
    text-align: left;
  }
  #menu[data-mode="start"]::before {
    display: none;
  }
  #menu[data-mode="start"] .kicker {
    justify-content: flex-start;
  }
  #menu[data-mode="start"] h1 {
    font-size: clamp(54px, min(8.6vw, 17vh), 150px);
  }
  #menu[data-mode="start"] h1 span,
  #menu[data-mode="start"] h1 strong {
    margin-inline: 0;
  }
  #menu[data-mode="start"] #menuButtons {
    flex-direction: row;
  }
  #menu[data-mode="start"] #menuButtons button {
    min-width: 0;
  }
}
@media (max-width: 1000px) {
  #menu[data-mode="start"] {
    top: 56%;
  }
}

/* How to play: a tabbed guide over the arena. */
#guide {
  position: absolute;
  z-index: 3;
  inset: 4% max(3%, calc(50% - 480px));
  display: flex;
  flex-direction: column;
  border: 1px solid #5d5488;
  border-radius: 12px;
  background: linear-gradient(140deg, #1b1e38, #110f24 80%);
  box-shadow: 0 0 0 100vmax #05060fb8;
}
.guide-head {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding: 18px 16px 0 24px;
  border-bottom: 1px solid var(--line);
}
.guide-head h2 {
  margin: 0 0 13px;
  font: italic 900 22px/1 var(--display);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
#guideTabs {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
#guideTabs button {
  padding: 11px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: 600 11px/1 var(--mono);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
}
#guideTabs button:hover {
  color: var(--text);
}
#guideTabs button[aria-selected="true"] {
  border-color: var(--cyan);
  color: var(--cyan);
}
#close {
  align-self: center;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #13152a;
}
#close:hover {
  border-color: #595f8c;
  background: #1b1e39;
}
#guideBody {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 26px;
  font-size: 14px;
  line-height: 1.55;
  color: #cfc8e2;
}
#guideBody:focus {
  outline: none;
}
#guideBody h3 {
  margin: 24px 0 10px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
}
#guideBody :is(h3, p):first-child {
  margin-top: 0;
}
#guideBody p {
  max-width: 70ch;
  margin: 0 0 12px;
}
#guideBody ul {
  max-width: 74ch;
  margin: 0;
  padding-left: 18px;
}
#guideBody li {
  margin-bottom: 8px;
}
#guideBody b {
  color: var(--text);
}
#guideBody a {
  color: var(--violet);
}
#guideBody table {
  width: 100%;
  border-collapse: collapse;
}
#guideBody :is(th, td) {
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid #ffffff12;
  text-align: left;
  vertical-align: top;
}
#guideBody th {
  font: 600 10px/1.4 var(--mono);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--dim);
}
#guideBody td:first-child {
  white-space: nowrap;
  color: var(--text);
}
/* Enemy and boss cards. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border: 1px solid #40406a;
  border-left: 3px solid var(--kind);
  border-radius: 6px;
  background: #0d0f2099;
}
.card > img {
  width: 44px;
  height: 44px;
  margin: -4px -3px;
}
/* The elite version, small, beside what it adds. */
.card p img {
  width: 26px;
  height: 26px;
  margin: -8px 2px -8px -5px;
  vertical-align: middle;
}
.card b {
  font: 700 12px/1 var(--mono);
  letter-spacing: 1.6px;
}
.card small {
  display: inline;
  margin-left: 8px;
  color: var(--dim);
}
.card p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
.card em {
  margin-right: 6px;
  font: 600 9px/1 var(--mono);
  letter-spacing: 1.4px;
  font-style: normal;
  color: var(--kind);
}
.card button {
  align-self: start;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #13152a;
  font-size: 10px;
}
.card button:hover {
  border-color: var(--kind);
  color: var(--kind);
}
/* The module list, one block per family. */
#guideMods h3 {
  color: var(--kind);
}
#guideMods dl {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0;
}
#guideMods dt {
  color: var(--text);
  white-space: nowrap;
}
#guideMods dt small {
  margin-top: 2px;
  letter-spacing: 1px;
  color: var(--dim);
}
#guideMods dd {
  margin: 0;
}
.guide-foot {
  padding: 10px 24px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}
kbd {
  display: inline-block;
  min-width: 22px;
  margin-right: 3px;
  padding: 2px 5px;
  border: 1px solid #4b4f76;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #1c1f3a;
  color: var(--text);
  letter-spacing: 0;
  text-align: center;
}

/* Refit offer. It is picked on the fly with the number keys or the D-pad, so
   it never takes the mouse, and it steps back once it has been seen. */
#refit {
  position: absolute;
  z-index: 2;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 2 * var(--inset)));
  pointer-events: none;
  font-family: var(--mono);
}
body[data-state="menu"] #refit,
body[data-state="over"] #refit {
  display: none;
}
/* Paused, the cards open up to show their descriptions, so the pause menu
   moves up out of their way and drops what it can. */
body.refit[data-state="pause"] #menu {
  top: 33%;
  padding-block: 18px 14px;
}
body.refit[data-state="pause"] :is(#loadout, #hint) {
  display: none;
}
#refit > p {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 7px;
  font: 600 10px/1 var(--mono);
  letter-spacing: 1.8px;
  color: var(--dim);
  text-shadow: 0 1px 4px #05060f;
}
#refit > p b {
  color: var(--cyan);
  text-shadow: 0 0 10px #63f7e088;
}
#refit > p em {
  font-style: normal;
  color: var(--gold);
}
#refit > p em:empty {
  display: none;
}
#refit s {
  text-decoration: none;
}
body[data-state="pause"] #refit s {
  display: none;
}
body[data-input="keys"] .for-pad,
body[data-input="pad"] .for-keys {
  display: none;
}
#choices {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  column-gap: 10px;
  min-width: 0;
  padding: 8px 10px 9px;
  border: 1px solid #40406a;
  border-left: 3px solid var(--kind);
  border-radius: 6px;
  background: #0d0f20d9;
  animation:
    arrive 0.28s ease-out,
    settle 0.8s 6s forwards;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes settle {
  to {
    opacity: 0.62;
  }
}
/* The key to press sits beside the name; the rest runs the full width. */
.choice kbd {
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 26px;
  margin: 0;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1;
  color: #fff;
}
.choice i {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 600 9px/1 var(--mono);
  letter-spacing: 1.3px;
  white-space: nowrap;
  color: var(--kind);
}
.choice i em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  color: var(--dim);
}
.choice b {
  overflow: hidden;
  margin-top: 5px;
  font:
    700 15px/1.1 Arial,
    sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #f1ecff;
}
.choice > span,
.choice p {
  grid-column: 1 / -1;
}
.choice > span {
  margin-top: 8px;
  font: 600 11px/1.3 var(--mono);
  color: var(--cyan);
}
.choice p {
  display: none;
  margin: 7px 0 0;
  font:
    12px/1.4 Arial,
    sans-serif;
  color: #c2bcd6;
}
body[data-state="pause"] .choice {
  pointer-events: auto;
  cursor: pointer;
  animation: none;
}
body[data-state="pause"] .choice:hover {
  background: #1b1e39;
}
body[data-state="pause"] .choice p {
  display: block;
}
/* A touch screen has no number keys, so its cards take taps. */
@media (pointer: coarse) {
  .choice {
    pointer-events: auto;
  }
}

@media (max-width: 760px) {
  .online,
  #track,
  .stat.quiet,
  #legend {
    display: none;
  }
  #hud {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }
  .cluster {
    gap: 12px;
  }
  .stat b {
    font-size: 17px;
  }
  .bar {
    width: auto;
    min-width: 70px;
  }
  #summary {
    grid-template-columns: repeat(2, 1fr);
  }
  #menu:not([data-mode="start"]) {
    padding-inline: 16px;
  }
  .guide-head {
    flex-wrap: wrap;
    gap: 0 12px;
    padding-left: 16px;
  }
  .guide-head h2 {
    flex: 1;
  }
  #guideTabs {
    order: 3;
    flex-basis: 100%;
  }
  #guideBody {
    padding: 16px;
  }
  #guideMods dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  #guideMods dd {
    margin-bottom: 10px;
  }
  #alert small {
    letter-spacing: 0.5px;
    white-space: normal;
  }
  /* Two rows of two, and only the essentials on each card. */
  #choices {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .choice i em,
  #refit s {
    display: none;
  }
}
@media (max-width: 560px) {
  .cluster.end .stat:first-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #alert.crit,
  .meter.crit {
    animation: none;
  }
  .choice {
    animation: settle 0s 6s forwards;
  }
  .bar i {
    transition: none;
  }
}
