:root {
  color-scheme: dark;
  --ink: #050b14;
  --panel: rgba(7, 16, 27, 0.74);
  --panel-strong: rgba(7, 16, 27, 0.92);
  --line: rgba(133, 239, 255, 0.18);
  --text: #f4fbff;
  --muted: #9eb3c6;
  --accent: #ffd166;
  --accent-2: #4de1df;
  --danger: #ff4c4c;
  --frame-cut: 10px;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
  border-radius: 0;
}

.panel,
.hud-panel,
button,
#minimap,
#annunciator,
#chat-form,
.aircraft-card,
.aircraft-status,
.room-chip {
  clip-path: polygon(
    var(--frame-cut) 0,
    calc(100% - var(--frame-cut)) 0,
    100% var(--frame-cut),
    100% calc(100% - var(--frame-cut)),
    calc(100% - var(--frame-cut)) 100%,
    var(--frame-cut) 100%,
    0 calc(100% - var(--frame-cut)),
    0 var(--frame-cut)
  );
}

#app-shell {
  width: 100vw;
  height: 100svh;
  position: relative;
  overflow: hidden;
}

#auth-screen,
#select-screen,
#game-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#auth-screen {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 390px);
  gap: clamp(24px, 6vw, 88px);
  align-items: center;
  padding: clamp(22px, 5vw, 72px);
  background: #07121d;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 10, 16, 0.88) 0 18%, rgba(4, 10, 16, 0.56) 38%, rgba(4, 10, 16, 0.18) 60%, rgba(4, 10, 16, 0.54) 100%),
    linear-gradient(180deg, rgba(4, 10, 16, 0.32), rgba(4, 10, 16, 0.58)),
    url("/assets/ui/auth-runway-hero.jpg") center center / cover no-repeat;
  filter: saturate(1.02) contrast(1.02);
}

#auth-screen::before {
  content: "";
  position: absolute;
  inset: auto auto 6% 5%;
  width: min(420px, 36vw);
  height: 1px;
  transform: perspective(600px) rotateX(64deg);
  background:
    repeating-linear-gradient(180deg, transparent 0 84px, rgba(255, 255, 255, 0.85) 84px 126px, transparent 126px 190px),
    linear-gradient(90deg, #2f3537, #4b5254 46%, #2f3537);
  border-left: 4px solid rgba(255, 255, 255, 0.75);
  border-right: 4px solid rgba(255, 255, 255, 0.75);
  opacity: 0.42;
}

#auth-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 26%, rgba(255, 180, 74, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.05));
  pointer-events: none;
}

#select-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
  padding: clamp(18px, 3vw, 34px);
  background:
    linear-gradient(180deg, rgba(6, 17, 27, 0.98) 0 36%, rgba(25, 54, 57, 0.96) 36% 60%, rgba(54, 79, 55, 0.96) 60% 100%),
    linear-gradient(120deg, rgba(255, 176, 0, 0.12), transparent 34% 100%);
}

#select-screen::before {
  content: "";
  position: absolute;
  inset: 54% -8% -18% -8%;
  transform: perspective(760px) rotateX(63deg);
  background:
    linear-gradient(90deg, transparent 0 45%, rgba(245, 251, 255, 0.8) 45% 46%, transparent 46% 54%, rgba(245, 251, 255, 0.8) 54% 55%, transparent 55% 100%),
    repeating-linear-gradient(180deg, transparent 0 82px, rgba(245, 251, 255, 0.74) 82px 114px, transparent 114px 190px),
    linear-gradient(90deg, #252b2d, #4b5558 50%, #252b2d);
  opacity: 0.34;
  filter: saturate(0.8);
}

#select-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.26), transparent 26% 66%, rgba(0, 0, 0, 0.24)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 24% 72%, rgba(0, 0, 0, 0.34));
}

#select-header {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(245, 251, 255, 0.16);
}

#select-header h1 {
  max-width: none;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.select-account {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.select-account span {
  max-width: 180px;
  overflow: hidden;
  color: #f5fbff;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.select-account button {
  min-height: 36px;
  padding: 0 12px;
}

#changelog-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
}

