/* ==========================================================================
   Hangar page — War Thunder style hangar HUD (own drawings, parody).
   The 3D stage sits underneath; drags fall through wherever there's no panel.
   ========================================================================== */

.page-hangar {
  --g-bar: rgba(20, 28, 36, 0.94);
  --g-panel: rgba(22, 31, 40, 0.86);
  --g-panel-2: rgba(30, 42, 53, 0.92);
  --g-head: rgba(44, 58, 72, 0.95);
  --g-line: rgba(140, 165, 185, 0.22);
  --g-text: #c9d3dc;
  --g-dim: #8b9aa7;
  --g-gold: #f0b640;
  --g-red-1: #b8261d;
  --g-red-2: #86170f;

  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  color: var(--g-text);
  font-size: 14px;
}
.page-hangar .log__body,
.page-hangar .gnotice__text {
  -webkit-user-select: text;
  user-select: text;
}

.gpanel {
  background: var(--g-panel);
  border: 1px solid var(--g-line);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ---------- Top bar ---------- */
.gbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-hud);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  padding: 0 10px;
  background: linear-gradient(180deg, rgba(30, 41, 51, 0.97), var(--g-bar));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.gbar__left,
.gbar__right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.gbar__right {
  justify-self: end;
}
.gbar__icon,
.gbar__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--g-dim);
  font-size: 14px;
  white-space: nowrap;
}
.gbar__icon .icon {
  width: 20px;
  height: 20px;
}
.gbar__icon:hover,
.gbar__link:hover,
.gbar__icon[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.gbar__link {
  padding: 0 16px;
}
.gbar__icon--medal {
  color: var(--g-gold);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.gbar__icon--medal span {
  color: var(--g-text);
}
.gbar__squad {
  margin-left: 18px;
  color: var(--g-dim);
  font-size: 13px;
}
.gbar__player {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 18px;
  color: var(--g-text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.gbar__roundel {
  width: 18px;
  height: 18px;
}
.gbar__star {
  color: var(--g-gold);
}
.gbar__nick {
  margin-left: 4px;
}
.gcoin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--g-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.gcoin .icon {
  width: 18px;
  height: 18px;
}
.gcoin--sl .icon {
  color: #aeb9c2;
}
.gcoin--ge .icon {
  color: var(--g-gold);
}
.gcoin:hover {
  background: rgba(255, 255, 255, 0.07);
}
.gshop {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin: 0 6px 0 18px;
  padding: 0 12px;
  border: 1px solid rgba(214, 90, 70, 0.6);
  background: linear-gradient(180deg, rgba(150, 40, 30, 0.55), rgba(90, 20, 14, 0.55));
  color: #f2d9d4;
  font-size: 14px;
}
.gshop .icon {
  width: 17px;
  height: 17px;
}
.gshop__alert {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--g-gold);
  color: #1b1b1b;
  font-weight: 700;
  font-size: 11px;
}
.gbar__version {
  position: absolute;
  top: 1px;
  right: 8px;
  color: var(--g-dim);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

/* dropdowns */
.gmenu {
  position: relative;
}
.gdrop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 3;
  display: grid;
  min-width: 220px;
  padding: 4px;
  background: rgba(20, 28, 36, 0.98);
}
.gdrop a,
.gdrop button {
  display: block;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--g-text);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}
.gdrop a:hover,
.gdrop button:hover,
.gdrop button:focus-visible,
.gdrop a:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* ---------- To Battle + mode ---------- */
.gbattle {
  position: relative;
  display: flex;
  justify-content: center;
  align-self: start;
  padding-top: 3px;
}
.gbattle__btn {
  position: relative;
  z-index: 1;
  width: 152px;
  height: 36px;
  border: 1px solid #e27a66;
  background: linear-gradient(180deg, #c92e22 0%, var(--g-red-1) 45%, var(--g-red-2) 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  transition: filter 0.15s ease;
}
.gbattle__btn:hover {
  filter: brightness(1.12);
}
.gbattle__btn:active {
  filter: brightness(0.92);
}
.gbattle__mode {
  position: absolute;
  top: 40px;
  left: 50%;
  display: grid;
  gap: 2px;
  width: 270px;
  padding: 6px 10px 5px;
  border: 1px solid var(--g-line);
  border-top: 0;
  background: rgba(24, 38, 56, 0.9);
  color: var(--g-dim);
  font-size: 13px;
  text-align: center;
  transform: translateX(-50%);
}
.gbattle__mode:hover,
.gbattle__mode[aria-expanded="true"] {
  background: rgba(32, 50, 72, 0.95);
  color: var(--g-text);
}
.gbattle__mode-name {
  color: var(--g-text);
}
.gbattle__mode-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 12px;
}
.gbattle__mode-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gbattle__mode-row .icon {
  width: 13px;
  height: 13px;
}
.gdrop--mode {
  top: 98px;
  left: 50%;
  width: 270px;
  transform: translateX(-50%);
}
.gdrop--mode button {
  position: relative;
  display: grid;
  gap: 1px;
  padding-left: 26px;
}
.gdrop--mode button[aria-checked="true"]::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 15px;
  width: 7px;
  height: 7px;
  background: var(--g-gold);
  transform: rotate(45deg);
}
.mode__name {
  font-size: 14px;
}
.mode__note {
  color: var(--g-dim);
  font-size: 12px;
}

/* ---------- Left: achievements ---------- */
.gfav {
  position: fixed;
  top: 96px;
  left: 10px;
  z-index: var(--z-hud);
  width: 300px;
  animation: card-in 0.6s var(--ease-out) both;
}
.gpanel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  background: var(--g-head);
}
.gpanel__head .icon {
  width: 16px;
  height: 16px;
  color: var(--g-dim);
}
.gpanel__head h2 {
  flex: 1;
  color: #e3e9ee;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gfav__list {
  display: grid;
}
.gfav__item {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 8px 12px 8px 10px;
  border-bottom: 1px solid var(--g-line);
}
.gfav__item .icon {
  width: 50px;
  height: 50px;
  color: #6f7c86;
}
.gfav__item.is-done .icon {
  color: var(--g-gold);
}
.gfav__name {
  color: var(--g-gold);
  font-size: 13px;
  line-height: 1.3;
}
.gfav__item:not(.is-done) .gfav__name {
  color: var(--g-dim);
}
.gfav__hint {
  margin-top: 2px;
  color: var(--g-dim);
  font-size: 12px;
  line-height: 1.3;
}
.gfav__bar {
  height: 3px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.1);
}
.gfav__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--g-gold);
}
.gfav__item.is-done .gfav__bar span {
  width: 100%;
}
.gpanel__foot {
  display: block;
  width: 100%;
  height: 30px;
  border: 0;
  background: rgba(44, 58, 72, 0.7);
  color: var(--g-text);
  font-size: 14px;
}
.gpanel__foot:hover {
  background: rgba(60, 78, 96, 0.85);
  color: #fff;
}

