:root {
  color-scheme: dark;
  --ink:#f3eee4;
  --muted:#9aafaf;
  --gold:#efbc79;
  --mint:#8cdac7;
  --line:#344a51;
  --panel:#14252e;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #09151e;
  color: var(--ink);
  font-family: Barlow, sans-serif;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: .45;
  cursor: default;
}
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
.fleet-app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 12px;
  overflow: hidden;
  background: linear-gradient(#07141de8, #0b1721ed), url(./art/terminus.webp?v=9c206968) center/cover;
}
.mast {
  flex: none;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
h1 {
  font: 800 calc(27px * var(--tyrants-text-game-title, 1)) "Barlow Condensed", sans-serif;
  letter-spacing: 3px;
}
.eyebrow {
  font: 9px "IBM Plex Mono", monospace;
  letter-spacing: 1.5px;
  color: var(--mint);
}
.mast .eyebrow {
  display: none;
}
.round {
  margin-left: auto;
  font: 11px "IBM Plex Mono", monospace;
  color: var(--muted);
}
.help,
.sell,
.cancel,
.reroll {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #20333b;
  padding: 8px 12px;
  min-height: 34px;
}
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 38px 216px;
  gap: 8px;
  overflow: hidden;
}
.battle-heading,
.doctrine {
  display: none;
}
.arena {
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 8px;
}
.fleet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 6px;
}
.fleet header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  flex: none;
}
.fleet header img {
  height: 34px;
  width: 34px;
  object-fit: cover;
  border: 1px solid var(--fleet-paint, var(--mint));
  border-radius: 50%;
}
.enemy header img {
  border-color: var(--fleet-paint, #df9b8b);
}
.fleet header h2 {
  font: 600 calc(18px * var(--tyrants-text-fleet-names, 1)) "Barlow Condensed", sans-serif;
}
.fleet header p {
  font-size: 10px;
  color: var(--muted);
}
.fleet header b {
  margin-left: auto;
  white-space: nowrap;
  color: var(--gold);
  font-size: 11px;
}
.line {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 5px;
  touch-action: none;
}
.berth {
  position: relative;
  min-width: 0;
  min-height: 0;
  touch-action: none;
}
.berth.covered {
  display: none;
}
.ship {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 0;
  min-width: 0;
  padding: 5px 3px 29px;
  border: 1px solid #49665d;
  border-radius: 7px;
  background:
    linear-gradient(
      145deg,
      #203b36a6,
      #11222ce8);
}
.enemy .ship {
  border-color: #72564f;
  background:
    linear-gradient(
      145deg,
      #442e2e8a,
      #11222ce8);
}
.ship:not(.occupied) {
  background: #15242b50;
  border-style: dashed;
  color: #718c90;
  padding-bottom: 5px;
}
.ship-label {
  position: absolute;
  top: 4px;
  left: 5px;
  font: calc(8px * var(--tyrants-text-grid-labels, 1)) "IBM Plex Mono", monospace;
  color: var(--muted);
}
.ship-art {
  position: relative;
  width: 100%;
  height: clamp(20px, 5vh, 50px);
  flex: 0 1 50px;
  min-height: 16px;
}
.ship-art img,
.ship-art canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.enemy .ship-art img,
.enemy .ship-art canvas {
  transform: scaleX(-1);
}
.ship-art span {
  color: #56757a;
  font-size: 20px;
}
.numbers {
  font: 9px "IBM Plex Mono", monospace;
  white-space: nowrap;
}
.health {
  width: 84%;
  height: 3px;
  background: #07121b;
  border-radius: 2px;
  overflow: hidden;
  flex: none;
}
.health i {
  display: block;
  height: 100%;
  background: var(--mint);
  transition: width .15s;
}
.enemy .health i {
  background: #e99f8b;
}
.ship:not(.occupied) .health {
  visibility: hidden;
}
.level {
  position: absolute;
  right: 5px;
  top: 4px;
  font-size: 8px;
  color: var(--gold);
}
.flagship {
  border-color: var(--gold) !important;
}
.flagship .ship-label {
  color: var(--gold);
}
.ship.selected, .ship.drop {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  background: #57d2ac26 !important;
}
.ship.reachable {
  box-shadow: inset 0 0 0 1px var(--gold);
}
.ship.wreck {
  opacity: .23;
  filter: grayscale(1);
}
.mounts {
  position: absolute;
  bottom: 4px;
  left: 3px;
  right: 3px;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.mount {
  width: 26px;
  height: 23px;
  min-height: 0;
  padding: 0;
  border: 1px solid #6a9993;
  border-radius: 4px;
  background: #1c393e;
  color: #bcf3e8;
  font: 600 11px "IBM Plex Mono", monospace;
}
.mount[data-type=utility] {
  border-color: #7591b9;
  background: #273950;
  color: #c2dcff;
}
.mount[data-type=hangar] {
  border-color: #b09c63;
  background: #413b29;
  color: #ffe3a1;
}
.mount.empty {
  border-style: dashed;
  background: #0c1b24;
  color: #839da3;
}
.mount[aria-pressed=true] {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
  color: var(--gold);
}
.versus {
  align-self: center;
  text-align: center;
  font: 10px "IBM Plex Mono", monospace;
  color: var(--gold);
}
.effects {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fleet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}
.status {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.engage,
.fit {
  background: var(--gold);
  color: #18262b;
  font-weight: 700;
  border: 0;
  border-radius: 5px;
  padding: 9px 17px;
  min-height: 34px;
  white-space: nowrap;
}
.supply {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 34px minmax(0, 1fr);
  gap: 7px 12px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.supply-head {
  grid-column: 1/-1;
  display: flex;
  gap: 8px;
  align-items: center;
}
.supply-head > button {
  background: none;
  border: 0;
  padding: 5px 8px;
  color: var(--muted);
  font-weight: 600;
  min-height: 30px;
}
.supply-head > button[aria-pressed=true] {
  color: var(--gold);
}
.wallet {
  margin-left: auto;
  color: var(--gold);
  font: 600 12px "IBM Plex Mono", monospace;
  white-space: nowrap;
}
.supply-head .reroll {
  border: 1px solid var(--line);
  background: #20333b;
  color: var(--ink);
  padding: 5px 10px;
}
.shop {
  min-height: 0;
}
.offers {
  height: 100%;
}
.gear-shop {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 20px 34px 42px minmax(28px, 1fr);
  gap: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #13252d;
  padding: 8px;
}
.gear-shop > h2,
.gear-shop > p:not(.fit-summary),
.inspector p {
  display: none;
}
.inspector {
  grid-column: 1/-1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.inspector strong {
  font-size: 13px;
  color: var(--gold);
}
.sockets {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
}
.sockets button {
  min-width: 0;
  padding: 5px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  background: #20363d;
  border-radius: 4px;
  font-size: 10px;
  text-align: left;
}
.sockets button[aria-pressed=true] {
  border-color: var(--gold);
  color: var(--gold);
}
.gear-offers {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
}
.gear-offer {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #20363d;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}
.gear-offer[aria-pressed=true] {
  border-color: var(--gold);
  color: var(--gold);
  background: #33483f;
}
.fit-summary {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}
.fit {
  align-self: center;
  font-size: 11px;
  padding: 8px 12px;
}
@media (max-width: 900px) {
  .help {
    padding: 5px 8px;
    min-height: 28px;
  }
  .arena {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
  .versus {
    display: none;
  }
  .fleet {
    gap: 3px;
  }
  .fleet header .eyebrow {
    display: none;
  }
  .ship-label {
    top: 2px;
    left: 3px;
    font-size: 6px;
  }
}
@media (max-height: 700px) and (max-width: 900px) {
  .ship-label,
  .level {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.workspace {
  grid-template-columns: minmax(0, 1fr);
}
.arena,
.supply,
.fleet-actions,
.gear-shop,
.sockets,
.gear-offers {
  min-width: 0;
}
.fit-summary {
  min-width: 0;
  overflow-wrap: anywhere;
}
.supply {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px minmax(0, 1fr) 62px;
  gap: 5px;
}
.supply-head {
  grid-column: 1;
}
.yard-title {
  font: 600 17px "Barlow Condensed", sans-serif;
  letter-spacing: 1px;
  color: var(--gold);
}
.shop {
  grid-row: 2;
}
.gear-offers {
  display: contents;
}
.gear-offer {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  gap: 2px 7px;
  padding: 8px;
  touch-action: none;
}
.gear-picture {
  grid-row: 1/4;
  align-self: center;
  width: 52px;
  height: 52px;
}
.gear-picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gear-offer strong {
  font: 600 16px/1.1 "Barlow Condensed", sans-serif;
  align-self: end;
}
.gear-offer small {
  color: var(--muted);
  font-size: 10px;
}
.gear-offer b {
  color: var(--gold);
  font-size: calc(11px * var(--tyrants-text-prices, 1));
}
.gear-shop {
  grid-row: 3;
  grid-template-columns: 160px minmax(0, 1fr) 170px;
  grid-template-rows: 1fr;
  gap: 7px;
  align-items: center;
  padding: 6px 8px;
}
.inspector {
  grid-column: 1;
}
.inspector strong {
  font-size: 12px;
}
.sockets {
  grid-column: 2;
  grid-row: 1;
}
.sockets button {
  height: 44px;
}
.fit {
  grid-column: 3;
  grid-row: 1;
  font-size: 10px;
  white-space: normal;
}
.fit-summary {
  display: none;
}
.ship-art {
  flex: 1;
  max-height: none;
  min-height: 16px;
  width: 100%;
}
.ship-art img,
.ship-art canvas {
  object-fit: contain;
}
.ship {
  justify-content: space-between;
  padding: 12px 5px 34px;
}
.mounts {
  bottom: 5px;
  gap: 6px;
}
.mount {
  width: 32px;
  height: 27px;
  padding: 3px;
}
.mount img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.mount.empty {
  background:
    repeating-linear-gradient(
      135deg,
      #0c1c25,
      #0c1c25 5px,
      #152b35 5px,
      #152b35 7px);
}
.drop {
  box-shadow: inset 0 0 0 2px #9df4c4 !important;
}
.invalid-drop {
  box-shadow: inset 0 0 0 2px #ff8d7a !important;
}
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  filter: drop-shadow(0 4px 7px #0009);
}
.drag-ghost img,
.drag-ghost canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gear-picture[data-drag-source],
.ship[data-drag-source] > :is(.ship-art, .health, .shield-strip, .numbers, .level, .reserve-module),
.ship[data-drag-source]::before,
.berth:has(> .ship[data-drag-source]) .mounts,
.mount[data-drag-source] > * {
  visibility: hidden;
}
.reserve-grid .ship.occupied[data-drag-source],
.reserve-grid .ship.occupied[data-model][data-drag-source] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.line > .berth .ship[data-drag-source].selected,
.line > .berth .ship[data-drag-source].linked { background: transparent !important; }
.ship[data-drag-source].selected { outline: none; }
.sockets button[data-drag-source] { color: transparent; }
.sell {
  border-style: dashed;
  border-color: #b67f67;
  color: #f5c2a7;
}
.offers,
.sockets,
.gear-shop {
  touch-action: none;
}
.mount img,
.mount canvas,
.gear-picture img,
.gear-picture canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.gear-cell {
  min-width: 0;
  min-height: 0;
  touch-action: none;
}
.gear-cell > .gear-offer {
  width: 100%;
  height: 100%;
}

.ship.merge-ready { border-color: var(--gold); box-shadow: inset 0 0 0 1px #e8c66d77; }
.ship.merge-drop { border-color: #ffe6a4; box-shadow: inset 0 0 0 3px #ffe6a4, 0 0 18px #e8c66d99 !important; }

.mount.merge-ready, .sockets button.merge-ready { border-color: var(--gold); box-shadow: inset 0 0 0 1px #e8c66d77; }
.merge-drop { border-color: #ffe6a4 !important; box-shadow: inset 0 0 0 2px #ffe6a4, 0 0 14px #e8c66d99 !important; }
.mount { position: relative; }
.mount .module-level {
  position: absolute;
  bottom: 0;
  right: 1px;
  color: var(--gold);
  background: #0c1b22dd;
  border-radius: 2px;
  font-size: 7px;
  line-height: 1;
  pointer-events: none;
}
@media (max-width: 600px) { .mount .module-level { font-size: 5px; } }

/* The cosmetic canvas paints above engine-registered card controls. */
.effects { z-index: 100; }
.mount .module-level { color: var(--weapon-color, var(--gold)); }
.mount:not(.empty) { border-color: var(--weapon-color, #6a9993); }

/* Keep game controls and VFX inside the stage's content layer, below shell dialogs. */
.fleet-app { isolation: isolate; }

/* Presentation only: the SDK still owns the results card, actions and countdown. */
#app { --mm-font-display: "Barlow Condensed", sans-serif; }
#app .mm-results-card {
  background: #10212bf7;
  border: 1px solid #647678;
  border-radius: 10px;
  box-shadow: 0 24px 80px #000b;
  color: #f3eee4;
  font-family: Barlow, sans-serif;
}
#app .mm-results-band {
  background: linear-gradient(145deg, #243c44, #12242e);
  border-top: 2px solid #efbc79;
  border-bottom: 1px solid #496064;
  box-shadow: none;
  padding-top: 22px;
  padding-bottom: 20px;
}
#app .mm-results-title {
  color: #efbc79;
  font: 500 10px "IBM Plex Mono", monospace;
  letter-spacing: .18em;
}
#app .mm-results-winner {
  margin-top: 10px;
  font: 700 clamp(26px, 4vw, 36px)/1.1 "Barlow Condensed", sans-serif;
  text-transform: none;
  letter-spacing: .01em;
  color: #f3eee4;
  background: none;
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter: none;
  animation: none;
  transform: none;
}
#app .mm-results-board { width: 100%; }
#app .mm-results-board li {
  padding: 11px 12px;
  border: 1px solid #344d57;
  border-radius: 5px;
  background: #1a303b;
}
#app .mm-results-board li:first-child { border-color: #a88b5f; }
#app .mm-results-board .mm-nm { font-size: 14px; font-weight: 600; }
#app .mm-results-timer { color: #b5c8c7; font: 11px "IBM Plex Mono", monospace; }

.berth[data-sockets="3"] .mounts, .berth[data-sockets="4"] .mounts {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 3px;
}
.berth[data-sockets="3"] .mount, .berth[data-sockets="4"] .mount { width: min(28px,100%); height: 20px; justify-self: center; }
.berth[data-sockets="3"] .ship, .berth[data-sockets="4"] .ship { padding-bottom: 48px; }
.sockets[data-count="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
.sockets[data-count="4"] { grid-template-columns: repeat(4,minmax(0,1fr)); }
@media(max-width:900px) {
  .berth[data-sockets="3"] .mount, .berth[data-sockets="4"] .mount { width: min(23px,100%); height: 13px; padding: 1px; }
  .berth[data-sockets="3"] .mounts, .berth[data-sockets="4"] .mounts { gap: 1px; }
  .berth[data-sockets="3"] .ship, .berth[data-sockets="4"] .ship { padding-bottom: 29px; }
  .berth[data-sockets="3"] .ship-art, .berth[data-sockets="4"] .ship-art { min-height: 0; }
}

/* The arena rows stay fixed when fitting controls are withdrawn. */
.fleet-app {
  --gold: #ffe04f;
  --mint: #70f5ff;
  background:
    linear-gradient(#0b062528, #0b072b08 60%, #0b062545),
    url(./art/tyrants-nebula.webp?v=7c306ade) center / cover;
}
.workspace {
  grid-template-rows: 28px minmax(0, 1fr) 44px;
  overflow: clip;
}
.fleet-app { overflow: clip; }
.mast { padding-right: var(--mast-reserve, 50px); }
.battle-heading {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ded7ee;
  background: #19112bd9;
  border-block: 1px solid #585066;
  font: 11px "IBM Plex Mono", monospace;
}
.phase {
  background: var(--gold);
  color: #211623;
  padding: 3px 10px;
  font-weight: 600;
  letter-spacing: .11em;
}
.arena {
  grid-row: 2;
  grid-template-columns: minmax(0, 1.07fr) clamp(16px, 4vw, 54px) minmax(0, 1fr);
}
.arena > .own { grid-area: 1 / 1; }
.arena > .enemy, .arena > .supply { grid-area: 1 / 3; }
.versus { visibility: hidden; }
.fleet-actions { grid-row: 3; }
[data-phase="formation"] .fleet-actions .engage {
  min-width: clamp(122px, 12vw, 192px);
  padding: 5px 13px 7px;
  background: #ffdf57;
  color: #211424;
  font: italic 800 calc(clamp(18px, 1.9vw, 26px) * var(--tyrants-text-controls, 1))/1 "Barlow Condensed", sans-serif;
}
.supply {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  padding: clamp(8px, 1.25vw, 17px);
  border: 1px solid #d272e1;
  border-radius: 12px;
  background: linear-gradient(145deg, #251044eb, #141024f5 65%);
  box-shadow: inset 0 0 28px #ad53e52c, 0 0 20px #be27d32c, 0 8px 26px #08031183;
}
.supply-head { grid-row: 1; min-height: 42px; }
.supply .yard-title {
  padding: 3px 17px 5px;
  color: #191127;
  background: #ffdf57;
  clip-path: polygon(4% 8%, 99% 0, 96% 32%, 100% 34%, 95% 66%, 97% 86%, 0 100%, 3% 61%, 0 47%);
  font: italic 800 calc(clamp(23px, 3vw, 40px) * var(--tyrants-text-section-titles, 1))/1 "Barlow Condensed", sans-serif;
}
.supply .wallet { font-size: calc(clamp(12px, 1.35vw, 18px) * var(--tyrants-text-prices, 1)); }
.supply-head .reroll { color: #fff2cb; background: #282237; border-color: #886a9c; }
.supply .gear-offers {
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: clamp(48px, 9vh, 72px);
  gap: 8px;
}
.supply .gear-offer {
  border: 1px solid #e7bb50;
  border-radius: 8px;
  background: linear-gradient(160deg, #22223e, #121426 68%);
  box-shadow: inset 0 0 13px #c881251a;
}
.supply .gear-offer[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 12px #f7dc7c45;
}
.supply .gear-offer strong {
  color: #fff1d9;
  font: italic 700 calc(clamp(15px, 1.7vw, 24px) * var(--tyrants-text-ship-names, 1))/1 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}
.supply .gear-offer {
  grid-template-columns: minmax(38px, 28%) minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 6px;
}
.supply .gear-picture { grid-area: 1 / 1; width: 100%; height: 100%; max-height: 61px; }
.supply .gear-offer strong { align-self: center; font-size: calc(clamp(14px, 1.35vw, 19px) * var(--tyrants-text-module-names, 1)); }
.supply .gear-offer small { display: none; }
.supply .gear-offer b { padding: 3px 6px; background: #f5d45d; color: #211424; white-space: nowrap; }
.gear-shop { background: #211933d9; border-color: #524263; }
.gear-shop .inspector { display: none; }
.supply .gear-shop {
  grid-template-columns: minmax(0, 1fr) minmax(82px, 122px);
  grid-template-rows: 1fr;
  grid-row: 4;
}
.supply .gear-shop:has(.sockets[hidden]) { display: none; }
.gear-shop .sockets { grid-column: 1; }
.gear-shop .fit { grid-column: 2; }
.sockets button {
  height: 38px;
  color: #edf6ff;
  white-space: normal;
  font-size: 12px;
  line-height: 1.1;
}
.reserve-panel {
  grid-row: 5;
  min-width: 0;
  padding: 6px 8px 8px;
  border: 1px solid #56eaff;
  border-radius: 7px;
  background: linear-gradient(125deg, #102849e8, #11142be8 46%);
}
.reserve-panel > h2 {
  margin: 0 0 5px;
  color: #f5ece1;
  font: italic 700 calc(21px * var(--tyrants-text-section-titles, 1))/1 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}
.reserve-grid {
  display: grid;
  position: relative;
  aspect-ratio: 4;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  background: #10172c;
  border: 1px solid #65eaff;
  box-shadow: 0 0 12px #64d1ff32;
  touch-action: none;
}
.reserve-grid::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, transparent 0 calc(12.5% - 1px), #63e6f5ad calc(12.5% - 1px) 12.5%),
    linear-gradient(transparent calc(50% - 0.5px), #63e6f5ad calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.reserve-grid > .berth {
  grid-column: var(--reserve-column);
  grid-row: var(--reserve-row);
}
.reserve-grid .ship {
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: none;
}
.reserve-grid .ship.occupied {
  background: radial-gradient(ellipse at center, #287c9652, #164c6420 75%);
  border-color: #68e4ff59;
}
.reserve-grid .ship.occupied[data-model="live"] {
  box-shadow: inset 0 0 20px #2ea1c033;
}
.reserve-grid .ship.contains-module {
  background: radial-gradient(ellipse at center, #24bfe15c, #13315d52 74%);
  border-color: #80fbff9c;
}
.reserve-grid .ship:not(.occupied)::after {
  content: "+";
  font: 18px/1 "IBM Plex Mono", monospace;
  color: #6bb4ca;
}
.reserve-grid .ship[data-model="live"] .ship-art { visibility: hidden; }
.reserve-grid .ship-art {
  position: absolute;
  inset: 9% 7%;
  width: auto;
  height: auto;
  min-height: 0;
  pointer-events: none;
}
.reserve-grid .ship:not(.occupied) .ship-art,
.reserve-grid .ship .health, .reserve-grid .ship .numbers { display: none !important; }
.reserve-grid .reserve-module {
  position: absolute;
  inset: 5%;
  filter: drop-shadow(0 3px 4px #080416);
  pointer-events: none;
}
.reserve-grid .reserve-module img, .reserve-grid .reserve-module canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.08);
}
.reserve-grid .reserve-module .module-level {
  position: absolute;
  inset: auto 0 0 auto;
  color: var(--gold);
  padding: 1px 3px;
  border-radius: 2px;
  background: #101226df;
  font: 11px/1 "IBM Plex Mono", monospace;
  text-shadow: 0 1px 3px #050212;
}
.reserve-grid .ship.selected {
  border-color: #9cf4ff;
  outline: 1px solid #9cf4ff;
  outline-offset: -2px;
}
.fleet header {
  height: 48px;
  gap: 10px;
}
.fleet header img {
  width: 44px;
  height: 44px;
  border-radius: 5px;
}
.enemy header { flex-direction: row-reverse; text-align: right; }
.enemy header b { margin-left: 0; margin-right: auto; }
.fleet-models, .tactical-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fleet-models { z-index: 2; }
/* Keep held hulls visible over the 44px action row and its grid gap. */
[data-phase="formation"] .fleet-models { height: calc(100% + 52px); }
.tactical-overlay { z-index: 101; }
.fleet { --grid-glow: #48edff; }
.enemy { --grid-glow: #ff69d7; }
.line > .berth { grid-column: var(--col); grid-row: var(--row); }
.line > .berth .ship,
.line > .berth .ship.occupied {
  padding: 0;
  background: color-mix(in srgb, var(--grid-glow) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--grid-glow) 45%, transparent);
  border-radius: 3px;
}
.line > .berth .ship.occupied::before {
  position: absolute;
  content: "";
  inset: 28% 14% 34%;
  background: radial-gradient(ellipse at center, #090416c8, #10071900 72%);
  pointer-events: none;
}
[data-phase="combat"] .line > .berth .ship.occupied::before,
[data-phase="resolved"] .line > .berth .ship.occupied::before {
  inset: 30% 14% 24%;
}
.line > .berth .ship.selected, .line > .berth .ship.linked {
  background: #6dcbf125 !important;
}
.ship.reachable::after {
  content: "SCREEN";
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 3px;
  background: #140b25de;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent);
  color: var(--gold);
  font: 700 8px/1 "IBM Plex Mono", monospace;
  letter-spacing: .06em;
  z-index: 3;
  pointer-events: none;
}
.ship.flagship.reachable::after {
  left: 5px;
  top: 14px;
  right: auto;
  transform: none;
}
@media (max-width: 900px) {
  .ship.flagship.reachable::after {
    left: auto;
    top: 2px;
    right: 16px;
  }
}
.line > .berth .ship-art {
  position: absolute;
  inset: 7% 0 27%;
  width: auto;
  height: auto;
  min-height: 0;
}
.line > .berth .ship-art { pointer-events: none; }
.line > .berth .ship-art > :not(span) { filter: drop-shadow(0 5px 5px #05010d); }
.line > .berth .ship[data-model] .ship-art { visibility: hidden; }
.line > .berth .ship:not(.occupied) .ship-art { display: none; }
.line > .berth .ship:not(.occupied)::after { content: none; }
@media (prefers-reduced-motion: no-preference) {
  [data-phase="formation"] .ship.occupied:not([data-model]):not(.contains-module) .ship-art {
    animation: hull-idle 4.2s ease-in-out infinite;
  }
  @keyframes hull-idle {
    0%, 100% { translate: 0 0; }
    50% { translate: 1px -3px; }
  }
}
@media (min-width: 901px) {
  .fleet .line {
    margin-block: clamp(18px, 6.8vh, 62px) clamp(26px, 13vh, 118px);
    transform: perspective(1120px) rotateX(30deg);
  }
  .own .line { margin-inline: 38px 14px; transform-origin: 100% 56%; }
  .enemy .line { margin-inline: 14px 38px; transform-origin: 0 56%; }
  .line::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: calc(80% - 1px);
    border: 1px solid var(--grid-glow);
    border-radius: 3px;
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--grid-glow) 72%, transparent) 1px, transparent 1px) 0 0 / 25% 100%,
      linear-gradient(color-mix(in srgb, var(--grid-glow) 72%, transparent) 1px, transparent 1px) 0 0 / 100% calc(100% / 3),
      linear-gradient(180deg, #0c102780, color-mix(in srgb, var(--grid-glow) 16%, #100b27d0));
    box-shadow: inset 0 0 17px color-mix(in srgb, var(--grid-glow) 25%, transparent),
      0 0 18px color-mix(in srgb, var(--grid-glow) 45%, transparent);
    pointer-events: none;
  }
  .enemy .line::before { inset-inline: 0 auto; }
  .line > .berth .ship:not(.flagship) {
    background: transparent;
    border-color: transparent;
  }
  .line > .berth .ship.reachable {
    box-shadow: inset 0 0 0 1px var(--gold);
  }
}
.ship .health, .ship .shield-strip, .ship .numbers {
  position: absolute;
  left: 22%;
  width: 56%;
  z-index: 3;
}
.ship .health { display: block; bottom: 24%; height: 3px; box-shadow: 0 0 0 1px #080517; }
.ship .shield-strip { bottom: calc(24% + 5px); height: 2px; background: #090b25; }
.shield-strip i { display: block; height: 100%; background: #7cb9ff; box-shadow: 0 0 5px #6be7ff; }
.ship .numbers {
  display: none;
  bottom: calc(24% + 8px);
  font-size: calc(10px * var(--tyrants-text-hull-stats, 1));
  line-height: 1;
  color: white;
  text-shadow: 0 1px 3px #03010a, 0 0 4px #03010a, 0 0 2px #03010a;
}
[data-stats="detailed"] .ship.occupied:not(.wreck) .numbers { display: block; }
.ship.wreck .health { display: none !important; }
.ship-label, .level { z-index: 3; }
.mounts { bottom: 4px; gap: 3px; z-index: 90; pointer-events: none; }
.mounts .mount { pointer-events: auto; }
.mount, .berth[data-sockets] .mount {
  width: min(23%, 36px);
  height: clamp(23px, 2vw, 33px);
  padding: 1px;
  min-width: 0;
}
.berth:has(.flagship) .mounts { left: -5px; right: -5px; }
.mount:not(.empty) {
  background: radial-gradient(ellipse at center, #2b7f98, #12213d 72%);
  box-shadow: inset 0 0 4px #53deed5c;
}
.mount .module-level { font-size: 10px; }
.berth[data-sockets] .mounts { display: flex; }
.mount.fit-ready { box-shadow: inset 0 0 0 1px #86ffe0; border-color: #86ffe0; }
.stats, .set-course {
  border: 1px solid #785f92;
  background: #231937;
  border-radius: 4px;
  padding: 6px 10px;
  white-space: nowrap;
}
.stats[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.supply-top {
  grid-row: 1;
  min-width: 0;
}
.info-strip {
  --info-accent: var(--grid-glow, var(--gold));
  display: flex;
  align-items: center;
  flex: none;
  min-width: 0;
  height: calc(36px * max(1, var(--tyrants-text-info-pills, 1)));
  pointer-events: none;
}
.enemy .info-strip { justify-content: flex-end; }
.hover-info {
  z-index: 4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--info-accent) 52%, #292238);
  border-radius: 11px;
  background: #19132bf2;
  color: #f5eaff;
  font: 600 calc(13px * var(--tyrants-text-info-pills, 1))/1.15 Barlow, sans-serif;
}
.action-copy {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.action-copy > :is(.status, .focus-readout) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 3px 0;
  white-space: normal;
  font: calc(13px * var(--tyrants-text-status, 1))/1.25 Barlow, sans-serif;
}
.action-copy > .focus-readout {
  padding-inline: 9px;
  border-inline-start: 2px solid #61e9ff;
  color: #f5eaff;
  background: linear-gradient(90deg, #19102cf2, #140c2087);
}
.fleet-actions { position: relative; overflow: visible; }
[data-phase="combat"] .line > .berth .ship:not(.occupied),
[data-phase="resolved"] .line > .berth .ship:not(.occupied) { opacity: .53; }

.galaxy {
  grid-row: 1 / -1;
  display: grid;
  width: min(940px, 100%);
  justify-self: center;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  align-items: center;
  gap: 12px 24px;
  padding: clamp(8px, 3vw, 32px);
}
.galaxy header, .navigation, .trail { grid-column: 1 / -1; }
.galaxy header { text-align: center; }
.galaxy h2 { font: 700 clamp(32px, 5vw, 62px)/1 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.map-rival { margin-top: 6px; color: #cabce8; font-size: 13px; }
.departure { color: var(--gold); text-align: center; font: 11px "IBM Plex Mono", monospace; }
.departure-ship { position: relative; height: clamp(38px, 11vw, 105px); }
.departure-ship img, .departure-ship canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.systems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(6px, 2vw, 20px); }
.systems button {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  min-height: 0;
  padding: clamp(7px, 3vw, 30px) 6px;
  border: 1px solid #64618b;
  border-radius: 9px;
  background: #17122eaa;
  color: #f9ecff;
  text-align: center;
}
.systems button[aria-pressed="true"] { border-color: #8eefff; background: #29204de8; box-shadow: 0 0 20px #7bc4ff42; }
.systems strong { font: 600 clamp(16px, 3vw, 32px)/1 "Barlow Condensed", sans-serif; }
.screen-intel { color: #cdc2e6; font-size: clamp(10px, 1.2vw, 13px); }
.planet {
  --light: #fbdf87;
  position: relative;
  display: block;
  width: clamp(36px, 11vw, 115px);
  aspect-ratio: 1;
  margin: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 31% 27%, var(--light), #997153 49%, #251632 81%);
  box-shadow: -3px -2px 14px color-mix(in srgb, var(--light) 60%, transparent);
}
.planet::after { content: ""; position: absolute; inset: 40% -21%; border: 2px dashed #dec087; border-radius: 50%; transform: rotate(-26deg); }
[data-planet="crystal"] .planet {
  --light: #baffef;
  border-radius: 0;
  background: conic-gradient(from 21deg, #beffed, #3c8ad0, #28275b, #65f7e5, #3d6a9d, #beffed);
  clip-path: polygon(10% 44%, 24% 14%, 42% 24%, 62% 0, 87% 32%, 96% 71%, 56% 99%, 18% 81%);
}
[data-planet="rock"] .planet { --light: #cab7ff; background: radial-gradient(circle at 39% 28%, #d8baff, #604c92 56%, #1a143a 85%); }
[data-planet="crystal"] .planet::after, [data-planet="rock"] .planet::after { display: none; }
[data-planet="fortress"] .planet { --light: #ef9bb3; }
[data-planet="fortress"] .planet::after { inset: 13% 20% 19%; border: 0; border-radius: 0; background: linear-gradient(120deg, #ffceaf, #3d283e 70%); clip-path: polygon(0 45%, 13% 45%, 13% 22%, 36% 22%, 36% 0, 67% 0, 67% 26%, 89% 26%, 89% 47%, 100% 47%, 100% 100%, 0 100%); transform: rotate(-8deg); }
[data-planet="gate"] .planet { --light: #ff7d62; background: radial-gradient(circle at 36% 35%, #ff965c, #ae414c 50%, #291824 80%); }
[data-planet="gate"] .planet::after { inset: 31% -17%; border: 5px ridge #d7ab80; }
.navigation { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px; }
.set-course { background: var(--gold); color: #231628; font-weight: 700; padding: 9px 15px; }
.trail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.trail li { text-align: center; border-top: 2px solid #66547f; padding: 5px 0; color: #b7a9c9; font: 11px "IBM Plex Mono", monospace; }
.trail li.visited { border-color: #70d9db; }
.trail li[aria-current="step"] { color: var(--gold); border-color: var(--gold); }

@media (max-width: 900px) {
  .fleet-app { padding: 7px 8px; gap: 4px; }
  .mast { height: 35px; gap: 8px; }
  .mast h1 { font-size: calc(22px * var(--tyrants-text-game-title, 1)); letter-spacing: .11em; }
  .workspace { grid-template-rows: 21px minmax(0, 1fr) 44px; gap: 4px; }
  .arena { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .arena > .own { grid-area: 2 / 1; }
  .arena > .enemy { grid-area: 1 / 1; }
  [data-phase="formation"] .arena:has(.supply:not([hidden])) { grid-template-rows: minmax(0, 1fr) auto; }
  [data-phase="formation"] .arena:has(.supply:not([hidden])) > .own { grid-area: 1 / 1; }
  .arena > .supply { grid-area: 2 / 1; }
  .fleet header { height: 24px; gap: 5px; }
  .fleet header img { width: 23px; height: 23px; }
  .line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 2px;
  }
  .line > .berth { grid-column: var(--phone-col); grid-row: var(--phone-row); }
  .line > .berth .ship-art { inset: 1px 4px 9px; }
  .own .line > .berth .ship-art > :not(span) { transform: rotate(-90deg); }
  .enemy .line > .berth .ship-art > :not(span) { transform: rotate(90deg); }
  .mounts, .berth[data-sockets] .mounts { bottom: 1px; gap: 2px; }
  .mount, .berth[data-sockets] .mount { width: min(23%, 22px); height: 15px; font-size: 9px; padding: 0; }
  .mount .module-level, .reserve-grid .reserve-module .module-level { font-size: 7px; }
  .ship .health { bottom: 16px; height: 2px; }
  .ship .shield-strip { bottom: 19px; }
  .ship .numbers { bottom: 22px; display: none; font-size: calc(7px * var(--tyrants-text-hull-stats, 1)); }
  .ship.reachable::after { font-size: 5px; }
  .ship.flagship .ship-label { display: block; font-size: 0; }
  .ship.flagship .ship-label::before { content: "♛"; font-size: 9px; }
  .supply {
    grid-template-rows: repeat(5, auto);
    gap: 5px;
    padding: 6px;
  }
  .supply-head { min-height: 29px; }
  .supply .yard-title { font-size: calc(21px * var(--tyrants-text-section-titles, 1)); padding-inline: 11px; }
  .supply .gear-offers { grid-template-rows: 36px; gap: 4px; }
  .supply .gear-offer strong { font-size: calc(13px * var(--tyrants-text-module-names, 1)); }
  .supply .gear-offer b { font-size: calc(12px * var(--tyrants-text-prices, 1)); padding: 0 4px 1px; }
  .supply .gear-offer { display: grid; padding: 3px 4px; gap: 4px; }
  .supply .gear-picture { max-height: 29px; }
  .reserve-panel { padding: 4px 5px 5px; }
  .reserve-panel > h2 { font-size: calc(16px * var(--tyrants-text-section-titles, 1)); margin-bottom: 3px; }
  .reserve-grid .ship:not(.occupied)::after { font-size: 12px; }
  .sockets button, .fit { height: 44px; }
  .sockets button { overflow-wrap: anywhere; font-size: 10px; }
  .gear-picture { height: 23px; }
  .info-strip { height: calc(29px * max(1, var(--tyrants-text-info-pills, 1))); }
  .hover-info { font-size: calc(11px * var(--tyrants-text-info-pills, 1)); line-height: 1; }
  .action-copy > :is(.status, .focus-readout) {
    -webkit-line-clamp: 3;
    font-size: calc(10px * var(--tyrants-text-status, 1));
  }
  .action-copy > .focus-readout { padding-inline: 4px; }
  .stats { font-size: 10px; }
  .fleet-actions { padding-inline-end: max(36px, calc(var(--footer-reserve, 0px) - 8px)); }
  [data-phase="formation"] .fleet-actions .engage { min-width: 76px; font-size: calc(17px * var(--tyrants-text-controls, 1)); }
  .galaxy { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr) auto auto; gap: 7px; }
  .departure-ship { height: 64px; }
  .planet { width: clamp(65px, 19vw, 115px); }
}

.display-options-trigger {
  position: absolute;
  z-index: 5;
  inset: 67px auto auto 20px;
  width: 29px;
  height: 29px;
  padding: 2px 0 0;
  border: 1px solid #6a527e;
  border-radius: 5px;
  background: #21182c;
  color: #cfbbdf;
  font: 700 19px/1 "IBM Plex Mono", monospace;
}
.display-options-trigger[aria-expanded="true"] { color: var(--gold); }
.display-options {
  position: absolute;
  z-index: 110;
  inset: 76px auto auto clamp(8px, 2vw, 26px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 9px;
  width: min(368px, calc(100% - 16px));
  max-height: calc(100% - 94px);
  padding: 12px;
  border: 1px solid #ae73ca;
  border-radius: 9px;
  background: #191327f5;
  color: #fff0e4;
  box-shadow: 0 12px 30px #050211bf;
  font: 14px/1.2 Barlow, sans-serif;
}
.display-options > header, .display-options > nav,
.display-options-actions, .ship-angle-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.display-options > header { justify-content: space-between; }
.display-options > header strong {
  color: var(--gold);
  font: italic 800 23px/1 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}
.display-options button, .display-options input[type="number"], .display-options select {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #654e7e;
  border-radius: 4px;
  color: inherit;
  background: #251b3a;
  font: inherit;
}
.display-options button { min-height: 30px; cursor: pointer; }
.display-options button[aria-pressed="true"], .display-options [data-text-export], .display-options [data-angle-export] {
  border-color: var(--gold);
  color: #231528;
  background: var(--gold);
  font-weight: 700;
}
.display-options-body { min-height: 0; overflow: auto; scrollbar-width: thin; color-scheme: dark; }
.text-size-fields, .ship-angle-options, .ship-angle-selectors, [data-angle-fields] { display: grid; gap: 6px; }
.text-size-fields > label, .ship-angle-axis {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 55px 10px;
  align-items: center;
  gap: 5px;
}
.ship-angle-preview-wrap {
  position: relative;
  display: grid;
  border: 1px solid #4c3b6b;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 52%, #231a3d 0%, #100b1d 100%);
  overflow: hidden;
}
.ship-angle-preview {
  display: block;
  width: 100%;
  height: 140px;
}
.ship-angle-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #c8b8df;
  font: 600 12px/1 "IBM Plex Mono", monospace;
  pointer-events: none;
}
.ship-angle-loading[hidden] { display: none; }
.ship-angle-facing {
  position: absolute;
  inset: auto 6px 6px auto;
  display: flex;
  gap: 4px;
}
.ship-angle-facing button {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 11px;
}
.ship-angle-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}
.ship-angle-counter {
  text-align: center;
  color: #d6c5ec;
  font: 600 12px/1 "IBM Plex Mono", monospace;
}
.ship-angle-axis { grid-template-columns: 32px 34px minmax(0, 1fr) 54px 34px; }
.ship-angle-axis input[type="range"] { width: 100%; margin: 0; accent-color: var(--gold); }
.ship-angle-nudge {
  min-height: 26px !important;
  padding: 2px 3px !important;
  font: 600 11px/1 "IBM Plex Mono", monospace !important;
}
.ship-angle-selectors label { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; }
.display-options-actions, .ship-angle-actions { justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.ship-angle-status {
  min-height: 15px;
  margin: 0;
  color: #b5ff4f;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
  text-align: right;
}
.mast .angles-btn {
  padding: 5px 10px;
  border: 1px solid #6b5387;
  border-radius: 5px;
  background: #231834;
  color: #f3e4ff;
  font: 700 12px/1 Barlow, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.mast .angles-btn:hover { border-color: var(--gold); color: var(--gold); }
.fleet-actions :is(.sell, .cancel), .mast .help, .mast .angles-btn, .supply-head .reroll { font-size: calc(1em * var(--tyrants-text-controls, 1)); }
.fleet-actions .stats { font-size: calc(1em * var(--tyrants-text-controls, 1)); }
.ship.reachable::after { font-size: calc(8px * var(--tyrants-text-grid-labels, 1)); }
.sockets button { font-size: calc(12px * var(--tyrants-text-module-names, 1)); }

/* === v22 Mockup visual polish, targeting UI & layout fixes === */
.mast {
  border-bottom-color: #484068;
}
.mast h1 {
  font-style: italic;
  text-shadow: 0 2px 12px #000a;
}
.battle-heading {
  background: none;
  border: 0;
  gap: 10px;
}
.phase {
  position: relative;
  padding: 2px 18px 3px;
  background: #ffe047;
  color: #1c1026;
  clip-path: polygon(4% 10%, 99% 0, 96% 45%, 100% 48%, 95% 92%, 1% 100%, 4% 55%, 0 42%);
  font: italic 800 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
  box-shadow: 0 3px 12px #0007;
}
.battle-heading .instruction {
  padding: 2px 10px;
  border: 1px solid #594b76;
  border-radius: 999px;
  background: #17102ce0;
  color: #e7dff7;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .04em;
}
.battle-heading .instruction:empty { display: none; }

/* Commander headers aligned to mockups */
.fleet header {
  height: 54px;
  gap: 11px;
}
.fleet header img {
  width: 48px;
  height: 48px;
  border-width: 2px;
  border-color: var(--grid-glow);
  border-radius: 7px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--grid-glow) 45%, transparent), 0 4px 10px #000a;
}
.fleet-id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.enemy .fleet-id { align-items: flex-end; }
.fleet header h2 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: italic 800 calc(21px * var(--tyrants-text-fleet-names, 1))/1 "Barlow Condensed", sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff7ee;
  text-shadow: 0 2px 6px #060212;
}
.enemy header h2 { flex-direction: row-reverse; }
.fleet-crown {
  color: var(--gold);
  font-style: normal;
  font-size: .86em;
}
.enemy .fleet-crown { color: #ff5ac8; }
.fleet-bar {
  display: block;
  width: clamp(92px, 12vw, 175px);
  height: 4px;
  margin: 2px 0;
  background: linear-gradient(90deg, #b8ff3c, #49efff 75%, transparent);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%);
}
.enemy .fleet-bar {
  background: linear-gradient(270deg, #ff4cc8, #ff6d8d 75%, transparent);
  clip-path: polygon(6% 0, 100% 0, 100% 100%, 0 100%);
}
.fleet header p {
  font: 500 11px/1.1 Barlow, sans-serif;
  color: #cbbfe2;
}
.win-badge {
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--grid-glow) 55%, #4d426c);
  border-radius: 5px;
  background: #140f29e0;
  color: var(--gold);
  font: 700 11px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Mockup-faithful chunky capsule health & shield bars + unobscured hull fractions */
.ship .health {
  height: 6px;
  border-radius: 999px;
  background: #0a071ae8;
  border: 1px solid #495d79;
  box-shadow: 0 2px 6px #000c, inset 0 1px 2px #000a;
}
.ship .health i {
  border-radius: 999px;
  background: linear-gradient(90deg, #74ff45, #48f5c7);
}
.enemy .ship .health i {
  background: linear-gradient(90deg, #ff5fb8, #ff99d6);
}
.ship[data-hp-tier="mid"] .health i {
  background: linear-gradient(90deg, #ffa62b, #ffe047);
}
.ship[data-hp-tier="low"] .health i {
  background: linear-gradient(90deg, #ff3a4e, #ff7955);
}
.ship .shield-strip {
  height: 3px;
  border-radius: 999px;
  background: #091326e0;
  box-shadow: 0 0 6px #48edff88;
}
.shield-strip i {
  border-radius: 999px;
  background: linear-gradient(90deg, #48edff, #aef8ff);
}
.ship .level {
  top: 3px;
  right: 5px;
  font-size: 10px;
  text-shadow: 0 1px 4px #000, 0 0 6px #000;
}
/* Battle phase: put health bar + bold hull fraction cleanly BELOW the 3D ship silhouette */
[data-phase="combat"] .ship .health,
[data-phase="resolved"] .ship .health {
  bottom: 18%;
  left: 16%;
  width: 68%;
}
[data-phase="combat"] .ship .shield-strip,
[data-phase="resolved"] .ship .shield-strip {
  bottom: calc(18% + 8px);
  left: 16%;
  width: 68%;
}
[data-phase="combat"] .ship .numbers,
[data-phase="resolved"] .ship .numbers {
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  padding: 1px 6px;
  border-radius: 4px;
  background: #0d081ed6;
  font: italic 700 calc(13px * var(--tyrants-text-hull-stats, 1))/1.1 "Barlow Condensed", sans-serif;
  letter-spacing: .03em;
  color: #ffffff;
}
/* Shipyard phase: keep hull fraction cleanly in the open top-right band, clear of 3D hulls & grid labels */
[data-phase="formation"] .line .ship .numbers {
  top: 3px;
  right: 20px;
  bottom: auto;
  left: auto;
  transform: none;
  width: auto;
  padding: 1px 6px;
  border-radius: 4px;
  background: #100b25df;
  border: 1px solid #49e6ff5c;
  font: italic 700 calc(12px * var(--tyrants-text-hull-stats, 1))/1.1 "Barlow Condensed", sans-serif;
}
[data-phase="formation"] .line .ship .health {
  bottom: 38px;
  height: 5px;
}
[data-phase="formation"] .line .ship .shield-strip {
  bottom: 45px;
}
/* Luminous neon perspective grid polish */
@media (min-width: 901px) {
  .line::before {
    border-width: 1.5px;
    box-shadow:
      inset 0 0 22px color-mix(in srgb, var(--grid-glow) 28%, transparent),
      0 0 22px color-mix(in srgb, var(--grid-glow) 52%, transparent);
  }
  .line > .berth .ship.selected {
    border: 1.5px solid #75f4ff;
    box-shadow: inset 0 0 14px #52e8ff3a, 0 0 12px #52e8ff55;
    outline: none;
  }
}

/* Equipment offer targeting tags */
.supply .gear-offer {
  grid-template-columns: minmax(38px, 24%) minmax(0, 1fr) auto;
  padding: 5px 8px;
}
.gear-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.supply .gear-offer strong {
  align-self: flex-start;
  line-height: 1;
}
.supply .gear-offer small {
  display: block;
  color: #93e8ff;
  font: 600 10px/1.1 "IBM Plex Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supply .gear-offer[data-bypass="true"] small {
  color: #ffe26a;
}

/* Sleek mockup bottom bar with desktop footer-reserve safety */
.fleet-actions {
  padding: 4px max(12px, var(--footer-reserve, 0px)) 4px 12px;
  border: 1px solid #4d446c;
  border-radius: 10px;
  background: linear-gradient(180deg, #16102ce8, #0e091ef2);
  box-shadow: 0 4px 16px #06021285;
}
.action-copy > .focus-readout {
  border: 1px solid #59e8ff75;
  border-inline-start: 3px solid #61e9ff;
  border-radius: 5px;
  padding: 3px 10px;
  background: #140e2bf0;
}
[data-phase="formation"] .fleet-actions .engage {
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  padding: 6px 18px;
}
.workspace {
  grid-template-rows: 30px minmax(0, 1fr) 48px;
}

/* Galaxy Map closer to map-first-system.webp & map-final-approach.webp */
.galaxy {
  width: min(1040px, 100%);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: clamp(6px, 2vw, 22px);
}
.galaxy header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.map-round {
  padding: 2px 14px;
  border: 1px solid #6f5a96;
  border-radius: 999px;
  background: #16102be6;
  color: #f4ecff;
  font: 700 12px/1.3 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
}
.galaxy h2 {
  padding: 4px 26px 6px;
  background: #ffe047;
  color: #1c1026;
  clip-path: polygon(3% 8%, 99% 0, 96% 36%, 100% 42%, 95% 92%, 0 100%, 4% 58%, 0 44%);
  font: italic 800 clamp(28px, 4.2vw, 50px)/1 "Barlow Condensed", sans-serif;
  letter-spacing: .04em;
  box-shadow: 0 5px 20px #0009;
}
.map-rival {
  margin-top: 2px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #18102dc8;
  border: 1px solid #ff56c555;
  color: #e9d9ff;
  font: 600 12px/1.2 Barlow, sans-serif;
}
.galaxy-chart {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(0, 2.2fr);
  align-items: center;
  gap: clamp(10px, 2.5vw, 28px);
  min-height: 0;
  height: 100%;
  padding: 6px 8px;
}
.orbit-routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.orbit-ring {
  fill: none;
  stroke: #49e6ff2e;
  stroke-width: 1.2;
  stroke-dasharray: 4 7;
}
.route-line {
  fill: none;
  stroke: #49e6ff66;
  stroke-width: 2.6;
  transition: stroke .2s, stroke-width .2s;
}
.route-origin {
  fill: #70f5ff;
  filter: drop-shadow(0 0 8px #48edff);
}
.route-node {
  fill: #13112d;
  stroke: #49e6ff88;
  stroke-width: 2.5;
}
.galaxy[data-focus="0"] .route-0,
.galaxy[data-focus="1"] .route-1 {
  stroke: #6ef6ff;
  stroke-width: 3.6;
  filter: drop-shadow(0 0 7px #48edff);
}
.galaxy[data-focus="0"] .node-0,
.galaxy[data-focus="1"] .node-1 {
  fill: #d8ff4d;
  stroke: #ffffff;
  filter: drop-shadow(0 0 8px #d8ff4d);
}
.departure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.departure-ship {
  width: 100%;
  height: clamp(58px, 12vw, 118px);
  filter: drop-shadow(0 8px 14px #040112);
}
.beacon {
  width: clamp(64px, 9vw, 110px);
  height: 22px;
  margin-top: -12px;
  border-radius: 50%;
  border: 1.5px solid #59f0ff;
  background: radial-gradient(ellipse at center, #70f5ffaa, #25b8e838 55%, transparent 74%);
  box-shadow: 0 0 18px #48edff99, inset 0 0 10px #8ff8ff;
}
.beacon-caption {
  padding: 2px 8px;
  border: 1px solid #4be5ff66;
  border-radius: 4px;
  background: #11102ae6;
  color: #9aefff;
  font: 600 9px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .1em;
}
.systems {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 2vh, 18px);
}
.systems button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: clamp(10px, 2vw, 22px);
  padding: clamp(10px, 1.8vw, 18px) clamp(14px, 2.2vw, 24px);
  border: 1px solid #5b5386;
  border-radius: 10px;
  background: linear-gradient(125deg, #171230cc, #100b24e0);
  text-align: left;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.systems button[aria-pressed="true"] {
  border-color: #d6ff4d;
  background: linear-gradient(125deg, #241c49e8, #141030f2);
  box-shadow: 0 0 24px #75f0ff3a, inset 0 0 16px #d6ff4d1a;
}
.planet-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px;
}
.reticle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed transparent;
  transition: border-color .18s, box-shadow .18s;
}
.systems button[aria-pressed="true"] .reticle {
  border-color: #d8ff47;
  box-shadow: 0 0 14px #d8ff4777, inset 0 0 10px #d8ff4733;
}
.planet {
  width: clamp(54px, 8.5vw, 96px);
  margin: 0;
}
.system-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.systems strong {
  font: italic 800 clamp(20px, 2.6vw, 32px)/1 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff6ea;
}
.system-rival {
  color: #ff69cf;
  font: 700 11px/1.1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.screen-intel {
  color: #cbeeff;
  font: 600 clamp(11px, 1.15vw, 13px)/1.25 Barlow, sans-serif;
}
.set-course {
  background: #e2ff3b;
  color: #1a1026;
  border: 0;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  padding: 10px 26px;
  font: italic 800 19px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px #d6ff4d44;
}
.trail {
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid #4e4273;
  border-radius: 999px;
  background: #120c26d8;
}
.trail li {
  border-top: 0;
  border: 1px solid #534778;
  border-radius: 6px;
  padding: 4px 2px;
  background: #1a1333;
  color: #c2b6dc;
  font: italic 700 12px/1.1 "Barlow Condensed", sans-serif;
}
.trail li.visited {
  border-color: #49e8e8;
  background: #103242;
  color: #8df8ff;
}
.trail li[aria-current="step"] {
  border-color: #e4ff47;
  background: #e4ff47;
  color: #1c1026;
  box-shadow: 0 0 12px #e4ff4766;
}

/* Fix short desktop viewports (e.g. 1366x599): keep all 3 ship models + 3 cr + Freeze unclipped & * clear of portrait */
@media (max-height: 700px) and (min-width: 901px) {
  .fleet-app { padding: 8px 14px 8px; gap: 4px; }
  .mast { height: 32px; padding-bottom: 4px; }
  .workspace { grid-template-rows: 26px minmax(0, 1fr) 42px; gap: 5px; }
  .phase { font-size: 15px; padding: 2px 14px; }
  .fleet header { height: 40px; gap: 8px; }
  .fleet header img { width: 36px; height: 36px; }
  .fleet header h2 { font-size: calc(17px * var(--tyrants-text-fleet-names, 1)); }
  .fleet .info-strip { height: 26px; }
  .supply { padding: 7px 10px; gap: 5px; }
  .supply-head { min-height: 30px; }
  .supply .yard-title { font-size: calc(22px * var(--tyrants-text-section-titles, 1)); padding: 2px 13px 3px; }
  .supply .info-strip { height: 22px; }
  .supply .gear-offers { grid-template-rows: 46px; gap: 6px; }
  .supply .gear-picture { max-height: 36px; }
  .supply .gear-offer strong { font-size: calc(13px * var(--tyrants-text-module-names, 1)); }
  .supply .gear-offer small { font-size: 9px; }
  .reserve-panel { padding: 4px 6px 5px; }
  .reserve-panel > h2 { font-size: calc(15px * var(--tyrants-text-section-titles, 1)); margin-bottom: 3px; }
  .reserve-grid { aspect-ratio: auto; height: 74px; }
  .display-options-trigger { inset: 44px auto auto 14px; width: 25px; height: 25px; font-size: 16px; }
  .display-options { top: 72px; }
  [data-phase="formation"] .line .ship .health { bottom: 32px; }
  [data-phase="formation"] .line .ship .shield-strip { bottom: 39px; }
  .fleet .line { margin-block: 10px 26px; }
}

@media (max-width: 900px) {
  /* Keep How to play right-aligned beside avatar and move round chip clear of the centered engine clock */
  .mast .help {
    margin-left: auto;
    flex: none;
    max-width: max(54px, calc(50vw - 110px));
    padding-inline: 7px;
    font-size: calc(10px * var(--tyrants-text-controls, 1));
    line-height: 1.1;
  }
  .mast .round {
    position: absolute;
    top: 47px;
    right: 8px;
    z-index: 6;
    margin: 0;
    padding: 2px 6px;
    border: 1px solid #594b76;
    border-radius: 4px;
    background: #140e27e6;
    color: #d8ccef;
    font-size: 9px;
  }
  .workspace { grid-template-rows: 24px minmax(0, 1fr) 44px; }
  .phase { font-size: 13px; padding: 2px 11px; }
  .battle-heading .instruction { font-size: 9px; padding: 1px 7px; }
  .fleet header { height: 30px; gap: 6px; }
  .fleet header img { width: 28px; height: 28px; }
  .fleet header h2 { font-size: 14px; }
  .fleet-bar { width: 64px; height: 2.5px; margin: 1px 0; }
  .win-badge { padding: 2px 6px; font-size: 9px; }
  .ship .health { height: 4px; }
  .ship .shield-strip { height: 2px; }
  .ship .level { font-size: 7px; right: 3px; top: 2px; }
  [data-phase="combat"] .ship .health,
  [data-phase="resolved"] .ship .health { bottom: 13px; left: 12%; width: 76%; }
  [data-phase="combat"] .ship .shield-strip,
  [data-phase="resolved"] .ship .shield-strip { bottom: 19px; left: 12%; width: 76%; }
  [data-phase="combat"] .ship .numbers,
  [data-phase="resolved"] .ship .numbers { bottom: 1px; font-size: calc(9px * var(--tyrants-text-hull-stats, 1)); padding: 0 4px; }
  [data-phase="formation"] .line .ship .numbers { top: 2px; right: 14px; font-size: calc(8px * var(--tyrants-text-hull-stats, 1)); padding: 0 4px; }
  [data-phase="formation"] .line .ship .health { bottom: 18px; height: 3px; }
  [data-phase="formation"] .line .ship .shield-strip { bottom: 23px; }
  .supply .gear-offers { grid-template-rows: 46px; }
  .supply .gear-offer { padding: 3px 5px; }
  .supply .gear-offer small { font-size: 8px; }
  .galaxy-chart { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  .orbit-routes { display: none; }
  .departure-ship { height: 56px; }
  .beacon { width: 72px; height: 14px; }
  .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .systems button { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 10px 6px; gap: 6px; }
  .system-card { align-items: center; }
  .planet { width: 52px; }
  .systems strong { font-size: 18px; }
  .system-rival { font-size: 9px; }
  .screen-intel { font-size: 10px; }
  .trail { padding: 4px 5px; gap: 3px; }
  .trail li { font-size: 10px; padding: 3px 1px; }
  .fleet-actions { gap: 4px; padding: 3px max(34px, calc(var(--footer-reserve, 0px) - 8px)) 3px 5px; }
  .action-copy > .focus-readout { font-size: 9px; line-height: 1.15; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fleet-actions :is(.sell, .cancel, .stats) { padding: 5px 6px; font-size: calc(10px * var(--tyrants-text-controls, 1)); }
  [data-phase="formation"] .fleet-actions .engage { min-width: 72px; padding: 5px 10px; font-size: calc(16px * var(--tyrants-text-controls, 1)); }
  .display-options-trigger { inset: 44px auto auto 8px; width: 25px; height: 25px; }
  .display-options { top: 48px; max-height: 48%; }
  .ship.reachable::after { font-size: calc(6px * var(--tyrants-text-grid-labels, 1)); padding: 0 3px; }
  .ship.flagship .ship-label::before { font-size: calc(9px * var(--tyrants-text-grid-labels, 1)); }
  .sockets button { font-size: calc(10px * var(--tyrants-text-module-names, 1)); }
}

/* === v23 Mobile iOS Safari & Touch Ergonomics === */
html,
body {
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
}
.fleet-app {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.fleet-app button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.fleet-app img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.display-options input,
.display-options select {
  -webkit-user-select: text;
  user-select: text;
}
@media (pointer: coarse) {
  .display-options input[type="number"],
  .display-options select {
    font-size: 16px;
  }
}

/* Tap-to-fit & drag-to-ship highlights */
.ship.fit-ready,
.ship.tap-fit {
  border-color: #70f5ff !important;
  box-shadow: inset 0 0 12px #48edff55, 0 0 10px #48edff44;
}
.ship.tap-merge {
  border-color: #ffe25a !important;
  box-shadow: inset 0 0 14px #ffe04766, 0 0 12px #ffe04755;
}

/* Desktop keeps all Shipyard sections expanded together */
.dock-tabs {
  display: none;
}

/* Compact tabbed Shipyard dock for Portrait Phones AND Landscape Phones */
@media (max-width: 900px), (max-height: 500px) {
  .info-strip {
    display: none !important;
  }
  .dock-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 4px;
  }
  .dock-tab {
    min-height: 32px;
    padding: 4px 6px;
    border: 1px solid #5c4f7a;
    border-radius: 6px;
    background: #1a1230e8;
    color: #d6c8f2;
    font: 700 11px/1 "IBM Plex Mono", monospace;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dock-tab[aria-selected="true"] {
    border-color: #ffe047;
    background: #ffe047;
    color: #1c1026;
    box-shadow: 0 0 10px #ffe04744;
  }
  .dock-tab.dim {
    opacity: .58;
  }
  .supply[data-tab="shop"] .reserve-panel,
  .supply[data-tab="shop"] .gear-shop {
    display: none !important;
  }
  .supply[data-tab="reserve"] .shop,
  .supply[data-tab="reserve"] .gear-offers,
  .supply[data-tab="reserve"] .gear-shop {
    display: none !important;
  }
  .supply[data-tab="sockets"] .shop,
  .supply[data-tab="sockets"] .reserve-panel {
    display: none !important;
  }
  .supply[data-tab="sockets"] .gear-shop {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 5px 6px;
    padding: 6px;
    align-items: center;
  }
  .supply[data-tab="sockets"] .gear-shop .inspector {
    display: block;
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .supply[data-tab="sockets"] .gear-shop .sockets {
    grid-column: 1;
    grid-row: 2;
  }
  .supply[data-tab="sockets"] .gear-shop .fit {
    grid-column: 2;
    grid-row: 2;
    min-width: 92px;
    height: 40px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .supply[data-tab="sockets"] .gear-shop .sockets button {
    height: 40px;
    font-size: 10px;
    padding: 3px 5px;
  }
  .supply .reserve-panel > h2 {
    display: none;
  }
}

/* Portrait iPhones (iPhone SE 375x553 through iPhone Pro Max 430x932) */
@media (max-width: 900px) and (orientation: portrait), (max-width: 560px) {
  .fleet-app {
    padding:
      max(6px, env(safe-area-inset-top, 0px))
      max(8px, env(safe-area-inset-right, 0px))
      calc(max(6px, env(safe-area-inset-bottom, 0px)) + var(--ios-occluded, 0px))
      max(8px, env(safe-area-inset-left, 0px));
    gap: 4px;
  }
  .mast {
    height: 36px;
    padding-bottom: 4px;
    padding-right: max(48px, var(--mast-reserve, 50px));
  }
  .mast .round {
    top: calc(max(6px, env(safe-area-inset-top, 0px)) + 44px);
    right: max(8px, env(safe-area-inset-right, 0px));
  }
  .display-options-trigger {
    inset: calc(max(6px, env(safe-area-inset-top, 0px)) + 41px) auto auto max(8px, env(safe-area-inset-left, 0px));
    width: 26px;
    height: 26px;
  }
  .workspace {
    grid-template-rows: 24px minmax(0, 1fr) 46px;
    gap: 4px;
  }
  [data-phase="formation"] .arena:has(.supply:not([hidden])) {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px;
  }
  .supply {
    grid-template-rows: auto auto auto;
    gap: 5px;
    padding: 6px 7px;
  }
  .supply-head {
    min-height: 30px;
    gap: 6px;
  }
  .supply .yard-title {
    font-size: calc(19px * var(--tyrants-text-section-titles, 1));
    padding: 2px 10px 3px;
  }
  .supply-head .reroll {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 12px;
  }
  .supply .gear-offers {
    grid-row: 3;
    grid-template-rows: 48px;
    gap: 5px;
  }
  .supply .gear-offer {
    padding: 4px 6px;
    gap: 5px;
  }
  .supply .gear-offer .gear-copy {
    align-items: flex-start;
    text-align: left;
    overflow: hidden;
  }
  .supply .gear-offer strong {
    font-size: 11px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .supply .gear-offer small {
    display: block;
    max-width: 100%;
    font-size: 9px;
  }
  .supply .gear-offer b {
    font-size: 10px;
    padding: 2px 5px;
  }
  .supply .reserve-panel {
    grid-row: 2;
    padding: 6px;
  }
  .supply .reserve-grid {
    aspect-ratio: 4;
    min-height: 92px;
  }
  .supply .gear-shop {
    grid-row: 2;
  }
  .supply[data-tab="sockets"] .gear-offers {
    grid-row: 3;
  }
  .mount,
  .berth[data-sockets] .mount {
    width: min(26%, 26px);
    height: 18px;
  }
  .berth[data-sockets="3"] .mount,
  .berth[data-sockets="4"] .mount {
    width: min(23%, 22px);
    height: 15px;
  }
  [data-phase="formation"] .line .ship .health {
    bottom: 21px;
    height: 3px;
  }
  [data-phase="formation"] .line .ship .shield-strip {
    bottom: 25px;
  }
  [data-phase="combat"] .ship .health,
  [data-phase="resolved"] .ship .health {
    bottom: 4px;
    left: 12%;
    width: 76%;
    height: 4px;
  }
  [data-phase="combat"] .ship .shield-strip,
  [data-phase="resolved"] .ship .shield-strip {
    bottom: 10px;
    left: 12%;
    width: 76%;
  }
  [data-stats="detailed"][data-phase="combat"] .ship .health,
  [data-stats="detailed"][data-phase="resolved"] .ship .health {
    bottom: 14px;
  }
  [data-stats="detailed"][data-phase="combat"] .ship .shield-strip,
  [data-stats="detailed"][data-phase="resolved"] .ship .shield-strip {
    bottom: 20px;
  }
  .ship.reachable::after {
    left: auto;
    right: 2px;
    top: 2px;
    transform: none;
    font-size: 6px;
    padding: 1px 3px;
  }
  .fleet-actions {
    gap: 5px;
    padding: 4px max(6px, var(--footer-reserve, 0px)) 4px 6px;
  }
  .fleet-actions :is(.sell, .cancel, .stats) {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 11px;
  }
  [data-phase="formation"] .fleet-actions .engage {
    min-width: 82px;
    min-height: 36px;
    padding: 5px 12px;
    font-size: 17px;
  }
  .set-course {
    min-height: 44px;
    padding: 10px 22px;
    font-size: 18px;
  }
}

/* Compact Portrait iPhones (iPhone SE 375x553 / Safari with bars expanded) */
@media (max-height: 610px) and (orientation: portrait), (max-height: 610px) and (max-width: 560px) {
  .mast { height: 32px; }
  .mast h1 { font-size: 20px; }
  .mast .round { top: calc(max(6px, env(safe-area-inset-top, 0px)) + 39px); }
  .display-options-trigger { inset: calc(max(6px, env(safe-area-inset-top, 0px)) + 37px) auto auto max(8px, env(safe-area-inset-left, 0px)); width: 24px; height: 24px; }
  .workspace { grid-template-rows: 20px minmax(0, 1fr) 42px; gap: 3px; }
  .fleet header { height: 24px; }
  .fleet header img { width: 22px; height: 22px; }
  .fleet header h2 { font-size: 13px; }
  .fleet header p { font-size: 8px; }
  .supply { padding: 5px 6px; gap: 4px; }
  .supply-head { min-height: 26px; }
  .supply .yard-title { font-size: 17px; }
  .supply-head .reroll { min-height: 26px; padding: 3px 8px; font-size: 11px; }
  .dock-tab { min-height: 28px; font-size: 10px; }
  .supply .gear-offers { grid-template-rows: 42px; }
  .supply .gear-picture { max-height: 26px; }
  .supply .reserve-grid { min-height: 76px; }
  .supply[data-tab="sockets"] .gear-shop .sockets button,
  .supply[data-tab="sockets"] .gear-shop .fit { height: 34px; }
  [data-phase="formation"] .line .ship .health { bottom: 1px; height: 2px; left: 8%; width: 84%; }
  [data-phase="formation"] .line .ship .shield-strip { bottom: 4px; left: 8%; width: 84%; }
  .mount, .berth[data-sockets] .mount { height: 15px; width: min(24%, 22px); }
  .berth[data-sockets="3"] .mount, .berth[data-sockets="4"] .mount { height: 13px; width: min(22%, 20px); }
  .fleet-actions :is(.sell, .cancel, .stats, .engage) { min-height: 32px; }
  .galaxy { padding: 4px 6px; gap: 5px; }
  .galaxy h2 { font-size: 24px; padding: 3px 16px 4px; }
  .departure-ship { height: 42px; }
  .planet { width: 42px; }
  .systems button { padding: 7px 5px; gap: 4px; }
  .systems strong { font-size: 16px; }
  .set-course { min-height: 38px; padding: 7px 18px; font-size: 16px; }
}

/* Landscape iPhones (e.g. 667x375, 844x390, 932x430) — restore side-by-side 2-column fleets */
@media (max-height: 500px) and (min-width: 561px) {
  .fleet-app {
    padding:
      max(4px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      calc(max(4px, env(safe-area-inset-bottom, 0px)) + var(--ios-occluded, 0px))
      max(10px, env(safe-area-inset-left, 0px));
    gap: 3px;
  }
  .mast {
    height: 30px;
    padding-bottom: 3px;
    padding-right: max(48px, var(--mast-reserve, 50px));
    gap: 10px;
  }
  .mast h1 { font-size: 20px; }
  .mast .round {
    position: static;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    font-size: 10px;
  }
  .mast .help {
    margin-left: 0;
    min-height: 26px;
    padding: 3px 8px;
    font-size: 10px;
  }
  .display-options-trigger {
    inset: calc(max(4px, env(safe-area-inset-top, 0px)) + 34px) auto auto max(10px, env(safe-area-inset-left, 0px));
    width: 24px;
    height: 24px;
    font-size: 15px;
  }
  .workspace {
    grid-template-rows: 20px minmax(0, 1fr) 38px;
    gap: 3px;
  }
  .phase { font-size: 13px; padding: 1px 12px 2px; }
  .arena,
  [data-phase="formation"] .arena:has(.supply:not([hidden])) {
    grid-template-columns: minmax(0, 1.08fr) 12px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }
  .arena > .own,
  [data-phase="formation"] .arena:has(.supply:not([hidden])) > .own {
    grid-area: 1 / 1;
    order: 0;
  }
  .arena > .enemy,
  .arena > .supply {
    grid-area: 1 / 3;
    order: 0;
  }
  .fleet header { height: 28px; gap: 6px; }
  .fleet header img { width: 26px; height: 26px; }
  .fleet header h2 { font-size: 15px; }
  .fleet header p { font-size: 9px; }
  .fleet-bar { width: 70px; height: 2.5px; }
  .win-badge { padding: 2px 7px; font-size: 9px; }
  .line {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin-block: 4px;
    margin-inline: 0;
    transform: none;
  }
  .line::before { display: none; }
  .line > .berth {
    grid-column: var(--col);
    grid-row: var(--row);
  }
  .own .line > .berth .ship-art > :not(span) { transform: none; }
  .enemy .line > .berth .ship-art > :not(span) { transform: scaleX(-1); }
  .line > .berth .ship {
    background: color-mix(in srgb, var(--grid-glow) 8%, #100b2799);
    border: 1px solid color-mix(in srgb, var(--grid-glow) 45%, transparent);
  }
  .mount, .berth[data-sockets] .mount { width: min(26%, 24px); height: 18px; }
  [data-phase="formation"] .line .ship .health { bottom: 20px; height: 3px; }
  [data-phase="formation"] .line .ship .shield-strip { bottom: 24px; }
  [data-phase="formation"] .line .ship .numbers { top: 2px; right: 14px; font-size: 9px; padding: 0 4px; }
  [data-phase="combat"] .ship .health,
  [data-phase="resolved"] .ship .health { bottom: 4px; left: 12%; width: 76%; height: 4px; }
  [data-phase="combat"] .ship .shield-strip,
  [data-phase="resolved"] .ship .shield-strip { bottom: 10px; left: 12%; width: 76%; }
  [data-stats="detailed"][data-phase="combat"] .ship .health,
  [data-stats="detailed"][data-phase="resolved"] .ship .health { bottom: 14px; }
  [data-stats="detailed"][data-phase="combat"] .ship .shield-strip,
  [data-stats="detailed"][data-phase="resolved"] .ship .shield-strip { bottom: 20px; }
  [data-phase="combat"] .ship .numbers,
  [data-phase="resolved"] .ship .numbers { bottom: 1px; font-size: 10px; padding: 0 4px; }
  .supply {
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 5px 7px;
    gap: 4px;
  }
  .supply-head { min-height: 24px; }
  .supply .yard-title { font-size: 18px; padding: 1px 10px 2px; }
  .supply .wallet { font-size: 12px; }
  .supply-head .reroll { min-height: 24px; padding: 2px 8px; font-size: 11px; }
  .dock-tabs { margin-top: 3px; }
  .dock-tab { min-height: 26px; font-size: 10px; }
  .supply .gear-offers {
    grid-row: 3;
    grid-template-rows: 42px;
    gap: 5px;
  }
  .supply .gear-offer { padding: 3px 5px; }
  .supply .gear-picture { max-height: 28px; }
  .supply .gear-offer strong { font-size: 12px; }
  .supply .gear-offer small { font-size: 8px; }
  .supply .reserve-panel { grid-row: 2 / 4; padding: 5px; display: flex; flex-direction: column; justify-content: center; }
  .supply .reserve-grid { aspect-ratio: 4; max-height: 100%; }
  .supply .gear-shop { grid-row: 2; }
  .supply[data-tab="sockets"] .gear-offers { grid-row: 3; }
  .supply[data-tab="sockets"] .gear-shop .sockets button,
  .supply[data-tab="sockets"] .gear-shop .fit { height: 34px; }
  .fleet-actions { padding: 3px max(8px, var(--footer-reserve, 0px)) 3px 8px; gap: 5px; }
  .fleet-actions :is(.sell, .cancel, .stats, .engage) { min-height: 30px; padding: 3px 9px; font-size: 11px; }
  [data-phase="formation"] .fleet-actions .engage { font-size: 15px; min-width: 80px; }
  /* Compact Landscape Galaxy Map */
  .galaxy { padding: 4px 10px; gap: 4px; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .galaxy h2 { font-size: 22px; padding: 2px 16px 3px; }
  .map-round, .map-rival { font-size: 10px; padding: 1px 8px; }
  .galaxy-chart { grid-template-columns: minmax(110px, .7fr) minmax(0, 2.4fr); grid-template-rows: 1fr; gap: 10px; padding: 2px 4px; }
  .departure-ship { height: 46px; }
  .beacon { width: 58px; height: 12px; }
  .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .systems button { grid-template-columns: auto minmax(0, 1fr); text-align: left; justify-items: start; padding: 6px 10px; gap: 8px; }
  .system-card { align-items: flex-start; }
  .planet { width: 42px; }
  .systems strong { font-size: 18px; }
  .set-course { min-height: 32px; padding: 5px 16px; font-size: 15px; }
  .trail { padding: 3px 6px; }
  .trail li { font-size: 10px; padding: 2px 1px; }
  .display-options {
    inset: calc(max(4px, env(safe-area-inset-top, 0px)) + 36px) auto auto max(10px, env(safe-area-inset-left, 0px));
    max-height: calc(100% - 48px - max(4px, env(safe-area-inset-top, 0px)) - max(4px, env(safe-area-inset-bottom, 0px)));
    padding: 8px 10px;
    gap: 6px;
  }
}

/* Keep Tyrants' Display Options panel touch-scrollable, clipped-free, and easy to dismiss on mobile */
.display-options-body {
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 8px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.display-options [data-tuning-close] {
  min-width: 64px;
  min-height: 38px;
  padding: 6px 12px;
  font-weight: 700;
}
@media (max-width: 900px), (pointer: coarse) {
  .display-options {
    width: min(332px, calc(100% - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    left: max(8px, env(safe-area-inset-left, 0px));
    top: calc(max(6px, env(safe-area-inset-top, 0px)) + 44px);
    max-height: min(64%, calc(100% - 62px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  }
  .text-size-fields > label {
    grid-template-columns: minmax(0, 1fr) 70px 14px;
  }
  .ship-angle-axis {
    grid-template-columns: 32px minmax(0, 1fr) 70px 12px;
  }
  .display-options button {
    min-height: 38px;
  }
}

/* === v25 SDK session.shop draggable hull rack (#566) & Galaxy Map telemetry canvas === */
.galaxy-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.supply .offers {
  display: block;
  height: 100%;
  min-height: 0;
}
.supply .offers > .mm-modal-h,
.supply .offers > .mm-shoppage {
  display: none;
}
.supply .offers .mm-shopgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
  margin-top: 0 !important;
  align-items: stretch;
}
.supply .offers .mm-shopslot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  border: 1px solid #e7bb50;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, #22223e, #121426 68%);
  box-shadow: inset 0 0 13px #c881251a;
  touch-action: none;
}
.supply .offers .mm-shopslot:has(.mm-shopcard-c:not(.on)) {
  border-color: #ffe047;
  box-shadow: inset 0 0 15px #ffe04724;
}
.supply .offers .mm-shopslot:has(.mm-shopact.on) {
  border-color: var(--mint);
  box-shadow: inset 0 0 13px #78e3cd24;
}
.supply .offers .mm-shopslot:has(.mm-shopcard[aria-pressed="true"]) {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 12px #f7dc7c45;
}
.supply .offers .mm-shopslot:has(.mm-shopcard.on) {
  opacity: .5;
}
.supply .offers .mm-shopcard {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  align-content: stretch;
  gap: 1px;
  padding: 7px 3px 4px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(ellipse 31% 8% at 50% 62%, #000b, transparent),
    radial-gradient(ellipse 48% 53% at 50% 52%, #2d63ae3c, #2c246626 65%, transparent);
  box-shadow: none;
  text-align: center;
  touch-action: none;
}
.supply .offers .mm-shopcard.on,
.supply .offers .mm-shopcard.off {
  box-shadow: none;
  background: none;
}
.supply .offers .mm-shopcard.off {
  opacity: .58;
}
.supply .offers .mm-shopcard .mm-tgbadge {
  position: absolute;
  top: 4px;
  right: 4px;
  pointer-events: none;
}
.supply .offers .mm-shopcard.off .mm-tgbadge {
  display: none;
}
.supply .offers .mm-shoplabel {
  grid-row: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff1d9;
  font: italic 700 calc(clamp(14px, 1.4vw, 20px) * var(--tyrants-text-ship-names, 1))/1 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}
.supply .offers .mm-shopcard[aria-pressed="true"] .mm-shoplabel {
  color: var(--gold);
}
.supply .offers .mm-shopart {
  grid-row: 2;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}
.supply .offers .mm-shopart[data-model="live"],
.supply .offers .mm-shopart[data-drag-source] {
  visibility: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  [data-phase="formation"] .mm-shopcard:not(.on) .mm-shopart:not([data-model]) {
    animation: hull-idle 4.2s ease-in-out infinite;
  }
}
.supply .offers .mm-shopcost {
  grid-row: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.24em;
  padding: 1px 10px 2px;
  border: 0;
  border-radius: 3px;
  color: #211424;
  background: #f5d45d;
  font: italic 800 calc(17px * var(--tyrants-text-prices, 1))/1 "Barlow Condensed", sans-serif;
}
.supply .offers .mm-shopcost .mmi {
  display: none;
}
.supply .offers .mm-shopcost::after {
  content: "cr";
}
.supply .offers .mm-shopcard.on .mm-shopcost {
  gap: 0;
  font-size: 0;
  background: #362e52;
  color: #dcd2ee;
}
.supply .offers .mm-shopcard.on .mm-shopcost::after {
  content: "Bought";
  font-size: calc(13px * var(--tyrants-text-prices, 1));
}
.supply .offers .mm-shopact {
  flex: 0 0 23px;
  height: 23px;
  min-height: 0;
  padding: 0 4px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #2b213d;
  color: #d2bbeb;
  font: 600 11px/1 Barlow, sans-serif;
}
.supply .offers .mm-shopact:hover:not(:disabled) {
  color: #ffffff;
  border-top-color: var(--mint);
}
.supply .offers .mm-shopact.on {
  background: #1c3a44;
  color: var(--mint);
  border-top-color: var(--mint);
}
.supply .offers .mm-shopact:disabled {
  opacity: .5;
  cursor: default;
}

@media (max-height: 700px) and (min-width: 901px) {
  .supply .offers { min-height: 112px; }
  .supply .offers .mm-shopgrid { gap: 6px; }
  .supply .offers .mm-shopcard { padding: 4px 3px 3px; }
  .supply .offers .mm-shoplabel { font-size: calc(14px * var(--tyrants-text-ship-names, 1)); }
  .supply .offers .mm-shopcost { font-size: calc(14px * var(--tyrants-text-prices, 1)); padding: 1px 8px; }
  .supply .offers .mm-shopact { height: 20px; flex-basis: 20px; font-size: 10px; }
}

@media (max-width: 900px), (max-height: 500px) {
  .supply { position: relative; }
  .fleet-app.dragging .supply[data-tab="reserve"] .shop {
    display: block !important;
    position: absolute;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 900px) and (orientation: portrait), (max-width: 560px) {
  .supply .offers { height: 94px; }
  .supply .offers .mm-shopgrid { gap: 5px; }
  .supply .offers .mm-shopcard { padding: 4px 2px 3px; }
  .supply .offers .mm-shoplabel { font-size: calc(11.5px * var(--tyrants-text-ship-names, 1)); }
  .supply .offers .mm-shopcost { font-size: calc(12px * var(--tyrants-text-prices, 1)); padding: 0 5px 1px; }
  .supply .offers .mm-shopact { height: 24px; flex-basis: 24px; font-size: 10px; }
}

@media (max-height: 610px) and (orientation: portrait), (max-height: 610px) and (max-width: 560px) {
  .supply .offers { height: 80px; }
  .supply .offers .mm-shopact { height: 22px; flex-basis: 22px; }
}

@media (max-height: 500px) and (min-width: 561px) {
  .supply .offers { height: 100%; min-height: 82px; }
  .supply .offers .mm-shopgrid { gap: 5px; }
  .supply .offers .mm-shopcard { padding: 3px 2px 2px; }
  .supply .offers .mm-shoplabel { font-size: 13px; }
  .supply .offers .mm-shopcost { font-size: 12px; padding: 1px 6px; }
  .supply .offers .mm-shopact { height: 20px; flex-basis: 20px; font-size: 9px; }
}

/* Tactile hover & focus polish for desktop pointers */
@media (hover: hover) and (pointer: fine) {
  .supply .offers .mm-shopslot,
  .supply .gear-offer,
  .fleet-actions :is(.sell, .cancel, .stats, .engage),
  .supply-head .reroll,
  .set-course {
    transition: border-color .14s ease, box-shadow .14s ease, filter .14s ease, background-color .14s ease;
  }
  .supply .offers .mm-shopslot:has(.mm-shopcard:not(:disabled)):hover,
  .supply .gear-offer:not(:disabled):hover {
    border-color: #fff08c;
    box-shadow: inset 0 0 16px #ffe0472e, 0 0 12px #ffe04730;
  }
  .supply-head .reroll:not(:disabled):hover,
  .fleet-actions :is(.sell, .cancel, .stats):not(:disabled):hover {
    border-color: #b79ce0;
    filter: brightness(1.1);
  }
  [data-phase="formation"] .fleet-actions .engage:not(:disabled):hover,
  .set-course:not(:disabled):hover {
    filter: brightness(1.07);
    box-shadow: 0 4px 18px #ffe04755;
  }
}

/* === v28 Option B Ranked Runs, Hearts/Wins HUD, Survival Banner & #518 Leaderboard Cards === */
.mast .ladder-btn,
.mast .new-run {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #20333b;
  color: var(--ink);
  padding: 6px 10px;
  min-height: 32px;
  font: 600 calc(12px * var(--tyrants-text-controls, 1))/1 Barlow, sans-serif;
  white-space: nowrap;
}
.mast .ladder-btn {
  border-color: #c29b4d88;
  background: linear-gradient(180deg, #322546, #1d1730);
  color: #ffe48f;
}
.mast .new-run {
  border-color: #79507c88;
  background: #251b36;
  color: #e2ccf2;
}
.fleet-id {
  min-width: 0;
  overflow: hidden;
}
.fleet header h2 {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.fleet-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.fleet header .fleet-status b {
  margin-left: 0;
}
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--tier-color, #9ea8c4) 65%, #3d3556);
  border-radius: 5px;
  background: color-mix(in srgb, var(--tier-color, #9ea8c4) 14%, #120d24e8);
  color: var(--tier-color, #d6dcf0);
  font: 700 10px/1 "IBM Plex Mono", monospace;
  letter-spacing: .04em;
  white-space: nowrap;
}
.rank-pill.is-casual {
  --tier-color: #9bb1c4;
  opacity: .88;
}
.mmr-delta {
  font-weight: 800;
  margin-left: 2px;
}
.mmr-delta.up {
  color: #72f89d;
}
.mmr-delta.down {
  color: #ff7793;
}
.win-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.win-badge .hearts {
  color: #ff698b;
  letter-spacing: .5px;
  text-shadow: 0 0 8px #ff4f7a66;
}
.win-badge .hearts .lost {
  color: #6b5a82;
  text-shadow: none;
}
.win-badge.is-survival {
  border-color: #ffe047b5;
  background: linear-gradient(180deg, #3a2a16e8, #1c1328e8);
  color: #ffe36e;
  box-shadow: 0 0 12px #ffe04736;
}
.win-badge.is-ghost {
  border-color: #78e4dcb0;
  color: #8af3ea;
}
.win-badge.is-rival {
  border-color: #e4789c78;
  color: #f3b2c9;
}

.trail:has(.overtime:not([hidden])) {
  grid-template-columns: repeat(10, minmax(0, 1fr)) minmax(48px, 1.4fr);
}
.trail li.overtime {
  color: #ffe36e;
  border-color: #ffe047;
  background: #3a2a1680;
  font-weight: 700;
}

.survival-banner {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  width: min(440px, calc(100% - 24px));
  padding: 18px 20px;
  border: 1.5px solid #ffe047c8;
  border-radius: 12px;
  background: linear-gradient(160deg, #21163bf2, #0f0d22f7);
  box-shadow: 0 18px 46px #000b, 0 0 28px #ffe04738;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.survival-eyebrow {
  font: 700 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .16em;
  color: #76f2ff;
}
.survival-banner h2 {
  font: 800 28px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #ffe678;
}
.survival-copy {
  font: 500 13px/1.4 Barlow, sans-serif;
  color: #e4dcf2;
}
.survival-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.survival-claim,
.survival-continue {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 6px;
  font: 700 14px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.survival-claim {
  border: 1px solid #8a78ad;
  background: #221c38;
  color: #f3eefc;
}
.survival-continue {
  border: 0;
  background: linear-gradient(180deg, #ffe36e, #f0b23c);
  color: #1c1322;
  box-shadow: 0 4px 16px #ffe04744;
}

/* #518 Leaderboard still thumbnails & detail fleet cards */
.ty-lb-thumb {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--lb-paint, #367de5);
  background: #100c20;
  overflow: visible;
}
.ty-lb-thumb img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.ty-lb-tier-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #120d24;
  border: 1px solid var(--lb-tier, #f6c963);
  color: var(--lb-tier, #f6c963);
  font: 700 9px/12px sans-serif;
  text-align: center;
}
.ty-lb-detail {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  background: radial-gradient(circle at 18% 15%, color-mix(in srgb, var(--lb-paint, #367de5) 28%, transparent), transparent 60%), linear-gradient(160deg, #1b1531, #0d0a1c);
  color: #f4effc;
  box-sizing: border-box;
}
.ty-lb-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ty-lb-head img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--lb-paint, #367de5);
  object-fit: cover;
  flex: none;
}
.ty-lb-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ty-lb-meta strong {
  font: 700 14px/1.15 "Barlow Condensed", sans-serif;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ty-lb-meta span {
  font: 500 10px/1.2 Barlow, sans-serif;
  color: #bfb5d6;
}
.ty-lb-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.ty-lb-tier {
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--lb-tier, #f6c963) 70%, #3a3054);
  background: color-mix(in srgb, var(--lb-tier, #f6c963) 14%, #120d24);
  color: var(--lb-tier, #f6c963);
  font: 700 10px/1 "IBM Plex Mono", monospace;
}
.ty-lb-wins {
  padding: 3px 7px;
  border-radius: 4px;
  background: #271f42;
  color: #ffe36e;
  font: 700 10px/1 "IBM Plex Mono", monospace;
}
.ty-lb-fleet {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
}
.ty-lb-ship {
  aspect-ratio: 1;
  border-radius: 5px;
  border: 1px solid #3c345c;
  background: #141028;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ty-lb-ship.is-flag {
  border-color: #f6c963aa;
}
.ty-lb-ship img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 900px) {
  .mast :is(.new-run, .ladder-btn, .help):not([hidden]) {
    margin-left: auto;
  }
  .mast :is(.new-run, .ladder-btn):not([hidden]) ~ :is(.ladder-btn, .help) {
    margin-left: 0;
  }
  .mast .ladder-btn,
  .mast .new-run {
    min-height: 28px;
    padding: 4px 7px;
    font-size: calc(10px * var(--tyrants-text-controls, 1));
  }
  .mast .round .round-run {
    display: none;
  }
  .fleet-app[data-phase="course"] .mast .round {
    display: none;
  }
  .fleet-status {
    gap: 4px;
  }
  .rank-pill {
    padding: 2px 5px;
    font-size: 8px;
  }
  .win-badge {
    gap: 4px;
    padding: 2px 6px;
    font-size: 9px;
  }
  .win-badge .hearts {
    letter-spacing: -0.5px;
  }
}

@media (max-height: 500px) and (min-width: 561px) {
  .mast :is(.new-run, .ladder-btn, .help):not([hidden]) {
    margin-left: 0;
  }
  .mast .round .round-run {
    display: inline;
  }
  .fleet-app[data-phase="course"] .mast .round {
    display: block;
  }
  .mast .ladder-btn,
  .mast .new-run {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 10px;
  }
}

.fleet-app[data-mode="run"] .fleet.own > header {
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .fleet-app[data-mode="run"] .fleet.own > header:hover .rank-pill {
    filter: brightness(1.18);
    box-shadow: 0 0 10px color-mix(in srgb, var(--tier-color, #9bb1c4) 45%, transparent);
  }
  .mast :is(.ladder-btn, .new-run):hover,
  .survival-claim:hover,
  .survival-continue:hover,
  .fleet-actions :is(.speed-btn, .meter-btn):hover {
    filter: brightness(1.1);
  }
}

/* === v30 Shipyard Tactical Overlays, Combat Meter & Solo Battle Speed === */
.battle-heading .scout-pill {
  padding: 2px 10px;
  border: 1px solid #ff69cf66;
  border-radius: 999px;
  background: #231133e6;
  color: #ffd6f2;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(360px, 46vw);
}
.own .line > .berth .ship.passive-cell {
  box-shadow: inset 0 0 12px #ffe0472b, inset 0 0 0 1px #ffe04766;
}
.passive-tag {
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 3;
  padding: 1px 4px;
  border-radius: 3px;
  background: #1a112de0;
  border: 1px solid #ffe04780;
  color: #ffe87a;
  font: 700 8px/1.1 "IBM Plex Mono", monospace;
  letter-spacing: .03em;
  pointer-events: none;
}
.ship.occupied .passive-tag {
  top: 15px;
  left: 5px;
  right: auto;
  border-color: #70f5ff88;
  color: #9bf7ff;
}
.fleet-actions :is(.speed-btn, .meter-btn) {
  border: 1px solid #785f92;
  background: #231937;
  border-radius: 4px;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: calc(1em * var(--tyrants-text-controls, 1));
}
.fleet-actions :is(.speed-btn, .meter-btn)[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
  background: #332548;
  box-shadow: 0 0 10px #ffe04730;
}
.combat-meter {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 105;
  width: min(600px, calc(100% - 16px));
  max-height: calc(100% - 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1.5px solid #6ef6ff88;
  border-radius: 12px;
  background: linear-gradient(160deg, #1b1236f5, #0e0a20fa);
  box-shadow: 0 18px 46px #000c, 0 0 24px #48edff28;
  color: #f4effc;
}
.meter-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.meter-head strong {
  font: italic 800 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .06em;
  color: var(--gold);
}
.meter-totals {
  margin-left: auto;
  font: 700 11px/1 "IBM Plex Mono", monospace;
  color: #9aefff;
  white-space: nowrap;
}
.meter-close {
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid #6b568b;
  border-radius: 5px;
  background: #261b40;
  color: #f4effc;
  font: 700 16px/1 Barlow, sans-serif;
}
.meter-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-right: 2px;
}
.meter-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.meter-col-head {
  font: 700 10px/1 "IBM Plex Mono", monospace;
  letter-spacing: .12em;
  color: #70f5ff;
  border-bottom: 1px solid #49e6ff40;
  padding-bottom: 4px;
}
.enemy-col .meter-col-head {
  color: #ff77d6;
  border-bottom-color: #ff69cf40;
}
.meter-empty {
  color: var(--muted);
  font-size: 12px;
}
.meter-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 5px;
  background: #17102db0;
  border: 1px solid #3c325e;
}
.meter-row.is-mvp {
  border-color: #ffe04788;
  background: #251a3be0;
}
.meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font: 600 12px/1.15 Barlow, sans-serif;
}
.meter-label b {
  font: 700 11px/1 "IBM Plex Mono", monospace;
  color: #fff6db;
  white-space: nowrap;
}
.mvp-tag {
  font-style: normal;
  padding: 1px 4px;
  border-radius: 3px;
  background: #ffe047;
  color: #1c1026;
  font: 800 9px/1 "IBM Plex Mono", monospace;
  margin-left: 3px;
}
.meter-bar {
  height: 5px;
  border-radius: 999px;
  background: #0a0718;
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #48edff, #84ff9e);
}
.enemy-col .meter-bar i {
  background: linear-gradient(90deg, #ff5fb8, #ff99d6);
}
.meter-sub {
  font: 600 10px/1.1 "IBM Plex Mono", monospace;
  color: #b7c8df;
}

@media (max-width: 900px) {
  .battle-heading .scout-pill {
    font-size: 9px;
    padding: 1px 7px;
    max-width: 54vw;
  }
  .passive-tag {
    font-size: 6.5px;
    padding: 0 3px;
  }
  .ship.occupied .passive-tag {
    top: 11px;
    left: 3px;
  }
  .fleet-actions :is(.speed-btn, .meter-btn) {
    padding: 5px 6px;
    font-size: calc(10px * var(--tyrants-text-controls, 1));
  }
}
@media (max-width: 560px) {
  .battle-heading:has(.scout-pill:not([hidden])) .instruction {
    display: none;
  }
  .meter-cols {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .combat-meter {
    padding: 9px 10px;
  }
  .meter-head strong {
    font-size: 15px;
  }
  .meter-totals {
    font-size: 9px;
  }
  .fleet-actions :is(.speed-btn, .meter-btn) {
    min-height: 36px;
    padding: 5px 7px;
    font-size: 10px;
  }
}
@media (max-height: 610px) and (orientation: portrait), (max-height: 610px) and (max-width: 560px) {
  .passive-tag {
    display: none !important;
  }
  .fleet-actions :is(.speed-btn, .meter-btn) {
    min-height: 32px;
  }
}
@media (max-height: 500px) and (min-width: 561px) {
  .fleet-actions :is(.speed-btn, .meter-btn) {
    min-height: 30px;
    padding: 3px 8px;
    font-size: 10px;
  }
  .passive-tag {
    font-size: 7px;
    padding: 0 3px;
  }
}

/* === v31 Tactile Weapon Firing, Muzzle Pulse & Impact Flinch === */
.line > .berth .ship:not([data-model="live"]) .ship-art {
  translate: var(--kick-x, 0px) var(--kick-y, 0px);
}
.line > .berth .ship[data-fire-flash="1"] {
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--fire-color, var(--gold)) 52%, transparent),
    0 0 12px color-mix(in srgb, var(--fire-color, var(--gold)) 42%, transparent);
}
.line > .berth .ship[data-hit-flash="shield"] {
  border-color: #8cf3ff !important;
  box-shadow: inset 0 0 18px #66ebff7a, 0 0 14px #52e2ff66;
}
.line > .berth .ship[data-hit-flash="hull"] {
  border-color: #ffe285 !important;
  box-shadow: inset 0 0 18px #ff9a527a, 0 0 14px #ff6e4866;
}
.line > .berth .ship[data-hit-flash="hull"]:not([data-model="live"]) .ship-art > :not(span) {
  filter: drop-shadow(0 5px 5px #05010d) brightness(1.42);
}
.line > .berth .ship[data-hit-flash="shield"]:not([data-model="live"]) .ship-art > :not(span) {
  filter: drop-shadow(0 0 10px #70f5ff) brightness(1.24);
}

/* === v33 Concept-Art Space Atmosphere, Punk Halftone Framing & Holographic Stage Polish === */
.space-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.mast,
.workspace {
  position: relative;
  z-index: 1;
}
.ship-atmosphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* Punk halftone screenprint corner accents framing the deep-space nebula (concept art motif) */
.fleet-app::before,
.fleet-app::after {
  content: "";
  position: absolute;
  top: 0;
  width: clamp(180px, 28vw, 420px);
  height: clamp(120px, 24vh, 240px);
  pointer-events: none;
  z-index: 0;
  opacity: .52;
}
.fleet-app::before {
  left: 0;
  background-image: radial-gradient(#ff4cd8 1.35px, transparent 1.75px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 0% 0%, #000 18%, transparent 74%);
  mask-image: radial-gradient(ellipse 85% 85% at 0% 0%, #000 18%, transparent 74%);
}
.fleet-app::after {
  right: 0;
  background-image: radial-gradient(#ff38b8 1.35px, transparent 1.75px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 100% 0%, #000 22%, transparent 76%);
  mask-image: radial-gradient(ellipse 85% 85% at 100% 0%, #000 22%, transparent 76%);
}

/* Crowned TYRANTS title with acid-lime painted slash underline */
.mast {
  border-bottom-color: #6a4e9666;
}
.mast h1 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 3px;
  letter-spacing: 2.4px;
  color: #fffbf2;
  text-shadow: 0 2px 14px #040112, 0 0 18px #ff4ed833;
}
.mast h1 .title-crown {
  color: #e2ff3f;
  font-style: normal;
  font-size: .82em;
  filter: drop-shadow(0 0 7px #d8ff3f88);
}
.mast h1::after {
  content: "";
  position: absolute;
  left: 2px;
  right: -6px;
  bottom: -1px;
  height: 4px;
  background: linear-gradient(90deg, #dcff3b, #6bf5ff 78%, transparent);
  clip-path: polygon(0 25%, 100% 0, 94% 100%, 2% 88%);
  pointer-events: none;
}

/* Bold torn-tape acid-yellow phase banner matching concept art */
.phase {
  background: linear-gradient(105deg, #e8ff47, #ffd93d 65%, #ffca36);
  color: #190d26;
  padding: 3px 22px 4px;
  font-size: 20px;
  letter-spacing: .08em;
  box-shadow: 0 4px 18px #05011299, 0 0 18px #ffe04736;
}
.fleet-app[data-phase="combat"] .phase {
  background: linear-gradient(105deg, #ffe245, #ffcf33 65%, #ffb830);
}

/* Vibrant luminous cyan / hot-magenta perspective grids with glowing + vertex ticks */
.fleet { --grid-glow: #42f2ff; }
.enemy { --grid-glow: #ff4dc8; }
@media (min-width: 901px) {
  .line::before {
    border: 1.5px solid color-mix(in srgb, var(--grid-glow) 92%, #ffffff);
    background:
      radial-gradient(circle 4.5px at 0 0, color-mix(in srgb, var(--grid-glow) 85%, #ffffff) 0, transparent 72%) 0 0 / 25% calc(100% / 3),
      linear-gradient(90deg, color-mix(in srgb, var(--grid-glow) 78%, transparent) 1.25px, transparent 1.25px) 0 0 / 25% 100%,
      linear-gradient(color-mix(in srgb, var(--grid-glow) 78%, transparent) 1.25px, transparent 1.25px) 0 0 / 100% calc(100% / 3),
      linear-gradient(180deg, color-mix(in srgb, var(--grid-glow) 8%, #0a092466), color-mix(in srgb, var(--grid-glow) 22%, #130b2fd6));
    box-shadow:
      inset 0 0 28px color-mix(in srgb, var(--grid-glow) 34%, transparent),
      0 0 26px color-mix(in srgb, var(--grid-glow) 56%, transparent),
      0 12px 34px #06011299;
  }
  .line > .berth .ship.flagship {
    background: radial-gradient(ellipse 72% 48% at 50% 60%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 72%) !important;
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--gold) 24%, transparent), 0 0 14px color-mix(in srgb, var(--gold) 28%, transparent);
  }
  .enemy .line > .berth .ship.flagship {
    background: radial-gradient(ellipse 72% 48% at 50% 60%, #ff4dc82e, transparent 72%) !important;
    box-shadow: inset 0 0 18px #ff4dc830, 0 0 14px #ff4dc836;
  }
}

/* Enhanced neon commander portrait frames & painted underline slashes */
.fleet header img {
  box-shadow:
    0 0 16px color-mix(in srgb, var(--grid-glow) 58%, transparent),
    inset 0 0 8px color-mix(in srgb, var(--grid-glow) 30%, transparent),
    0 4px 12px #050112b8;
}
.fleet-bar {
  height: 4.5px;
  box-shadow: 0 0 10px #8aff4a55;
}
.enemy .fleet-bar {
  box-shadow: 0 0 10px #ff4dc866;
}

/* Toyetic Galaxy Map planets with luminous atmosphere halos & rings */
.planet {
  box-shadow:
    -4px -3px 18px color-mix(in srgb, var(--light) 74%, transparent),
    inset -10px -12px 18px #110622c8,
    inset 4px 4px 12px color-mix(in srgb, var(--light) 45%, transparent);
}
.planet::after {
  border-color: #ffe28acc;
  box-shadow: 0 0 10px #ffce6655;
}
[data-planet="crystal"] .planet {
  box-shadow: 0 0 22px #66f8e888, inset 3px 3px 12px #ffffff77;
}
[data-planet="gate"] .planet::after {
  border-color: #ff9c5c;
  box-shadow: 0 0 14px #ff6e4288;
}
.systems button[aria-pressed="true"] {
  box-shadow: 0 0 28px #75f0ff48, 0 0 16px #d6ff4d28, inset 0 0 18px #d6ff4d22;
}
.beacon {
  box-shadow: 0 0 24px #48edffcc, 0 0 42px #48edff55, inset 0 0 12px #b6fbff;
}

@media (max-width: 900px) {
  .fleet-app::before,
  .fleet-app::after {
    opacity: .34;
    width: 150px;
    height: 90px;
  }
  .mast h1::after {
    height: 3px;
  }
  .phase {
    font-size: 13px;
    padding: 2px 12px;
  }
}

/* === v38 Combat Speed Slider (0.5x–4x) === */
.fleet-actions .speed-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 9px 2px 3px;
  border: 1px solid #59447a;
  border-radius: 6px;
  background: #1b132de6;
  flex-shrink: 0;
}
.fleet-actions .speed-control[hidden] { display: none; }
.fleet-actions .speed-control .speed-btn {
  min-width: 40px;
  padding: 4px 6px;
  border: 1px solid transparent;
  background: transparent;
  font: 700 12px/1 "IBM Plex Mono", monospace;
}
.fleet-actions .speed-control .speed-btn[aria-pressed="true"] {
  border-color: var(--gold);
  background: #332347;
  color: var(--gold);
}
.fleet-actions .speed-slider {
  width: 92px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
}
@media (max-width: 720px) {
  .fleet-actions .speed-slider { width: 68px; }
  .fleet-actions .speed-control { gap: 4px; padding: 2px 6px 2px 2px; }
}

/* === v40–v41 Complete Typography, Font Types & Module Display Scaling ($ shortcut) === */
.fleet-app {
  font-family: var(--tyrants-font-ui, "Barlow", sans-serif);
}
.mast h1,
.fleet header,
.phase,
.versus,
.supply .yard-title,
.supply .ship-offer strong,
.reserve-panel > h2,
.gear-shop h2,
.fleet-actions .engage,
.galaxy h2,
.systems strong,
.survival-banner h2,
.meter-head strong,
.dock-tab {
  font-family: var(--tyrants-font-display, "Barlow Condensed", sans-serif);
}
.hover-info,
.status,
.focus-readout,
.instruction,
.doctrine,
.scout-pill,
.inspector,
.inspector strong,
.inspector p,
.gear-shop p,
.fit-summary,
.supply .gear-offer strong,
.supply .gear-offer small,
.fleet-actions button,
.mast button,
.supply-head .reroll,
.survival-copy,
.galaxy p,
.galaxy-scout,
.systems span,
.systems small,
.meter-row,
.meter-empty {
  font-family: var(--tyrants-font-ui, "Barlow", sans-serif);
}
.eyebrow,
.round,
.supply .wallet,
.supply .gear-offer b,
.ship .ship-label,
.ship .level,
.passive-tag,
.ship.reachable::after,
.ship .numbers,
.mount .module-level,
.fleet-actions .speed-control .speed-btn,
.meter-col-head,
.meter-totals,
.survival-eyebrow {
  font-family: var(--tyrants-font-mono, "IBM Plex Mono", monospace);
}

/* Complete text-size coverage for every remaining display element */
.eyebrow { font-size: calc(10px * var(--tyrants-text-grid-labels, 1)); }
.round { font-size: calc(12px * var(--tyrants-text-controls, 1)); }
.phase { font-size: calc(16px * var(--tyrants-text-section-titles, 1)); }
.versus { font-size: calc(15px * var(--tyrants-text-section-titles, 1)); }
.battle-heading .instruction { font-size: calc(13px * var(--tyrants-text-status, 1)); }
.doctrine { font-size: calc(12.5px * var(--tyrants-text-status, 1)); }
.scout-pill { font-size: calc(11.5px * var(--tyrants-text-info-pills, 1)); }
.ship .ship-label { font-size: calc(9.5px * var(--tyrants-text-ship-names, 1)); }
.ship .level { font-size: calc(9.5px * var(--tyrants-text-hull-stats, 1)); }
.passive-tag { font-size: calc(8.5px * var(--tyrants-text-grid-labels, 1)); }
.gear-shop h2 { font-size: calc(15px * var(--tyrants-text-section-titles, 1)); }
.gear-shop p,
.fit-summary,
.inspector p { font-size: calc(12px * var(--tyrants-text-status, 1)); }
.inspector strong { font-size: calc(13.5px * var(--tyrants-text-ship-names, 1)); }
.dock-tab { font-size: calc(13px * var(--tyrants-text-controls, 1)); }
.galaxy h2 { font-size: calc(clamp(28px, 4.5vw, 54px) * var(--tyrants-text-game-title, 1)); }
.galaxy p,
.galaxy-scout,
.systems span { font-size: calc(13px * var(--tyrants-text-status, 1)); }
.systems strong { font-size: calc(clamp(16px, 2.8vw, 30px) * var(--tyrants-text-section-titles, 1)); }
.systems small { font-size: calc(11px * var(--tyrants-text-info-pills, 1)); }
.survival-eyebrow { font-size: calc(11px * var(--tyrants-text-grid-labels, 1)); }
.survival-banner h2 { font-size: calc(28px * var(--tyrants-text-game-title, 1)); }
.survival-copy { font-size: calc(13px * var(--tyrants-text-status, 1)); }
.meter-head strong { font-size: calc(16px * var(--tyrants-text-section-titles, 1)); }
.meter-col-head { font-size: calc(10px * var(--tyrants-text-grid-labels, 1)); }
.meter-totals,
.meter-row,
.meter-empty { font-size: calc(12px * var(--tyrants-text-hull-stats, 1)); }

/* Module display size slider (--tyrants-text-module-display) */
.mount {
  width: calc(30px * var(--tyrants-text-module-display, 1));
  height: calc(22px * var(--tyrants-text-module-display, 1));
}
.berth[data-sockets="3"] .mount,
.berth[data-sockets="4"] .mount {
  width: min(calc(28px * var(--tyrants-text-module-display, 1)), 100%);
  height: calc(20px * var(--tyrants-text-module-display, 1));
}
.mount .module-level {
  font-size: calc(8px * var(--tyrants-text-module-display, 1));
}
.supply .gear-offer img,
.supply .gear-offer canvas {
  width: calc(32px * var(--tyrants-text-module-display, 1));
  height: calc(32px * var(--tyrants-text-module-display, 1));
}
.reserve-grid .reserve-module img,
.reserve-grid .reserve-module canvas {
  width: calc(26px * var(--tyrants-text-module-display, 1));
  height: calc(26px * var(--tyrants-text-module-display, 1));
}
.sockets button {
  min-height: calc(30px * var(--tyrants-text-module-display, 1));
}

.font-type-fields {
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #493866;
}
.font-type-fields > label {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.text-size-fields > label {
  grid-template-columns: 118px minmax(0, 1fr) 50px 10px;
  font-size: 12px;
}
.text-size-fields input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--gold);
}
.typography-status {
  min-height: 15px;
  margin: 4px 0 0;
  color: #b5ff4f;
  font: 600 11px/1.2 "IBM Plex Mono", monospace;
  text-align: right;
}

/* === v43 Tactile Ship & Module Merge Flash === */
@keyframes tyrants-merge-pop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 #b8ff62dd, inset 0 0 18px #66f5ffcc; }
  30% { transform: scale(1.13); box-shadow: 0 0 26px 6px #b8ff62cc, inset 0 0 24px #ffffffcc; }
  65% { transform: scale(0.97); box-shadow: 0 0 18px 2px #66f5ff88, inset 0 0 10px #b8ff6266; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent, inset 0 0 0 transparent; }
}
@keyframes tyrants-merge-pop-max {
  0% { transform: scale(1); box-shadow: 0 0 0 0 #ffe066ee, inset 0 0 22px #ff6ed6dd; }
  28% { transform: scale(1.18); box-shadow: 0 0 34px 8px #ffe066dd, inset 0 0 28px #fffef0dd; }
  62% { transform: scale(0.96); box-shadow: 0 0 24px 4px #ff6ed6aa, inset 0 0 14px #ffe06688; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent, inset 0 0 0 transparent; }
}
.merge-flash {
  animation: tyrants-merge-pop 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  border-color: #b8ff62 !important;
}
.merge-flash-max {
  animation: tyrants-merge-pop-max 0.82s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  border-color: #ffe066 !important;
}
@media (prefers-reduced-motion: reduce) {
  .merge-flash, .merge-flash-max { animation: none; }
}

/* === v45 Leveled-Up Glow (L2 Lime-Cyan & L3 Gold-Magenta) + Enhanced Merge Feedback === */
@keyframes tyrants-tier2-glow {
  0%, 100% { box-shadow: inset 0 0 10px #a8ff5240, 0 0 10px #5ef2ff44; }
  50% { box-shadow: inset 0 0 16px #b8ff6266, 0 0 16px #a8ff5266; }
}
@keyframes tyrants-tier3-glow {
  0%, 100% { box-shadow: inset 0 0 14px #ffe06666, 0 0 14px #ff6ed666; }
  50% { box-shadow: inset 0 0 22px #ffe06699, 0 0 22px #ffe06688; }
}
@keyframes tyrants-merge-beacon {
  0%, 100% { box-shadow: inset 0 0 0 2px #b8ff62cc, 0 0 12px #b8ff6277; }
  50% { box-shadow: inset 0 0 0 2px #ffe066ff, 0 0 22px #ffe066cc; }
}

/* Upgraded Ships (L2 & L3) */
.ship[data-level="2"]:not(.wreck):not(.flagship) {
  border-color: #a8ff52cc;
  animation: tyrants-tier2-glow 2.6s ease-in-out infinite;
}
.ship[data-level="3"]:not(.wreck):not(.flagship) {
  border-color: #ffe066ee;
  animation: tyrants-tier3-glow 2.1s ease-in-out infinite;
}
.ship[data-level="2"]:not(.wreck) .level {
  color: #b8ff62;
  text-shadow: 0 0 8px #a8ff52cc, 0 1px 2px #090414;
}
.ship[data-level="3"]:not(.wreck) .level {
  color: #ffe066;
  text-shadow: 0 0 10px #ffe066ee, 0 0 16px #ff6ed6bb, 0 1px 2px #090414;
}

/* Upgraded Components: Ship Socket Mounts, Reserve Modules & Sockets Panel */
.mount[data-level="2"],
.sockets button[data-level="2"] {
  border-color: #a8ff52cc;
  background-color: #192b28e8;
  box-shadow: inset 0 0 8px #a8ff5255, 0 0 8px #5ef2ff55;
}
.mount[data-level="3"],
.sockets button[data-level="3"] {
  border-color: #ffe066ee;
  background-color: #30203be8;
  box-shadow: inset 0 0 10px #ffe06677, 0 0 12px #ff6ed677;
}
.mount[data-level="2"] .module-level,
.reserve-module[data-level="2"] .module-level {
  color: #b8ff62;
  text-shadow: 0 0 7px #a8ff52dd, 0 1px 2px #090414;
}
.mount[data-level="3"] .module-level,
.reserve-module[data-level="3"] .module-level {
  color: #ffe066;
  text-shadow: 0 0 9px #ffe066ee, 0 0 14px #ff6ed6cc, 0 1px 2px #090414;
}
.ship.contains-module[data-level="2"] {
  border-color: #a8ff52bb;
  box-shadow: inset 0 0 10px #a8ff5244, 0 0 8px #5ef2ff44;
}
.ship.contains-module[data-level="3"] {
  border-color: #ffe066ee;
  box-shadow: inset 0 0 14px #ffe06666, 0 0 12px #ff6ed666;
}

/* Vivid Pre-Merge Beacon & Lock-On Hover Feedback */
.ship.merge-ready,
.ship.tap-merge,
.mount.merge-ready,
.sockets button.merge-ready {
  border-color: #b8ff62 !important;
  animation: tyrants-merge-beacon 1.05s ease-in-out infinite;
}
.ship.merge-drop,
.mount.merge-drop,
.sockets button.merge-drop {
  border-color: #fff2a8 !important;
  box-shadow: inset 0 0 0 3px #ffe066, 0 0 26px 4px #ff6ed6cc, 0 0 16px #ffe066ee !important;
  transform: scale(1.05);
  z-index: 4;
}
.ship.merge-drop::after,
.mount.merge-drop::after {
  content: "★ MERGE";
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe066, #ff79d8);
  color: #160926;
  font: italic 800 10px/1.2 "Barlow Condensed", sans-serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 2px 10px #00000099;
  pointer-events: none;
  z-index: 6;
}
@media (prefers-reduced-motion: reduce) {
  .ship[data-level="2"]:not(.wreck):not(.flagship),
  .ship[data-level="3"]:not(.wreck):not(.flagship),
  .ship.merge-ready,
  .ship.tap-merge,
  .mount.merge-ready,
  .sockets button.merge-ready { animation: none; }
}

/* === v46 Blizzard Art Direction Pass (Beveled Chrome, Tactical Bars, Damage Trail, Value Hierarchy) === */
@keyframes tyrants-cta-sheen {
  0%, 72% { transform: translateX(-140%) skewX(-22deg); }
  100% { transform: translateX(260%) skewX(-22deg); }
}
@keyframes tyrants-phase-stinger {
  0% { transform: scale(1.18); filter: brightness(1.45); }
  45% { transform: scale(0.97); filter: brightness(1.12); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes tyrants-lowhp-pulse {
  0%, 100% { box-shadow: 0 0 0 1px #2a0714, 0 0 8px #ff3e5588; }
  50% { box-shadow: 0 0 0 1px #ff5a6e, 0 0 14px #ff3e55dd; }
}

/* 1. Heroic Beveled Primary CTA (ENGAGE / BATTLE) */
[data-phase="formation"] .fleet-actions .engage {
  position: relative;
  overflow: hidden;
  border: 1.5px solid #fff3b0;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff099 0%, #ffcf40 46%, #e39519 100%);
  color: #1c0f22;
  text-shadow: 0 1px 0 #fff7cc88;
  box-shadow:
    inset 0 1px 0 #ffffffcc,
    inset 0 -2px 3px #9c520a88,
    0 3px 0 #6e3708,
    0 6px 18px #04010eb8,
    0 0 22px #ffcf4044;
  transition: transform 0.1s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
[data-phase="formation"] .fleet-actions .engage::after {
  content: "";
  position: absolute;
  inset: -4px 0;
  width: 44%;
  background: linear-gradient(90deg, transparent, #ffffff77, transparent);
  pointer-events: none;
  animation: tyrants-cta-sheen 4.4s ease-in-out infinite;
}
[data-phase="formation"] .fleet-actions .engage:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 #ffffffdd,
    inset 0 -2px 3px #9c520a88,
    0 4px 0 #6e3708,
    0 8px 22px #04010ecc,
    0 0 28px #ffdf5777;
}
[data-phase="formation"] .fleet-actions .engage:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px #783b0799,
    0 1px 0 #6e3708,
    0 2px 8px #04010eaa;
}

/* 2. Armored Beveled Gunmetal Utility Buttons */
.mast :is(.help, .angles-btn, .stats, .new-run, .leaderboard-btn),
.fleet-actions :is(.sell, .cancel, .meter-btn),
.supply-head .reroll,
.set-course {
  background: linear-gradient(180deg, #32264f 0%, #1d1633 58%, #150f26 100%);
  border: 1px solid #6c5794;
  box-shadow:
    inset 0 1px 0 #ffffff24,
    inset 0 -1px 2px #05020ea6,
    0 2px 0 #090516,
    0 4px 10px #04010d7a;
  transition: transform 0.1s ease, border-color 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.mast :is(.help, .angles-btn, .stats, .new-run, .leaderboard-btn):hover:not(:disabled),
.fleet-actions :is(.sell, .cancel, .meter-btn):hover:not(:disabled),
.supply-head .reroll:hover:not(:disabled),
.set-course:hover:not(:disabled) {
  border-color: #f4cc68;
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 #fff5d040,
    0 3px 0 #090516,
    0 6px 14px #04010d99,
    0 0 12px #f4cc6833;
}
.mast :is(.help, .angles-btn, .stats, .new-run, .leaderboard-btn):active:not(:disabled),
.fleet-actions :is(.sell, .cancel, .meter-btn):active:not(:disabled),
.supply-head .reroll:active:not(:disabled),
.set-course:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px #05020ec4, 0 1px 0 #090516;
}
.fleet-actions .speed-control {
  background: linear-gradient(180deg, #271d42ee, #151026f2);
  border-color: #6b5594;
  box-shadow: inset 0 1px 0 #ffffff1c, 0 2px 0 #090516, 0 4px 10px #04010d70;
}

/* 3. Armored Double-Bevel Shipyard, Shop Cards & Reserve Chrome */
.supply {
  border: 1.5px solid #c972e0cc;
  background: linear-gradient(162deg, #241342f2 0%, #140f28f7 56%, #0e0a1ef8 100%);
  box-shadow:
    inset 0 1px 0 #f4c6ff40,
    inset 0 0 32px #8e3fd424,
    0 0 0 1px #060212,
    0 12px 32px #04010ec8;
}
.supply .gear-offer,
.supply .ship-offer {
  border-width: 1.5px;
  background: linear-gradient(180deg, #282448f0 0%, #16152ef5 62%, #100f24fa 100%);
  box-shadow:
    inset 0 1px 0 #ffffff24,
    inset 0 -2px 6px #06031288,
    0 3px 0 #080414,
    0 5px 14px #04010d80;
  transition: transform 0.12s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.supply .gear-offer:hover:not(:disabled),
.supply .ship-offer:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #ffe27a;
  box-shadow:
    inset 0 1px 0 #fff6cf44,
    0 5px 0 #080414,
    0 8px 18px #04010da8,
    0 0 14px #ffdc6638;
}
.supply .gear-offer b,
.supply .ship-offer b {
  border-radius: 4px;
  background: linear-gradient(180deg, #ffeb8a 0%, #f0bd38 100%);
  color: #1c1022;
  box-shadow: inset 0 1px 0 #ffffffaa, 0 2px 0 #7a460b;
  font-weight: 800;
}
.reserve-panel {
  border: 1.5px solid #5be6ffbb;
  background: linear-gradient(165deg, #132948ee 0%, #0e1630f4 58%, #0b1024f8 100%);
  box-shadow:
    inset 0 1px 0 #a8f4ff38,
    inset 0 0 22px #2eb8ff1f,
    0 4px 16px #04010ea6;
}
.gear-shop {
  border: 1px solid #6b5594;
  background: linear-gradient(180deg, #241b3de8, #161028f2);
  box-shadow: inset 0 1px 0 #ffffff1c, 0 3px 12px #04010d78;
}

/* 4. Recessed Mechanical Socket Bays */
.mount {
  border-radius: 5px;
  border: 1px solid #4d6b88;
  background: linear-gradient(180deg, #0b1022ee, #141d36ee);
  box-shadow: inset 0 2px 5px #03010ad6, 0 1px 0 #ffffff18;
  transition: transform 0.1s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.mount:not(.empty) {
  border-color: #6fdcf2bb;
  background: radial-gradient(ellipse at 50% 30%, #2e7d9a, #121f3b 78%);
  box-shadow:
    inset 0 1px 0 #b8f6ff55,
    inset 0 -2px 4px #040814aa,
    0 2px 5px #04010d99;
}
.mount:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #ffe27a;
}
.sockets button {
  border: 1px solid #584c7c;
  background: linear-gradient(180deg, #251d3f, #151029);
  box-shadow: inset 0 1px 0 #ffffff1c, 0 2px 0 #070412;
}

/* 5. Heroic Commander Portrait Medallions & Specular Fleet Bar */
.fleet header img {
  border-width: 2px;
  box-shadow:
    inset 0 0 0 1.5px #090516,
    0 0 0 1.5px #090516,
    0 0 18px color-mix(in srgb, var(--grid-glow) 64%, transparent),
    0 4px 12px #04010ec8;
}
.fleet-bar {
  border-radius: 3px;
  box-shadow: inset 0 1px 0 #ffffff55, 0 0 12px #8aff4a66;
}
.enemy .fleet-bar {
  box-shadow: inset 0 1px 0 #ffffff55, 0 0 12px #ff4dc877;
}

/* 6. Blizzard Segmented Tactical Health & Shield Bars + Delayed Damage-Drain Trail */
.ship .health {
  position: absolute;
  height: 6px;
  border-radius: 3px;
  background: #080416e8;
  border: 1px solid #04020d;
  box-shadow: 0 0 0 1px #ffffff1f, 0 2px 5px #04010dc8;
  overflow: hidden;
}
.ship .health::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(25% - 1px),
    rgba(6, 3, 18, 0.55) calc(25% - 1px) 25%
  );
  pointer-events: none;
  z-index: 3;
}
.ship .health .hp-trail {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #fff9d6, #ffba49);
  box-shadow: 0 0 8px #ffcf66aa;
  transition: width 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.14s;
  z-index: 1;
}
.ship .health.no-trail .hp-trail {
  transition: none;
}
.ship .health i {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #b8ff78 0%, #52e58c 55%, #27a864 100%);
  box-shadow: inset 0 1px 0 #ffffff88;
  transition: width 0.11s ease-out;
}
.enemy .ship .health i {
  background: linear-gradient(180deg, #ff9982 0%, #f05264 58%, #b82840 100%);
  box-shadow: inset 0 1px 0 #ffd6cc88;
}
.ship[data-hp-tier="low"]:not(.wreck) .health {
  animation: tyrants-lowhp-pulse 0.9s ease-in-out infinite;
}
.ship[data-hp-tier="low"]:not(.wreck) .health i {
  background: linear-gradient(180deg, #ff8f70 0%, #ff3b4e 60%, #b8182e 100%);
}
.ship .shield-strip {
  bottom: calc(24% + 8px);
  height: 3px;
  border-radius: 2px;
  background: #070b22e8;
  border: 1px solid #040818;
  box-shadow: 0 0 6px #4ee6ff44;
  overflow: hidden;
}
.shield-strip i {
  background: linear-gradient(180deg, #d8fdff 0%, #5ce8ff 58%, #28a6e8 100%);
  box-shadow: 0 0 7px #6be7ffaa;
  transition: width 0.12s ease-out;
}
@media (max-width: 900px) {
  .ship .health { height: 4px; }
  .ship .shield-strip { bottom: 21px; height: 2.5px; }
}

/* 7. Cinematic Phase Banner Stinger */
.phase {
  border-top: 1px solid #fff8c4aa;
  box-shadow: 0 4px 18px #050112aa, 0 0 22px #ffe04744;
}
.phase.phase-stinger {
  animation: tyrants-phase-stinger 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  [data-phase="formation"] .fleet-actions .engage::after,
  .ship[data-hp-tier="low"]:not(.wreck) .health,
  .phase.phase-stinger { animation: none; }
  .ship .health .hp-trail { transition: none; }
}

/* === v47 Blizzard Mockup Adaptation (Riveted Crests, Commander Wing Medallions, Sculpted Planets, Combat Deck) === */

/* 1. Center Phase Crest & Chamfered Round Hex Pill */
.battle-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.phase-round {
  display: inline-flex;
  align-items: center;
  padding: 3px 13px;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  background: linear-gradient(180deg, #2b2742, #151226);
  border-top: 1px solid #8a94b866;
  color: #f3ecff;
  font: italic 700 calc(11px * var(--tyrants-text-controls, 1))/1.15 var(--tyrants-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 3px 10px #04010ea6;
  white-space: nowrap;
}
[data-phase="formation"] .phase {
  position: relative;
  padding: 4px 26px 5px;
  border: 1.5px solid #a6b4d2;
  border-radius: 5px;
  clip-path: none;
  background:
    radial-gradient(circle 2.2px at 8px 50%, #ffffff 35%, #404b68 72%, transparent 100%),
    radial-gradient(circle 2.2px at calc(100% - 8px) 50%, #ffffff 35%, #404b68 72%, transparent 100%),
    linear-gradient(180deg, #eef4fc 0%, #bcc8de 52%, #8695b2 100%);
  color: #131829;
  text-shadow: 0 1px 0 #ffffffbb;
  box-shadow:
    inset 0 1px 0 #ffffffea,
    inset 0 -2px 4px #2c3550aa,
    0 3px 0 #1f2538,
    0 6px 18px #04010ec4;
  letter-spacing: 0.1em;
}
.fleet-app[data-phase="combat"] .phase,
.fleet-app[data-phase="resolved"] .phase {
  padding: 4px 30px 5px;
  border-top: 2px solid #9eb2d4;
  border-bottom: 2px solid #2b3552;
  clip-path: polygon(0 0, 100% 0, 91% 100%, 9% 100%);
  background: linear-gradient(180deg, #3c4868 0%, #222a44 55%, #161b2e 100%);
  color: #ffe270;
  text-shadow: 0 2px 0 #160c1f, 0 0 14px #ffb83066;
  box-shadow:
    inset 0 1px 0 #dbe8ff66,
    0 5px 18px #04010ed4;
  letter-spacing: 0.12em;
}

/* 2. Circular Commander Portrait Medallions & Chamfered Gunmetal Wing Plates */
.fleet header {
  height: 54px;
  gap: 0;
  align-items: center;
}
.commander-medallion {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-flex;
  padding: 2.5px;
  border-radius: 50%;
  background: linear-gradient(155deg, #c2d2ec 0%, #4e5d80 48%, #212940 100%);
  box-shadow:
    inset 0 1px 0 #ffffffaa,
    0 0 0 1.5px #070412,
    0 0 18px color-mix(in srgb, var(--grid-glow) 60%, transparent),
    0 4px 12px #04010ec8;
}
.fleet header .commander-medallion img {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--grid-glow) 85%, #ffffff);
  box-shadow: inset 0 0 8px #04010e99;
}
.fleet-plate {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: -14px;
  padding: 4px 20px 4px 22px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  border-top: 1.5px solid #7f90b899;
  border-bottom: 1.5px solid #262e48cc;
  background: linear-gradient(180deg, #2d3552eb 0%, #191f36f2 58%, #111528f5 100%);
  box-shadow: inset 0 1px 0 #dce8ff33, 0 5px 16px #04010eb0;
}
.enemy .fleet-plate {
  flex-direction: row-reverse;
  margin-left: 0;
  margin-right: -14px;
  padding: 4px 22px 4px 20px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%);
}
.fleet-plate .fleet-status,
.fleet-plate > .win-badge {
  margin-left: auto;
}
.enemy .fleet-plate .fleet-status,
.enemy .fleet-plate > .win-badge {
  margin-left: 0;
  margin-right: auto;
}

/* 3. Riveted Blizzard Shipyard Chrome (Own-Fleet-Only Setup, Full 8x2 Reserve) */
.supply {
  border: 1.5px solid #7f8eb8cc;
  border-radius: 10px;
  background:
    radial-gradient(circle 2.4px at 9px 9px, #d4e0f8 35%, #3b4462 72%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 9px) 9px, #d4e0f8 35%, #3b4462 72%, transparent 100%),
    radial-gradient(circle 2.4px at 9px calc(100% - 9px), #d4e0f8 35%, #3b4462 72%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 9px) calc(100% - 9px), #d4e0f8 35%, #3b4462 72%, transparent 100%),
    linear-gradient(168deg, #252b46f4 0%, #15172cf8 54%, #0e0e20fa 100%);
  box-shadow:
    inset 0 1px 0 #e2ecff40,
    inset 0 -2px 6px #04020ecc,
    0 0 0 1.5px #060312,
    0 12px 34px #04010ed8;
}
.supply .yard-title {
  padding: 3px 16px 4px;
  border: 1px solid #96a4c2;
  border-radius: 4px;
  clip-path: none;
  background: linear-gradient(180deg, #e4ecf8 0%, #aebbd2 55%, #7c8aa6 100%);
  color: #14192b;
  text-shadow: 0 1px 0 #ffffff88;
  box-shadow: inset 0 1px 0 #ffffffcc, 0 2px 0 #1e2438;
}
.supply .wallet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border: 1px solid #8a98be88;
  border-radius: 5px;
  background: linear-gradient(180deg, #1b2036, #0e1120);
  color: #ffe270;
  font-weight: 800;
  box-shadow: inset 0 2px 4px #04020ecc, 0 1px 0 #ffffff22;
}
.wallet-crown {
  color: #ffe047;
  filter: drop-shadow(0 0 5px #ffe04788);
}
.supply .offers .mm-shopslot {
  border: 1.5px solid #6b7aa4bb;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a304cf2 0%, #171a30f6 62%, #111326fa 100%);
  box-shadow:
    inset 0 1px 0 #dce8ff2e,
    inset 0 -2px 5px #050310a6,
    0 3px 0 #090716,
    0 5px 14px #04010e88;
  transition: transform 0.12s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.supply .offers .mm-shopslot:hover {
  transform: translateY(-2px);
  border-color: #ffe27a;
  box-shadow:
    inset 0 1px 0 #fff5cc44,
    0 5px 0 #090716,
    0 8px 18px #04010ea8,
    0 0 14px #ffdc6638;
}
.supply .offers .mm-shopcost {
  border-radius: 4px;
  background: linear-gradient(180deg, #ffeb8a 0%, #f0bd38 100%);
  color: #1c1022;
  box-shadow: inset 0 1px 0 #ffffffbb, 0 2px 0 #7a460b;
}
.supply .offers .mm-shopact {
  border-top: 1px solid #60709988;
  background: linear-gradient(180deg, #28304d, #161b30);
  color: #d8e6ff;
  font-weight: 700;
}
.supply .offers .mm-shopact.on {
  background: linear-gradient(180deg, #1b4d5e, #102e3e);
  color: #8af6ff;
  border-top-color: #5cf0ff99;
}
.reserve-panel {
  border: 1.5px solid #56d6f0aa;
  background: linear-gradient(170deg, #152844f0 0%, #0e162ef5 60%, #0a1022fa 100%);
  box-shadow:
    inset 0 1px 0 #a8f4ff38,
    inset 0 0 22px #2eb8ff1c,
    0 3px 0 #080514,
    0 6px 18px #04010eb0;
}

/* 4. Chamfered Gunmetal Combat Control Deck, Custom Speed Slider & Battle Timer */
[data-phase="combat"] .fleet-actions,
[data-phase="resolved"] .fleet-actions {
  margin-inline: auto;
  width: min(860px, 100%);
  padding: 5px 22px;
  border: 1.5px solid #7f90b8aa;
  border-radius: 6px;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  background: linear-gradient(180deg, #323c5cf2 0%, #1c2238f6 54%, #121628fa 100%);
  box-shadow:
    inset 0 1px 0 #dce8ff40,
    inset 0 -2px 4px #060412bb,
    0 6px 20px #04010ecc;
}
[data-phase="combat"] .fleet-actions .status,
[data-phase="resolved"] .fleet-actions .status {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.battle-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #6b7ba488;
  border-radius: 4px;
  background: linear-gradient(180deg, #191f34, #0f1324);
  color: #ffe270;
  font: 700 calc(12px * var(--tyrants-text-controls, 1))/1 var(--tyrants-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: inset 0 1px 3px #04020ecc;
}
.battle-timer[hidden] { display: none; }
.fleet-actions .speed-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0b0e1c, #1c233a);
  border: 1px solid #6676a088;
  box-shadow: inset 0 1px 2px #03010acc;
}
.fleet-actions .speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #fff3b0;
  background: linear-gradient(180deg, #fff099 0%, #f0b832 60%, #b87312 100%);
  box-shadow: 0 2px 5px #04010ecc;
  cursor: pointer;
}
.fleet-actions .speed-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #fff3b0;
  background: linear-gradient(180deg, #fff099 0%, #f0b832 60%, #b87312 100%);
  box-shadow: 0 2px 5px #04010ecc;
  cursor: pointer;
}

/* 5. Galaxy Map — Sculpted WebP Planets, Heroic Crest, Floating Leader Plaques & Octagonal Gunmetal Rail */
.galaxy .map-round {
  padding: 3px 18px;
  border: 1.5px solid #8a99beaa;
  border-radius: 4px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  background: linear-gradient(180deg, #2d3550, #161b2e);
  color: #f4eeff;
  box-shadow: inset 0 1px 0 #dce8ff44, 0 4px 12px #04010eb8;
}
.galaxy h2 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 30px 6px;
  border: 2px solid #96a4c2;
  border-radius: 5px;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  background: linear-gradient(180deg, #ffe878 0%, #e8a728 54%, #b56c10 100%);
  color: #191024;
  text-shadow: 0 1px 0 #fff5be99;
  box-shadow:
    inset 0 2px 0 #fff9d6cc,
    inset 0 -3px 5px #783c08aa,
    0 4px 0 #232a40,
    0 8px 24px #04010ed4;
}
.galaxy-crown {
  display: inline-grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  border-radius: 4px;
  background: linear-gradient(180deg, #323c5a, #171c30);
  border: 1.5px solid #ffe47a;
  color: #ffe45c;
  font-style: normal;
  font-size: 0.68em;
  box-shadow: 0 2px 8px #04010ec8;
}
.galaxy .map-rival {
  padding: 4px 16px;
  border: 1.5px solid #8a99be99;
  border-radius: 4px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  background: linear-gradient(180deg, #312c48eb, #18162bf2);
  color: #f3e4ff;
  box-shadow: inset 0 1px 0 #ffffff2a, 0 4px 12px #04010eb0;
}

/* Sculpted WebP Planet Sprites */
.planet {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(82px, 11vw, 134px);
  height: clamp(82px, 11vw, 134px);
  border-radius: 50%;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  overflow: visible;
}
.planet::before,
.planet::after {
  display: none !important;
}
.planet-sprite {
  width: 118%;
  height: 118%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px #040112cc);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), filter 0.22s ease;
}
.systems button[aria-pressed="true"] .planet-sprite {
  transform: scale(1.06);
  filter: drop-shadow(0 0 18px #d8ff4d66) drop-shadow(0 10px 20px #040112dd);
}

/* Free-floating Planets + Horizontal Metallic Leader Line + Right-Hand Armored Intel Plaques (Desktop) */
@media (min-width: 901px) {
  .systems {
    gap: clamp(14px, 2.4vh, 24px);
  }
  .systems .system-row > button {
    grid-template-columns: auto 28px minmax(250px, 380px);
    gap: 0;
    padding: 4px 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .systems .system-row > button[aria-pressed="true"] {
    box-shadow: none !important;
  }
  .planet-wrap {
    padding: 10px;
  }
  .planet-leader {
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #8aa4cc88, #d8e6ffcc);
    box-shadow: 0 0 6px #6ef6ff44;
  }
  .systems .system-row > button[aria-pressed="true"] .planet-leader {
    background: linear-gradient(90deg, #e4ff5c, #ffe27a);
    box-shadow: 0 0 10px #e4ff5caa;
  }
  .system-card {
    width: 100%;
    padding: clamp(10px, 1.25vw, 15px) clamp(16px, 1.8vw, 22px);
    border: 2px solid #8a9ac2cc;
    border-radius: 6px;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    background: linear-gradient(180deg, #3a4462ee 0%, #202740f6 52%, #151a2efa 100%);
    box-shadow:
      inset 0 2px 0 #e4eeff55,
      inset 0 -2px 5px #050310cc,
      0 6px 22px #04010ed0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  }
  .systems .system-row > button:hover .system-card {
    border-color: #ffe27a;
    transform: translateX(2px);
  }
  .systems .system-row > button[aria-pressed="true"] .system-card {
    border-color: #f6d872;
    background: linear-gradient(180deg, #445072f4 0%, #262e4af8 54%, #181e36fa 100%);
    box-shadow:
      inset 0 2px 0 #fff7d466,
      inset 0 0 20px #ffd85c28,
      0 8px 26px #04010ee0;
  }
  .system-rival {
    padding-bottom: 5px;
    margin-bottom: 2px;
    border-bottom: 1px solid #8ea4cc44;
    color: #e4ecff;
  }
  .systems .system-row > button[aria-pressed="true"] .system-rival {
    color: #ffe28a;
    border-bottom-color: #ffe27a66;
  }
  .galaxy .navigation {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: clamp(10px, 2.5vw, 28px);
    width: 100%;
  }
  .galaxy .course-status {
    justify-self: start;
    text-align: left;
    color: #f3ecff;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .galaxy .set-course {
    justify-self: end;
    min-width: 240px;
  }
}
@media (max-width: 900px) {
  .planet-leader { display: none; }
  .planet { width: 64px; height: 64px; }
}
@media (max-height: 700px) and (min-width: 901px) {
  .planet { width: 78px; height: 78px; }
  .fleet header { height: 42px; }
  .fleet header .commander-medallion img { width: 34px; height: 34px; }
  .fleet-plate { padding: 2px 14px 2px 18px; }
}
@media (max-height: 500px) and (min-width: 561px) {
  .planet { width: 52px; height: 52px; }
  .fleet header { height: 30px; }
  .fleet header .commander-medallion img { width: 24px; height: 24px; }
  .fleet-plate { padding: 1px 10px 1px 14px; }
}
@media (max-width: 900px) {
  .phase-round { display: none; }
  .galaxy h2 {
    white-space: nowrap;
    font-size: clamp(22px, 6vw, 28px);
    padding: 4px 18px 5px;
  }
  .fleet header { height: 32px; }
  .fleet header .commander-medallion img { width: 26px; height: 26px; }
  .fleet-plate { margin-left: -10px; padding: 2px 12px 2px 14px; }
  .enemy .fleet-plate { margin-right: -10px; padding: 2px 14px 2px 12px; }
  [data-phase="combat"] .fleet-actions,
  [data-phase="resolved"] .fleet-actions {
    clip-path: none;
    padding: 4px max(8px, var(--footer-reserve, 0px)) 4px 8px;
  }
}

/* Molten-Gold Heroic SET COURSE » Jewel CTA */
.galaxy .set-course {
  position: relative;
  overflow: hidden;
  border: 1.5px solid #fff3b0;
  border-radius: 6px;
  clip-path: none;
  background: linear-gradient(180deg, #fff099 0%, #ffcf40 46%, #df8f16 100%);
  color: #1b0e22;
  text-shadow: 0 1px 0 #fff7cc88;
  box-shadow:
    inset 0 1px 0 #ffffffcc,
    inset 0 -2px 3px #9c520a88,
    0 3px 0 #6e3708,
    0 6px 20px #04010ec8,
    0 0 22px #ffcf4044;
}
.galaxy .set-course:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: #fff8cc;
}
.galaxy .set-course:active:not(:disabled) {
  transform: translateY(2px);
}

/* Sculpted Gunmetal Octagonal 01–10 Campaign Sector Rail */
.trail {
  position: relative;
  gap: 7px;
  padding: 7px 22px;
  border: 1.5px solid #8696beaa;
  border-radius: 6px;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  background: linear-gradient(180deg, #323c5aeb 0%, #1b2136f4 55%, #121628fa 100%);
  box-shadow:
    inset 0 1px 0 #dce8ff44,
    inset 0 -2px 4px #050310cc,
    0 6px 20px #04010ed0;
}
.trail::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 50%;
  height: 2px;
  background: #7c8eb877;
  pointer-events: none;
  z-index: 0;
}
.trail li {
  position: relative;
  z-index: 1;
  clip-path: polygon(16% 0, 84% 0, 100% 28%, 100% 72%, 84% 100%, 16% 100%, 0 72%, 0 28%);
  border: 0;
  border-radius: 0;
  padding: 5px 2px;
  background: linear-gradient(180deg, #323c5c, #181e34);
  color: #dce6ff;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 1.5px 0 #b8caee55, inset 0 -1.5px 0 #070a18cc;
}
.trail li.visited {
  background: linear-gradient(180deg, #1e5c72, #113144);
  color: #9af8ff;
  box-shadow: inset 0 1.5px 0 #8ef6ff77, inset 0 -1.5px 0 #071926cc;
}
.trail li[aria-current="step"] {
  background: linear-gradient(180deg, #fff099 0%, #f5be32 58%, #c97c10 100%);
  color: #1b0e22;
  text-shadow: 0 1px 0 #fff7cc88;
  box-shadow: inset 0 1.5px 0 #ffffffcc, inset 0 -1.5px 0 #7a4208cc;
}
@media (max-width: 900px) {
  .trail {
    padding: 5px 10px;
    gap: 3px;
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  }
  .trail::before { left: 12px; right: 12px; }
  .trail li { font-size: 9px; padding: 4px 1px; }
}

/* === v47 Deep Blizzard Fidelity Pass (3-Col Galaxy Header, Contextual CTA, Stacked Heroic Crests, Socket Wells) === */

/* 1. Stacked Heroic Shipyard & Battle Center Crests + Clean Row-1 Placement (Desktop) */
@media (min-width: 901px) {
  .workspace {
    grid-template-rows: 54px minmax(0, 1fr) 48px;
  }
  .battle-heading {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
    gap: 12px;
    padding-inline: 2px;
  }
  .battle-heading .phase-round {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 6;
    padding: 1.5px 14px;
    font-size: calc(10px * var(--tyrants-text-controls, 1));
    border: 1px solid #8a99beaa;
    background: linear-gradient(180deg, #2d3552, #14182b);
  }
  .battle-heading .phase {
    grid-row: 1;
    grid-column: 2;
    align-self: end;
    margin-bottom: 1px;
    padding: 5px 40px 5px;
    font-size: calc(20px * var(--tyrants-text-section-titles, 1));
  }
  .fleet-app[data-phase="combat"] .battle-heading .phase,
  .fleet-app[data-phase="resolved"] .battle-heading .phase {
    padding: 6px 46px 6px;
    font-size: calc(22px * var(--tyrants-text-section-titles, 1));
    letter-spacing: 0.14em;
  }
  .battle-heading .instruction {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
    align-self: center;
    margin-left: 38px;
    max-width: calc(100% - 38px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-color: #6e86b088;
    background: linear-gradient(180deg, #232a46e8, #14172bf0);
    box-shadow: inset 0 1px 0 #dce8ff33, 0 3px 10px #04010ea6;
  }
  .battle-heading .scout-pill {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
    align-self: center;
    border-color: #d668b499;
    background: linear-gradient(180deg, #321b46eb, #1b102bf2);
    box-shadow: inset 0 1px 0 #ffc2ec33, 0 3px 10px #04010ea6;
  }
}
@media (max-height: 700px) and (min-width: 901px) {
  .workspace {
    grid-template-rows: 46px minmax(0, 1fr) 42px;
  }
  .battle-heading .phase-round {
    top: -1px;
    font-size: 9px;
    padding: 1px 11px;
  }
  .battle-heading .phase,
  .fleet-app[data-phase="combat"] .battle-heading .phase,
  .fleet-app[data-phase="resolved"] .battle-heading .phase {
    padding: 3px 32px 4px;
    font-size: calc(17px * var(--tyrants-text-section-titles, 1));
  }
}

/* Commander Wing Header Painted Team Slash Accents (Acid-Lime Ally / Hot-Magenta Rival) */
.fleet-plate .commander-copy strong {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 4px;
}
.fleet-plate .commander-copy strong::after {
  content: "";
  position: absolute;
  left: 0;
  right: -8px;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #d8ff3f, #6bf5ff 74%, transparent);
  clip-path: polygon(0 20%, 100% 0, 94% 100%, 2% 85%);
  pointer-events: none;
}
.enemy .fleet-plate .commander-copy strong::after {
  left: -8px;
  right: 0;
  background: linear-gradient(270deg, #ff4cc8, #ff7eb6 74%, transparent);
  clip-path: polygon(0 0, 100% 20%, 98% 85%, 6% 100%);
}

/* 2. Shipyard Sleek Depot Header, Color-Coded Recessed Socket Wells & Riveted Bottom Deck */
.supply .yard-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 13px 4px;
  background: linear-gradient(180deg, #2f3856 0%, #1b2136 100%);
  border-color: #8494bc;
  color: #f3f6ff;
  text-shadow: 0 1px 3px #05020e;
  box-shadow: inset 0 1px 0 #dce8ff44, 0 2px 0 #090c18;
}
.supply .yard-title .yard-chev {
  color: #ffe047;
  text-shadow: 0 0 8px #ffe04788;
}
.mount.empty {
  background: linear-gradient(180deg, #090d1cf2, #12182ef2);
  border: 1.5px solid #52688899;
  box-shadow: inset 0 2px 6px #020108e6, 0 1px 0 #ffffff1c;
  color: #7b96bc;
}
.mount:not(.empty)[data-type="weapon"] {
  border-color: #ffa64dcc;
  background: radial-gradient(ellipse at 50% 30%, #613426, #1b1224 80%);
  box-shadow: inset 0 1px 0 #ffd8a866, 0 0 8px #ff8c3844, 0 2px 5px #04010d99;
}
.mount:not(.empty)[data-type="utility"] {
  border-color: #5eeeffcc;
  background: radial-gradient(ellipse at 50% 30%, #1f607d, #101b33 80%);
  box-shadow: inset 0 1px 0 #c4fbff66, 0 0 8px #4ceeff44, 0 2px 5px #04010d99;
}
.mount:not(.empty)[data-type="hangar"] {
  border-color: #a8ff52cc;
  background: radial-gradient(ellipse at 50% 30%, #2b5c34, #11221e 80%);
  box-shadow: inset 0 1px 0 #d8ffb066, 0 0 8px #8cff4844, 0 2px 5px #04010d99;
}
[data-phase="formation"] .fleet-actions {
  border: 1.5px solid #7c8cb4aa;
  border-radius: 8px;
  background:
    radial-gradient(circle 2px at 8px 50%, #d4e0f8 35%, #384260 72%, transparent 100%),
    radial-gradient(circle 2px at calc(100% - 8px) 50%, #d4e0f8 35%, #384260 72%, transparent 100%),
    linear-gradient(180deg, #2b334ff0 0%, #171c30f6 56%, #101324fa 100%);
  box-shadow:
    inset 0 1px 0 #dce8ff38,
    inset 0 -2px 4px #050310cc,
    0 6px 20px #04010ec4;
  padding-inline: 18px max(18px, var(--footer-reserve, 0px));
}
[data-phase="combat"] .fleet-actions .speed-control,
[data-phase="resolved"] .fleet-actions .speed-control {
  border-inline: 1px solid #7f90b855;
  padding-inline: 10px;
}
[data-phase="combat"] .fleet-actions .status,
[data-phase="resolved"] .fleet-actions .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f3ecff;
  font-weight: 700;
}
[data-phase="combat"] .fleet-actions .status::before {
  content: "▶";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff099 0%, #f5be32 58%, #c97c10 100%);
  border: 1.5px solid #fff7cc;
  color: #1c1024;
  font-size: 10px;
  padding-left: 2px;
  box-shadow: 0 0 10px #ffe04766, 0 2px 6px #04010ecc;
}

/* 3. Galaxy Map — 3-Column Heroic Header (Commander Medallion | Gold Crest | Rival Skull Plate) */
.galaxy {
  width: min(1160px, 100%);
}
.galaxy > header {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  gap: 18px;
  width: 100%;
}
.map-crest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.galaxy h2 {
  font-size: clamp(26px, 3.1vw, 40px);
  padding: 5px 28px 6px;
}
.map-unlock {
  padding: 2px 12px;
  border-radius: 999px;
  background: #141028d4;
  border: 1px solid #7080aa55;
  color: #cdd8f4;
  font: 600 10.5px/1.2 var(--tyrants-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.map-commander {
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
}
.map-portrait-box {
  position: relative;
  z-index: 2;
  flex: none;
  width: 50px;
  height: 50px;
  padding: 2.5px;
  border-radius: 7px;
  background: linear-gradient(155deg, #c8d6f0 0%, #505f84 52%, #20273e 100%);
  box-shadow: 0 0 0 1.5px #070412, 0 0 16px #4ef2ff55, 0 5px 14px #04010ec8;
}
.map-commander-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  border: 1.5px solid #5af2ff;
}
.map-crown-badge {
  position: absolute;
  left: -6px;
  bottom: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #323c5c, #171c30);
  border: 1.5px solid #ffe47a;
  color: #ffe047;
  font-size: 11px;
  box-shadow: 0 2px 8px #04010ed8;
}
.map-commander-plate {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: -8px;
  padding: 5px 18px 5px 16px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  border-top: 1.5px solid #8292b8aa;
  border-bottom: 1.5px solid #262e48cc;
  background: linear-gradient(180deg, #2e3754eb, #171d32f5);
  box-shadow: inset 0 1px 0 #dce8ff33, 0 5px 16px #04010eb8;
  min-width: 0;
}
.map-cmd-label {
  font: 700 8.5px/1 var(--tyrants-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: 0.1em;
  color: #8ceeff;
}
.map-cmd-name {
  font: italic 800 16px/1.1 var(--tyrants-font-display, "Barlow Condensed", sans-serif);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff8ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-threat {
  display: flex;
  align-items: center;
  justify-self: end;
  min-width: 0;
}
.map-threat-plate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: -12px;
  padding: 7px 22px 7px 18px;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%);
  border-top: 1.5px solid #8a99beaa;
  border-bottom: 1.5px solid #282f4acc;
  background: linear-gradient(180deg, #323954eb 0%, #1a1d32f5 100%);
  box-shadow: inset 0 1px 0 #dce8ff33, 0 5px 16px #04010ec0;
}
.map-rival-crown {
  color: #ff62cc;
  font-size: 13px;
  filter: drop-shadow(0 0 6px #ff52c877);
}
.galaxy .map-threat .map-rival {
  margin: 0;
  padding: 0;
  border: 0;
  clip-path: none;
  background: none;
  box-shadow: none;
  font: italic 800 16px/1.05 var(--tyrants-font-display, "Barlow Condensed", sans-serif);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff4fa;
  white-space: nowrap;
}
.map-skull-badge {
  position: relative;
  z-index: 2;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #b8c8e6 0%, #4b5778 52%, #1d2338 100%);
  border: 2px solid #96a6ca;
  color: #fff6fa;
  font-size: 18px;
  text-shadow: 0 2px 4px #070412;
  box-shadow: 0 0 0 1.5px #070412, 0 0 14px #ff4dc844, 0 4px 12px #04010ec8;
}

/* 4. Galaxy Map Contextual SET COURSE » Snapped Under Selected Planet's Intel Plaque (Desktop) */
@media (min-width: 901px) {
  .systems {
    gap: clamp(12px, 2vh, 20px);
    justify-items: start;
  }
  .system-row {
    display: grid;
    grid-template-columns: clamp(110px, 12.2vw, 152px) 28px minmax(250px, 380px);
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: 8px;
  }
  .system-row > button {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: clamp(110px, 12.2vw, 152px) 28px minmax(250px, 380px);
    align-items: center;
    justify-items: center;
  }
  .system-row > button .system-card {
    justify-self: stretch;
  }
  .course-cta-slot {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    justify-content: stretch;
    filter: drop-shadow(0 6px 14px #04010ed0) drop-shadow(0 0 14px #ffcf4044);
  }
  .course-cta-slot:empty {
    display: none;
  }
  .course-cta-slot .set-course {
    width: 100%;
    min-width: 0;
    padding: 9px 22px 10px;
    border: 2px solid #fff5be;
    border-radius: 5px;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    background: linear-gradient(180deg, #fff29c 0%, #ffc838 48%, #d68210 100%);
    color: #190d22;
    font: italic 800 22px/1 var(--tyrants-font-display, "Barlow Condensed", sans-serif);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 #fff8cc99;
    box-shadow:
      inset 0 2px 0 #ffffffcc,
      inset 0 -3px 5px #8e490888;
  }
  .galaxy .navigation {
    grid-template-columns: auto 1fr;
    min-height: 28px;
  }
  .galaxy .course-status {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: clamp(8px, 3vw, 40px);
    padding-bottom: 6px;
    white-space: nowrap;
    font: italic 800 15px/1.1 var(--tyrants-font-display, "Barlow Condensed", sans-serif);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff9f0;
  }
  .galaxy .course-status::before {
    content: "»";
    color: #ff4dc8;
    font-size: 20px;
    line-height: 1;
    text-shadow: 0 0 10px #ff4dc888;
  }
  .galaxy .course-status::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 4px;
    bottom: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #d8ff3f, #6bf5ff 74%, transparent);
    clip-path: polygon(0 25%, 100% 0, 94% 100%, 2% 85%);
  }
}

/* 5. Chevron-Capped Octagonal 01–10 Sector Rail (.trail-bar) */
.trail-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1.5px solid #8696beaa;
  border-radius: 6px;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  background: linear-gradient(180deg, #323c5aeb 0%, #1b2136f4 55%, #121628fa 100%);
  box-shadow:
    inset 0 1px 0 #dce8ff44,
    inset 0 -2px 4px #050310cc,
    0 6px 20px #04010ed0;
}
.trail-cap {
  text-align: center;
  color: #a8bee8;
  font: 800 15px/1 var(--tyrants-font-display, "Barlow Condensed", sans-serif);
  text-shadow: 0 1px 3px #04010e;
}
.trail-bar .trail {
  grid-column: 2;
  padding: 0;
  border: 0;
  clip-path: none;
  background: none;
  box-shadow: none;
}
.trail-bar .trail::before {
  left: 8px;
  right: 8px;
}

/* Responsive Safeguards for Short Desktop (1366x599) & Mobile (390x844 / 375x553 / 844x390) */
@media (max-height: 700px) and (min-width: 901px) {
  .galaxy { gap: 5px; padding: 6px 14px; }
  .map-portrait-box { width: 38px; height: 38px; }
  .map-crown-badge { width: 17px; height: 17px; font-size: 9px; }
  .map-cmd-name, .galaxy .map-threat .map-rival { font-size: 13px; }
  .map-skull-badge { width: 30px; height: 30px; font-size: 14px; }
  .map-unlock { font-size: 9.5px; padding: 1px 10px; }
  .galaxy h2 { font-size: clamp(22px, 2.7vw, 31px); padding: 3px 22px 4px; }
  .system-row { row-gap: 5px; }
  .course-cta-slot .set-course { padding: 6px 16px; font-size: 17px; }
  .trail-bar { padding: 4px 12px; }
}
@media (max-width: 900px) {
  .mast {
    gap: 5px;
  }
  .mast h1 {
    font-size: clamp(16px, 4.6vw, 20px);
    letter-spacing: 1.4px;
  }
  .mast .angles-btn {
    padding: 4px 6px;
    min-height: 26px;
    font-size: 9.5px;
    white-space: nowrap;
  }
  [data-phase="combat"] .fleet-actions .status::before {
    width: 17px;
    height: 17px;
    font-size: 8px;
  }
  .galaxy > header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
  }
  .map-commander,
  .map-unlock { display: none; }
  .map-threat { justify-self: center; }
  .map-threat-plate { padding: 4px 16px 4px 14px; }
  .map-skull-badge { width: 28px; height: 28px; font-size: 13px; }
  .galaxy .map-threat .map-rival { font-size: 13px; }
  .systems .system-row {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .systems .system-row > button {
    flex: 1 1 auto;
    width: 100%;
  }
  .course-cta-slot { display: none; }
  .trail-bar {
    grid-template-columns: 14px minmax(0, 1fr) 14px;
    padding: 4px 8px;
    gap: 2px;
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  }
  .trail-cap { font-size: 11px; }
}
@media (max-height: 500px) and (min-width: 561px) {
  .map-commander, .map-unlock { display: none; }
  .galaxy > header { grid-template-columns: auto auto; justify-content: center; gap: 10px; }
  .course-cta-slot { display: none; }
}

/* === v49 SDK v331 Adoptions (#607 --mm-shop-* Theme Tokens & Card Badges/Tags) === */
.supply .offers {
  --mm-shop-card-bg: linear-gradient(180deg, #2a304cf2 0%, #171a30f6 62%, #111326fa 100%);
  --mm-shop-card-border: #6b7aa4bb;
  --mm-shop-card-border-hover: #ffe27a;
  --mm-shop-card-radius: 8px;
  --mm-shop-card-shadow: inset 0 1px 0 #dce8ff2e, inset 0 -2px 5px #050310a6, 0 3px 0 #090716, 0 5px 14px #04010e88;
  --mm-shop-cost-bg: linear-gradient(180deg, #ffeb8a 0%, #f0bd38 100%);
  --mm-shop-cost-color: #1c1022;
  --mm-shop-cost-radius: 4px;
  --mm-shop-act-bg: linear-gradient(180deg, #28304d, #161b30);
  --mm-shop-act-color: #d8e6ff;
  --mm-shop-act-active-bg: linear-gradient(180deg, #1b4d5e, #102e3e);
  --mm-shop-act-active-color: #8af6ff;
}
.supply .offers .mm-shopcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}
.supply .offers .mm-shopart {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
}
.supply .offers .mm-shoptag {
  font: 600 calc(9.5px * var(--tyrants-text-hull-stats, 1))/1.05 var(--tyrants-font-mono, "IBM Plex Mono", monospace);
  color: #a4b8dc;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.supply .offers .mm-shopbadge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 3px;
  font: italic 800 9px/1.15 var(--tyrants-font-display, "Barlow Condensed", sans-serif);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1b0e22;
  box-shadow: 0 2px 6px #04010ec4;
  pointer-events: none;
}
@media (max-width: 900px), (max-height: 700px) {
  .supply .offers .mm-shoptag { font-size: 8px; }
  .supply .offers .mm-shopbadge { top: 2px; left: 2px; padding: 0 4px; font-size: 8px; }
}
@media (max-height: 560px) {
  .supply .offers .mm-shoptag { display: none; }
}

/* === v52 AAA PC Blizzard Flagship Polish (v51_aaa_* Paintover Adaptation) === */

/* 1. Sculpted Brushed-Gunmetal & Burnished-Gold Naval Masthead Bar */
.mast {
  background:
    linear-gradient(180deg, rgba(64, 76, 108, 0.94) 0%, rgba(30, 36, 56, 0.96) 52%, rgba(18, 22, 36, 0.98) 100%);
  border-bottom: 1.5px solid #c99d4cbb;
  box-shadow:
    inset 0 1px 0 rgba(226, 238, 255, 0.24),
    inset 0 -2px 4px rgba(4, 2, 12, 0.85),
    0 4px 18px rgba(4, 2, 14, 0.78);
}
.mast h1 {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 10px rgba(0, 0, 0, 0.85);
}
.mast :is(.help, .angles-btn, .stats, .new-run, .leaderboard-btn, .ladder-btn) {
  border: 1.5px solid #8a9ac2aa;
  background: linear-gradient(180deg, #3c4666 0%, #22283d 55%, #161b2c 100%);
  box-shadow:
    inset 0 1px 0 rgba(230, 240, 255, 0.28),
    inset 0 -2px 3px rgba(5, 3, 14, 0.85),
    0 2px 6px rgba(4, 2, 14, 0.65);
}
.mast :is(.ladder-btn, .leaderboard-btn) {
  border-color: #d6a94ebb;
  background: linear-gradient(180deg, #4a3f30 0%, #282328 55%, #191722 100%);
}
.mast :is(.help, .angles-btn, .stats, .new-run, .leaderboard-btn, .ladder-btn):hover:not(:disabled) {
  border-color: #ffe285;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 200, 0.42),
    0 0 12px rgba(255, 210, 96, 0.35),
    0 2px 8px rgba(4, 2, 14, 0.78);
}

/* 2. Galaxy Map: Ornate Gold-and-Steel Crest, Riveted Intel Plaques, Forged Gold CTA & LED Sector Pips */
.galaxy h2 {
  position: relative;
  color: #ffe388;
  -webkit-text-fill-color: #ffe388;
  text-shadow: 0 2px 8px rgba(4, 2, 12, 0.95), 0 0 16px rgba(255, 206, 86, 0.42);
  border: 2px solid #d7aa4ee6;
  background:
    radial-gradient(circle at 8px 50%, #6cf6ff 0 3px, rgba(64, 224, 255, 0.35) 5px, transparent 8px),
    radial-gradient(circle at calc(100% - 8px) 50%, #6cf6ff 0 3px, rgba(64, 224, 255, 0.35) 5px, transparent 8px),
    linear-gradient(180deg, #3a4158f2 0%, #1d2236f6 52%, #131728fa 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 194, 0.42),
    inset 0 -3px 6px rgba(5, 3, 14, 0.9),
    0 0 0 1.5px rgba(10, 12, 22, 0.95),
    0 6px 24px rgba(4, 2, 14, 0.85);
}
.systems .system-row > button .system-card {
  position: relative;
  border: 1.5px solid #8a98baa8;
  background:
    radial-gradient(circle at 8px 8px, #b4c2df 0 1.6px, #121626 2px, transparent 3px),
    radial-gradient(circle at calc(100% - 8px) 8px, #b4c2df 0 1.6px, #121626 2px, transparent 3px),
    radial-gradient(circle at 8px calc(100% - 8px), #b4c2df 0 1.6px, #121626 2px, transparent 3px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), #b4c2df 0 1.6px, #121626 2px, transparent 3px),
    linear-gradient(180deg, rgba(46, 54, 76, 0.92) 0%, rgba(23, 28, 44, 0.95) 56%, rgba(14, 18, 30, 0.97) 100%);
  box-shadow:
    inset 0 1px 0 rgba(226, 238, 255, 0.25),
    inset 0 -2px 6px rgba(4, 2, 14, 0.88),
    0 8px 22px rgba(4, 2, 14, 0.78);
}
.systems .system-row > button[aria-pressed="true"] .system-card {
  border-color: #e4ba5fe6;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 198, 0.36),
    inset 0 -2px 6px rgba(4, 2, 14, 0.88),
    0 0 20px rgba(242, 188, 66, 0.28),
    0 8px 24px rgba(4, 2, 14, 0.85);
}
.course-cta-slot .set-course {
  border: 2px solid #ffea96;
  background: linear-gradient(180deg, #ffe27c 0%, #f3b533 46%, #c97f14 100%);
  color: #1a1004;
  text-shadow: 0 1px 0 rgba(255, 244, 198, 0.55);
  box-shadow:
    inset 0 2px 0 rgba(255, 252, 232, 0.65),
    inset 0 -3px 5px rgba(102, 52, 4, 0.65),
    0 0 22px rgba(255, 192, 56, 0.48),
    0 6px 18px rgba(4, 2, 14, 0.82);
}
.course-cta-slot .set-course:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow:
    inset 0 2px 0 rgba(255, 252, 232, 0.8),
    inset 0 -3px 5px rgba(102, 52, 4, 0.55),
    0 0 28px rgba(255, 212, 92, 0.68),
    0 6px 20px rgba(4, 2, 14, 0.88);
}
.trail-bar .trail li {
  position: relative;
}
.trail-bar .trail li::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: #5ee9ff88;
  box-shadow: 0 0 6px #5ee9ff88;
  pointer-events: none;
}
.trail-bar .trail li.now::after {
  width: 12px;
  background: #ffd966;
  box-shadow: 0 0 8px #ffb938;
}
.trail-bar .trail li.done::after {
  background: #9eff5e;
  box-shadow: 0 0 6px #9eff5e;
}

/* 3. Shipyard: Armored Naval Console Dock & Collectible Metallic Shop Cards */
.supply {
  border-top: 2px solid #c99d4ccc;
  background:
    linear-gradient(180deg, rgba(44, 52, 74, 0.94) 0%, rgba(22, 27, 42, 0.97) 26%, rgba(14, 17, 29, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(232, 240, 255, 0.25),
    inset 0 -2px 8px rgba(4, 2, 12, 0.9),
    0 -6px 24px rgba(4, 2, 14, 0.72);
}
.supply .offers {
  --mm-shop-card-bg: linear-gradient(180deg, #323c5af4 0%, #1c2238f8 58%, #121628fc 100%);
  --mm-shop-card-border: #8294bcc4;
  --mm-shop-card-border-hover: #ffe588;
  --mm-shop-card-shadow:
    inset 0 2px 0 rgba(122, 232, 255, 0.36),
    inset 0 -3px 6px rgba(4, 2, 12, 0.88),
    0 4px 0 #090b16,
    0 8px 18px rgba(4, 2, 14, 0.78);
}
.supply .offers .mm-shopcard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, #6bf3ff, transparent);
  opacity: 0.75;
  pointer-events: none;
}
.fleet-actions .engage {
  border: 2px solid #ffea96;
  background: linear-gradient(180deg, #ffe27c 0%, #f0b130 48%, #c27812 100%);
  color: #1a1004;
  text-shadow: 0 1px 0 rgba(255, 246, 206, 0.55);
  box-shadow:
    inset 0 2px 0 rgba(255, 252, 232, 0.65),
    inset 0 -3px 5px rgba(96, 48, 4, 0.65),
    0 0 20px rgba(255, 188, 52, 0.45),
    0 4px 14px rgba(4, 2, 14, 0.82);
}

/* 4. Battle: Winged Gold-and-Steel Shield Crest, Unified Brushed Commander Wing Plates & Anodized Control Deck */
[data-phase="combat"] .phase-banner {
  position: relative;
  border: 2px solid #e5b857;
  background:
    linear-gradient(90deg, rgba(64, 212, 255, 0.24) 0%, rgba(26, 32, 52, 0.96) 44%, rgba(26, 32, 52, 0.96) 56%, rgba(238, 72, 178, 0.24) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 204, 0.55),
    inset 0 -3px 8px rgba(4, 2, 12, 0.9),
    0 0 24px rgba(242, 186, 68, 0.34),
    0 6px 20px rgba(4, 2, 14, 0.88);
}
[data-phase="combat"] .phase-banner::before,
[data-phase="combat"] .phase-banner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24px;
  height: 14px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #ffe68e 0%, #d19936 58%, #7d5314 100%);
  box-shadow: 0 2px 8px rgba(4, 2, 14, 0.85);
  pointer-events: none;
}
[data-phase="combat"] .phase-banner::before {
  left: -20px;
  clip-path: polygon(100% 0, 100% 100%, 22% 84%, 0 20%);
}
[data-phase="combat"] .phase-banner::after {
  right: -20px;
  clip-path: polygon(0 0, 100% 20%, 78% 84%, 0 100%);
}
.fleet-plate {
  border-color: #9aaad0b8;
  background:
    linear-gradient(180deg, rgba(60, 72, 102, 0.93) 0%, rgba(28, 34, 52, 0.96) 55%, rgba(16, 20, 34, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(232, 242, 255, 0.3),
    inset 0 -2px 5px rgba(4, 2, 12, 0.88),
    0 5px 18px rgba(4, 2, 14, 0.78);
}
[data-phase="combat"] .fleet-actions {
  border: 1.5px solid #9aaad0b8;
  background:
    linear-gradient(180deg, rgba(54, 64, 92, 0.94) 0%, rgba(24, 30, 46, 0.97) 52%, rgba(14, 18, 30, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(232, 242, 255, 0.28),
    inset 0 -2px 6px rgba(4, 2, 12, 0.9),
    0 6px 22px rgba(4, 2, 14, 0.86);
}
@media (max-width: 900px) {
  [data-phase="combat"] .phase-banner::before,
  [data-phase="combat"] .phase-banner::after { display: none; }
  .trail-bar .trail li::after { display: none; }
}

/* === v53 AAA Mockup Fidelity Pass (Heraldic Battle Shield, Holographic Scanline Grids, Recessed Reserve Bays & Planet Limb Glow) === */

/* 1. Galaxy Map: Ornate Circular Bronze-and-Cyan Side Medallions on GALAXY MAP Crest + Planet Atmospheric Limb Glow */
.galaxy h2 {
  overflow: visible;
}
.galaxy h2::before,
.galaxy h2::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translateY(-50%);
  border: 2px solid #e2b453;
  background:
    radial-gradient(circle, #8afaff 0 28%, #1e6280 56%, #14192b 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 246, 200, 0.55),
    0 0 12px rgba(96, 236, 255, 0.45),
    0 3px 10px rgba(4, 2, 14, 0.85);
  pointer-events: none;
}
.galaxy h2::before { left: -13px; }
.galaxy h2::after { right: -13px; }

.planet-sprite {
  filter: drop-shadow(0 0 16px rgba(92, 224, 255, 0.34)) drop-shadow(0 10px 22px rgba(4, 2, 14, 0.82));
}
.systems .system-row > button[aria-pressed="true"] .planet-sprite {
  filter: drop-shadow(0 0 22px rgba(255, 210, 96, 0.48)) drop-shadow(0 0 10px rgba(108, 242, 255, 0.38)) drop-shadow(0 10px 22px rgba(4, 2, 14, 0.86));
}

/* 2. Battle: True Pointed Heraldic Gold-and-Steel Shield Crest with Unclipped Golden Wings */
[data-phase="combat"] .battle-heading {
  position: relative;
  overflow: visible;
}
[data-phase="combat"] .battle-heading .phase {
  position: relative;
  z-index: 1;
  padding: 5px 28px 11px;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%);
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 226, 126, 0.24) 0%, transparent 30%),
    linear-gradient(90deg, rgba(58, 214, 255, 0.36) 0%, rgba(22, 28, 48, 0.96) 44%, rgba(22, 28, 48, 0.96) 56%, rgba(242, 74, 182, 0.36) 100%);
  box-shadow:
    inset 0 2px 0 #ffe388,
    inset 0 -3px 10px rgba(4, 2, 12, 0.92);
  filter: drop-shadow(0 0 1.5px #e8ba58) drop-shadow(0 6px 18px rgba(4, 2, 14, 0.88));
}
[data-phase="combat"] .battle-heading::before,
[data-phase="combat"] .battle-heading::after {
  content: "";
  position: absolute;
  top: 56%;
  width: 34px;
  height: 16px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #ffeb99 0%, #d49b36 52%, #7d5214 100%);
  filter: drop-shadow(0 3px 8px rgba(4, 2, 14, 0.88));
  pointer-events: none;
  z-index: 0;
}
[data-phase="combat"] .battle-heading::before {
  right: calc(50% + 72px);
  clip-path: polygon(100% 8%, 100% 92%, 30% 100%, 0 26%, 24% 0);
}
[data-phase="combat"] .battle-heading::after {
  left: calc(50% + 72px);
  clip-path: polygon(0 8%, 76% 0, 100% 26%, 70% 100%, 0 92%);
}

/* 3. Holographic Scanline Tactical Grids + Luminous Faction Edge Glow */
.fleet.ally .grid {
  background-image:
    repeating-linear-gradient(180deg, rgba(114, 240, 255, 0.045) 0 1px, transparent 1px 4px);
  box-shadow:
    inset 0 0 22px rgba(72, 224, 255, 0.16),
    0 0 24px rgba(56, 206, 255, 0.22);
}
.fleet.enemy .grid {
  background-image:
    repeating-linear-gradient(180deg, rgba(255, 110, 206, 0.045) 0 1px, transparent 1px 4px);
  box-shadow:
    inset 0 0 22px rgba(244, 78, 186, 0.16),
    0 0 24px rgba(240, 72, 180, 0.22);
}

/* 4. Shipyard Recessed Brushed-Metal Reserve Bays & Armored Gear Cards */
.reserve-cell {
  border: 1px solid #6b7da688;
  background:
    linear-gradient(180deg, rgba(22, 27, 42, 0.92) 0%, rgba(12, 15, 26, 0.96) 100%);
  box-shadow:
    inset 0 2px 6px rgba(4, 2, 12, 0.88),
    inset 0 -1px 0 rgba(186, 208, 255, 0.14);
}
.gear-offers button {
  border: 1.5px solid #7d8fb8a8;
  background:
    linear-gradient(180deg, rgba(46, 54, 78, 0.92) 0%, rgba(22, 27, 42, 0.96) 58%, rgba(14, 18, 30, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(224, 238, 255, 0.24),
    inset 0 -2px 5px rgba(4, 2, 12, 0.88),
    0 4px 12px rgba(4, 2, 14, 0.72);
}
.gear-offers button:hover:not(:disabled) {
  border-color: #ffe388;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 200, 0.36),
    0 0 14px rgba(255, 204, 86, 0.32),
    0 4px 14px rgba(4, 2, 14, 0.82);
}
@media (max-width: 900px) {
  .galaxy h2::before,
  .galaxy h2::after,
  [data-phase="combat"] .battle-heading::before,
  [data-phase="combat"] .battle-heading::after { display: none; }
}

/* === v53 Choreographed Screen Transitions (Zero Input Delay, GPU-Composited) === */
.phase-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  will-change: opacity, transform;
}
.phase-veil[data-tone="combat"] {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 224, 108, 0.34) 0%, rgba(92, 236, 255, 0.16) 36%, rgba(242, 74, 182, 0.14) 64%, transparent 86%);
}
.phase-veil[data-tone="shipyard"] {
  background:
    radial-gradient(circle at 50% 48%, rgba(114, 244, 255, 0.30) 0%, rgba(255, 218, 106, 0.12) 42%, transparent 82%);
}
.phase-veil[data-tone="course"] {
  background:
    radial-gradient(circle at 50% 46%, rgba(128, 240, 255, 0.24) 0%, rgba(176, 132, 255, 0.12) 48%, transparent 84%);
}
.phase-veil[data-tone="kill"] {
  background:
    radial-gradient(circle at 50% 50%, transparent 48%, rgba(255, 166, 72, 0.14) 76%, rgba(255, 76, 128, 0.22) 100%);
}
.phase-veil[data-tone="flagship-kill"] {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 244, 198, 0.18) 0%, transparent 44%, rgba(255, 196, 76, 0.26) 76%, rgba(255, 68, 140, 0.34) 100%);
}
.phase-veil.active {
  animation: tyrantsVeilFlash 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tyrantsVeilFlash {
  0% { opacity: 0; transform: scale(0.94); }
  16% { opacity: 0.78; transform: scale(1.0); }
  52% { opacity: 0.34; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.09); }
}
@keyframes tyrantsDropCrest {
  0% { opacity: 0; transform: translateY(-14px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tyrantsFadeRise {
  0% { opacity: 0; transform: translateY(14px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tyrantsSlideLeft {
  0% { opacity: 0; transform: translateX(-22px) scale(0.985); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes tyrantsSlideRight {
  0% { opacity: 0; transform: translateX(24px) scale(0.985); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes tyrantsSlideUp {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes tyrantsCardPop {
  0% { opacity: 0; transform: translateY(10px) scale(0.955); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tyrantsFleetWarpIn {
  0% { opacity: 0; transform: translateX(34px) scale(0.97); filter: brightness(1.32); }
  55% { opacity: 1; filter: brightness(1.06); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: brightness(1); }
}

/* Entering Galaxy Map (*-to-course) */
[data-transition$="-to-course"] .galaxy {
  animation: tyrantsGalaxyArrive 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-course"] .galaxy > header {
  animation: tyrantsDropCrest 400ms 30ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-course"] .galaxy .galaxy-canvas {
  animation: tyrantsFadeRise 440ms 40ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-course"] .galaxy .systems .system-row:nth-child(1) {
  animation: tyrantsFadeRise 420ms 60ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-course"] .galaxy .systems .system-row:nth-child(2) {
  animation: tyrantsFadeRise 420ms 110ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-course"] .trail-bar {
  animation: tyrantsSlideUp 400ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Entering Shipyard from Galaxy Map (course-to-formation) */
[data-transition="course-to-formation"] .battle-heading {
  animation: tyrantsDropCrest 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition="course-to-formation"] .fleet.own {
  animation: tyrantsSlideLeft 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition="course-to-formation"] .fleet-actions {
  animation: tyrantsSlideUp 400ms 50ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Entering Shipyard from ANY screen (*-to-formation): dock & cards glide smoothly in from right */
[data-transition$="-to-formation"] .supply {
  animation: tyrantsSlideRight 460ms 20ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-formation"] .supply .offers .mm-shopcard:nth-child(1) {
  animation: tyrantsCardPop 350ms 70ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-formation"] .supply .offers .mm-shopcard:nth-child(2) {
  animation: tyrantsCardPop 350ms 115ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-formation"] .supply .offers .mm-shopcard:nth-child(3) {
  animation: tyrantsCardPop 350ms 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-formation"] .supply .gear-offers > div:nth-child(1) {
  animation: tyrantsCardPop 350ms 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-formation"] .supply .gear-offers > div:nth-child(2) {
  animation: tyrantsCardPop 350ms 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition="combat-to-formation"] .battle-heading .phase,
[data-transition="resolved-to-formation"] .battle-heading .phase {
  animation: tyrantsCrestMorph 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Entering Battle (*-to-combat): own fleet FLIP-glides seamlessly, rival warps in, crest morphs */
[data-transition="formation-to-combat"] .battle-heading .phase {
  animation: tyrantsCrestMorph 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition="course-to-combat"] .battle-heading {
  animation: tyrantsDropCrest 420ms cubic-bezier(0.16, 1.12, 0.3, 1) both;
}
[data-transition="course-to-combat"] .fleet.own {
  animation: tyrantsSlideLeft 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition="course-to-combat"] .fleet-actions {
  animation: tyrantsSlideUp 380ms 50ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-combat"] .fleet.enemy .fleet-plate {
  animation: tyrantsSlideRight 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-transition$="-to-combat"] .fleet.enemy {
  animation: tyrantsFleetWarpIn 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Entering Resolved (combat-to-resolved): smooth crest glow morph */
[data-transition$="-to-resolved"] .battle-heading .phase {
  animation: tyrantsCrestMorph 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* === v59 Seamless Screen-to-Screen Departing Ghosts & Overlay Choreography === */
.workspace {
  position: relative;
}
.transition-ghosts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: clip;
  z-index: 25;
}
.ghost-exit {
  will-change: transform, opacity;
  pointer-events: none !important;
}
.ghost-exit * {
  pointer-events: none !important;
}
@keyframes tyrantsGalaxyArrive {
  0% { opacity: 0; transform: scale(0.955); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tyrantsCrestMorph {
  0% { transform: scale(0.90); filter: brightness(1.45); }
  55% { transform: scale(1.04); filter: brightness(1.12); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes tyrantsGhostZoomOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.045); }
}
@keyframes tyrantsGhostSlideLeft {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(-46px) scale(0.97); }
}
@keyframes tyrantsGhostSlideRight {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(52px) scale(0.97); }
}
@keyframes tyrantsGhostSlideUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-22px); }
}
@keyframes tyrantsGhostSlideDown {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(24px); }
}
@keyframes tyrantsPanelIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tyrantsPanelOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(14px) scale(0.96); }
}
.ghost-zoom-out {
  animation: tyrantsGhostZoomOut 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-zoom-out > header {
  animation: tyrantsGhostSlideUp 340ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-zoom-out .trail-bar {
  animation: tyrantsGhostSlideDown 340ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-slide-left {
  animation: tyrantsGhostSlideLeft 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-slide-right {
  animation: tyrantsGhostSlideRight 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-slide-up {
  animation: tyrantsGhostSlideUp 380ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-slide-down {
  animation: tyrantsGhostSlideDown 380ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ghost-panel-out {
  animation: tyrantsPanelOut 280ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.combat-meter:not([hidden]),
.survival-banner:not([hidden]) {
  animation: tyrantsPanelIn 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.galaxy .system-row,
.galaxy .system-card,
.galaxy .planet-sprite,
.supply .gear-offer,
.supply .dock-tab,
.fleet-actions button {
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease, filter 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

@keyframes tyrantsKillPunch {
  0% { filter: brightness(1.18) saturate(1.2); }
  45% { filter: brightness(1.06) saturate(1.08); }
  100% { filter: brightness(1) saturate(1); }
}
.arena.arena-kill-punch {
  animation: tyrantsKillPunch 240ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* === v56 Sector Anomalies & Shipyard Tactical Readability === */
.system-card .anomaly-pill,
.battle-heading .anomaly-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 10.5px/1.15 var(--tyrants-font-mono, "IBM Plex Mono", monospace);
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(120, 232, 255, 0.45);
  background: linear-gradient(180deg, rgba(18, 32, 54, 0.92), rgba(10, 18, 34, 0.94));
  color: #a4f6ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.system-card .anomaly-pill {
  margin-top: 4px;
  align-self: flex-start;
}
.battle-heading .anomaly-badge {
  margin-left: 6px;
}
.anomaly-pill[data-tone="gold"], .anomaly-badge[data-tone="gold"] { border-color: rgba(255, 214, 102, 0.6); color: #ffe388; }
.anomaly-pill[data-tone="lime"], .anomaly-badge[data-tone="lime"] { border-color: rgba(168, 255, 98, 0.58); color: #c7ff8c; }
.anomaly-pill[data-tone="violet"], .anomaly-badge[data-tone="violet"] { border-color: rgba(192, 146, 255, 0.58); color: #dfbeff; }
.anomaly-pill[data-tone="amber"], .anomaly-badge[data-tone="amber"] { border-color: rgba(255, 162, 82, 0.62); color: #ffc17a; }
.anomaly-pill[data-tone="emerald"], .anomaly-badge[data-tone="emerald"] { border-color: rgba(108, 255, 184, 0.58); color: #9effcc; }
.anomaly-pill[hidden], .anomaly-badge[hidden] { display: none; }

@keyframes tyrantsGearMergePulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 0 0 1px rgba(176, 255, 92, 0.62), 0 0 14px rgba(142, 255, 86, 0.28); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 0 0 1.5px rgba(188, 255, 108, 0.92), 0 0 20px rgba(142, 255, 86, 0.48); }
}
.gear-offers .gear-offer[data-merge="1"]:not(:disabled) {
  border-color: rgba(182, 255, 98, 0.85);
  animation: tyrantsGearMergePulse 1.8s ease-in-out infinite;
}
.gear-offers .gear-offer[data-merge="1"]:not(:disabled) b {
  color: #c8ff78;
  text-shadow: 0 0 8px rgba(168, 255, 84, 0.55);
}

@media (max-width: 900px) {
  .battle-heading .anomaly-badge {
    font-size: 9.5px;
    padding: 2px 6px;
    margin-left: 0;
  }
  .system-card .anomaly-pill {
    font-size: 9.5px;
    padding: 2px 6px;
  }
}

/* === v57 AAA Graphics Polish: Holographic Inspector, Illuminated Fleet Rims & Specular Chrome === */
.supply .inspector {
  border-left: 3px solid rgba(98, 240, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(16, 30, 52, 0.92), rgba(10, 18, 34, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(164, 246, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
.fleet.own .grid {
  box-shadow:
    inset 0 1px 0 rgba(114, 244, 255, 0.28),
    inset 0 -1px 0 rgba(114, 244, 255, 0.18),
    0 0 24px rgba(56, 212, 255, 0.12);
}
.fleet.enemy .grid {
  box-shadow:
    inset 0 1px 0 rgba(255, 108, 206, 0.28),
    inset 0 -1px 0 rgba(255, 108, 206, 0.18),
    0 0 24px rgba(255, 74, 182, 0.12);
}
.map-commander-plate,
.map-threat-plate {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.52),
    0 8px 22px rgba(0, 0, 0, 0.44);
}
.engage:not(:disabled):hover,
.galaxy .set-course:not(:disabled):hover {
  filter: brightness(1.12) saturate(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 224, 0.72),
    0 0 22px rgba(255, 202, 74, 0.52),
    0 6px 18px rgba(0, 0, 0, 0.45);
}

/* === v60 Smoovinator & Chromebook Optimizer: Compositor Stand-Down ===
   Strips multi-layer offscreen drop-shadow blurs and continuous box-shadow
   re-paint keyframes on school Chromebooks (session.device.chromebook),
   shed perf rungs (data-fx-tier="low"), and dimmed shell chrome (.mm-chrome-dim). */
.fleet-app[data-chromebook="1"] .ship-art > :not(span),
.fleet-app[data-fx-tier="low"] .ship-art > :not(span),
.mm-chrome-dim .fleet-app .ship-art > :not(span),
.fleet-app[data-chromebook="1"] .galaxy .planet-sprite,
.fleet-app[data-fx-tier="low"] .galaxy .planet-sprite,
.fleet-app[data-chromebook="1"] .galaxy .departure-ship,
.fleet-app[data-fx-tier="low"] .galaxy .departure-ship,
.fleet-app[data-chromebook="1"] .galaxy .map-crest,
.fleet-app[data-fx-tier="low"] .galaxy .map-crest,
.fleet-app[data-chromebook="1"] .battle-heading .phase,
.fleet-app[data-fx-tier="low"] .battle-heading .phase,
.fleet-app[data-chromebook="1"] .mm-shopart > :not(span),
.fleet-app[data-fx-tier="low"] .mm-shopart > :not(span) {
  filter: none !important;
}

.fleet-app[data-chromebook="1"] .ship-art > :not(span),
.fleet-app[data-fx-tier="low"] .ship-art > :not(span),
.fleet-app[data-chromebook="1"] .ship[data-level="2"],
.fleet-app[data-fx-tier="low"] .ship[data-level="2"],
.fleet-app[data-chromebook="1"] .ship[data-level="3"],
.fleet-app[data-fx-tier="low"] .ship[data-level="3"],
.fleet-app[data-chromebook="1"] .ship[data-hp-tier="low"],
.fleet-app[data-fx-tier="low"] .ship[data-hp-tier="low"],
.fleet-app[data-chromebook="1"] .gear-offers .gear-offer[data-merge="1"],
.fleet-app[data-fx-tier="low"] .gear-offers .gear-offer[data-merge="1"],
.fleet-app[data-chromebook="1"] .engage::after,
.fleet-app[data-fx-tier="low"] .engage::after,
.fleet-app[data-chromebook="1"] .set-course::after,
.fleet-app[data-fx-tier="low"] .set-course::after,
.fleet-app[data-chromebook="1"] .merge-ready,
.fleet-app[data-fx-tier="low"] .merge-ready,
.mm-chrome-dim .fleet-app .gear-offers .gear-offer[data-merge="1"],
.mm-chrome-dim .fleet-app .ship[data-level="2"],
.mm-chrome-dim .fleet-app .ship[data-level="3"] {
  animation: none !important;
}

.fleet-app[data-chromebook="1"] .gear-offers .gear-offer[data-merge="1"]:not(:disabled),
.fleet-app[data-fx-tier="low"] .gear-offers .gear-offer[data-merge="1"]:not(:disabled) {
  box-shadow: 0 0 0 1.5px rgba(182, 255, 98, 0.9);
}

.fleet-app[data-chromebook="1"] .phase-veil,
.fleet-app[data-fx-tier="low"] .phase-veil,
.fleet-app[data-chromebook="1"] .ghost-exit,
.fleet-app[data-fx-tier="low"] .ghost-exit {
  will-change: auto;
}

.fleet-app[data-chromebook="1"] .arena.arena-kill-punch,
.fleet-app[data-fx-tier="low"] .arena.arena-kill-punch {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .phase-veil,
  .phase-veil.active,
  .transition-ghosts,
  .ghost-exit,
  .combat-meter,
  .survival-banner,
  .arena.arena-kill-punch,
  .gear-offers .gear-offer[data-merge="1"],
  [data-transition] * {
    animation: none !important;
    transition: none !important;
  }
}