#changelog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}

#changelog-dialog {
  position: absolute;
  inset: 8vh 50% auto auto;
  transform: translateX(50%);
  width: min(720px, calc(100vw - 28px));
  max-height: 78vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

#changelog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(245, 251, 255, 0.14);
}

.changelog-body {
  padding: 16px 18px 18px;
  overflow: auto;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(245, 251, 255, 0.1);
}

.changelog-entry:last-child {
  border-bottom: none;
}

.changelog-date {
  font-weight: 650;
  color: rgba(245, 251, 255, 0.88);
}

.changelog-notes {
  color: rgba(245, 251, 255, 0.9);
  line-height: 1.4;
}

.changelog-notes ul {
  margin: 0;
  padding-left: 18px;
}

.changelog-notes li {
  margin: 0 0 6px;
}

.changelog-notes li:last-child {
  margin-bottom: 0;
}

#aircraft-grid {
  position: relative;
  z-index: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(245, 251, 255, 0.16);
  border-radius: 0;
  background: rgba(4, 13, 21, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  scrollbar-color: rgba(255, 176, 0, 0.72) rgba(255, 255, 255, 0.08);
}

.aircraft-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
}

.aircraft-group.compact {
  gap: 8px;
}

.aircraft-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f5fbff;
  font-size: 0.9rem;
  font-weight: 800;
}

.aircraft-group-header small {
  color: var(--muted);
  font-size: 0.78rem;
}

.aircraft-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.aircraft-group-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.aircraft-card {
  min-height: 156px;
  display: grid;
  grid-template-rows: auto minmax(44px, 1fr) auto;
  align-content: space-between;
  gap: 12px;
  border: 1px solid rgba(245, 251, 255, 0.2);
  border-radius: 0;
  padding: 15px;
  color: var(--text);
  background: rgba(8, 20, 30, 0.94);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.aircraft-card:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 251, 255, 0.48);
  background: rgba(12, 28, 41, 0.98);
}

.aircraft-card.active {
  border-color: rgba(255, 176, 0, 0.92);
  background: rgba(29, 31, 25, 0.98);
  box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.09);
}

.aircraft-card.missing {
  opacity: 0.74;
}

.aircraft-card strong {
  display: block;
  color: #ffffff;
  font-size: 1.08rem;
  line-height: 1.16;
}

.aircraft-card small,
.aircraft-card span {
  color: #c8d6de;
  line-height: 1.35;
}

.aircraft-card > span:nth-child(2) {
  color: #d5e2e8;
}

.aircraft-status {
  justify-self: start;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 800;
}

.aircraft-status.ready {
  color: #0f302d;
  background: var(--accent-2);
}

.aircraft-status.missing {
  color: #1f1602;
  background: var(--accent);
}

#aircraft-detail {
  position: relative;
  z-index: 2;
  align-self: start;
  justify-self: end;
  width: 100%;
  background: rgba(5, 14, 22, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  border-radius: 0;
}

#aircraft-detail h2 {
  line-height: 1.05;
}

#aircraft-detail .message {
  color: #cbd8df;
  line-height: 1.38;
  min-height: 2.76em;
}

#select-message {
  color: #f4e8c3;
}

.room-chip {
  justify-self: start;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(245, 251, 255, 0.18);
  border-radius: 0;
  color: #d7e5ec;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  display: grid;
  gap: 18px;
  padding-bottom: min(10vh, 84px);
}

.auth-copy h1 {
  max-width: 8ch;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.auth-copy p:not(.eyebrow) {
  max-width: 40ch;
  margin: 0;
  color: #ebf8fb;
  font-size: 1.08rem;
  line-height: 1.45;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.28);
}

.auth-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 17, 27, 0.4);
  color: #eef8ff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: min(820px, 100%);
}

.auth-feature {
  min-height: 148px;
  padding: 16px 16px 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(7, 18, 29, 0.54), rgba(7, 18, 29, 0.68));
  backdrop-filter: blur(8px);
}

.auth-feature-label {
  color: #84d8e4;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-feature strong {
  font-size: clamp(1.2rem, 3vw, 2rem);
  line-height: 1;
}