/* ---------- Right: launch pass ---------- */
.gpass {
  position: fixed;
  top: 150px;
  right: 12px;
  z-index: var(--z-hud);
  width: 250px;
  animation: card-in-r 0.6s 0.1s var(--ease-out) both;
}
.gpass__card {
  padding: 8px 10px 10px;
}
.gpass__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gpass__stamp {
  padding: 1px 8px;
  border: 1px solid #d9dee2;
  color: #eef2f4;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-4deg) skewX(-6deg);
}
.gpass__level {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e3e9ee;
  font-size: 14px;
}
.gpass__lvl {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  background: #c62b23;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}
.gpass__warn {
  margin-bottom: 6px;
  color: var(--g-text);
  font-size: 13px;
}
.gpass__warn span {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--g-gold);
  color: #1b1b1b;
  font-weight: 700;
  font-size: 10px;
}
.gpass__task {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  border-top: 1px solid var(--g-line);
  border-bottom: 1px solid var(--g-line);
  background: none;
  color: #e3e9ee;
  font-size: 13px;
  text-align: left;
}
.gpass__task span {
  flex: 1;
}
.gpass__task small {
  color: var(--g-dim);
  font-size: 12px;
}
.gpass__task .icon {
  width: 16px;
  height: 16px;
  color: var(--g-gold);
}
.gpass__task:hover {
  background: rgba(255, 255, 255, 0.05);
}
.gpass__goal {
  margin: 6px 0 8px;
  color: var(--g-dim);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}
