:root {
  color-scheme: dark;
  --bg: #080a10;
  --panel: #12151ddd;
  --line: #ffffff16;
  --muted: #8b929f;
  --text: #edece7;
  --orange: #ffac78;
  --mint: #a2e8ce;
  --purple: #b79aff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.5 Inter,
    "Segoe UI",
    system-ui,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}
button {
  transition:
    background 0.2s,
    transform 0.2s,
    border-color 0.2s;
}
button:hover:not(:disabled) {
  transform: translateY(-2px);
}
input,
select {
  width: 100%;
  background: #ffffff05;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px 12px;
  min-height: 44px;
}
input:focus,
select:focus {
  outline: 1px solid var(--purple);
}
select option {
  background: #171923;
}
input::placeholder {
  color: #686e7c;
}
label {
  display: block;
  color: #9da2af;
  font-size: 11px;
  letter-spacing: 0.2px;
}
label input,
label select {
  display: block;
  margin-top: 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
p {
  color: #a6adbc;
}
h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -1px;
}
.muted {
  font-size: 12px;
  color: var(--muted);
}
small,
.eyebrow,
.section-title,
.edition,
.hero-meta,
.orbit-label,
.ship-caption,
footer {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
}
.eyebrow {
  color: var(--orange);
}
.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 9px #a2e8ce77;
}
.primary,
.secondary,
.icon-button {
  border-radius: 5px;
  padding: 11px 16px;
  min-height: 42px;
}
.primary {
  background: var(--orange);
  border: 1px solid var(--orange);
  color: #221a16;
  font-weight: 650;
}
.primary span {
  float: right;
}
.primary:hover {
  background: #ffbf97;
}
.secondary,
.icon-button {
  background: #ffffff05;
  border: 1px solid #ffffff22;
  color: #c7cbd5;
}
.icon-button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}
.section-title {
  color: #9ba2b1;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(15px);
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, #080a1088, transparent 60%),
    linear-gradient(0deg, #080a10, transparent 65%);
}
.topbar {
  height: 82px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  gap: 34px;
  position: relative;
  border-bottom: 1px solid var(--line);
  z-index: 10;
  background: #080a1040;
}
.brand {
  color: var(--text);
  font-size: 29px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -2px;
}
.brand span {
  font-weight: 350;
}
.brand sup {
  font-size: 11px;
  position: relative;
  top: -7px;
  left: 3px;
}
.edition {
  color: #8f96a5;
  font-size: 9px;
  letter-spacing: 1.7px;
}
.edition i {
  font-style: normal;
  padding: 0 14px;
  color: #53606d;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
#connection {
  font-size: 10px;
  color: #b2b9c4;
}
#lobby-screen {
  position: relative;
}
.hero {
  height: 408px;
  position: relative;
  padding: 45px 5vw 0;
}
.intro {
  max-width: 490px;
}
h1 {
  font-size: clamp(50px, 6vw, 86px);
  font-weight: 650;
  letter-spacing: -5px;
  line-height: 0.94;
  margin: 21px 0 22px;
  position: relative;
}
h1 span {
  color: #a1a6b1;
}
h1 b {
  position: absolute;
  left: 93%;
  top: 0;
  font-size: 36px;
  color: var(--orange);
  font-weight: 300;
}
.intro p {
  font-size: 13px;
  line-height: 1.8;
}
.hero-meta {
  display: flex;
  gap: 20px;
  color: #6f7c8d;
  font-size: 8px;
  margin-top: 22px;
}
.ship-caption {
  position: absolute;
  right: 12%;
  bottom: 36px;
  color: var(--orange);
  display: grid;
  gap: 7px;
  font-size: 11px;
}
.ship-caption small {
  font-size: 8px;
  color: #929aa9;
}
.ship-caption .dot {
  margin-left: 10px;
}
.orbit-label {
  position: absolute;
  right: 4vw;
  top: 48px;
  writing-mode: vertical-rl;
  color: #86909e;
  font-size: 8px;
}
.orbit-label span {
  color: #5c6370;
}
.command-deck {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 42px;
  margin: 0 5vw;
  padding: 27px 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, #080a10bb, #080a1050);
}
.ship-panel,
.launch-panel {
  min-width: 0;
}
.ship-select {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ship-choice {
  border: 1px solid var(--line);
  background: #11151bcc;
  color: #9da6b3;
  border-radius: 5px;
  padding: 10px 4px;
  display: grid;
  justify-items: center;
  gap: 5px;
  position: relative;
}
.ship-choice img {
  width: 47px;
  height: 47px;
}
.ship-choice span {
  font-size: 10px;
}
.ship-choice.active {
  border-color: var(--ship-color);
  background: #ffffff08;
  color: var(--text);
}
.ship-choice.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  width: 35%;
  height: 2px;
  background: var(--ship-color);
}
#ship-detail {
  margin-top: 24px;
}
#ship-detail h2 {
  margin: 0 0 6px;
  font-size: 23px;
}
#ship-detail h2 small {
  float: right;
  color: var(--orange);
  letter-spacing: 0;
  font-family: inherit;
  font-size: 10px;
  margin-top: 9px;
}
#ship-detail p {
  font-size: 12px;
  min-height: 40px;
  max-width: 430px;
}
.ship-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ship-stat small {
  font-size: 9px;
  color: #777f8e;
  letter-spacing: 0;
}
.ship-stat b {
  float: right;
  font-weight: 400;
  font-size: 11px;
  color: #c5cad5;
}
.stat-line {
  height: 3px;
  background: #ffffff0c;
  margin-top: 7px;
}
.stat-line i {
  display: block;
  height: 100%;
  background: #9eacc3;
}
.starting {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: #a5aeba;
  margin-top: 20px;
}
.starting img {
  width: 33px;
  height: 33px;
  background: #ffffff06;
  border-radius: 4px;
}
.howto {
  margin-top: 20px;
  font-size: 11px;
}
summary {
  cursor: pointer;
  color: #9da5b5;
  list-style: none;
  font-size: 11px;
  padding: 10px 0;
}
.howto p {
  margin-top: 14px;
  font-size: 12px;
}
.recipe {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
  font-size: 10px;
  color: #9ca8ba;
}
.recipe img {
  width: 24px;
  height: 24px;
}
.recipe span {
  margin-left: auto;
  color: #bba6e4;
}
.form-pair {
  display: flex;
  gap: 12px;
  align-items: end;
}
.form-pair > label {
  flex: 1;
  min-width: 0;
}
.launch-panel label {
  margin-bottom: 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  max-width: 110px;
  white-space: nowrap;
}
.check input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--orange);
}
#create {
  width: 100%;
  margin: 2px 0 10px;
}
.join {
  display: flex;
  gap: 8px;
}
.join input {
  min-width: 0;
  font-size: 10px;
  letter-spacing: 1px;
}
.join button {
  white-space: nowrap;
}
.rooms {
  display: grid;
  gap: 7px;
  max-height: 160px;
  overflow: auto;
}
.room-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: #d2d7e1;
  background: #ffffff05;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 4px;
}
.room-entry small {
  font-size: 8px;
  color: #919cad;
  letter-spacing: 0;
}
.rooms .empty {
  font-size: 11px;
  color: #697384;
  padding: 7px 0;
}
#room-count {
  float: right;
  color: var(--mint);
}
.code-pill {
  border: 1px solid #ffac7840;
  color: var(--orange);
  background: #ffac7809;
  padding: 9px 15px;
  border-radius: 4px;
  font: 18px monospace;
  letter-spacing: 5px;
}
.players {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}
.pilot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: #ffffff04;
}
.pilot-row img {
  width: 30px;
  height: 30px;
}
.pilot-row small {
  margin-left: auto;
  color: #9c8abd;
  font-size: 9px;
}
#start,
#leave {
  width: 100%;
  margin: 5px 0;
}
.hangar {
  position: relative;
  margin: 10px 5vw 0;
  border-top: 1px solid var(--line);
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 30px;
  background: #080a10a0;
}
.hangar h2 {
  font-size: 23px;
  margin: 7px 0;
}
.hangar p {
  font-size: 12px;
}
.hangar p b {
  font-size: 20px;
  color: var(--orange);
  font-weight: 500;
}
.hangar-upgrades {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.upgrade {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #11151bc9;
}
.upgrade b {
  font-size: 11px;
  font-weight: 500;
}
.upgrade p {
  font-size: 10px;
  margin: 7px 0 10px;
}
.upgrade button {
  width: 100%;
  padding: 7px 4px;
  font-size: 10px;
  min-height: 32px;
}
.upgrade small {
  float: right;
  color: #9384ab;
  letter-spacing: 0;
}
footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 23px 5vw;
  color: #626b7b;
  font-size: 8px;
}
#hud {
  position: fixed;
  inset: 82px 0 0;
  pointer-events: none;
}
#hud button {
  pointer-events: auto;
}
.hud-pilot {
  position: absolute;
  top: 23px;
  left: 24px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
}
.hud-pilot > img {
  width: 46px;
  height: 46px;
}
.hud-pilot > div {
  flex: 1;
}
.hud-pilot small {
  font-size: 9px;
  letter-spacing: 1px;
  color: #9aa7b7;
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-pilot b {
  font-size: 17px;
  letter-spacing: 2px;
  font-weight: 500;
}
.hud-pilot span {
  font: 9px monospace;
  color: #9cafb1;
}
.health,
.boss-health {
  height: 4px;
  background: #ffffff15;
  margin: 6px 0;
}
.health i {
  height: 100%;
  display: block;
  background: var(--mint);
  transition: width 0.2s;
}
.hud-clock {
  position: absolute;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.hud-clock small {
  font-size: 8px;
  display: block;
  letter-spacing: 2px;
  color: #9da9bd;
}
.hud-clock > b {
  font: 38px/1.5 monospace;
  letter-spacing: -2px;
}
.hud-clock > span {
  display: block;
  font-size: 10px;
  color: #99a5b9;
}
#fragments {
  color: var(--orange);
  font-size: 20px;
  letter-spacing: 7px;
}
.hud-tools {
  position: absolute;
  right: 23px;
  top: 23px;
  display: flex;
  gap: 8px;
}
.hud-tools button {
  font-size: 10px;
  min-height: 32px;
  padding: 7px 12px;
  background: #10121dbb;
}
.boss-panel {
  position: absolute;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 70vw);
  padding: 13px 18px;
}
.boss-panel > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.boss-panel span {
  color: #919db3;
  font: 10px monospace;
}
.boss-health i {
  height: 100%;
  display: block;
  background: #ff8b95;
  transition: width 0.15s;
}
.boss-panel small {
  font-size: 9px;
  letter-spacing: 0;
  display: block;
  color: #a6aebe;
}
.quest-panel {
  position: absolute;
  left: 24px;
  top: 140px;
  padding: 12px 16px;
  max-width: 240px;
  font-size: 11px;
}
.quest-panel b {
  display: block;
  color: #a3eccb;
}
.quest-panel small {
  font-size: 9px;
  letter-spacing: 0;
  color: #9ba8b9;
}
#minimap {
  position: absolute;
  right: 24px;
  top: 85px;
  width: 140px;
  height: 140px;
  border: 1px solid #ffffff23;
  background: #090d18c9;
  border-radius: 6px;
}
.stories {
  position: absolute;
  right: 24px;
  bottom: 100px;
  width: 250px;
}
.story {
  font-size: 10px;
  color: #a1aabd;
  padding: 7px 10px;
  border-right: 2px solid #b79aff44;
  background: linear-gradient(90deg, transparent, #090e1bcc);
  margin-top: 5px;
}
.story.boss {
  color: #ffbba3;
  border-color: #ffac78;
}
.story.evolution,
.story.victory {
  color: #a2e8ce;
  border-color: #a2e8ce;
}
.story.death {
  color: #f887a3;
}
.loadout {
  position: absolute;
  left: 24px;
  bottom: 100px;
  padding: 12px;
}
.loadout .section-title {
  font-size: 8px;
  padding-bottom: 7px;
  margin-bottom: 9px;
  letter-spacing: 1px;
}
.slots {
  display: flex;
  gap: 5px;
}
.slot {
  width: 39px;
  height: 43px;
  background: #ffffff04;
  border: 1px solid #ffffff13;
  border-radius: 4px;
  position: relative;
  display: grid;
  place-items: center;
}
.slot img {
  width: 29px;
  height: 29px;
}
.slot small {
  position: absolute;
  bottom: -2px;
  right: 3px;
  font-size: 9px;
  color: #d3c5f7;
  letter-spacing: 0;
}
.slot.evolved {
  border-color: var(--orange);
  box-shadow: inset 0 0 10px #ffac7822;
}
.passives {
  margin-top: 7px;
}
.passives .slot {
  height: 31px;
}
.passives img {
  width: 22px;
  height: 22px;
}
.xp-track {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 55vw;
}
.xp-track > div:first-child {
  display: flex;
  justify-content: space-between;
  font: 10px monospace;
  color: #a4aec1;
  margin-bottom: 10px;
}
.xp-line {
  height: 5px;
  border-radius: 3px;
  background: #ffffff13;
  overflow: hidden;
}
.xp-line i {
  display: block;
  height: 100%;
  background: #b6a1ef;
  transition: width 0.15s;
}
.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 100px monospace;
  color: var(--orange);
  text-shadow: 0 0 70px #ffac7840;
}
.spectator {
  pointer-events: auto;
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
}
.spectator button {
  width: 100%;
  margin-top: 12px;
}
.silence {
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translateX(-50%);
  color: #ffad82;
  font: 12px monospace;
  letter-spacing: 2px;
  text-align: center;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 25px;
  background: #05070dcc;
  backdrop-filter: blur(12px);
  overflow: auto;
}
.modal-content {
  width: min(950px, 100%);
  text-align: center;
  max-height: 90vh;
  overflow: auto;
  padding: 10px;
}
.modal h2 {
  font-size: 44px;
  margin: 15px 0 8px;
}
.cards {
  display: flex;
  gap: 15px;
  margin: 25px 0;
}
.card {
  flex: 1;
  min-width: 0;
  position: relative;
  min-height: 245px;
  border: 1px solid #ffffff22;
  border-top: 3px solid var(--rarity, #7f8a9d);
  border-radius: 7px;
  padding: 22px 18px;
  background: #161b27;
  text-align: left;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.card:hover {
  background: #202638;
}
.card .card-top {
  font: 9px monospace;
  color: var(--rarity);
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.card img {
  width: 65px;
  height: 65px;
  margin: 17px 0;
}
.card h3 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
}
.card p {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.card > small {
  font-size: 9px;
  letter-spacing: 0;
  margin-top: auto;
  color: #a7aebf;
}
.card .key {
  position: absolute;
  right: 15px;
  top: 46px;
  font: 11px monospace;
  color: #788194;
}
.result-content {
  max-width: 760px;
}
.result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 20px 0 30px;
}
.result-stats b {
  display: block;
  font-size: 30px;
  font-weight: 400;
  color: var(--orange);
}
.result-stats small {
  font-size: 9px;
  color: #9aa3b5;
}
.score-row {
  display: grid;
  grid-template-columns: 25px 1fr repeat(3, 70px);
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.score-row.self {
  background: #b79aff0a;
}
.score-row > span {
  color: #96a3b5;
}
.score-row b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-row.heading {
  font-size: 8px;
  color: #8f9aae;
}
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 25px;
}
#toast {
  position: fixed;
  z-index: 80;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  background: #232333;
  border: 1px solid #a78bfa55;
  padding: 13px 20px;
  border-radius: 6px;
  font-size: 12px;
  color: #ebe4ff;
  box-shadow: 0 10px 50px #0008;
}
.offline {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 340px;
  max-width: 90vw;
  height: 210px;
  padding: 30px;
  z-index: 90;
}
.offline b {
  font-size: 21px;
}
.offline p {
  font-size: 12px;
}
.offline button {
  width: 100%;
}
#joystick {
  display: none;
}
body.playing {
  overflow: hidden;
}
body.playing .vignette {
  background: radial-gradient(ellipse, transparent 50%, #080a1044);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .hero {
    height: 480px;
  }
  .command-deck {
    gap: 7vw;
  }
  .intro {
    padding-top: 20px;
  }
  .ship-select img {
    height: 60px;
    width: 60px;
  }
}
@media (max-width: 900px) {
  .topbar {
    gap: 20px;
  }
  .edition {
    font-size: 8px;
  }
  .hero {
    height: 365px;
  }
  .hero h1 {
    font-size: 64px;
  }
  .ship-caption {
    right: 8%;
    bottom: 36px;
  }
  .command-deck {
    gap: 25px;
  }
  .ship-choice span {
    font-size: 8px;
  }
  .ship-choice img {
    width: 39px;
    height: 39px;
  }
  .hangar {
    grid-template-columns: 1fr;
  }
  .stories {
    width: 180px;
  }
  .hud-pilot {
    width: 200px;
  }
  .loadout {
    bottom: 100px;
  }
  .slot {
    width: 33px;
  }
  .hud-tools button {
    padding: 7px;
  }
  .hero-meta {
    font-size: 7px;
    gap: 13px;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 65px;
    padding: 0 20px;
    gap: 12px;
  }
  .brand {
    font-size: 25px;
  }
  .edition {
    display: none;
  }
  .header-right {
    gap: 12px;
  }
  #connection {
    font-size: 8px;
    max-width: 125px;
  }
  .icon-button {
    font-size: 9px;
    padding: 6px 9px;
  }
  .hero {
    height: 500px;
    padding: 28px 23px 0;
  }
  .intro h1 {
    font-size: 57px;
    letter-spacing: -3px;
    max-width: 320px;
  }
  .intro h1 b {
    left: 90%;
    font-size: 24px;
  }
  .intro p {
    font-size: 12px;
  }
  .hero-meta {
    gap: 15px;
  }
  .ship-caption {
    right: 27px;
    bottom: 18px;
  }
  .ship-caption small {
    font-size: 7px;
  }
  .orbit-label {
    top: 260px;
    right: 20px;
  }
  .command-deck {
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 0 22px;
    padding-top: 20px;
    background: #080a10b0;
  }
  .ship-select img {
    width: 47px;
    height: 47px;
  }
  .ship-select span {
    font-size: 9px;
  }
  #ship-detail p {
    min-height: 0;
  }
  .hangar {
    margin: 0 22px;
    padding-top: 25px;
    gap: 15px;
  }
  .hangar-upgrades {
    gap: 6px;
  }
  .upgrade {
    padding: 10px 7px;
  }
  .upgrade b {
    font-size: 10px;
  }
  .upgrade p {
    font-size: 9px;
    min-height: 30px;
  }
  footer {
    padding: 20px 22px;
    font-size: 7px;
    gap: 20px;
  }
  footer span:last-child {
    display: none;
  }
  .modal {
    padding: 15px;
  }
  .modal h2 {
    font-size: 30px;
  }
  .cards {
    display: grid;
    gap: 10px;
    margin: 15px 0;
  }
  .card {
    min-height: 120px;
    display: grid;
    grid-template-columns: 50px 1fr;
    column-gap: 15px;
    padding: 12px;
    border-top: 1px solid #ffffff22;
    border-left: 3px solid var(--rarity);
  }
  .card .card-top {
    grid-column: 1/-1;
    font-size: 8px;
  }
  .card img {
    grid-column: 1;
    grid-row: 2/5;
    width: 45px;
    height: 45px;
    margin: 8px 0;
  }
  .card h3 {
    grid-column: 2;
    font-size: 15px;
    margin-top: 6px;
  }
  .card p {
    grid-column: 2;
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 5px;
  }
  .card > small {
    grid-column: 2;
    font-size: 8px;
  }
  .card .key {
    display: none;
  }
  #hud {
    inset: 65px 0 0;
  }
  .hud-pilot {
    left: 13px;
    top: 14px;
    width: 162px;
    padding: 9px;
    gap: 7px;
  }
  .hud-pilot > img {
    width: 29px;
    height: 29px;
  }
  .hud-pilot small {
    font-size: 8px;
    max-width: 100px;
  }
  .hud-pilot b {
    font-size: 14px;
  }
  .hud-clock {
    top: 16px;
    left: auto;
    right: 17px;
    transform: none;
  }
  .hud-clock > b {
    font-size: 27px;
    line-height: 1.2;
  }
  .hud-clock > small {
    font-size: 7px;
  }
  .hud-clock > span {
    font-size: 8px;
  }
  #fragments {
    font-size: 15px;
    letter-spacing: 4px;
  }
  .hud-tools {
    right: 13px;
    top: 112px;
    gap: 5px;
  }
  .hud-tools button {
    min-height: 30px;
    font-size: 8px;
    padding: 5px 8px;
  }
  .boss-panel {
    top: 154px;
    width: 90vw;
    padding: 10px 13px;
  }
  .boss-panel small {
    font-size: 8px;
  }
  .boss-panel b {
    font-size: 10px;
  }
  #minimap {
    right: 14px;
    top: 235px;
    width: 76px;
    height: 76px;
    opacity: 0.8;
  }
  .quest-panel {
    left: 13px;
    top: 99px;
    max-width: 175px;
    font-size: 9px;
    padding: 8px 10px;
  }
  .quest-panel small {
    font-size: 8px;
  }
  .stories {
    right: 13px;
    bottom: 135px;
    width: 150px;
  }
  .story {
    font-size: 8px;
    padding: 5px 6px;
  }
  .story:nth-child(n + 3) {
    display: none;
  }
  .loadout {
    left: 13px;
    bottom: 12px;
    padding: 8px;
  }
  .loadout .section-title {
    display: none;
  }
  .slot {
    width: 31px;
    height: 35px;
  }
  .slot img {
    width: 25px;
    height: 25px;
  }
  .passives .slot {
    height: 26px;
  }
  .passives .slot img {
    width: 19px;
    height: 19px;
  }
  .xp-track {
    bottom: 105px;
    left: 13px;
    transform: none;
    width: calc(100vw - 26px);
  }
  .xp-track > div:first-child {
    font-size: 8px;
    margin-bottom: 7px;
  }
  #joystick {
    display: block;
    pointer-events: auto;
    position: absolute;
    bottom: 160px;
    left: 26px;
    border-radius: 50%;
    width: 105px;
    height: 105px;
    border: 1px solid #b79aff33;
    background: #b79aff08;
    touch-action: none;
  }
  #joystick i {
    position: absolute;
    left: 32px;
    top: 32px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: #b79aff33;
    border: 1px solid #d5c8ff44;
  }
  #joystick span {
    position: absolute;
    bottom: -25px;
    left: 6px;
    font: 8px monospace;
    letter-spacing: 2px;
    color: #8c83a1;
  }
  .result-stats {
    gap: 16px;
  }
  .result-stats b {
    font-size: 25px;
  }
  .result-stats small {
    font-size: 7px;
  }
  .score-row {
    grid-template-columns: 15px 1fr 45px 40px 45px;
    gap: 5px;
    padding: 10px 3px;
    font-size: 9px;
  }
  .result-actions {
    flex-direction: column;
  }
  .silence {
    font-size: 9px;
    width: 90%;
  }
  .spectator {
    top: 45%;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.recipe {
  flex-wrap: wrap;
}
.recipe b {
  font-size: 9px;
  font-weight: 400;
  color: #a8a0b6;
}
.recipe span {
  font-size: 9px;
}

.chat-history {
  margin: 10px 0;
  font-size: 11px;
  max-height: 100px;
  overflow: auto;
}
.chat-history p {
  margin: 5px 0;
  padding: 5px 8px;
  background: #ffffff04;
  overflow-wrap: anywhere;
}

.arrow {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  position: relative;
  vertical-align: middle;
  margin-left: 5px;
}
.arrow:after {
  content: "";
  height: 1.5px;
  width: 14px;
  background: currentColor;
  position: absolute;
  right: -2px;
  top: 4px;
  transform: rotate(-45deg);
}
h1 b .arrow {
  width: 22px;
  height: 22px;
}
h1 b .arrow:after {
  width: 30px;
  right: -4px;
  top: 9px;
}
.primary > span:has(.arrow) {
  float: right;
}
.primary > .arrow {
  margin-top: 5px;
}

@media (min-width: 601px) and (max-width: 900px) {
  .hero h1 {
    font-size: clamp(46px, 7vw, 64px);
  }
}
@media (max-width: 600px) {
  .intro h1 {
    font-size: clamp(45px, 14.6vw, 57px);
  }
}
/* Осмотр настоящей модели вместо абстрактной пиктограммы. */
.inspection-zone {
  position: absolute;
  top: 65px;
  right: 5vw;
  width: 42vw;
  height: 260px;
  cursor: grab;
  touch-action: none;
  outline-offset: -8px;
}
.inspection-zone:active {
  cursor: grabbing;
}
.inspection-zone > span {
  position: absolute;
  bottom: 0;
  right: 12px;
  font: 8px monospace;
  letter-spacing: 1.5px;
  color: #8a97a9;
  pointer-events: none;
}
.inspect-controls {
  position: absolute;
  right: 5vw;
  bottom: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.inspect-controls button {
  background: #111b28aa;
  color: #b9c6d6;
  border: 1px solid #71839b44;
  border-radius: 4px;
  min-width: 34px;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 10px;
}
.inspect-controls button[aria-pressed="true"] {
  color: #d3bfff;
  border-color: #b79aff;
}
.ship-caption {
  bottom: 64px;
  right: 6vw;
}
.ship-choice img {
  width: 100%;
  height: 74px;
  object-fit: contain;
  filter: saturate(0.6);
  transition: filter 0.2s;
}
.ship-choice.active img,
.ship-choice:hover img {
  filter: saturate(1);
}
.ship-choice {
  background: linear-gradient(160deg, #24304166, #0c131dcc);
  padding: 10px 5px 12px;
}
.ship-choice span {
  font-size: 11px;
}
.equipment-note {
  margin: 15px 0 0;
  font-size: 10px;
  color: #a0b5be;
  border-left: 2px solid #628596;
  padding-left: 9px;
}
.hero-meta {
  gap: 14px;
  font-size: 8px;
}
@media (max-width: 900px) {
  .inspection-zone {
    height: 235px;
    top: 55px;
  }
  .ship-choice img {
    height: 58px;
  }
  .ship-choice span {
    font-size: 9px;
  }
  .hero-meta {
    font-size: 7px;
    gap: 8px;
  }
}
@media (max-width: 600px) {
  .hero {
    height: 545px;
  }
  .inspection-zone {
    top: 250px;
    right: 20px;
    width: calc(100% - 40px);
    height: 180px;
  }
  .inspection-zone > span {
    font-size: 7px;
    right: 0;
  }
  .inspect-controls {
    right: 23px;
    bottom: 12px;
  }
  .ship-caption {
    bottom: 62px;
    right: 25px;
  }
  .ship-choice img {
    height: 59px;
  }
  .hero-meta {
    font-size: 6px;
    gap: 8px;
  }
  .ship-choice span {
    font-size: 8px;
  }
}

.inspection-zone > span {
  top: 5px;
  bottom: auto;
}
@media (max-width: 600px) {
  .inspection-zone > span {
    top: 28px;
  }
}
/* Мобильная оболочка приложения: один viewport, содержимое открывается по разделам. */
#mobile-shell {
  display: none;
}
body.mobile-ui {
  height: var(--app-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}
.mobile-ui #lobby-screen {
  display: none !important;
}
.mobile-ui .topbar {
  position: fixed;
  inset: 0 0 auto;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  gap: 10px;
  background: #080c14dd;
}
.mobile-ui .topbar .brand {
  font-size: 25px;
}
.mobile-ui .edition {
  display: none;
}
.mobile-ui .header-right {
  gap: 9px;
}
.mobile-ui #connection {
  font-size: 8px;
  max-width: 125px;
}
.mobile-ui #sound {
  min-height: 38px;
  font-size: 9px;
  padding: 6px 9px;
}
.mobile-ui #mobile-shell {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  z-index: 15;
  pointer-events: none;
  --mobile-head: calc(56px + env(safe-area-inset-top));
  --mobile-foot: calc(64px + env(safe-area-inset-bottom));
}
.mobile-ui .topbar {
  z-index: 25;
}
.mobile-home {
  pointer-events: auto;
  position: absolute;
  top: var(--mobile-head);
  bottom: var(--mobile-foot);
  left: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: 15px 20px 12px;
  gap: 8px;
}
.mobile-heading small {
  font-size: 8px;
  color: #a997c6;
  letter-spacing: 1.7px;
}
.mobile-heading h1 {
  font-size: 27px;
  letter-spacing: -1px;
  line-height: 1.03;
  margin: 7px 0 0;
  font-weight: 550;
}
.mobile-heading h1 span {
  color: #8b99af;
}
.mobile-viewer {
  position: relative;
  min-height: 0;
}
.mobile-ui #inspection-zone {
  inset: 0;
  width: 100%;
  height: 100%;
}
.mobile-ui #inspection-zone > span {
  top: auto;
  bottom: 45px;
  right: 0;
  font-size: 7px;
  letter-spacing: 1px;
}
.mobile-ui .ship-caption {
  inset: 8px auto auto 0;
  gap: 3px;
  font-size: 9px;
}
.mobile-ui .ship-caption small {
  display: none;
}
.mobile-ui .inspect-controls {
  bottom: 1px;
  right: 0;
  gap: 5px;
}
.mobile-ui .inspect-controls button {
  min-width: 35px;
  min-height: 36px;
  padding: 6px 9px;
  font-size: 9px;
}
.mobile-brief {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #ffffff17;
  padding-top: 12px;
}
.mobile-brief h2 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0 0 2px;
}
.mobile-brief > div > span {
  color: #a4aab7;
  font-size: 10px;
}
.mobile-brief > button {
  min-height: 40px;
  font-size: 11px;
  padding: 8px 13px;
}
#mobile-stats {
  grid-column: 1/-1;
  display: flex;
  gap: 26px;
  padding-top: 3px;
}
#mobile-stats span {
  color: #7f8c9f;
  font-size: 9px;
}
#mobile-stats b {
  font: 15px monospace;
  display: block;
  color: #d5dce8;
  margin-bottom: 2px;
}
.mobile-play {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}
.mobile-play > span {
  float: right;
}
.mobile-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--mobile-foot);
  padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-top: 1px solid #ffffff13;
  background: #0c111bf5;
  pointer-events: auto;
}
.mobile-nav button {
  background: none;
  border: 0;
  color: #778399;
  border-radius: 7px;
  min-height: 49px;
  font-size: 9px;
  display: grid;
  place-content: center;
  gap: 1px;
}
.mobile-nav button > span {
  font-size: 20px;
  line-height: 1.1;
}
.mobile-nav button[aria-current="page"] {
  color: #c3b0f5;
  background: #aa8eff10;
}
.mobile-panel {
  position: absolute;
  inset: var(--mobile-head) 0 var(--mobile-foot);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  background: #0b101bf5;
  backdrop-filter: blur(18px);
  animation: mobile-enter 0.18s ease-out;
  overflow: hidden;
}
.mobile-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid #ffffff13;
  flex-shrink: 0;
  min-height: 49px;
}
.mobile-panel-head h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin: 0;
  flex: 1;
}
.mobile-panel-head button {
  background: #ffffff05;
  color: #bdc6d7;
  border: 1px solid #ffffff12;
  border-radius: 6px;
  min-width: 38px;
  min-height: 36px;
  font-size: 19px;
}
.mobile-page {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
  overflow: hidden;
}
.mobile-page > p,
.mobile-step > p {
  font-size: 12px;
  margin: 0 0 16px;
  color: #a5b0c3;
}
.mobile-page button.primary {
  width: 100%;
  min-height: 44px;
  flex-shrink: 0;
}
.mobile-page label {
  font-size: 11px;
  margin-bottom: 14px;
}
.mobile-page input,
.mobile-page select {
  min-height: 44px;
  font-size: 13px;
}
.mobile-page .form-pair {
  align-items: start;
}
.mobile-page .form-pair > label {
  margin-bottom: 0;
}
.mobile-page .check {
  max-width: none;
  padding-bottom: 0;
  display: flex;
}
.mobile-page .check input {
  min-height: 18px;
  width: 18px;
  margin: 0;
}
.mobile-steps {
  display: flex;
  justify-content: space-between;
  padding: 0 0 13px;
  border-bottom: 1px solid #ffffff13;
  font: 10px monospace;
  color: #5e6b7c;
  margin-bottom: 8px;
}
.mobile-steps span.active {
  color: #d0b5ff;
}
.mobile-step {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.mobile-step > .primary {
  margin-top: 12px;
}
#mobile-name-error {
  font-size: 11px;
  color: #ffad9b;
  margin: 0 0 10px;
}
.mobile-choice {
  padding: 21px 17px;
  text-align: left;
  background: #151d2c;
  border: 1px solid #a8b9d029;
  border-radius: 9px;
  color: #e1e6ef;
  margin-bottom: 12px;
}
.mobile-choice b {
  font-size: 17px;
  font-weight: 500;
  display: block;
}
.mobile-choice span {
  font-size: 11px;
  color: #8999af;
  display: block;
  margin-top: 6px;
}
#mobile-create-action {
  margin-top: auto;
  padding-top: 15px;
}
#mobile-create-step #create {
  margin: 0;
}
#mobile-private-field {
  margin-top: 17px;
}
#mobile-join-code {
  flex-shrink: 0;
  margin-bottom: 15px;
}
#mobile-room-list {
  min-height: 0;
  overflow: auto;
  flex: 1;
  overscroll-behavior: contain;
}
#mobile-room-list details {
  display: flex;
  flex-direction: column;
}
#mobile-room-list .rooms {
  max-height: none;
  overflow: visible;
  gap: 9px;
}
#mobile-room-list summary {
  padding: 8px 0 13px;
}
#mobile-room-list .room-entry {
  min-height: 52px;
}
#mobile-ships-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
#mobile-ships .ship-select {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
#mobile-ships .ship-choice {
  padding: 5px;
  min-height: 80px;
  gap: 0;
}
#mobile-ships .ship-choice img {
  height: 53px;
}
#mobile-ships .ship-choice span {
  font-size: 10px;
}
#mobile-ships #ship-detail {
  margin-top: 12px;
}
#mobile-ships #ship-detail h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
#mobile-ships #ship-detail h2 small {
  font-size: 9px;
  float: right;
  margin-top: 5px;
}
#mobile-ships #ship-detail p {
  display: none;
}
#mobile-ships .ship-stats {
  gap: 11px 18px;
}
#mobile-ships .ship-stat small {
  font-size: 8px;
}
#mobile-ships .stat-line {
  margin-top: 4px;
}
#mobile-ships .starting {
  margin-top: 12px;
  font-size: 10px;
}
#mobile-ships .starting img {
  width: 28px;
  height: 28px;
}
#mobile-waiting #waiting {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#mobile-waiting #waiting > .eyebrow {
  display: none;
}
#mobile-waiting #roomtitle {
  font-size: 20px;
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mobile-waiting .code-pill {
  font-size: 17px;
  align-self: flex-start;
  padding: 7px 13px;
  min-height: 36px;
}
#mobile-waiting .players {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 12px 0;
  gap: 6px;
}
#mobile-waiting .pilot-row {
  min-height: 42px;
  flex-shrink: 0;
}
#mobile-waiting #room-chat {
  flex-shrink: 0;
}
#mobile-waiting #chat-history {
  max-height: 55px;
  flex-shrink: 0;
  font-size: 10px;
  margin: 5px 0;
}
#mobile-waiting #chat-history:empty {
  display: none;
}
#mobile-waiting #start,
#mobile-waiting #leave {
  min-height: 40px;
  margin: 4px 0;
  flex-shrink: 0;
}
#mobile-waiting #host-hint {
  font-size: 10px;
  margin: 3px 0;
  flex-shrink: 0;
}
#mobile-progress .hangar {
  display: flex;
  flex-direction: column;
  position: static;
  margin: 0;
  padding: 0;
  gap: 8px;
  border: 0;
  background: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