.auth-feature p,
.auth-briefing p {
  margin: 0;
  color: rgba(234, 244, 250, 0.88);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-briefing {
  max-width: min(760px, 100%);
  padding: 18px 18px 16px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(7, 18, 29, 0.74), rgba(7, 18, 29, 0.52));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.auth-briefing-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
}

.auth-briefing-head strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

#flight-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #8fd0ed;
}

.panel {
  position: absolute;
  z-index: 5;
  width: min(390px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(133, 239, 255, 0.22);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(10, 22, 34, 0.92), rgba(5, 12, 21, 0.94)),
    var(--panel);
  backdrop-filter: blur(18px);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(77, 225, 223, 0.15), transparent 26%),
    linear-gradient(315deg, rgba(255, 209, 102, 0.1), transparent 24%);
  opacity: 0.9;
}

#auth-panel {
  position: relative;
  z-index: 3;
  justify-self: end;
  width: min(420px, calc(100vw - 32px));
  background:
    linear-gradient(180deg, rgba(11, 22, 35, 0.92), rgba(5, 12, 21, 0.96)),
    var(--panel);
}

#settings-button {
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 6;
  min-height: 42px;
  padding: 0 18px;
  border-color: rgba(77, 225, 223, 0.34);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(14, 28, 42, 0.92), rgba(8, 16, 25, 0.96));
  backdrop-filter: blur(14px);
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#settings-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
}

#settings-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 13, 0.46);
  backdrop-filter: blur(3px);
}

#settings-dialog {
  position: absolute;
  right: 24px;
  top: 76px;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100svh - 104px);
  overflow: auto;
  background: rgba(5, 14, 22, 0.96);
}

#settings-header,
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#settings-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 251, 255, 0.14);
}

#settings-close-button {
  min-height: 36px;
  padding: 0 12px;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-label {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settings-aircraft-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-aircraft-card {
  min-height: 92px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.settings-aircraft-card strong {
  font-size: 0.98rem;
}

.settings-aircraft-card small {
  display: block;
  margin-top: 2px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 0.96;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.35rem, 9vw, 4rem);
}

h2 {
  font-size: 1.7rem;
}

.brief {
  max-width: 30ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

form,
.panel {
  display: grid;
  gap: 14px;
}

.language-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.language-toggle button {
  min-height: 36px;
  color: #d7e5ec;
  background: rgba(255, 255, 255, 0.06);
}

.language-toggle button.active {
  border-color: rgba(64, 199, 192, 0.82);
  color: #06131b;
  background: var(--accent-2);
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
}

.toggle-row,
.range-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 251, 255, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.055);
}

.toggle-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.range-row {
  grid-template-columns: 1fr minmax(120px, 180px) auto;
  align-items: center;
}

.toggle-row span,
.range-row span,
.range-row strong {
  color: #d7e5ec;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: none;
}

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(133, 239, 255, 0.22);
  border-radius: 0;
  color: var(--text);
  background: rgba(10, 20, 30, 0.78);
  padding: 0 12px;
  outline: none;
}

select {
  min-height: 38px;
  width: 100%;
  border: 1px solid rgba(133, 239, 255, 0.22);
  color: var(--text);
  background: rgba(10, 20, 30, 0.78);
  padding: 0 10px;
  outline: none;
}

select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(77, 225, 223, 0.18);
}

.server-node-picker {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(77, 225, 223, 0.18);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent-2);
}

input[type="range"] {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  box-shadow: none;
}

.mode-toggle,
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 42px;
  border: 1px solid rgba(133, 239, 255, 0.22);
  border-radius: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(15, 27, 40, 0.94), rgba(7, 14, 22, 0.94)),
    linear-gradient(135deg, rgba(77, 225, 223, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(255, 209, 102, 0.06), transparent 30%);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.18);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