.gpass__research p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--g-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.gpass__research p span:last-child {
  color: #7fc0f5;
}
.gpass__bar {
  height: 5px;
  overflow: hidden;
  background: rgba(90, 174, 240, 0.14);
}
.gpass__bar span {
  display: block;
  width: 97.4%;
  height: 100%;
  background: #5aaef0;
  transition: width 0.8s var(--ease-out);
}
.gpass__bar.is-setback span {
  background: var(--missing);
}
.gpass__time {
  margin-top: 8px;
  color: var(--g-dim);
  font-size: 12px;
  text-align: right;
}
.gpass__time b {
  color: var(--g-text);
  font-weight: 500;
}
.gpass__all {
  display: block;
  margin-top: 2px;
  color: var(--g-text);
  font-size: 13px;
  text-align: right;
  text-decoration: none;
}
.gpass__all:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Center notice (where the camouflage notice lives in game) ---------- */
.gnotice {
  position: fixed;
  left: 50%;
  bottom: 186px;
  z-index: var(--z-hud);
  display: grid;
  justify-items: center;
  gap: 2px;
  width: min(600px, calc(100vw - 24px));
  padding: 14px 40px 16px;
  background: radial-gradient(closest-side, rgba(8, 12, 16, 0.78), rgba(8, 12, 16, 0.5) 65%, rgba(8, 12, 16, 0));
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  animation: fade-in 0.8s 0.2s ease both;
}
.gnotice:focus {
  outline: none;
}
.gnotice__title {
  color: #f1f4f6;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
}
.gnotice__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ff8ae9;
  font-size: 14px;
}
.gnotice__status .swatch-missing {
  animation: blink 1.4s steps(2, jump-none) infinite;
}
.gnotice__text {
  max-width: 48ch;
  color: #dfe5ea;
  font-size: 14px;
  line-height: 1.45;
}
.gnotice__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 5px 16px;
  border: 1px solid var(--g-line);
  background: rgba(40, 54, 68, 0.9);
  color: #e3e9ee;
  font-size: 14px;
  text-decoration: none;
  text-shadow: none;
}
.gnotice__btn .icon {
  width: 16px;
  height: 16px;
}
.gnotice__btn:hover {
  background: rgba(60, 80, 100, 0.95);
  color: #fff;
}
.gnotice.is-snail .gnotice__status {
  color: var(--g-gold);
}
.gnotice.is-snail .gnotice__status .swatch-missing {
  animation: none;
  background: var(--g-gold);
}
.gnotice.is-glitching .gnotice__title,
.gnotice.is-glitching .gnotice__status {
  animation: glitch-swap 0.34s steps(4, end) both;
}

/* ---------- Right: engine log ---------- */
.glog {
  position: fixed;
  right: 12px;
  bottom: 196px;
  z-index: var(--z-hud);
  width: 300px;
  animation: card-in-r 0.6s 0.2s var(--ease-out) both;
}
.glog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
  padding: 0 6px 0 10px;
  background: var(--g-head);
}
.glog__title {
  color: #e3e9ee;
  font-weight: 500;
  font-size: 13px;
}
.glog__toggle {
  padding: 2px 6px;
  border: 0;
  background: none;
  color: var(--g-dim);
  font-size: 12px;
}
.glog__toggle:hover {
  color: #fff;
}
.log__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 112px;
  overflow: hidden;
  padding: 5px 10px 7px;
  color: var(--g-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%);
  mask-image: linear-gradient(180deg, transparent 0, #000 30%);
}
.glog.is-collapsed .log__body {
  display: none;
}
.log__line {
  flex: none;
  animation: log-in 0.25s ease both;
}
.log__time {
  margin-right: 6px;
  color: #5f6d78;
}
.log__lvl {
  margin-right: 6px;
}
.log__lvl--info {
  color: #7f9bb0;
}
.log__lvl--warn {
  color: var(--g-gold);
}
.log__lvl--err {
  color: var(--missing);
}
.log__lvl--ok {
  color: var(--wire);
}
.log__line a {
  color: #e3e9ee;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.log__line a:hover {
  color: var(--missing);
}