#mobile-progress .hangar h2 {
  font-size: 22px;
  margin: 3px 0;
}
#mobile-progress .hangar .eyebrow {
  font-size: 8px;
}
#mobile-progress .hangar > div > p {
  margin: 0 0 8px;
  font-size: 10px;
}
#mobile-progress .hangar-upgrades {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
#mobile-progress .upgrade {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 10px;
  padding: 12px;
}
#mobile-progress .upgrade small {
  grid-column: 2;
  grid-row: 1;
  font-size: 10px;
}
#mobile-progress .upgrade b {
  font-size: 12px;
}
#mobile-progress .upgrade p {
  font-size: 10px;
  min-height: 0;
  margin: 0;
  grid-column: 1;
}
#mobile-progress .upgrade button {
  grid-column: 2;
  grid-row: 2;
  min-height: 35px;
  white-space: nowrap;
  padding: 7px 10px;
  font-size: 10px;
}
.mobile-help .mobile-help-mark {
  font-size: 30px;
  color: #b79aff;
  line-height: 1;
}
.mobile-help h3 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}
.mobile-help > p {
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
}
.mobile-help ol {
  margin: 0;
  padding-left: 20px;
  color: #a997d1;
}
.mobile-help li {
  padding-left: 5px;
  margin: 0 0 14px;
  font-size: 11px;
}
.mobile-help li b {
  display: block;
  font-weight: 500;
  color: #e1e6ef;
}
.mobile-help li span {
  display: block;
  font-size: 10px;
  color: #8f9caf;
  margin-top: 3px;
}
.mobile-help > button {
  margin-top: auto;
}
.mobile-keyboard #mobile-shell {
  --mobile-foot: 0px;
}
.mobile-keyboard .mobile-nav {
  display: none;
}
.mobile-keyboard .mobile-page {
  padding-top: 10px;
  padding-bottom: 10px;
}
.mobile-keyboard .mobile-steps {
  margin-bottom: 0;
  padding-bottom: 9px;
}
.mobile-keyboard #mobile-name-step > p:first-child {
  margin-bottom: 10px;
}
.mobile-ui #hud {
  inset: calc(56px + env(safe-area-inset-top)) 0 0;
  height: calc(var(--app-height, 100dvh) - 56px - env(safe-area-inset-top));
}
.mobile-ui.playing #mobile-shell {
  display: none !important;
}
.mobile-ui .modal {
  padding: 12px;
  height: var(--app-height, 100dvh);
  bottom: auto;
}
.mobile-ui .modal-content {
  max-height: calc(var(--app-height, 100dvh) - 24px);
  padding: 5px;
}
.mobile-ui .modal h2 {
  font-size: 26px;
  margin: 8px 0;
}
.mobile-ui .modal p.muted {
  font-size: 10px;
  margin-bottom: 6px;
}
.mobile-ui .cards {
  gap: 8px;
  margin: 12px 0;
}
.mobile-ui .card {
  min-height: 92px;
  padding: 9px 11px;
  column-gap: 10px;
}
.mobile-ui .card img {
  width: 40px;
  height: 40px;
  margin: 7px 0;
}
.mobile-ui .card h3 {
  font-size: 14px;
  margin-top: 5px;
  margin-bottom: 4px;
}
.mobile-ui .card p {
  font-size: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.mobile-ui .card .card-top {
  font-size: 7px;
}
.mobile-ui .card > small {
  font-size: 8px;
}
.mobile-ui #reroll {
  min-height: 38px;
  font-size: 11px;
  padding: 8px 12px;
}
.mobile-ui .result-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mobile-ui .result-stats {
  margin: 10px 0 16px;
  gap: 19px;
}
.mobile-ui .result-stats b {
  font-size: 23px;
}
.mobile-ui .result-stats small {
  font-size: 7px;
}
.mobile-ui #result-reason {
  font-size: 11px;
  margin-bottom: 4px;
}
.mobile-ui #result-players {
  overflow: auto;
  min-height: 45px;
  max-height: calc(var(--app-height, 100dvh) - 310px);
  overscroll-behavior: contain;
}
.mobile-ui .result-actions {
  margin-top: 14px;
  flex-shrink: 0;
  gap: 8px;
}
.mobile-ui .result-actions button {
  min-height: 40px;
  padding: 8px;
  font-size: 12px;
}
@keyframes mobile-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-height: 650px) {
  .mobile-ui .mobile-heading h1 {
    font-size: 22px;
  }
  .mobile-ui .mobile-home {
    padding-top: 9px;
    gap: 5px;
  }
  .mobile-ui .mobile-heading small {
    font-size: 7px;
  }
  .mobile-ui .mobile-brief {
    padding-top: 8px;
    gap: 5px;
  }
  .mobile-ui .mobile-brief h2 {
    font-size: 18px;
  }
  .mobile-ui #mobile-stats b {
    font-size: 13px;
  }
  .mobile-ui .mobile-page {
    gap: 9px;
    padding: 12px 17px;
  }
  .mobile-ui #mobile-ships .ship-choice {
    min-height: 69px;
  }
  .mobile-ui #mobile-ships .ship-choice img {
    height: 43px;
  }
  .mobile-ui .mobile-help .mobile-help-mark {
    display: none;
  }
  .mobile-ui .mobile-help h3 {
    font-size: 19px;
  }
  .mobile-ui .mobile-help li {
    margin-bottom: 10px;
  }
}
@media (max-height: 500px) and (min-width: 601px) {
  .mobile-ui .mobile-home {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    padding: 9px 22px;
    column-gap: 30px;
  }
  .mobile-ui .mobile-heading {
    grid-column: 1;
    grid-row: 1;
  }
  .mobile-ui .mobile-viewer {
    grid-column: 2;
    grid-row: 1/4;
  }
  .mobile-ui .mobile-brief {
    grid-column: 1;
    grid-row: 2;
  }
  .mobile-ui .mobile-play {
    grid-column: 1;
    grid-row: 3;
  }
  .mobile-ui .mobile-panel .mobile-step {
    max-width: 530px;
    width: 100%;
    margin: 0 auto;
  }
  .mobile-ui #mobile-ships-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .mobile-ui #mobile-ships #ship-detail {
    margin-top: 0;
  }
  .mobile-ui #mobile-ships .ship-choice {
    min-height: 62px;
  }
  .mobile-ui #mobile-ships .ship-choice img {
    height: 38px;
  }
  .mobile-ui #mobile-help {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .mobile-ui #mobile-help ol {
    grid-column: 2;
    grid-row: 1/4;
  }
  .mobile-ui #mobile-help button {
    grid-column: 1;
  }
  .mobile-ui .mobile-page {
    overflow: auto;
  }
  .mobile-ui .cards {
    display: flex;
  }
  .mobile-ui .card {
    display: flex;
    padding: 12px;
    min-height: 145px;
  }
  .mobile-ui .card p {
    font-size: 9px;
  }
  .mobile-ui #minimap,
  .mobile-ui .stories {
    display: none;
  }
  .mobile-ui .loadout {
    bottom: 40px;
    left: 15px;
    padding: 7px;
  }
  .mobile-ui .loadout .section-title {
    display: none;
  }
  .mobile-ui .slot {
    height: 28px;
    width: 29px;
  }
  .mobile-ui .slot img {
    width: 22px;
    height: 22px;
  }
  .mobile-ui .passives .slot {
    height: 23px;
  }
  .mobile-ui .xp-track {
    bottom: 12px;
    width: 55vw;
  }
  .mobile-ui #joystick {
    display: block;
    pointer-events: auto;
    position: absolute;
    left: auto;
    right: 25px;
    bottom: 25px;
    width: 95px;
    height: 95px;
    border: 1px solid #b79aff44;
    border-radius: 50%;
    background: #b79aff08;
    touch-action: none;
  }
  .mobile-ui #joystick i {
    position: absolute;
    left: 27px;
    top: 27px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #b79aff33;
  }
  .mobile-ui #joystick span {
    display: none;
  }
  .mobile-ui .hud-pilot {
    top: 10px;
    left: 15px;
    padding: 8px;
    width: 180px;
  }
  .mobile-ui .hud-clock {
    top: 5px;
  }
  .mobile-ui .hud-clock > b {
    font-size: 26px;
  }
  .mobile-ui .hud-tools {
    top: 10px;
    right: 15px;
  }
  .mobile-ui .boss-panel {
    top: 100px;
    width: 42vw;
    padding: 8px 12px;
  }
  .mobile-ui .quest-panel {
    top: 90px;
    left: 15px;
    font-size: 10px;
  }
  .mobile-ui .hud-clock > span {
    font-size: 9px;
  }
  .mobile-ui #fragments {
    font-size: 14px;
  }
  .mobile-ui .result-stats {
    margin: 5px 0;
  }
  .mobile-ui .result-actions {
    flex-direction: row;
  }
  .mobile-ui #result-players {
    max-height: 100px;
  }
}
@media (max-height: 500px) and (min-width: 601px) {
  .mobile-ui #mobile-create-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 5px 16px;
  }
  .mobile-ui #mobile-create-step label {
    margin-bottom: 0;
  }
  .mobile-ui #mobile-create-action {
    margin-top: 0;
    padding-top: 0;
  }
  .mobile-ui #mobile-private-field {
    margin-top: 7px;
  }
  .mobile-ui #mobile-choice-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
  }
  .mobile-ui #mobile-choice-step > p {
    grid-column: 1/-1;
    margin-bottom: 0;
  }
  .mobile-ui .mobile-choice {
    padding: 15px;
    margin-bottom: 0;
  }
  .mobile-ui #mobile-progress .hangar {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
  }
  .mobile-ui #mobile-progress .hangar-upgrades {
    grid-template-columns: repeat(3, 1fr);
  }
  .mobile-ui #mobile-progress .upgrade {
    display: block;
    padding: 10px;
  }
  .mobile-ui #mobile-progress .upgrade b {
    font-size: 11px;
  }
  .mobile-ui #mobile-progress .upgrade p {
    margin: 8px 0;
  }
  .mobile-ui #mobile-progress .upgrade small {
    float: right;
  }
  .mobile-ui #mobile-progress .upgrade button {
    width: 100%;
    font-size: 9px;
    padding: 7px 3px;
  }
}
.mobile-help-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.mobile-help-actions button {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 9px;
  min-height: 42px;
}
.mobile-help.recipes-mode > .mobile-help-mark,
.mobile-help.recipes-mode > h3,
.mobile-help.recipes-mode > p,
.mobile-help.recipes-mode > ol {
  display: none;
}
#mobile-recipe-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 16px;
}
.mobile-recipe-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 17px;
  font-size: 12px;
  color: #b4c0d4;
}
.mobile-recipe-item img {
  width: 47px;
  height: 47px;
  background: #ffffff05;
  border: 1px solid #ffffff13;
  border-radius: 7px;
  padding: 7px;
}
#mobile-recipe-detail h3 {
  margin: 5px 0 10px;
  font-size: 24px;
}
#mobile-recipe-detail p {
  font-size: 12px;
  margin: 24px 0 0;
  line-height: 1.7;
}
#mobile-recipe-detail p b {
  color: #e7bd8a;
  font-weight: 500;
}
.mobile-recipe-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.mobile-recipe-nav button {
  min-width: 45px;
  min-height: 40px;
}
.mobile-recipe-nav span {
  font: 12px monospace;
  color: #97a5be;
}
.mobile-keyboard #mobile-create-step #mobile-options,
.mobile-keyboard #mobile-create-step #mobile-private-field {
  display: none;
}
@media (max-height: 650px) {
  #mobile-recipe-detail h3 {
    font-size: 20px;
  }
  .mobile-recipe-item {
    margin-top: 10px;
  }
  .mobile-recipe-item img {
    width: 37px;
    height: 37px;
  }
  #mobile-recipe-detail p {
    margin-top: 14px;
    font-size: 11px;
  }
  .mobile-help ol {
    font-size: 10px;
  }
  .mobile-help-actions {
    gap: 8px;
  }
  .mobile-help > p {
    font-size: 10px;
  }
}
@media (max-height: 500px) and (min-width: 601px) {
  .mobile-help-actions {
    grid-column: 1;
  }
  .mobile-help.recipes-mode {
    display: flex !important;
  }
  #mobile-recipe-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 15px;
  }
  #mobile-recipe-detail h3 {
    grid-column: 1/-1;
    margin: 0;
    font-size: 17px;
  }
  .mobile-recipe-item {
    margin-top: 0;
    font-size: 10px;
  }
  .mobile-recipe-item img {
    width: 30px;
    height: 30px;
  }
  #mobile-recipe-detail p {
    grid-column: 1/-1;
    margin: 0;
    font-size: 10px;
  }
  #mobile-recipe-detail p br {
    display: none;
  }
  #mobile-recipe-panel {
    gap: 6px;
  }
  .mobile-recipe-nav button {
    min-height: 32px;
    padding: 4px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .mobile-ui .cards:has(.card:nth-child(4)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-ui .cards:has(.card:nth-child(4)) .card {
    display: flex;
    min-height: 128px;
    padding: 8px;
    gap: 3px;
  }
  .mobile-ui .cards:has(.card:nth-child(4)) .card img {
    width: 25px;
    height: 25px;
    margin: 2px 0;
  }
  .mobile-ui .cards:has(.card:nth-child(4)) .card h3 {
    font-size: 11px;
    margin: 0;
  }
  .mobile-ui .cards:has(.card:nth-child(4)) .card p {
    font-size: 8px;
    line-height: 1.2;
    margin-bottom: 1px;
  }
  .mobile-ui .cards:has(.card:nth-child(4)) .card > small {
    font-size: 7px;
  }
  .mobile-ui .cards:has(.card:nth-child(4)) .card .card-top {
    font-size: 6px;
  }
}
.mobile-ui .topbar {
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
.mobile-home,
.mobile-page {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.mobile-nav {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
.mobile-panel-head {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
.mobile-ui .pilot-row > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-ui .pilot-row > small {
  flex-shrink: 0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-ui #toast {
  bottom: calc(76px + env(safe-area-inset-bottom));
  pointer-events: none;
}
@media (max-height: 500px) and (min-width: 601px) {
  .mobile-ui .hud-pilot {
    left: calc(15px + env(safe-area-inset-left));
  }
  .mobile-ui .hud-tools {
    right: calc(15px + env(safe-area-inset-right));
  }
  .mobile-ui #joystick {
    right: calc(25px + env(safe-area-inset-right));
  }
}

/* Battle controls stay inside the viewport, above the loadout. */
.dash-control {
  position: absolute;
  right: 18px;
  bottom: 200px;
  pointer-events: auto;
  width: 92px;
  min-height: 64px;
  color: #9cefff;
  border: 1px solid #65eaff80;
  border-radius: 18px;
  touch-action: manipulation;
}
.dash-control small {
  display: block;
  font-size: 10px;
  margin-top: 6px;
}
.dash-control:disabled {
  opacity: 0.45;
}
.rescue-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 105px;
  max-width: 65%;
  padding: 8px 12px;
  font-size: 12px;
  color: #a8ffc8;
}
@media (max-height: 500px) {
  .dash-control {
    bottom: 125px;
    right: 12px;
    min-height: 52px;
  }
  .rescue-hint {
    top: 68px;
    max-width: 48%;
    font-size: 10px;
  }
}

.systems-toggle {
  position: absolute;
  right: 18px;
  bottom: 274px;
  width: 92px;
  min-height: 58px;
  pointer-events: auto;
  border-radius: 16px;
  border: 1px solid #c9ab6480;
  color: #ead6a7;
  touch-action: manipulation;
}
.systems-toggle small {
  display: block;
  margin-top: 5px;
  font-size: 9px;
}
.systems-toggle.repairing {
  border-color: #8efac0;
  color: #8efac0;
}
.systems-panel {
  position: absolute;
  right: 120px;
  bottom: 200px;
  width: min(230px, calc(100vw - 132px));
  padding: 12px;
  border: 1px solid #c9ab6460;
  border-radius: 16px;
  pointer-events: auto;
  z-index: 5;
  background: #10131ff5;
}
.systems-panel .section-title {
  font-size: 9px;
}
.systems-panel .section-title button {
  padding: 2px 9px;
  min-height: 28px;
  font-size: 18px;
  background: none;
  border: 0;
  color: #cbd1df;
}
.systems-panel p {
  font-size: 11px;
  line-height: 1.4;
  color: #b5bed1;
  margin: 8px 0;
}
.systems-panel > button {
  width: 100%;
  min-height: 38px;
  font-size: 11px;
}
.systems-panel > small {
  display: block;
  color: #a9b5c6;
  font-size: 10px;
  line-height: 1.35;
  margin: 5px 0 10px;
}
@media (max-height: 500px) {
  .systems-toggle {
    bottom: 187px;
    right: 12px;
    min-height: 48px;
  }
  .systems-panel {
    bottom: 105px;
    right: 116px;
    width: 220px;
    padding: 8px 12px;
  }
  .systems-panel p {
    display: none;
  }
}