button:hover {
  border-color: rgba(77, 225, 223, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(77, 225, 223, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(77, 225, 223, 0.18), transparent 28%);
  opacity: 0.55;
  mix-blend-mode: screen;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(64, 199, 192, 0.85);
  outline-offset: 2px;
}

button.active,
button.primary {
  border-color: rgba(77, 225, 223, 0.7);
  color: #08131f;
  background:
    linear-gradient(180deg, rgba(126, 255, 246, 0.98), rgba(77, 225, 223, 0.92)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(315deg, rgba(255, 209, 102, 0.18), transparent 30%);
  font-weight: 800;
}

button.ghost {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(14, 26, 39, 0.88), rgba(7, 14, 22, 0.92));
}

.message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

#hud {
  position: absolute;
  left: 22px;
  bottom: 22px;
  top: auto;
  z-index: 4;
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: min(416px, calc(100vw - 44px));
  height: clamp(322px, 35vh, 352px);
}

.hud-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(133, 239, 255, 0.2);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(9, 20, 31, 0.96), rgba(4, 11, 18, 0.96));
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hud-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(77, 225, 223, 0.1), transparent 28%),
    linear-gradient(315deg, rgba(255, 209, 102, 0.08), transparent 30%);
}

#attitude-card {
  padding: 8px;
  align-content: start;
  flex: 0 0 196px;
  height: 100%;
}

.hud-panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hud-label-stack {
  display: grid;
  gap: 3px;
}

.hud-label {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hud-label-stack strong {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.hud-heading-readout {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.hud-heading-readout span,
.hud-attitude-foot span,
.hud-metric span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hud-heading-readout strong {
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

#attitude-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 0;
  background: radial-gradient(circle at 50% 45%, rgba(81, 147, 188, 0.18), rgba(5, 12, 20, 0.96) 68%);
}

.hud-attitude-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hud-attitude-foot > div {
  display: grid;
  gap: 2px;
}

.hud-attitude-foot strong {
  color: var(--text);
  font-size: 0.72rem;
}

#hud-strip {
  flex: 0 0 200px;
  min-width: 200px;
  align-self: stretch;
  height: 100%;
  display: grid;
  gap: 8px;
  padding: 8px 8px 9px;
  border: 1px solid rgba(133, 239, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(7, 16, 26, 0.86), rgba(4, 10, 16, 0.92)),
    var(--panel);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.hud-data-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(133, 239, 255, 0.14);
}

.hud-data-header strong {
  color: var(--text);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.hud-data-state {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}

.hud-metric {
  display: grid;
  gap: 4px;
  padding: 4px 0 6px;
  border-bottom: 1px solid rgba(133, 239, 255, 0.12);
}

.hud-data-grid .hud-metric:nth-last-child(-n + 2) {
  border-bottom: 0;
  padding-bottom: 0;
}

.hud-metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hud-metric strong {
  color: var(--text);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.hud-data-grid-secondary {
  padding-top: 2px;
}

.hud-lever-bank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 2px;
}

.hud-lever {
  display: grid;
  gap: 6px;
  padding: 6px 6px 7px;
  border: 1px solid rgba(133, 239, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.hud-lever-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.hud-lever-label span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hud-lever-label strong {
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-lever-track {
  position: relative;
  height: 86px;
  border: 1px solid rgba(133, 239, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(8, 19, 29, 0.9), rgba(3, 8, 14, 0.96)),
    linear-gradient(180deg, transparent 0 20%, rgba(255, 255, 255, 0.04) 20% 21%, transparent 21% 40%, rgba(255, 255, 255, 0.04) 40% 41%, transparent 41% 60%, rgba(255, 255, 255, 0.04) 60% 61%, transparent 61% 80%, rgba(255, 255, 255, 0.04) 80% 81%, transparent 81% 100%);
  overflow: hidden;
}

.hud-lever-rail {
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(77, 225, 223, 0.2), rgba(77, 225, 223, 0.9), rgba(77, 225, 223, 0.18));
  box-shadow: 0 0 12px rgba(77, 225, 223, 0.34);
}

.hud-lever-thumb {
  position: absolute;
  left: 50%;
  top: calc(9px + (1 - var(--lever-position, 0)) * 64px);
  width: 50px;
  height: 15px;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(77, 225, 223, 0.92)),
    linear-gradient(90deg, rgba(255, 209, 102, 0.28), rgba(255, 209, 102, 0.02));
  border: 1px solid rgba(245, 251, 255, 0.22);
  box-shadow:
    0 0 0 1px rgba(77, 225, 223, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.22),
    0 0 18px rgba(77, 225, 223, 0.22);
}

.hud-lever-thumb::before,
.hud-lever-thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(8, 16, 24, 0.92);
}

.hud-lever-thumb::before {
  left: 6px;
}

.hud-lever-thumb::after {
  right: 6px;
}

.hud-lever-thumb.gear {
  width: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 209, 102, 0.92)),
    linear-gradient(90deg, rgba(77, 225, 223, 0.24), rgba(77, 225, 223, 0.02));
}

.hud-lever.disabled {
  border-color: rgba(133, 239, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.hud-lever-thumb.disabled {
  opacity: 0.38;
  filter: grayscale(1) saturate(0.2);
  box-shadow:
    0 0 0 1px rgba(245, 251, 255, 0.08),
    0 8px 14px rgba(0, 0, 0, 0.18);
}

.keybind-grid {
  display: grid;
  gap: 6px;
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 251, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.keybind-row span {
  color: #d7e5ec;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: none;
}

.keybind-row strong {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

#minimap {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 4;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(133, 239, 255, 0.18);
  border-radius: 0;
  background: rgba(5, 14, 22, 0.74);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

#minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#annunciator {
  position: absolute;
  left: 50%;
  top: 24px;
  z-index: 4;
  width: min(360px, calc(100vw - 48px));
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 11px 16px;
  border: 1px solid rgba(133, 239, 255, 0.18);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(10, 22, 34, 0.86), rgba(5, 12, 21, 0.9));
  backdrop-filter: blur(14px);
  text-align: center;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

#annunciator strong {
  color: var(--accent-2);
}

#annunciator.warning strong {
  color: var(--accent);
}

#annunciator.danger strong {
  color: var(--danger);
}

#annunciator span {
  color: var(--muted);
  font-size: 0.86rem;
}