/* ---------- Bottom dock ---------- */
.gdock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: var(--z-hud);
  width: min(1240px, calc(100vw - 20px));
  background: linear-gradient(180deg, rgba(22, 31, 40, 0.82), rgba(14, 20, 26, 0.94));
  border: 1px solid var(--g-line);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  animation: dock-in 0.6s 0.1s var(--ease-out) both;
}
.gdock__tabs {
  display: flex;
  align-items: stretch;
  height: 28px;
  border-bottom: 1px solid var(--g-line);
}
.gdock__research {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  width: 150px;
  background: rgba(60, 78, 96, 0.55);
  color: #e3e9ee;
  font-size: 14px;
  text-decoration: none;
}
.gdock__research .icon {
  width: 16px;
  height: 16px;
  color: var(--g-dim);
}
.gdock__research:hover {
  background: rgba(80, 102, 124, 0.7);
}
.gnations {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.gnations::-webkit-scrollbar {
  display: none;
}
.gnation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--g-dim);
  font-size: 13px;
  white-space: nowrap;
}
.gnation svg {
  width: 18px;
  height: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.gnation:first-child svg {
  width: 15px;
  height: 15px;
  box-shadow: none;
}
.gnation:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.gnation.is-active {
  border-bottom-color: #dfe5ea;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.gdock__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--g-dim);
}
.gdock__tools .icon {
  width: 16px;
  height: 16px;
}

.gslots {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.gslots::-webkit-scrollbar {
  display: none;
}
.gslot {
  position: relative;
  display: block;
  flex: none;
  width: 124px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(150, 170, 190, 0.28);
  background: linear-gradient(180deg, #2c3a47, #1a242d);
  color: #eef2f4;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s ease, filter 0.15s ease;
}
.gslot:hover {
  border-color: rgba(210, 222, 232, 0.7);
  filter: brightness(1.1);
}
.gslot.is-selected {
  border-color: #e7ecef;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.gslot__art {
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 62px;
  color: #aeb9c2;
}
.gslot__art svg {
  width: 62px;
  height: 22px;
}
.gslot__art img {
  height: 44px;
  width: auto;
  transform: rotate(-4deg);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.gslot__art .gslot__lock {
  width: 20px;
  height: 20px;
}
.gslot__art--crew {
  left: 0;
  top: 0;
  width: 100%;
  bottom: 16px;
  opacity: 0.55;
}
.gslot__art--crew svg {
  width: 88px;
  height: 56px;
}
.gslot__name {
  position: absolute;
  top: 5px;
  right: 7px;
  max-width: 60px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gslot__br {
  position: absolute;
  right: 7px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.gslot__br svg {
  width: 8px;
  height: 8px;
  color: #6fd46a;
}
.gslot__crew {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--g-dim);
  font-size: 10.5px;
  line-height: 16px;
  text-align: center;
}
.gslot__choose {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  color: #e3e9ee;
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.gslot__price {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #e9564a;
  font-size: 12px;
}
.gslot__price svg {
  width: 12px;
  height: 12px;
  color: var(--g-gold);
}
.gslot.is-locked .gslot__name,
.gslot.is-locked .gslot__br {
  color: var(--g-dim);
}

.gpresets {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 6px;
  border-top: 1px solid var(--g-line);
  font-size: 13px;
}
.gpresets__btn,
.gpresets__brs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  background: none;
  color: var(--g-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.gpresets__btn .icon {
  width: 15px;
  height: 15px;
}
.gpresets__btn:hover,
.gpresets__brs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.gpresets__cat {
  padding: 0 8px;
  color: #e3e9ee;
}
.gpresets__brs {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
}
.gpresets__squad {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-right: 6px;
  color: var(--g-dim);
}
.gpresets__squad .icon {
  width: 16px;
  height: 16px;
}

/* ---------- FPS + footer ---------- */
.gfps {
  position: fixed;
  left: 8px;
  bottom: 4px;
  z-index: var(--z-hud);
  display: flex;
  gap: 12px;
  color: #6f7d88;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.gfps b {
  color: #9aa7b1;
  font-weight: 500;
}
.hud-footer {
  position: fixed;
  right: 12px;
  bottom: 3px;
  z-index: var(--z-hud);
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #6f7d88;
  font-size: 11px;
}
.hud-footer a,
.hud-footer button {
  padding: 0;
  border: 0;
  background: none;
  color: #9aa7b1;
  font-size: 11px;
  text-decoration: underline;
  text-decoration-color: rgba(163, 175, 184, 0.35);
  text-underline-offset: 2px;
}
.hud-footer a:hover,
.hud-footer button:hover {
  color: #fff;
}

/* ---------- Locust dialog ---------- */
.gdialog {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(3, 6, 8, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease both;
}
.gdialog__panel {
  width: min(440px, 100%);
  padding: 0 0 16px;
  background: rgba(22, 31, 40, 0.98);
  text-align: center;
}
.gdialog__title {
  padding: 7px 12px;
  background: var(--g-head);
  color: #e3e9ee;
  font-weight: 500;
  font-size: 16px;
}
.gdialog__text {
  padding: 16px 22px 18px;
  color: var(--g-text);
  font-size: 15px;
  line-height: 1.5;
}
.gdialog__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gdialog__go {
  display: inline-grid;
  place-items: center;
  min-width: 150px;
  height: 36px;
  border: 1px solid #e27a66;
  background: linear-gradient(180deg, #c92e22, var(--g-red-2));
  color: #fff;
  font-size: 16px;
  text-decoration: none;
}
.gdialog__go:hover {
  filter: brightness(1.12);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
}
@keyframes card-in-r {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}
@keyframes dock-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
@keyframes log-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes glitch-swap {
  0% {
    transform: translateX(0);
    text-shadow: 3px 0 var(--missing), -3px 0 var(--wire);
  }
  25% {
    transform: translateX(-4px) skewX(-10deg);
    clip-path: inset(10% 0 45% 0);
  }
  50% {
    transform: translateX(3px);
    clip-path: inset(55% 0 5% 0);
  }
  100% {
    transform: none;
    clip-path: none;
  }
}

/* Hold entrances until the loader lifts (only when JS runs). */
.js body:not(.is-ready) .gfav,
.js body:not(.is-ready) .gpass,
.js body:not(.is-ready) .glog,
.js body:not(.is-ready) .gdock,
.js body:not(.is-ready) .gnotice {
  animation-play-state: paused;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
/* ---------- Stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: var(--z-stage);
  background: #020604;
}
.stage__rain,
.stage__gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage__gl {
  touch-action: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.stage__gl.is-dragging {
  cursor: grabbing;
}
.stage__gl.is-pointer {
  cursor: pointer;
}
.stage__fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 55% 55%, transparent 58%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, transparent 72%, rgba(3, 6, 8, 0.55) 100%);
}

.no-webgl .stage {
  background: #0b1014 url("../assets/img/hangar-fallback.jpg") center / cover no-repeat;
}
.no-webgl .stage__rain,
.no-webgl .stage__gl {
  display: none;
}

/* ---------- 3D-anchored labels ---------- */
.anchors {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.anchor {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.anchor.is-hidden {
  visibility: hidden;
}

.model-tag {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  transform: translate(-50%, calc(-100% - 30px));
  border: 1px solid rgba(238, 106, 31, 0.55);
  background: rgba(9, 13, 17, 0.8);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
.model-tag b {
  color: var(--battle-2);
  font-weight: 600;
}
.model-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 30px;
  background: linear-gradient(rgba(238, 106, 31, 0.8), rgba(238, 106, 31, 0));
}

.bubble {
  position: relative;
  width: 230px;
  padding: 12px 14px 14px;
  transform: translate(-50%, calc(-100% - 16px));
  border-radius: 12px;
  background: #fbf6e6;
  color: #1c1a17;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  pointer-events: auto;
  animation: bubble-in 0.45s var(--ease-out) both;
}
.bubble::after {
  content: "";
  position: absolute;
  left: calc(50% - 9px);
  top: calc(100% - 1px);
  border: 9px solid transparent;
  border-top-color: #fbf6e6;
  border-bottom-width: 0;
}
.bubble__btn {
  width: 100%;
  margin-top: 10px;
  border: 0;
  background: linear-gradient(180deg, var(--battle-2), var(--battle-1));
  color: #fff;
}
.bubble__btn:hover {
  background: linear-gradient(180deg, #ff7d33, #cc3620);
}
@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 4px)) scale(0.92);
  }
}


/* ---------- Tooltip (object inspector) ---------- */
.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-tooltip);
  max-width: 290px;
  padding: 8px 11px 9px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--wire);
  background: rgba(8, 12, 15, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  will-change: transform;
}
.tooltip__id {
  margin-bottom: 3px;
  color: var(--wire);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
}
.tooltip__text {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.tooltip__hint {
  margin-top: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
.tooltip--error {
  border-left-color: var(--missing);
}
.tooltip--error .tooltip__id {
  color: var(--missing);
}

/* ---------- Matchmaking ---------- */
.matchmaking {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(3, 6, 8, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.25s ease both;
}
.matchmaking__panel {
  position: relative;
  width: min(440px, 100%);
  padding: 26px 26px 22px;
  overflow: hidden;
  text-align: center;
  background: var(--panel-solid);
  border-top: 2px solid var(--battle-2);
}
.matchmaking__mode {
  color: var(--ink-faint);
  font-size: 13px;
}
.matchmaking__title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
}
.matchmaking__radar {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 14px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(66, 245, 138, 0.22) 31.5% 32.5%, transparent 33% 64%, rgba(66, 245, 138, 0.22) 64.5% 65.5%, transparent 66%),
    linear-gradient(transparent calc(50% - 0.5px), rgba(66, 245, 138, 0.18) 0 calc(50% + 0.5px), transparent 0),
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(66, 245, 138, 0.18) 0 calc(50% + 0.5px), transparent 0),
    rgba(66, 245, 138, 0.04);
  box-shadow: inset 0 0 0 1px rgba(66, 245, 138, 0.35);
}
.matchmaking__radar span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(66, 245, 138, 0.45), rgba(66, 245, 138, 0) 25%);
  animation: sweep 2.4s linear infinite;
}
.matchmaking__timer {
  margin: -84px 0 46px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
}
.matchmaking__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 14px;
  text-align: left;
}
.matchmaking__meta > div {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.matchmaking__meta dt {
  color: var(--ink-faint);
  font-size: 12px;
}
.matchmaking__meta dd {
  font-weight: 600;
  font-size: 15px;
}
.matchmaking__tip {
  min-height: 4.2em;
  margin-bottom: 14px;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.45;
}
.matchmaking.is-found .matchmaking__title {
  color: var(--gold);
}
.matchmaking.is-failed .matchmaking__title {
  color: var(--missing);
}
@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  align-items: flex-end;
  padding: var(--gutter) var(--gutter) calc(clamp(32px, 8vh, 88px) + var(--safe-bottom));
  background:
    radial-gradient(120% 90% at 30% 40%, rgba(18, 27, 34, 0.2), rgba(4, 7, 9, 0.9)),
    linear-gradient(rgba(90, 174, 240, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(90, 174, 240, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    #0a0f13;
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
}
html:not(.js) .loader {
  display: none;
}
.loader__inner {
  width: min(560px, 100%);
}
.loader__eyebrow {
  color: var(--ink-faint);
  font-size: 14px;
}
.loader__title {
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 7vw, 84px);
  line-height: 0.95;
}
.loader__bar {
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--battle-1), var(--battle-2));
  box-shadow: 0 0 14px rgba(238, 106, 31, 0.7);
  transition: width 0.35s var(--ease-out);
}
.loader__status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 22px;
  color: var(--ink-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.loader__tip {
  max-width: 56ch;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.5;
}
.loader.is-stuck .loader__bar span {
  background: linear-gradient(90deg, #b81f99, var(--missing));
  box-shadow: 0 0 14px rgba(255, 43, 214, 0.7);
}

.noscript {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  top: 80px;
  z-index: var(--z-loader);
  padding: 16px;
}


.page-hangar .toasts {
  top: 50px;
}
.noscript {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 80px;
  z-index: var(--z-loader);
  padding: 16px;
}

/* ---------- Medium screens ---------- */
@media (max-width: 1400px) {
  .gbar__squad,
  .gbar__version {
    display: none;
  }
  .gpresets__squad {
    display: none;
  }
}
@media (max-width: 1180px) {
  .gbar__link,
  .gbar__player {
    display: none;
  }
  .glog {
    display: none;
  }
  .gfav {
    width: 260px;
  }
  .gpass {
    width: 220px;
  }
}
@media (max-height: 820px) {
  .glog {
    display: none;
  }
  .gfav__item:nth-child(3) {
    display: none;
  }
}
@media (max-height: 700px) and (min-width: 721px) {
  .gpass,
  .gfav {
    display: none;
  }
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 900px) {
  .gfav,
  .gpass,
  .glog,
  .gbattle__mode,
  .gdrop--mode,
  .gcoin,
  .gshop,
  .gbar__icon[data-bar],
  .gdock__tools,
  .gpresets,
  .hud-footer p {
    display: none;
  }
  .gbar {
    grid-template-columns: auto 1fr auto;
    height: 46px;
  }
  .gbattle {
    padding-top: 5px;
  }
  .gbattle__btn {
    width: 140px;
    height: 34px;
    font-size: 19px;
  }
  .gnotice {
    top: 58px;
    bottom: auto;
    padding: 12px 14px 14px;
    background: rgba(18, 26, 33, 0.9);
    border: 1px solid var(--g-line);
    text-shadow: none;
  }
  .gnotice__title {
    font-size: 18px;
  }
  .gdock {
    bottom: 20px;
    width: 100vw;
    border-left: 0;
    border-right: 0;
  }
  .gdock__research {
    width: 116px;
  }
  .gslot {
    width: 112px;
    height: 66px;
  }
  .gfps {
    display: none;
  }
  .hud-footer {
    left: 12px;
    right: auto;
  }
}
@media (max-width: 380px) {
  .gbattle__btn {
    width: 124px;
    font-size: 17px;
  }
}