#danmaku-layer {
  position: absolute;
  inset: 78px 0 auto;
  z-index: 3;
  height: min(42svh, 360px);
  overflow: hidden;
  pointer-events: none;
}

.danmaku-message {
  position: absolute;
  left: 100%;
  top: var(--danmaku-top, 24px);
  max-width: min(72vw, 760px);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  color: #ffffff;
  background: rgba(5, 14, 22, 0.58);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  font-size: clamp(0.9rem, 2vw, 1.08rem);
  font-weight: 900;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.82);
  white-space: nowrap;
  animation: hfs-danmaku var(--danmaku-duration, 8s) linear forwards;
}

.danmaku-message strong {
  margin-right: 7px;
  color: var(--accent);
}

@keyframes hfs-danmaku {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-100vw - 100% - 80px));
  }
}

#chat-form {
  position: absolute;
  left: 50%;
  bottom: 74px;
  z-index: 8;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(245, 251, 255, 0.2);
  border-radius: 0;
  background: rgba(5, 14, 22, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

#chat-form label {
  gap: 4px;
}

#chat-form label span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

#chat-form input {
  min-height: 40px;
}

#chat-form button {
  align-self: end;
}

#mobile-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 112px;
  z-index: 5;
  display: none;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: end;
  gap: 12px;
  padding: 0 16px;
  pointer-events: none;
}

#game-screen.mobile-controls-enabled #mobile-controls {
  display: grid;
}

#game-screen.compact-mobile-hud #hud,
#game-screen.compact-mobile-hud #minimap,
#game-screen.compact-mobile-hud #annunciator,
#game-screen.compact-mobile-hud #danmaku-layer,
#game-screen.compact-mobile-hud #chat-form {
  display: none !important;
}

.mobile-stick-panel,
.mobile-button-bank,
.mobile-throttle {
  pointer-events: auto;
}

.mobile-stick-panel,
.mobile-throttle {
  display: grid;
  gap: 7px;
  justify-items: center;
}

.mobile-stick-panel {
  position: fixed;
  left: 18px;
  bottom: 122px;
  z-index: 6;
  width: 164px;
  height: 164px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  transform: translate(0, 0);
}

.mobile-stick-panel span,
.mobile-throttle span {
  color: #f5fbff;
  font-size: 0.72rem;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
}

.mobile-stick {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(245, 251, 255, 0.28);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(245, 251, 255, 0.12) 49% 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(245, 251, 255, 0.12) 49% 51%, transparent 51%),
    rgba(5, 14, 22, 0.62);
  box-shadow: inset 0 0 24px rgba(64, 199, 192, 0.16), 0 16px 44px rgba(0, 0, 0, 0.28);
  touch-action: none;
  user-select: none;
}

#mobile-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 176, 0, 0.92);
  border-radius: 50%;
  background: rgba(255, 176, 0, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

.mobile-button-bank {
  display: grid;
  gap: 8px;
  align-self: end;
  justify-self: center;
  width: min(300px, 100%);
}

.mobile-rudder-row,
.mobile-action-row {
  display: grid;
  gap: 8px;
}

.mobile-rudder-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-action-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mobile-button-bank button {
  min-height: 42px;
  padding: 0 8px;
  border-color: rgba(245, 251, 255, 0.24);
  color: #f5fbff;
  background: rgba(6, 15, 24, 0.72);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
  font-weight: 900;
  touch-action: none;
  user-select: none;
}

.mobile-button-bank button.active {
  border-color: rgba(255, 176, 0, 0.92);
  color: #15120a;
  background: var(--accent);
}

.mobile-throttle {
  align-self: stretch;
  width: 84px;
  padding: 10px 9px;
  border: 1px solid rgba(245, 251, 255, 0.2);
  border-radius: 0;
  background: rgba(5, 14, 22, 0.68);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
}

.mobile-throttle input {
  width: 148px;
  height: 30px;
  transform: rotate(-90deg);
  transform-origin: center;
  margin: 56px -46px 44px;
  touch-action: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  #select-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 16px;
    overflow: auto;
  }

  #select-header {
    display: grid;
    padding-bottom: 12px;
  }

  .select-account {
    flex-wrap: wrap;
  }

  #aircraft-grid {
    overflow: visible;
    padding: 12px;
  }

  #aircraft-detail {
    width: auto;
    justify-self: stretch;
    margin-bottom: 16px;
  }

  #auth-screen {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 18px;
    padding: 16px;
    align-items: start;
    padding-bottom: 28px;
  }

  .auth-backdrop {
    background-position: 64% center;
  }

  #auth-screen::before {
    inset: auto auto 3% 6%;
    width: 120px;
  }

  .auth-copy {
    align-self: end;
    padding-bottom: 0;
  }

  .auth-copy h1 {
    max-width: 10ch;
  }

  .auth-copy p:not(.eyebrow) {
    margin-top: 10px;
    font-size: 0.95rem;
  }

  .auth-feature-grid {
    grid-template-columns: 1fr;
  }

  .auth-feature {
    min-height: 0;
  }

  #auth-panel {
    left: auto;
    right: auto;
    top: auto;
    width: auto;
    padding: 16px;
  }

  #auth-panel {
    justify-self: stretch;
  }

  h1 {
    max-width: 14ch;
    font-size: 2.25rem;
  }

  .brief {
    display: none;
  }

  #hud {
    left: 12px;
    bottom: 12px;
    top: auto;
    width: min(296px, calc(100vw - 24px));
    height: auto;
    gap: 6px;
    flex-direction: column;
    align-items: stretch;
  }

  #minimap {
    right: 12px;
    top: 12px;
    bottom: auto;
    width: 92px;
    height: 92px;
  }

  #settings-button {
    left: 16px;
    right: auto;
    top: 16px;
  }

  #settings-dialog {
    left: 16px;
    right: 16px;
    top: 72px;
    width: auto;
    max-height: calc(100svh - 88px);
    padding: 16px;
  }

  #settings-aircraft-grid {
    grid-template-columns: 1fr;
  }

  .range-row {
    grid-template-columns: 1fr auto;
  }

  .range-row input {
    grid-column: 1 / -1;
  }

  #attitude-card {
    padding: 6px;
    flex-basis: auto;
    flex: 0 0 auto;
    min-height: 176px;
  }

  #attitude-canvas {
    max-width: 162px;
    justify-self: center;
  }

  #annunciator {
    top: auto;
    right: 12px;
    left: auto;
    bottom: 108px;
    width: min(188px, calc(100vw - 24px));
    padding: 10px 12px;
  }

  #game-screen.mobile-controls-enabled #annunciator {
    bottom: 262px;
  }

  #game-screen.mobile-controls-enabled #danmaku-layer {
    inset-block-start: 142px;
    height: 32svh;
  }

  #game-screen.mobile-controls-enabled #hud {
    bottom: 262px;
  }

  #chat-form {
    bottom: 142px;
    grid-template-columns: minmax(0, 1fr);
  }

  #game-screen.mobile-controls-enabled #chat-form {
    bottom: 278px;
  }

  #hud-strip {
    min-width: 0;
    width: 100%;
    padding: 6px;
    gap: 6px;
  }

  .hud-panel-header {
    gap: 8px;
  }

  .hud-label {
    font-size: 0.58rem;
  }

  .hud-label-stack strong,
  .hud-heading-readout strong,
  .hud-attitude-foot strong {
    font-size: 0.66rem;
  }

  .hud-heading-readout span,
  .hud-attitude-foot span,
  .hud-metric span,
  .hud-data-state,
  .hud-lever-label span {
    font-size: 0.56rem;
  }

  .hud-metric {
    gap: 3px;
    padding: 3px 0 5px;
  }

  .hud-metric strong {
    font-size: 0.74rem;
  }

  .hud-lever-bank {
    gap: 5px;
  }

  .hud-lever {
    padding: 5px 5px 6px;
    gap: 5px;
  }

  .hud-lever-label strong {
    font-size: 0.62rem;
  }

  .hud-lever-track {
    height: 62px;
  }

  .hud-lever-thumb {
    top: calc(7px + (1 - var(--lever-position, 0)) * 42px);
    width: 40px;
    height: 12px;
  }

  #minimap-canvas {
    width: 100%;
    height: 100%;
  }

  #annunciator strong {
    font-size: 0.82rem;
  }

  #annunciator span {
    font-size: 0.68rem;
    line-height: 1.3;
  }
}

@media (max-width: 430px) {
  .auth-meta-row {
    gap: 8px;
  }

  .auth-chip {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .auth-briefing {
    padding: 14px 14px 12px;
  }

  #hud {
    left: 10px;
    bottom: 10px;
    width: min(258px, calc(100vw - 20px));
  }

  #attitude-card {
    min-height: 156px;
  }

  #attitude-canvas {
    max-width: 138px;
  }

  #minimap {
    right: 10px;
    top: 10px;
    width: 82px;
    height: 82px;
  }

  #annunciator {
    right: 10px;
    bottom: 96px;
    width: min(162px, calc(100vw - 20px));
    padding: 8px 10px;
  }

  #game-screen.mobile-controls-enabled #hud {
    bottom: 248px;
  }

  #game-screen.mobile-controls-enabled #annunciator {
    bottom: 248px;
  }

  .hud-data-grid {
    gap: 5px 6px;
  }

  .hud-metric strong {
    font-size: 0.68rem;
  }

  .hud-lever-track {
    height: 56px;
  }

  .hud-lever-thumb {
    top: calc(7px + (1 - var(--lever-position, 0)) * 36px);
    width: 36px;
  }
}

@media (max-width: 430px) {
  #mobile-controls {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 7px;
    padding: 0 10px;
  }

  .mobile-stick {
    width: 100%;
  }

  #mobile-stick-knob {
    width: 50px;
    height: 50px;
  }

  .mobile-button-bank button {
    min-height: 38px;
    font-size: 0.7rem;
  }

  .mobile-throttle {
    width: 72px;
  }

  .mobile-throttle input {
    width: 132px;
    margin: 50px -40px 38px;
  }

  .mobile-stick-panel {
    width: 152px;
    height: 152px;
    left: 14px;
    bottom: 116px;
  }
}
