:root {
      --bg: #050916;
      --panel: rgba(13, 22, 36, 0.94);
      --panel-2: rgba(18, 29, 46, 0.94);
      --line: #2c465f;
      --line-bright: #20d8ff;
      --text: #dcebff;
      --muted: #8ea7c0;
      --weak: #60758b;
      --good: #62f06a;
      --warn: #f3b84a;
      --bad: #ff3e36;
      --faction: #ff3e36;
      --faction-soft: rgba(255, 62, 54, 0.2);
      --cell: 68.4583px;
      --cell-x: 72.7917px;
      --cell-y: 68.4583px;
      --bottom-ui-safe-height: 184px;
      --cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
      color-scheme: dark;
      font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
    }

    .battle-contact-shadow {
      position: absolute;
      left: 50%;
      bottom: -4px;
      z-index: 0;
      width: clamp(18px, calc(var(--battle-move-size, 64px) * 0.38), 86px);
      height: clamp(5px, calc(var(--battle-move-size, 64px) * 0.085), 14px);
      translate: -50% 0;
      border-radius: 50%;
      background: radial-gradient(ellipse, rgba(25, 24, 11, .58), rgba(25,24,11,.18) 62%, transparent 80%);
      filter: blur(1.5px);
      pointer-events: none;
    }

    .battle-unit.motion-atlas-unit.motion-biped.moving,
    .battle-unit.motion-atlas-unit.motion-organic.moving {
      animation: battleMotionGroundStride calc(var(--motion-duration, 0.8s) / 2) ease-in-out infinite alternate;
    }

    .race-construction-layout {
      display: grid;
      align-content: start;
      gap: 10px;
      height: 100%;
      padding: 10px;
      overflow: auto;
      color: #d9e7ef;
      background:
        linear-gradient(180deg, rgba(8, 20, 28, 0.98), rgba(3, 8, 13, 0.99)),
        linear-gradient(90deg, rgba(39, 181, 211, 0.08), rgba(129, 82, 183, 0.06), rgba(91, 190, 96, 0.06));
    }

    .race-construction-head {
      position: relative;
      isolation: isolate;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      min-height: 112px;
      padding: 14px;
      overflow: hidden;
      border-bottom: 1px solid rgba(183, 247, 255, 0.24);
    }

    .activity-head-art {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 48%;
      pointer-events: none;
    }

    .race-construction-head::after,
    .swarm-invasion-head::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      background: linear-gradient(90deg, rgba(2, 9, 16, 0.94), rgba(4, 13, 21, 0.68) 58%, rgba(2, 8, 13, 0.84));
      pointer-events: none;
    }

    .race-construction-head > :not(.activity-head-art),
    .swarm-invasion-head > :not(.activity-head-art) {
      position: relative;
      z-index: 2;
    }

    .race-construction-head > button,
    .race-construction-kind-tabs button,
    .race-construction-submit {
      min-height: 32px;
      border: 1px solid rgba(69, 219, 255, 0.48);
      border-radius: 4px;
      background: rgba(5, 28, 39, 0.9);
      color: #dffaff;
      cursor: pointer;
    }

    .race-construction-head > button {
      padding: 0 12px;
    }

    .race-construction-head > div,
    .race-construction-viewer,
    .race-construction-donation > header,
    .race-construction-rankings > header,
    .race-construction-races > header,
    .race-construction-rewards > header {
      display: grid;
      gap: 3px;
    }

    .race-construction-head > div > span,
    .race-construction-head > div > small,
    .race-construction-viewer span,
    .race-construction-donation header span,
    .race-construction-rankings header span,
    .race-construction-races header span,
    .race-construction-rewards header span {
      color: #91a9b8;
      font-size: 10px;
    }

    .race-construction-head > div > strong {
      color: #ffffff;
      font-size: 18px;
    }

    .race-construction-viewer {
      min-width: 150px;
      text-align: right;
    }

    .race-construction-viewer strong {
      color: #ffd46b;
      font-size: 14px;
    }

    .race-construction-viewer em {
      color: #7ee8ff;
      font-size: 10px;
      font-style: normal;
    }

    .race-construction-races,
    .race-construction-donation,
    .race-construction-rankings,
    .race-construction-rewards {
      display: grid;
      align-content: start;
      gap: 8px;
      min-width: 0;
    }

    .race-construction-races > header,
    .race-construction-donation > header,
    .race-construction-rankings > header,
    .race-construction-rewards > header {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.14);
    }

    .race-construction-races > header strong,
    .race-construction-donation > header strong,
    .race-construction-rankings > header strong,
    .race-construction-rewards > header strong {
      color: #ffffff;
      font-size: 12px;
    }

    .race-construction-races > div {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .race-construction-race-row {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      min-height: 54px;
      padding: 8px 10px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      border-left-width: 3px;
      background: rgba(6, 16, 23, 0.76);
    }

    .race-construction-race-row.terran { border-left-color: #45dbff; }
    .race-construction-race-row.zerg { border-left-color: #9b6bd4; }
    .race-construction-race-row.protoss { border-left-color: #6fe27a; }

    .race-construction-race-row b {
      color: #ffd46b;
      font-size: 18px;
      text-align: center;
    }

    .race-construction-race-row div {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .race-construction-race-row strong {
      color: #ffffff;
      font-size: 12px;
    }

    .race-construction-race-row span {
      color: #91a9b8;
      font-size: 9px;
    }

    .race-construction-race-row em {
      color: #b7f7ff;
      font-size: 13px;
      font-style: normal;
    }

    .race-construction-main {
      display: grid;
      grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.4fr);
      gap: 14px;
      min-width: 0;
      padding: 10px 0;
      border-top: 1px solid rgba(183, 247, 255, 0.08);
      border-bottom: 1px solid rgba(183, 247, 255, 0.12);
    }

    .race-construction-donation {
      padding-right: 14px;
      border-right: 1px solid rgba(183, 247, 255, 0.16);
    }

    .race-construction-kind-tabs {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .race-construction-kind-tabs button.active {
      border-color: #ffd46b;
      color: #ffd46b;
      box-shadow: inset 0 -2px #ffd46b;
    }

    .race-construction-donation form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 110px;
      gap: 8px;
      align-items: end;
    }

    .race-construction-donation label {
      display: grid;
      gap: 4px;
      color: #91a9b8;
      font-size: 10px;
    }

    .race-construction-donation select,
    .race-construction-donation input {
      width: 100%;
      min-width: 0;
      height: 34px;
      padding: 0 8px;
      border: 1px solid rgba(183, 247, 255, 0.26);
      border-radius: 3px;
      background: rgba(1, 9, 15, 0.9);
      color: #ffffff;
    }

    .race-construction-balance,
    .race-construction-preview,
    .race-construction-last-reward {
      display: grid;
      gap: 3px;
      min-height: 50px;
      padding: 8px;
      border-left: 2px solid #45dbff;
      background: rgba(17, 52, 65, 0.28);
    }

    .race-construction-balance span,
    .race-construction-preview span,
    .race-construction-preview small,
    .race-construction-last-reward span {
      color: #91a9b8;
      font-size: 9px;
    }

    .race-construction-balance strong,
    .race-construction-preview strong,
    .race-construction-last-reward strong {
      color: #ffd46b;
      font-size: 13px;
    }

    .race-construction-preview,
    .race-construction-submit,
    .race-construction-last-reward {
      grid-column: 1 / -1;
    }

    .race-construction-submit {
      min-height: 36px;
      border-color: rgba(111, 226, 122, 0.56);
      background: rgba(14, 65, 31, 0.86);
      color: #eaffed;
      font-weight: 700;
    }

    .race-construction-submit:disabled {
      opacity: 0.4;
      cursor: default;
    }

    .race-construction-ranking-head,
    .race-construction-ranking-row {
      display: grid;
      grid-template-columns: 42px 42px minmax(0, 1fr) minmax(86px, auto);
      gap: 6px;
      align-items: center;
      min-height: 28px;
      padding: 0 8px;
    }

    .race-construction-ranking-head {
      color: #6f8796;
      font-size: 9px;
    }

    .race-construction-ranking-list {
      display: grid;
      max-height: 260px;
      overflow: auto;
      border-top: 1px solid rgba(183, 247, 255, 0.14);
    }

    .race-construction-ranking-row {
      border-bottom: 1px solid rgba(183, 247, 255, 0.08);
      color: #c8d9e3;
      font-size: 10px;
    }

    .race-construction-ranking-row.viewer {
      background: rgba(255, 212, 107, 0.08);
    }

    .race-construction-ranking-row b {
      color: #ffd46b;
      text-align: center;
    }

    .race-construction-ranking-row strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .race-construction-ranking-row em {
      color: #b7f7ff;
      font-style: normal;
      text-align: right;
    }

    .race-dot {
      width: 10px;
      height: 10px;
      border: 1px solid rgba(255, 255, 255, 0.5);
      border-radius: 50%;
      justify-self: center;
    }

    .race-dot.terran { background: #45dbff; }
    .race-dot.zerg { background: #9b6bd4; }
    .race-dot.protoss { background: #6fe27a; }

    .race-construction-empty {
      padding: 18px 8px;
      color: #6f8796;
      font-size: 10px;
      text-align: center;
    }

    .race-construction-reward-columns {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .race-construction-reward-columns > div {
      display: grid;
      align-content: start;
    }

    .race-construction-reward-columns > div > div {
      display: grid;
      grid-template-columns: 86px minmax(0, 1fr);
      gap: 8px;
      padding: 5px 0;
      border-bottom: 1px solid rgba(183, 247, 255, 0.08);
    }

    .race-construction-reward-columns strong {
      color: #ffd46b;
      font-size: 10px;
    }

    .race-construction-reward-columns span {
      color: #9eb3bf;
      font-size: 9px;
      line-height: 14px;
    }

    @media (max-width: 900px) {
      .race-construction-head {
        grid-template-columns: auto minmax(0, 1fr);
      }

      .race-construction-viewer {
        grid-column: 1 / -1;
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
        min-width: 0;
        text-align: left;
      }

      .race-construction-viewer em {
        text-align: right;
      }

      .race-construction-races > div,
      .race-construction-main,
      .race-construction-reward-columns {
        grid-template-columns: 1fr;
      }

      .race-construction-donation {
        padding-right: 0;
        padding-bottom: 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(183, 247, 255, 0.16);
      }

      .race-construction-ranking-head,
      .race-construction-ranking-row {
        grid-template-columns: 36px 34px minmax(0, 1fr) minmax(76px, auto);
      }

      .race-construction-reward-columns > div > div {
        grid-template-columns: 78px minmax(0, 1fr);
      }
    }

    .swarm-invasion-layout {
      display: grid;
      align-content: start;
      gap: 10px;
      height: 100%;
      padding: 10px;
      overflow: auto;
      color: #d9e8ef;
      background: linear-gradient(180deg, rgba(8, 17, 23, 0.99), rgba(3, 8, 11, 0.99));
    }

    .swarm-invasion-head {
      position: relative;
      isolation: isolate;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 12px;
      align-items: center;
      min-height: 112px;
      padding: 14px;
      overflow: hidden;
      border-bottom: 1px solid rgba(120, 230, 202, 0.24);
    }

    .swarm-invasion-head .activity-head-art {
      object-position: center 43%;
    }

    .swarm-invasion-head > button,
    .swarm-garrison-actions > button:last-child,
    .swarm-support-control > button,
    .swarm-command-band > button {
      min-height: 34px;
      padding: 0 12px;
      border: 1px solid rgba(66, 209, 183, 0.5);
      border-radius: 4px;
      background: rgba(7, 43, 39, 0.9);
      color: #dffff7;
      cursor: pointer;
    }

    .swarm-invasion-head > div,
    .swarm-wave-status,
    .swarm-garrison-panel > header > div,
    .swarm-coordination-panel > header > div,
    .swarm-support-panel > header > div {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .swarm-invasion-head > div > span,
    .swarm-invasion-head > div > small,
    .swarm-wave-status span,
    .swarm-garrison-panel > header span,
    .swarm-coordination-panel > header span,
    .swarm-support-panel > header span {
      color: #8fa7ad;
      font-size: 10px;
    }

    .swarm-invasion-head > div > strong {
      color: #ffffff;
      font-size: 18px;
    }

    .swarm-wave-status {
      min-width: 210px;
      text-align: right;
    }

    .swarm-wave-status strong {
      color: #ffcf66;
      font-size: 13px;
    }

    .swarm-wave-status em {
      color: #74e6cb;
      font-size: 10px;
      font-style: normal;
    }

    .swarm-summary-band {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      border-top: 1px solid rgba(151, 239, 220, 0.12);
      border-bottom: 1px solid rgba(151, 239, 220, 0.12);
      background: rgba(8, 25, 27, 0.7);
    }

    .swarm-summary-band > div {
      display: grid;
      gap: 3px;
      min-width: 0;
      padding: 8px 10px;
      border-right: 1px solid rgba(151, 239, 220, 0.1);
    }

    .swarm-summary-band > div:last-child {
      border-right: 0;
    }

    .swarm-summary-band span {
      color: #789096;
      font-size: 9px;
    }

    .swarm-summary-band strong {
      color: #dffdf6;
      font-size: 13px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .swarm-main-grid {
      display: grid;
      grid-template-columns: minmax(300px, 1.05fr) minmax(260px, 0.9fr) minmax(300px, 1fr);
      gap: 12px;
      min-width: 0;
    }

    .swarm-garrison-panel,
    .swarm-coordination-panel,
    .swarm-support-panel,
    .swarm-report-panel {
      display: grid;
      align-content: start;
      gap: 8px;
      min-width: 0;
      padding: 10px;
      border: 1px solid rgba(151, 239, 220, 0.14);
      border-radius: 4px;
      background: rgba(5, 14, 17, 0.72);
    }

    .swarm-garrison-panel > header,
    .swarm-coordination-panel > header,
    .swarm-support-panel > header,
    .swarm-report-panel > header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      gap: 8px;
      min-height: 34px;
      padding-bottom: 7px;
      border-bottom: 1px solid rgba(151, 239, 220, 0.13);
    }

    .swarm-garrison-panel > header strong,
    .swarm-coordination-panel > header strong,
    .swarm-support-panel > header strong,
    .swarm-report-panel > header strong {
      color: #ffffff;
      font-size: 12px;
    }

    .swarm-garrison-panel > header b,
    .swarm-coordination-panel > header b {
      color: #ffcf66;
      font-size: 13px;
    }

    .swarm-garrison-list {
      display: grid;
      gap: 6px;
      min-height: 132px;
    }

    .swarm-garrison-row {
      display: grid;
      grid-template-columns: 24px minmax(128px, 1fr) 92px 28px;
      gap: 6px;
      align-items: end;
      min-width: 0;
      min-height: 40px;
      padding: 5px 0;
      border-bottom: 1px solid rgba(151, 239, 220, 0.08);
    }

    .swarm-garrison-row.invalid {
      border-bottom-color: rgba(255, 91, 91, 0.5);
    }

    .swarm-slot-index {
      display: grid;
      place-items: center;
      width: 22px;
      height: 30px;
      border-left: 2px solid #42d1b7;
      background: rgba(24, 76, 67, 0.34);
      color: #9ff5e4;
      font-size: 11px;
    }

    .swarm-garrison-row label,
    .swarm-support-control label {
      display: grid;
      gap: 3px;
      min-width: 0;
      color: #81989e;
      font-size: 9px;
    }

    .swarm-garrison-row select,
    .swarm-garrison-row input,
    .swarm-support-control select {
      width: 100%;
      min-width: 0;
      height: 30px;
      padding: 0 7px;
      border: 1px solid rgba(151, 239, 220, 0.24);
      border-radius: 3px;
      background: rgba(1, 9, 11, 0.95);
      color: #eefefb;
      font-size: 10px;
    }

    .swarm-icon-button {
      display: grid;
      place-items: center;
      width: 28px;
      height: 30px;
      padding: 0;
      border: 1px solid rgba(255, 114, 114, 0.42);
      border-radius: 3px;
      background: rgba(65, 17, 17, 0.72);
      color: #ffb3b3;
      font-size: 18px;
      cursor: pointer;
    }

    .swarm-icon-button.add {
      border-color: rgba(66, 209, 183, 0.5);
      background: rgba(7, 43, 39, 0.9);
      color: #9ff5e4;
    }

    .swarm-icon-button:disabled,
    .swarm-garrison-actions button:disabled,
    .swarm-command-band button:disabled {
      opacity: 0.38;
      cursor: default;
    }

    .swarm-garrison-actions {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      gap: 7px;
      align-items: center;
    }

    .swarm-garrison-actions > span {
      min-width: 0;
      color: #81989e;
      font-size: 9px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .swarm-branch-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 5px;
    }

    .swarm-branch {
      display: grid;
      justify-items: center;
      gap: 3px;
      min-width: 0;
      min-height: 70px;
      padding: 8px 4px;
      border: 1px solid rgba(122, 143, 148, 0.2);
      background: rgba(10, 18, 21, 0.8);
      color: #65777c;
    }

    .swarm-branch i {
      width: 18px;
      height: 18px;
      border: 2px solid currentColor;
      transform: rotate(45deg);
    }

    .swarm-branch strong {
      color: inherit;
      font-size: 10px;
    }

    .swarm-branch span {
      color: inherit;
      font-size: 8px;
      text-align: center;
    }

    .swarm-branch.active {
      border-color: rgba(66, 209, 183, 0.48);
      color: #74e6cb;
      background: rgba(12, 55, 48, 0.5);
    }

    .swarm-branch.weakness {
      box-shadow: inset 0 -3px #ffcf66;
    }

    .swarm-bonus-lines {
      display: grid;
      border-top: 1px solid rgba(151, 239, 220, 0.1);
    }

    .swarm-bonus-lines > div {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      padding: 6px 2px;
      border-bottom: 1px solid rgba(151, 239, 220, 0.08);
      font-size: 10px;
    }

    .swarm-bonus-lines span {
      color: #81989e;
    }

    .swarm-bonus-lines strong {
      color: #ffcf66;
    }

    .swarm-power-compare {
      display: grid;
      gap: 5px;
      padding: 7px;
      background: rgba(18, 44, 42, 0.35);
    }

    .swarm-power-compare > div:first-child {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: #9cb2b6;
      font-size: 9px;
    }

    .swarm-power-bar {
      height: 7px;
      overflow: hidden;
      border: 1px solid rgba(151, 239, 220, 0.2);
      background: rgba(0, 0, 0, 0.65);
    }

    .swarm-power-bar i {
      display: block;
      height: 100%;
      background: #e15757;
    }

    .swarm-power-bar i.ready {
      background: #42d1b7;
    }

    .swarm-power-compare > strong {
      color: #dffdf6;
      font-size: 10px;
      text-align: right;
    }

    .swarm-medical-line {
      display: grid;
      grid-template-columns: auto auto;
      gap: 3px 8px;
      padding: 7px;
      border-left: 2px solid #68b8ff;
      background: rgba(20, 48, 73, 0.34);
    }

    .swarm-enemy-composition {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      min-height: 34px;
      padding: 7px 10px;
      border: 1px solid rgba(186, 198, 220, 0.18);
      background: rgba(8, 12, 20, 0.45);
      font-size: 12px;
    }

    .swarm-enemy-composition span {
      color: #9aa8be;
    }

    .swarm-enemy-composition strong {
      min-width: 0;
      overflow: hidden;
      color: #e6edf8;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .swarm-medical-line span,
    .swarm-medical-line em {
      color: #8ca8bb;
      font-size: 9px;
    }

    .swarm-medical-line strong {
      color: #b9ddff;
      font-size: 10px;
      text-align: right;
    }

    .swarm-medical-line em {
      grid-column: 1 / -1;
      font-style: normal;
    }

    .swarm-support-control {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 7px;
      align-items: end;
    }

    .swarm-member-list {
      display: grid;
      max-height: 212px;
      overflow: auto;
      border-top: 1px solid rgba(151, 239, 220, 0.1);
    }

    .swarm-member-row {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) minmax(78px, auto);
      gap: 7px;
      align-items: center;
      min-height: 42px;
      padding: 5px 2px;
      border-bottom: 1px solid rgba(151, 239, 220, 0.08);
    }

    .swarm-member-row.viewer {
      background: rgba(66, 209, 183, 0.07);
    }

    .swarm-member-role {
      display: grid;
      place-items: center;
      width: 22px;
      height: 22px;
      border: 1px solid rgba(255, 207, 102, 0.5);
      color: #ffcf66;
      font-size: 9px;
    }

    .swarm-member-row > div {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .swarm-member-row strong {
      min-width: 0;
      color: #e9fbf7;
      font-size: 10px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .swarm-member-row span,
    .swarm-member-row em {
      color: #7f969b;
      font-size: 8px;
      font-style: normal;
    }

    .swarm-member-row em {
      color: #9fcfc3;
      text-align: right;
    }

    .swarm-command-band {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 8px;
      align-items: center;
      min-height: 54px;
      padding: 8px 10px;
      border-top: 1px solid rgba(255, 207, 102, 0.22);
      border-bottom: 1px solid rgba(255, 207, 102, 0.22);
      background: rgba(43, 34, 12, 0.34);
    }

    .swarm-command-band > div {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .swarm-command-band span {
      color: #a79871;
      font-size: 9px;
    }

    .swarm-command-band strong {
      color: #ffdf91;
      font-size: 10px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .swarm-command-band > button {
      min-width: 120px;
      border-color: rgba(255, 207, 102, 0.58);
      background: rgba(85, 56, 11, 0.88);
      color: #fff0bf;
      font-weight: 700;
    }

    .swarm-command-band > button.reward {
      border-color: rgba(66, 209, 183, 0.58);
      background: rgba(7, 63, 53, 0.9);
      color: #dffff7;
    }

    .swarm-claimed {
      color: #74e6cb !important;
    }

    .swarm-report-panel > header span {
      color: #81989e;
      font-size: 9px;
    }

    .swarm-report-list {
      display: grid;
      gap: 4px;
      max-height: 310px;
      overflow: auto;
    }

    .swarm-report-entry {
      border: 1px solid rgba(151, 239, 220, 0.12);
      background: rgba(0, 0, 0, 0.2);
    }

    .swarm-report-entry.latest {
      border-color: rgba(255, 207, 102, 0.58);
      box-shadow: inset 0 0 14px rgba(255, 207, 102, 0.08);
    }

    .swarm-report-row {
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr) minmax(100px, auto) 66px;
      gap: 8px;
      align-items: center;
      min-height: 38px;
      padding: 5px 6px;
      border-bottom: 1px solid rgba(151, 239, 220, 0.08);
      font-size: 9px;
    }

    .swarm-report-row > span {
      color: #8fa7ad;
    }

    .swarm-report-row > div {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .swarm-report-row strong {
      color: #e9fbf7;
      font-size: 10px;
    }

    .swarm-report-row small,
    .swarm-report-row em,
    .swarm-report-row i {
      color: #80969b;
      font-size: 8px;
      font-style: normal;
    }

    .swarm-report-row em,
    .swarm-report-row i {
      text-align: right;
    }

    .swarm-report-row b {
      color: #e15757;
      text-align: center;
    }

    .swarm-report-entry.success .swarm-report-row b {
      color: #74e6cb;
    }

    .swarm-report-metrics {
      display: grid;
      grid-template-columns: repeat(3, minmax(72px, 0.35fr)) minmax(180px, 1fr);
      gap: 5px;
      padding: 5px 6px;
      border-top: 1px solid rgba(151, 239, 220, 0.08);
    }

    .swarm-report-metrics > span {
      display: grid;
      gap: 1px;
      padding: 4px 5px;
      background: rgba(7, 25, 29, 0.58);
    }

    .swarm-report-metrics em {
      color: #748b91;
      font-size: 8px;
      font-style: normal;
    }

    .swarm-report-metrics strong {
      color: #e9fbf7;
      font-size: 10px;
    }

    .swarm-report-metrics .reward strong {
      color: #ffd77f;
      white-space: normal;
    }

    .swarm-report-loss-list {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px;
      padding: 0 6px 6px;
    }

    .swarm-report-loss-list > span {
      display: grid;
      gap: 1px;
      min-width: 0;
      padding: 4px 5px;
      border-left: 2px solid rgba(225, 87, 87, 0.42);
      background: rgba(45, 12, 15, 0.24);
    }

    .swarm-report-loss-list strong,
    .swarm-report-loss-list em {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .swarm-report-loss-list strong {
      color: #e9fbf7;
      font-size: 9px;
    }

    .swarm-report-loss-list em {
      color: #b78f91;
      font-size: 8px;
      font-style: normal;
    }

    .swarm-empty-row,
    .swarm-no-guild {
      display: grid;
      place-content: center;
      gap: 5px;
      min-height: 96px;
      color: #71868b;
      font-size: 10px;
      text-align: center;
    }

    .swarm-no-guild {
      min-height: 260px;
    }

    .swarm-no-guild strong {
      color: #e9fbf7;
      font-size: 14px;
    }

    @media (max-width: 1100px) {
      .swarm-main-grid {
        grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 0.9fr);
      }

      .swarm-support-panel {
        grid-column: 1 / -1;
      }

      .swarm-member-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 760px) {
      .swarm-invasion-head {
        grid-template-columns: auto minmax(0, 1fr);
        align-content: start;
        min-height: 126px;
      }

      .swarm-wave-status {
        grid-column: 1 / -1;
        min-width: 0;
        text-align: left;
      }

      .swarm-summary-band {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .swarm-summary-band > div:nth-child(even) {
        border-right: 0;
      }

      .swarm-main-grid {
        grid-template-columns: 1fr;
      }

      .swarm-support-panel {
        grid-column: auto;
      }

      .swarm-member-list {
        grid-template-columns: 1fr;
      }

      .swarm-garrison-row {
        grid-template-columns: 22px minmax(0, 1fr) 28px;
      }

      .swarm-garrison-row label:nth-of-type(2) {
        grid-column: 2 / 3;
      }

      .swarm-garrison-row > button {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
      }

      .swarm-command-band {
        grid-template-columns: 1fr;
        grid-template-rows: auto 34px;
        min-height: 96px;
        align-items: stretch;
      }

      .swarm-command-band > button {
        width: 100%;
      }

      .swarm-report-row {
        grid-template-columns: 48px minmax(0, 1fr) 64px;
      }

      .swarm-report-row em,
      .swarm-report-row i {
        display: none;
      }

      .swarm-report-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .swarm-report-metrics .reward {
        grid-column: 1 / -1;
      }

      .swarm-report-loss-list {
        grid-template-columns: 1fr;
      }
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      background:
        radial-gradient(circle at 28% 18%, rgba(32, 216, 255, 0.13), transparent 28%),
        radial-gradient(circle at 72% 62%, rgba(98, 240, 106, 0.08), transparent 25%),
        linear-gradient(180deg, #07101f 0%, #050916 62%, #03050b 100%);
      overflow: hidden;
    }

    button {
      font: inherit;
      color: inherit;
    }

    .app {
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: 34px 1fr;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
    }

    .topbar,
    .leftbar,
    .rightbar,
    .bottombar {
      background: var(--panel);
      border-color: var(--line);
      border-style: solid;
      box-shadow: inset 0 0 0 1px rgba(32, 216, 255, 0.06);
    }

    .topbar {
      position: relative;
      z-index: 40;
      grid-column: 1;
      display: grid;
      grid-template-columns: 148px minmax(470px, 1fr) auto auto;
      align-items: center;
      border-width: 0 0 1px;
      min-width: 0;
    }

    .leftbar,
    .rightbar {
      display: none;
    }

    .bottombar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 16;
      height: var(--bottom-ui-safe-height);
      display: grid;
      grid-template-columns: 220px 70px minmax(420px, 1fr) 180px minmax(340px, 360px);
      gap: 4px;
      align-items: stretch;
      padding: 5px 7px 6px;
      border-width: 2px 0 0;
      border-color: rgba(185, 232, 255, 0.75);
      background:
        linear-gradient(180deg, rgba(48, 63, 66, 0.78), rgba(3, 8, 15, 0.96) 18%, rgba(0, 0, 0, 0.94)),
        linear-gradient(90deg, rgba(185, 232, 255, 0.18), transparent 18%, transparent 82%, rgba(185, 232, 255, 0.16));
      box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.85), 0 -10px 26px rgba(0, 0, 0, 0.4);
      pointer-events: auto;
    }

    .brand {
      display: flex;
      align-items: center;
      height: 100%;
      padding: 0 18px;
      gap: 10px;
      border-right: 1px solid var(--line);
      color: #b7f7ff;
      font-weight: 700;
      letter-spacing: 0;
    }

    .brand-mark {
      width: 26px;
      height: 26px;
      clip-path: polygon(50% 0, 100% 32%, 82% 100%, 18% 100%, 0 32%);
      background: linear-gradient(135deg, var(--faction), var(--line-bright));
      box-shadow: 0 0 18px var(--faction-soft);
    }

    .resources {
      display: flex;
      gap: 4px;
      min-width: 0;
      padding: 0 6px;
      overflow-x: auto;
      overflow-y: hidden;
    }

    .resource {
      display: flex;
      align-items: center;
      flex: 1 0 auto;
      min-width: max-content;
      height: 30px;
      padding: 0 6px 0 4px;
      gap: 6px;
      color: #b7f7ff;
      background: rgba(5, 9, 22, 0.55);
      border: 1px solid rgba(44, 70, 95, 0.9);
      clip-path: var(--cut);
      font-size: 12px;
    }

    .resource span,
    .resource strong {
      white-space: nowrap;
    }

    .resource strong {
      flex: 0 0 auto;
      font-variant-numeric: tabular-nums;
    }

    .topbar .resources .resource > span { display: none; }
    .topbar .resources .resource i, .topbar .resources .resource i img {
      width: 24px; height: 24px; border: 0; filter: none; border-radius: 0;
    }
    .topbar .resources .resource[data-resource-key="money"] { order: 1; }
    .topbar .resources .resource[data-resource-key="honor"] { order: 2; }
    .resource-values { display: grid; align-content: center; text-align: left; font-variant-numeric: tabular-nums; }
    .resources .resource-values strong, .resource-values small { font-size: 11px; line-height: 12px; }
    .resource-limit, .population-limit { color: #d9dce2; font-weight: 400; }
    .resources .resource.storage-full .resource-values strong { color: #ff5b57; }

    .queue-item.storage-full span { color: #ffd486; }

    .resources:focus-visible {
      outline: 1px solid var(--line-bright);
      outline-offset: -1px;
    }

    @media (min-width: 901px) and (max-width: 1600px) {
      .topbar .resource span { display: none; }
    }

    .resource i,
    .stat i,
    .action-icon {
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      width: 16px;
      height: 16px;
      border: 1px solid currentColor;
      color: var(--line-bright);
      font-style: normal;
      font-size: 10px;
      line-height: 1;
    }

    .resource i img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      display: block;
    }

    .resource i {
      width: 24px;
      height: 24px;
      border: 0;
      background: transparent !important;
      filter: drop-shadow(0 0 5px rgba(120, 229, 255, 0.32));
    }

    .resource:nth-child(1) i {
      color: #78e5ff;
    }

    .resource:nth-child(2) i {
      color: #9cff78;
    }

    .resource:nth-child(3) i {
      color: #ffe18a;
    }

    .resource:nth-child(4) i {
      color: #d6eeff;
    }

    .resource:nth-child(5) i {
      color: #ffdfb0;
    }

    .resource:nth-child(6) i {
      color: #f2f7ff;
    }

    .resource:nth-child(7) i {
      color: #fff9ba;
    }

    .resource:nth-child(8) i {
      color: #ffd46a;
    }

    .faction-tabs {
      display: flex;
      align-items: center;
      gap: 3px;
      height: 100%;
      padding: 0 7px;
      border-right: 1px solid var(--line);
      white-space: nowrap;
    }

    .faction-tabs .tab {
      min-width: 46px;
      height: 28px;
      padding: 0 7px;
      color: var(--muted);
      border-color: rgba(105, 135, 160, 0.72);
      background: rgba(5, 9, 22, 0.78);
      font-size: 12px;
    }

    .faction-tabs .tab:hover {
      color: #ffffff;
      border-color: var(--tab-color, var(--line-bright));
      box-shadow: 0 0 9px var(--tab-soft, rgba(32, 216, 255, 0.2));
    }

    .faction-tabs .tab.active {
      color: #ffffff;
      border-color: var(--tab-color, var(--faction));
      background: var(--tab-soft, var(--faction-soft));
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 9px var(--tab-soft, var(--faction-soft));
    }

    .system-nav {
      display: flex;
      gap: 4px;
      padding: 0 6px;
      border-left: 1px solid var(--line);
      white-space: nowrap;
      min-width: 0;
    }

    .system-button,
    .hud-button {
      min-width: 44px;
      height: 28px;
      padding: 0 8px;
      color: var(--text);
      background: rgba(5, 9, 22, 0.78);
      border: 1px solid var(--line);
      clip-path: var(--cut);
      cursor: pointer;
      font-size: 12px;
    }

    .system-button {
      color: #f5fbff;
      background: linear-gradient(180deg, rgba(38, 96, 188, 0.92), rgba(8, 20, 55, 0.92));
      border-color: rgba(205, 232, 255, 0.74);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    .system-button[data-feature="情报"] { position: relative; }
    .intel-unread-dot {
      position: absolute;
      right: 4px;
      bottom: 4px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #ff493e;
      box-shadow: 0 0 5px #bc2b22;
      pointer-events: none;
    }

    .system-button:hover,
    .hud-button:hover {
      border-color: var(--line-bright);
      box-shadow: 0 0 14px rgba(32, 216, 255, 0.2);
    }

    .activity-lore-strip {
      display: grid;
      gap: 4px;
      margin: 10px 12px 0;
      padding: 9px 12px;
      border-left: 2px solid rgba(183, 247, 255, 0.62);
      background: rgba(6, 21, 45, 0.62);
      color: #d9f8ff;
    }

    .activity-lore-strip strong {
      color: #fff1ad;
      font-size: 13px;
    }

    .activity-lore-strip span {
      color: #a8cedd;
      font-size: 12px;
      line-height: 1.55;
    }

    .tab,
    .build-button,
    .command-button {
      height: 34px;
      border: 1px solid var(--line);
      background: rgba(10, 20, 34, 0.92);
      clip-path: var(--cut);
      cursor: pointer;
      transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    }

    .tab {
      min-width: 72px;
      padding: 0 8px;
      color: var(--muted);
    }

    .tab:hover,
    .build-button:hover,
    .command-button:hover {
      border-color: var(--line-bright);
      box-shadow: 0 0 14px rgba(32, 216, 255, 0.22);
    }

    .tab.active {
      color: var(--text);
      border-color: var(--faction);
      background: var(--faction-soft);
    }

    .leftbar {
      grid-column: 1;
      grid-row: 2 / 4;
      display: grid;
      grid-template-rows: auto 1fr;
      border-width: 0 1px 0 0;
      min-height: 0;
    }

    .panel-title {
      height: 42px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 14px;
      border-bottom: 1px solid var(--line);
      color: #b7f7ff;
      font-size: 14px;
      font-weight: 700;
    }

    .catalog {
      min-height: 0;
      overflow: auto;
      padding: 10px;
    }

    .build-button {
      display: grid;
      grid-template-columns: 42px 1fr;
      align-items: center;
      width: 100%;
      height: 72px;
      margin-bottom: 8px;
      padding: 8px;
      color: var(--text);
      text-align: left;
    }

    .build-button.active {
      border-color: var(--faction);
      background: linear-gradient(90deg, var(--faction-soft), rgba(10, 20, 34, 0.92));
    }

    .build-button.disabled {
      opacity: 0.42;
      cursor: default;
      box-shadow: none;
    }

    .build-icon {
      position: relative;
      width: 34px;
      height: 34px;
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .build-icon img,
    .build-pick-icon,
    .console-icon img,
    .nav-icon img,
    .chat-button img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .build-copy strong {
      display: block;
      font-size: 13px;
      font-weight: 700;
      line-height: 18px;
    }

    .build-copy span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      line-height: 18px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .stage-wrap {
      grid-column: 1;
      grid-row: 2;
      position: relative;
      overflow: hidden;
      background:
        linear-gradient(rgba(32, 216, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 216, 255, 0.04) 1px, transparent 1px),
        #07101d;
      background-size: 48px 48px, 48px 48px, auto;
    }

    .timed-item-hud {
      position: absolute;
      z-index: 14;
      top: var(--timed-item-hud-top, 5px);
      right: 7px;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 4px;
      width: max-content;
      max-width: min(47vw, 480px);
      max-height: 124px;
      margin: 0;
      padding: 1px;
      overflow: auto;
      list-style: none;
    }

    .timed-item-hud[hidden] { display: none; }
    .timed-item-hud li {
      display: grid;
      justify-items: center;
      gap: 2px;
      min-width: 45px;
      padding: 2px 3px;
      color: #e4f6ff;
      background: linear-gradient(#172d43e8, #071320ef);
      border: 1px solid #4d6b88;
      box-shadow: inset 0 1px #7794ad40, 0 1px 2px #000b;
    }

    .timed-item-hud li:focus-visible { outline: 1px solid #9ce7ff; outline-offset: -1px; }
    .timed-item-hud :is(img, .original-shop-icon) { width: 24px; height: 24px; object-fit: contain; }
    .timed-item-hud time {
      font-size: 10px;
      font-variant-numeric: tabular-nums;
      line-height: 1.1;
      white-space: nowrap;
      text-shadow: 0 1px 2px #000;
    }
    @media (max-width: 1020px) {
      .timed-item-hud { max-width: min(72vw, 480px); }
    }

    .city-jump-rail,
    .city-function-rail,
    .mission-panel,
    .resource-callout,
    .main-console {
      position: absolute;
      z-index: 12;
      pointer-events: none;
    }

    .mission-panel {
      left: 14px;
      top: 18px;
      z-index: 64;
      display: grid;
      grid-template-columns: 42px 1fr;
      gap: 8px;
      align-items: center;
      min-width: 220px;
      color: #f2f7df;
      text-shadow: 0 1px 2px #000;
      font-size: 13px;
      pointer-events: auto;
    }

    .newbie-guide {
      position: absolute;
      left: 14px;
      top: 68px;
      z-index: 60;
      width: min(300px, calc(100% - 28px));
      min-height: 38px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      padding: 6px 7px 6px 9px;
      border: 1px solid rgba(105, 204, 255, 0.58);
      border-left: 3px solid #69ccff;
      background: rgba(3, 15, 24, 0.92);
      box-shadow: 0 7px 18px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(196, 235, 255, 0.1);
      color: #e7f7ff;
      pointer-events: auto;
    }

    .newbie-guide[hidden] {
      display: none;
    }

    body:has(.feature-modal.open > :is(.guild-panel, .system-feature-view, .dungeon-feature-view,
      .equipment-enhance-view, .star-transfer-view, .forge-gem-view)) :is(.mission-panel, .newbie-guide) {
      display: none;
    }

    body:has(.feature-modal.open > .formation-screen) .mission-panel,
    body:has(.feature-modal.open > .formation-screen) .newbie-guide:not(:has(#newbieGuideAction[data-newbie-guide-mission="newbie-formation"])) {
      display: none;
    }

    body:has(.feature-modal.open > .formation-screen) .newbie-guide:has(#newbieGuideAction[data-newbie-guide-mission="newbie-formation"]) {
      position: fixed;
      top: auto;
      bottom: 12px;
    }

    body:has(.hero-detail-dialog.open) .newbie-guide {
      visibility: hidden;
    }

    body:has(.feature-modal.open .tech-side) .mission-panel,
    body:has(.feature-modal.open .tech-side) .newbie-guide:has(#newbieGuideAction[data-newbie-guide-mission^="base-"]) {
      display: none;
    }

    .newbie-guide.ready {
      border-color: rgba(255, 210, 92, 0.72);
      border-left-color: #ffd25c;
    }

    .newbie-guide-copy {
      min-width: 0;
    }

    .newbie-guide-copy span,
    .newbie-guide-copy strong {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .newbie-guide-copy span {
      color: #8fcbe8;
      font-size: 10px;
      line-height: 13px;
    }

    .newbie-guide-copy strong {
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
    }

    .stage-wrap:has(#planetView.open .i1-board) #newbieGuide:not([hidden]):has([data-newbie-guide-mission="newbie-planet"], [data-newbie-guide-mission="newbie-camp"], [data-newbie-guide-mission="newbie-battle"]) {
      display: grid !important;
    }
    .stage-wrap:has(#planetView.open .i1-board) #newbieGuide:has([data-newbie-guide-mission="newbie-camp"]) + #newbieGuidePointer:not([hidden]) {
      display: block !important;
    }

    .newbie-guide-copy small {
      display: block;
      margin-top: 3px;
      color: #bfd6df;
      font-size: 11px;
      line-height: 1.45;
    }

    .newbie-guide-copy time { color: #ffdf8a; font-variant-numeric: tabular-nums; }
    #newbieGuideCell {
      position: absolute;
      z-index: 28;
      width: var(--cell-x);
      height: var(--cell-y);
      box-sizing: border-box;
      pointer-events: none;
      border: 2px dashed #ffda72;
      background: rgba(255, 206, 70, .25);
    }
    #newbieGuideCell[hidden] { display: none; }

    .newbie-guide-copy #newbieGuideHint { display: inline; white-space: normal; color: inherit; font: inherit; }

    .newbie-guide button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-width: 64px;
      height: 28px;
      padding: 0 8px;
      border: 1px solid rgba(105, 204, 255, 0.68);
      background: #09263a;
      color: #ffffff;
      font-size: 11px;
      line-height: 1;
      cursor: pointer;
    }

    #newbieGuideActionIcon {
      font-size: 17px;
      line-height: 1;
    }

    .newbie-guide button:disabled {
      opacity: 0.62;
      cursor: wait;
    }

    .newbie-guide.ready button {
      border-color: rgba(255, 210, 92, 0.78);
      background: #4a3108;
      color: #ffe89b;
    }

    @keyframes newbie-guide-pulse {
      0%, 100% { outline-color: rgba(255, 220, 96, 0.42); box-shadow: 0 0 0 rgba(255, 220, 96, 0); }
      50% { outline-color: rgba(255, 220, 96, 1); box-shadow: 0 0 18px rgba(255, 220, 96, 0.42); }
    }

    .newbie-guide-target {
      --newbie-guide-accent: color-mix(in srgb, var(--faction, #ffd25c), white 24%);
      outline: 2px solid var(--newbie-guide-accent) !important;
      outline-offset: 2px;
      animation: newbie-guide-pulse 1.1s ease-in-out infinite;
    }

    .newbie-guide-pointer {
      --newbie-pointer-accent: #69ccff;
      --newbie-pointer-bg: rgba(3, 19, 30, 0.96);
      position: fixed;
      left: 0;
      top: 0;
      z-index: 160;
      max-width: min(220px, calc(100vw - 16px));
      padding: 7px 10px;
      border: 1px solid color-mix(in srgb, var(--newbie-pointer-accent), white 18%);
      border-left: 3px solid var(--newbie-pointer-accent);
      background: var(--newbie-pointer-bg);
      box-shadow: 0 5px 16px rgba(0, 0, 0, 0.5), 0 0 14px color-mix(in srgb, var(--newbie-pointer-accent), transparent 66%);
      color: #ffffff;
      pointer-events: none;
      visibility: hidden;
      will-change: transform;
    }

    .newbie-guide-pointer[hidden] {
      display: none;
    }

    .newbie-guide-pointer[data-faction="zerg"] {
      --newbie-pointer-accent: #ff6c88;
      --newbie-pointer-bg: rgba(31, 5, 17, 0.96);
    }

    .newbie-guide-pointer[data-faction="protoss"] {
      --newbie-pointer-accent: #ffd25c;
      --newbie-pointer-bg: rgba(31, 24, 3, 0.96);
    }

    .newbie-guide-pointer-label {
      display: block;
      overflow: hidden;
      color: #ffffff;
      font-size: 12px;
      font-weight: 700;
      line-height: 17px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .newbie-guide-pointer-arrow {
      position: absolute;
      width: 30px;
      height: 22px;
      background: var(--newbie-pointer-accent);
      clip-path: polygon(0 34%, 56% 34%, 56% 0, 100% 50%, 56% 100%, 56% 66%, 0 66%);
      filter: drop-shadow(0 0 5px color-mix(in srgb, var(--newbie-pointer-accent), white 12%));
      animation: newbie-guide-pointer-glow 0.82s ease-in-out infinite alternate;
    }

    .newbie-guide-pointer[data-side="top"] .newbie-guide-pointer-arrow {
      left: 50%;
      top: calc(100% + 7px);
      transform: translate(-50%, -50%) rotate(90deg);
    }

    .newbie-guide-pointer[data-side="bottom"] .newbie-guide-pointer-arrow {
      left: 50%;
      bottom: calc(100% + 7px);
      transform: translate(-50%, 50%) rotate(-90deg);
    }

    .newbie-guide-pointer[data-side="left"] .newbie-guide-pointer-arrow {
      left: calc(100% + 7px);
      top: 50%;
      transform: translate(-50%, -50%);
    }

    .newbie-guide-pointer[data-side="right"] .newbie-guide-pointer-arrow {
      right: calc(100% + 7px);
      top: 50%;
      transform: translate(50%, -50%) rotate(180deg);
    }

    @keyframes newbie-guide-pointer-glow {
      from { opacity: 0.68; }
      to { opacity: 1; }
    }

    @media (max-width: 560px) {
      .newbie-guide-pointer {
        max-width: min(180px, calc(100vw - 16px));
        padding: 6px 8px;
      }
    }

      .vip-system-button {
        color: #ffd46b;
        border-color: rgba(255, 212, 107, 0.58);
        background: rgba(79, 49, 7, 0.32);
      }

      .plan-task-dialog {
        position: fixed;
        left: 50%;
        top: 50%;
        z-index: 70;
        display: none;
        width: min(360px, calc(100% - 32px));
        max-height: min(800px, calc(100vh - 32px));
        transform: translate(-50%, -50%);
        grid-template-rows: 46px minmax(0, 1fr);
        overflow: hidden;
        border: 1px solid;
        border-radius: 6px;
      }

      .plan-task-dialog.open { display: grid; }
      .plan-task-dialog.multiplan { width: min(720px, calc(100% - 32px)); }
      .plan-task-dialog.multiplan .plan-task-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
      .plan-task-group { display: grid; align-content: start; gap: 10px; min-width: 0; }
      .plan-task-group:empty { display: none; }
      @media (max-width: 640px) {
        .plan-task-dialog.multiplan .plan-task-body { grid-template-columns: minmax(0, 1fr); }
      }

      .plan-task-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 7px 10px;
        border-bottom: 1px solid;
        cursor: move;
      }

      .plan-task-title { display: grid; gap: 2px; }
      .plan-task-title strong { color: #e9f4ff; font-size: 18px; letter-spacing: 0.08em; }
      .plan-task-title span { color: #91a9bf; font-size: 10px; }
      .plan-task-close {
        width: 26px;
        height: 26px;
        border-radius: 3px;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
      }

      .plan-task-body {
        min-height: 0;
        overflow: auto;
        display: grid;
        align-content: start;
        gap: 10px;
        padding: 10px;
        color: #dcecff;
      }

      .plan-task-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 7px 9px;
        border: 1px solid rgba(67, 140, 209, 0.34);
        border-radius: 7px;
        background: rgba(16, 38, 64, 0.74);
      }

      .plan-task-status.locked { border-color: rgba(243, 184, 74, 0.48); background: rgba(63, 48, 16, 0.34); }
      .plan-task-status > div { display: grid; gap: 1px; }
      .plan-task-status strong { color: #ffd46b; font-size: 13px; }
      .plan-task-status > span { color: #8ea7c0; font-size: 10px; text-align: right; }
      .plan-task-kicker { color: #6ebfff; font-size: 9px; letter-spacing: 0.12em; }

      .plan-task-section {
        min-inline-size: 0;
        margin: 0;
        padding: 8px 9px 9px;
        border: 1px solid rgba(63, 119, 176, 0.42);
        border-radius: 7px;
        background: rgba(18, 39, 65, 0.64);
      }

      .plan-task-section legend { padding: 0 4px; color: #dcecff; font-size: 12px; font-weight: 700; }
      .plan-task-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
      .plan-task-radio { display: flex; align-items: center; gap: 5px; color: #e6f2ff; font-size: 12px; cursor: pointer; }
      .plan-task-radio input { accent-color: #55b7ff; }
      .plan-task-radio:last-child { grid-column: 1 / -1; }
      .plan-task-section-note { display: block; margin-top: 6px; color: #7994ae; font-size: 10px; }

      .plan-task-selection { display: grid; gap: 7px; }
      .plan-task-selection label,
      .plan-task-inline-select { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 8px; color: #b8cee2; font-size: 11px; }
      .plan-task-selection select,
      .plan-task-selection input[type="number"],
      .plan-task-inline-select select {
        min-width: 0;
        height: 28px;
        padding: 0 7px;
        border: 1px solid rgba(76, 137, 195, 0.58);
        border-radius: 4px;
        color: #e7f3ff;
        background: #122941;
      }

      .plan-task-smart { display: grid; gap: 8px; }
      .plan-task-range { display: grid; gap: 5px; color: #b8cee2; font-size: 11px; }
      .plan-task-range strong { color: #62c6ff; }
      .plan-task-range > span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
      .plan-task-range input[type="range"] { width: 100%; accent-color: #238ed6; }
      .plan-task-range input[type="checkbox"] { width: auto; accent-color: #238ed6; }
      .plan-task-item-title { color: #7ea7c6; font-size: 10px; font-weight: 700; }
      .plan-task-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
      .plan-task-items label { display: flex; align-items: center; gap: 5px; color: #d0e2f1; font-size: 11px; }
      .plan-task-items input { accent-color: #3ba8f0; }

      .plan-task-actions { display: flex; justify-content: center; gap: 8px; }
      .plan-task-actions button { min-width: 70px; min-height: 26px; padding: 0 11px; border-radius: 3px; cursor: pointer; }
      .plan-task-actions button:disabled { opacity: 0.46; cursor: not-allowed; }
      .plan-task-hint { margin: 0; color: #758ea8; font-size: 10px; text-align: center; }

      .plan-task-list { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0 3px; font-size: 12px; }
      .plan-task-list th { height: 27px; background: linear-gradient(#183c56, #101e36 70%, #13273c); color: #e5f2ff; font-weight: 700; }
      .plan-task-list tbody tr:nth-child(odd) { background: rgba(37, 54, 83, 0.72); }
      .plan-task-list tbody tr:nth-child(even) { background: rgba(19, 28, 47, 0.72); }
      .plan-task-list td { height: 28px; padding: 0 8px; vertical-align: top; }
      .plan-task-list th:first-child { padding-left: 8px; text-align: left; }
      .plan-task-count { margin-left: 5px; color: #a9c6e0; font-weight: 400; font-variant-numeric: tabular-nums; }
      .plan-task-time-column { width: 94px; }
      .plan-task-action-column { width: 31px; }
      .plan-task-list .plan-task-time { padding: 0; text-align: center; line-height: 28px; white-space: nowrap; font-variant-numeric: tabular-nums; }
      .plan-task-list .plan-task-row-action { padding: 0; text-align: center; }
      .plan-task-row-action button { width: 22px; height: 22px; margin-top: 3px; padding: 0; border-radius: 3px; font-size: 15px; line-height: 1; cursor: pointer; }
      .plan-task-row-action button:disabled { opacity: 0.46; cursor: not-allowed; }
      .plan-task-runtime summary { cursor: pointer; line-height: 28px; overflow-wrap: anywhere; }
      .plan-task-runtime details:not([open]) summary { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
      .plan-task-runtime-grid { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 5px 7px; margin: 0 0 8px; font-size: 11px; }
      .plan-task-runtime-grid dt { color: #a9c6e0; }
      .plan-task-runtime-grid dd { margin: 0; overflow-wrap: anywhere; }
      .plan-task-runtime .plan-task-log { margin-bottom: 8px; }
      .plan-task-history > summary { padding: 3px 8px; color: #a9c6e0; cursor: pointer; font-size: 12px; }

      body:has(.plan-task-dialog.open) .mission-panel,
      body:has(.plan-task-dialog.open) .newbie-guide { visibility: hidden; }

      @media (max-width: 560px) {
        .plan-task-dialog { left: 5px; right: 5px; top: 68px; bottom: calc(var(--bottom-ui-safe-height) + 5px); width: auto; max-height: none; transform: none; }
        .plan-task-head { cursor: default; }
      }

    @media (max-width: 560px) {
      .newbie-guide-pointer-label { font-size: 11px; }
    }
    .plan-task-error { color: #ffb7a6; font-size: 11px; }
    .plan-task-items small { color: #7790a8; font-size: 9px; }
    .plan-task-log { margin: 0; padding-left: 18px; max-height: 100px; overflow-y: auto; font-size: 11px; color: #a4c5dc; }

    #halloweenCityGift { position: absolute; left: 100%; margin-left: 8px; white-space: nowrap; }
    #halloweenCityGift[hidden] { display: none; }

    .mission-avatar {
      width: 42px;
      height: 42px;
      padding: 0;
      border: 2px solid rgba(232, 218, 118, 0.86);
      background: linear-gradient(145deg, #12291b, #070b10);
      box-shadow: inset 0 0 16px rgba(98, 240, 106, 0.34), 0 0 10px rgba(0, 0, 0, 0.5);
      cursor: pointer;
      overflow: hidden;
    }

    .mission-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .mission-text strong,
    .mission-text span {
      display: block;
      line-height: 17px;
    }

    .mission-text strong {
      color: #fff8c6;
      font-size: 12px;
    }

    .mission-text span {
      color: #f2f7df;
      font-size: 13px;
    }

.mission-dialog {
  position: absolute;
  left: 62px;
  top: 56px;
  z-index: 65;
  width: min(768px, calc(100% - 100px));
  height: min(590px, calc(100% - 88px));
  display: none;
  grid-template-rows: 42px minmax(0, 1fr);
  border: 1px solid #415268;
  color: #dbe8ee;
  pointer-events: auto;
}
.mission-dialog.open { display: grid; }
.mission-dialog-head {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  padding: 4px 10px;
  cursor: move;
}
.mission-dialog-head img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border: 1px solid #6e8b97;
  box-shadow: 0 0 0 2px #0b1720;
}
.mission-dialog-title strong,
.mission-dialog-title span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mission-dialog-title strong { font-size: 15px; line-height: 18px; }
.mission-dialog-title span { color: #a8bbcb; font-size: 11px; line-height: 13px; }
.mission-dialog-close,
.mission-guide,
.mission-submit {
  border: 1px solid #41604d;
  background: linear-gradient(#223b35, #142621 56%, #0e1a19);
  color: #dff1dd;
  cursor: pointer;
}
.mission-dialog-close {
  width: 27px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
}
.mission-dialog .mission-dialog-body {
  display: grid;
  grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr);
  min-height: 0;
  padding: 10px 12px 12px;
  gap: 0;
  overflow: hidden;
  background: linear-gradient(#101b29, #080e18 42%);
}
.mission-dialog .mission-tabs {
  display: flex;
  gap: 4px;
  padding: 0 3px;
  border-bottom: 1px solid #42635e;
  overflow: auto hidden;
  scrollbar-width: thin;
}
.mission-dialog .mission-tab {
  flex: 0 0 auto;
  min-width: 0;
  height: 34px;
  padding: 0 15px;
  border: 1px solid #3a5565;
  border-bottom: 0;
  background: linear-gradient(#203744, #12212d 54%, #0e1824);
  color: #bbceda;
  clip-path: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  font-size: 13px;
  cursor: pointer;
}
.mission-dialog .mission-tab.active {
  border-color: #83ae74;
  background: linear-gradient(#3a6a48, #254b36 52%, #172e23);
  box-shadow: inset 0 1px #759e70;
  color: #efffd8;
}
.mission-dialog button:enabled:hover { filter: brightness(1.2); }
.mission-dialog :is(button, .mission-list):focus-visible {
  outline: 1px solid #a9d783;
  outline-offset: -2px;
}
.mission-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 9px 9px;
}
.mission-section-head h2 { margin: 0; color: #edf5f2; font-size: 16px; line-height: 1.2; }
.mission-section-head p { margin: 4px 0 0; color: #a7b9c9; font-size: 12px; }
.mission-ready-count { color: #c1e6a3; font-size: 12px; white-space: nowrap; }
.mission-list {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #45677e #0a1420;
  scrollbar-width: thin;
  padding: 1px 6px 3px 0;
}
.mission-gate {
  align-self: start;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid #384f60;
  background: linear-gradient(#142230, #0d1723);
}
.mission-gate strong { color: #f1f6f8; font-size: 15px; }
.mission-gate span { color: #b4c6d4; font-size: 13px; }
.mission-card {
  display: grid;
  gap: 7px;
  padding: 9px 11px 8px;
  border: 1px solid #344b5f;
  border-left: 2px solid #476276;
  background: linear-gradient(110deg, #162534, #111b29 64%, #101923);
  color: #d2dfe8;
}
.mission-card.current { border-left-color: #7ab8d1; }
.mission-card.ready {
  border-color: #587754;
  border-left-color: #9bcc76;
  background: linear-gradient(110deg, #1a302d, #13242a 62%, #111d25);
}
.mission-card:is(.done, .locked) {
  border-color: #2e4252;
  background: #101a25;
}
.mission-card-head,
.mission-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.mission-card-head > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.mission-card h3 {
  margin: 0;
  color: #f0f6f8;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mission-step,
.mission-status {
  color: #a2bbcf;
  font-size: 11px;
  white-space: nowrap;
}
.mission-status {
  border: 1px solid #455e70;
  padding: 2px 6px;
  background: #0f1b26;
}
.ready .mission-status { color: #dcfac1; border-color: #648750; background: #233e29; }
.done .mission-status { color: #a2c9ad; }
.locked .mission-status { color: #a8b2be; }
.mission-description { margin: 0; color: #bacbd9; font-size: 12px; line-height: 1.45; }
.mission-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.mission-checks > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.mission-checks dt { color: #a3b8ca; white-space: nowrap; }
.mission-checks dd { display: grid; gap: 2px; margin: 0; overflow-wrap: anywhere; }
.mission-checks .mission-progress dd { color: #d3e8f7; font-variant-numeric: tabular-nums; }
.mission-card-foot { border-top: 1px solid #324752; padding-top: 6px; }
.mission-rewards { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: #e7c98a; font-size: 12px; }
.mission-rewards ul { display: flex; gap: 3px 5px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.mission-rewards li { padding: 2px 5px; border: 1px solid #65583c; background: #211e1a; color: #f0dca6; }
.mission-rewards small { color: #9eabbb; font-size: 11px; }
.mission-guide,
.mission-submit { flex: none; min-width: 90px; height: 27px; padding: 0 9px; font-size: 12px; white-space: nowrap; }
.mission-submit {
  border-color: #8ca768;
  background: linear-gradient(#406744, #2b4f32 54%, #1c3726);
  color: #efffd7;
  font-weight: 600;
}
.mission-submit:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) {
  .mission-dialog .mission-dialog-body { padding: 7px; }
  .mission-dialog .mission-tab { height: 29px; padding: 0 9px; font-size: 12px; }
  .mission-section-head { padding-inline: 3px; }
  .mission-checks { grid-template-columns: 1fr; }
  .mission-card-foot { flex-wrap: wrap; }
  .mission-card-foot button { margin-inline-start: auto; }
}

    .shop-dialog {
      position: absolute;
      left: var(--art-left, 50%);
      top: 46px;
      z-index: 27;
      width: min(1120px, calc(100% - 28px));
      height: min(696px, calc(100% - 58px));
      display: none;
      grid-template-rows: 38px 1fr;
      border: 1px solid rgba(121, 178, 210, 0.48);
      background:
        linear-gradient(180deg, rgba(11, 25, 43, 0.97), rgba(4, 10, 20, 0.99)),
        radial-gradient(circle at 16% 4%, rgba(66, 159, 220, 0.13), transparent 55%);
      box-shadow: inset 0 1px 0 rgba(193, 236, 255, 0.13), 0 14px 34px rgba(0, 0, 0, 0.68);
      color: #d9f5ff;
      transform: translateX(-50%);
      pointer-events: auto;
    }

    .shop-dialog.open {
      display: grid;
      z-index: 30;
    }

    .chat-dialog {
      position: fixed;
      left: 8px;
      bottom: calc(var(--bottom-ui-safe-height) + 5px);
      z-index: 29;
      width: 430px;
      height: 300px;
      display: none;
      grid-template-rows: 36px 38px auto minmax(0, 1fr) 38px;
      border: 1px solid rgba(121, 205, 255, 0.58);
      background:
        linear-gradient(180deg, rgba(9, 25, 43, 0.97), rgba(3, 8, 18, 0.99)),
        radial-gradient(circle at 18% 0%, rgba(55, 185, 255, 0.18), transparent 58%);
      box-shadow: inset 0 1px 0 rgba(218, 245, 255, 0.18), 0 14px 30px rgba(0, 0, 0, 0.64);
      color: #d9f5ff;
      pointer-events: auto;
    }

    .chat-dialog.open {
      display: grid;
    }

    .chat-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 8px;
      padding: 6px 9px;
      border-bottom: 1px solid rgba(121, 205, 255, 0.3);
      background: linear-gradient(180deg, rgba(18, 43, 68, 0.84), rgba(4, 13, 28, 0.5));
      cursor: move;
    }

    .chat-title strong,
    .chat-title span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .chat-title strong {
      color: #ffffff;
      font-size: 13px;
      line-height: 15px;
    }

    .chat-title span {
      color: #9edfff;
      font-size: 11px;
      line-height: 13px;
    }

    .chat-close {
      width: 24px;
      height: 22px;
      border: 1px solid rgba(121, 205, 255, 0.52);
      background: rgba(2, 12, 24, 0.84);
      color: #d9f5ff;
      cursor: pointer;
    }

    .chat-dialog:has(.chat-input-row[hidden]) { grid-template-rows: 36px 38px auto minmax(0, 1fr) 0; }
    .chat-input-row[hidden] { display: none; }

    .chat-tabs {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 6px;
      padding: 6px 8px;
      border-bottom: 1px solid rgba(121, 205, 255, 0.2);
    }

    .chat-tab {
      height: 25px;
      border: 1px solid rgba(121, 205, 255, 0.26);
      background: rgba(0, 0, 0, 0.28);
      color: #aee7ff;
      cursor: pointer;
    }

    .chat-tab.active {
      border-color: rgba(255, 214, 107, 0.72);
      color: #ffe7a0;
      box-shadow: inset 0 0 12px rgba(255, 214, 107, 0.12);
    }

    .chat-recipient:empty {
      display: none;
    }

    .chat-recipient {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 7px;
      padding: 5px 8px;
      border-bottom: 1px solid rgba(121, 205, 255, 0.2);
      color: #9edfff;
      font-size: 11px;
    }

    .chat-recipient:has([data-chat-broadcast]) {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .chat-recipient [data-chat-broadcast] {
      min-height: 22px;
      padding: 1px 8px;
      font-size: inherit;
    }

    .chat-broadcast {
      position: fixed;
      inset-inline: 0;
      top: 50%;
      z-index: 65;
      transform: translateY(-50%);
      overflow: hidden;
      pointer-events: none;
    }

    .chat-broadcast-track {
      width: max-content;
      padding: 6px 14px;
      border: 1px solid #738c44;
      background: linear-gradient(#182619f5, #07110cf5);
      color: #effae4;
      box-shadow: inset 0 0 0 1px #0a1b10, 0 2px 7px #050a08b3;
      font-size: 15px;
      font-weight: bold;
      line-height: 20px;
      white-space: nowrap;
      animation: chat-broadcast-across var(--chat-broadcast-duration, 13s) linear both;
    }

    .chat-broadcast-track strong {
      margin-inline-end: 10px;
      color: #e6d68a;
    }

    @keyframes chat-broadcast-across {
      from { transform: translateX(100vw); }
      to { transform: translateX(-100%); }
    }

    @media (prefers-reduced-motion: reduce) {
      .chat-broadcast-track {
        max-width: min(700px, calc(100vw - 32px));
        margin-inline: auto;
        white-space: normal;
        overflow-wrap: anywhere;
        animation: chat-broadcast-stay 6s linear both;
      }
      @keyframes chat-broadcast-stay { from, to { opacity: 1; } }
    }

    .chat-recipient select {
      min-width: 0;
      height: 25px;
      border: 1px solid rgba(121, 205, 255, 0.34);
      background: rgba(0, 10, 20, 0.94);
      color: #effcff;
      padding: 0 7px;
    }

    .chat-log {
      grid-row: 4;
      min-height: 0;
      overflow: auto;
      padding: 8px;
      display: grid;
      align-content: start;
      gap: 6px;
    }

    .chat-message {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 6px;
      padding: 6px 7px;
      border: 1px solid rgba(121, 205, 255, 0.18);
      background: rgba(0, 0, 0, 0.24);
      font-size: 12px;
      line-height: 16px;
    }

    .chat-message em {
      color: #ffe7a0;
      font-style: normal;
      white-space: nowrap;
    }

    .chat-message span {
      color: #d9f5ff;
      overflow-wrap: anywhere;
    }

    .chat-battle-link {
      padding: 0 4px;
      border: 0;
      background: transparent;
      color: #9edfff;
      font: inherit;
      text-decoration: underline;
      cursor: pointer;
    }

    .chat-battle-link:hover, .chat-battle-link:focus-visible { color: #e8f7ff; }

    .chat-report-button {
      align-self: start;
      min-width: 34px;
      height: 20px;
      padding: 0 5px;
      border: 1px solid rgba(255, 126, 126, 0.38);
      background: rgba(64, 10, 14, 0.72);
      color: #ffb8b8;
      cursor: pointer;
      font-size: 10px;
    }

    .chat-input-row {
      grid-row: 5;
      display: grid;
      grid-template-columns: 1fr 58px;
      gap: 6px;
      padding: 6px 8px;
      border-top: 1px solid rgba(121, 205, 255, 0.22);
    }

    .chat-input-row:has(#chatFormation:not([hidden])) {
      grid-template-columns: minmax(72px, 104px) minmax(0, 1fr) 58px;
    }
    #chatFormation { min-width: 0; color: #cee4f0; background: #102331; border: 1px solid #416477; }
    .chat-formation-card { grid-column: 1/-1; padding: 4px 6px; color: #cde3e9; background: #102733; }
    .chat-formation-card summary { cursor: pointer; color: #a7dbc5; }
    .chat-formation-card ol { margin: 4px 0; padding-left: 24px; }
    .chat-formation-card li { overflow-wrap: anywhere; }
    .chat-input-row input {
      min-width: 0;
      border: 1px solid rgba(121, 205, 255, 0.34);
      background: rgba(0, 0, 0, 0.36);
      color: #ffffff;
      padding: 0 8px;
      outline: none;
    }

    .chat-input-row button {
      border: 1px solid rgba(255, 214, 107, 0.62);
      background: linear-gradient(180deg, rgba(81, 55, 15, 0.95), rgba(24, 10, 2, 0.96));
      color: #ffe7a0;
      cursor: pointer;
    }

    .shop-head {
      display: grid;
      grid-template-columns: 1fr auto auto;
      align-items: center;
      gap: 10px;
      padding: 5px 12px;
      border-bottom: 1px solid rgba(121, 178, 210, 0.32);
      background: linear-gradient(180deg, rgba(18, 39, 62, 0.8), rgba(6, 16, 31, 0.42));
      cursor: move;
    }

    .shop-title strong,
    .shop-title span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .shop-title strong {
      color: #ffffff;
      font-size: 13px;
      line-height: 17px;
    }

    .shop-title span,
    .shop-currency {
      color: #9ec9df;
      font-size: 11px;
      line-height: 15px;
    }

    .shop-close {
      width: 24px;
      height: 22px;
      border: 1px solid rgba(121, 178, 210, 0.5);
      background: rgba(4, 12, 24, 0.82);
      color: #d9f5ff;
      cursor: pointer;
    }

    .shop-body {
      min-height: 0;
      overflow: hidden;
      padding: 10px;
      display: grid;
      grid-template-columns: 226px 1fr;
      gap: 10px;
    }

    .shop-tabs {
      display: grid;
      align-content: start;
      gap: 8px;
      padding: 10px;
      border: 1px solid rgba(121, 178, 210, 0.28);
      background: rgba(4, 12, 24, 0.36);
      min-height: 0;
    }

    .shop-tab {
      height: 34px;
      border: 1px solid rgba(121, 178, 210, 0.25);
      background: linear-gradient(180deg, rgba(12, 29, 49, 0.72), rgba(3, 10, 20, 0.7));
      color: #d9f5ff;
      text-align: left;
      padding: 0 9px;
      cursor: pointer;
    }

    .shop-tab.active {
      border-color: rgba(255, 214, 107, 0.62);
      color: #ffe7a0;
      box-shadow: inset 0 0 12px rgba(255, 214, 107, 0.12);
    }

    .shop-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
      grid-auto-rows: 146px;
      gap: 10px;
      align-content: start;
      min-height: 0;
      overflow: auto;
      padding: 10px;
      border: 1px solid rgba(121, 178, 210, 0.28);
      background: rgba(4, 12, 24, 0.34);
    }

    .shop-card {
      display: grid;
      grid-template-rows: 48px 1fr auto;
      place-items: center;
      gap: 6px;
      min-width: 0;
      min-height: 0;
      padding: 8px;
      border: 1px solid rgba(121, 178, 210, 0.25);
      background: linear-gradient(180deg, rgba(7, 19, 35, 0.76), rgba(2, 8, 17, 0.72));
      box-shadow: inset 0 0 12px rgba(66, 159, 220, 0.04);
    }

    .shop-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(255, 214, 107, 0.38);
      background:
        radial-gradient(circle at 50% 18%, rgba(255, 214, 107, 0.28), transparent 52%),
        rgba(3, 12, 18, 0.72);
      color: #ffe7a0;
      font-size: 22px;
      box-shadow: inset 0 0 12px rgba(255, 214, 107, 0.09);
    }

    .shop-icon.has-image {
      width: 46px;
      height: 46px;
      overflow: visible;
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .shop-icon.has-image img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .shop-card strong,
    .shop-card span,
    .shop-card em {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .shop-card strong {
      color: #ffffff;
      font-size: 13px;
      line-height: 17px;
      white-space: nowrap;
      text-align: center;
    }

    .shop-card span {
      color: #9ec9df;
      font-size: 11px;
      line-height: 15px;
      display: none;
    }

    .shop-card em {
      margin-top: 2px;
      color: #ffe7a0;
      font-size: 11px;
      font-style: normal;
      line-height: 15px;
      white-space: normal;
      text-align: center;
      max-height: 30px;
    }

    .shop-buy {
      align-self: center;
      min-width: 64px;
      height: 26px;
      border: 1px solid rgba(121, 178, 210, 0.58);
      background: linear-gradient(180deg, rgba(28, 83, 118, 0.92), rgba(5, 18, 34, 0.96));
      color: #effcff;
      cursor: pointer;
    }

    .shop-buy:disabled {
      opacity: 0.48;
      cursor: default;
    }

    .shop-grid.payment-center {
      grid-template-columns: 1fr;
      grid-auto-rows: auto;
      align-content: start;
      gap: 12px;
    }

    .payment-catalog,
    .payment-orders {
      display: grid;
      gap: 9px;
      min-width: 0;
      padding: 10px;
      border: 1px solid rgba(121, 178, 210, 0.25);
      background: rgba(2, 9, 18, 0.5);
    }

    .payment-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }

    .payment-section-head strong,
    .payment-section-head span {
      display: block;
    }

    .payment-section-head strong {
      color: #ffffff;
      font-size: 13px;
      line-height: 18px;
    }

    .payment-section-head span {
      color: #8fb9cf;
      font-size: 11px;
      line-height: 15px;
    }

    .payment-section-head button,
    .payment-unavailable button,
    .payment-order-row button {
      min-width: 54px;
      height: 26px;
      border: 1px solid rgba(121, 178, 210, 0.48);
      background: rgba(5, 20, 35, 0.94);
      color: #d9f5ff;
      cursor: pointer;
    }

    .payment-products {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .payment-product-card {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr);
      grid-template-rows: 1fr auto;
      gap: 8px 10px;
      min-width: 0;
      min-height: 126px;
      padding: 10px;
      border: 1px solid rgba(121, 178, 210, 0.3);
      background: linear-gradient(180deg, rgba(9, 27, 45, 0.86), rgba(2, 10, 20, 0.88));
    }

    .payment-product-mark {
      grid-row: 1 / 3;
      width: 46px;
      height: 46px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(255, 214, 107, 0.46);
      background: rgba(67, 48, 10, 0.48);
      color: #ffe7a0;
      font-size: 11px;
      font-weight: 700;
    }

    .payment-product-copy {
      min-width: 0;
    }

    .payment-product-copy strong,
    .payment-product-copy span {
      display: block;
      overflow-wrap: anywhere;
    }

    .payment-product-copy strong {
      color: #ffffff;
      font-size: 13px;
      line-height: 18px;
    }

    .payment-product-copy span {
      margin-top: 3px;
      color: #9ec9df;
      font-size: 11px;
      line-height: 16px;
    }

    .payment-product-card > button {
      justify-self: end;
      min-width: 76px;
      height: 28px;
      border: 1px solid rgba(255, 214, 107, 0.58);
      background: linear-gradient(180deg, rgba(91, 65, 16, 0.94), rgba(30, 17, 3, 0.96));
      color: #ffe7a0;
      cursor: pointer;
    }

    .payment-product-card > button:disabled {
      opacity: 0.48;
      cursor: default;
    }

    .payment-unavailable,
    .payment-empty {
      grid-column: 1 / -1;
      min-height: 92px;
      display: grid;
      place-content: center;
      justify-items: center;
      gap: 6px;
      padding: 14px;
      border: 1px dashed rgba(121, 178, 210, 0.32);
      color: #9ec9df;
      text-align: center;
      font-size: 12px;
    }

    .payment-unavailable strong {
      color: #ffffff;
      font-size: 13px;
    }

    .payment-empty.compact {
      min-height: 50px;
    }

    .payment-order-list {
      display: grid;
      gap: 6px;
    }

    .payment-order-row {
      display: grid;
      grid-template-columns: minmax(150px, 1fr) 80px 66px auto;
      align-items: center;
      gap: 8px;
      min-width: 0;
      padding: 7px 8px;
      border: 1px solid rgba(121, 178, 210, 0.2);
      background: rgba(4, 14, 25, 0.68);
    }

    .payment-order-row span,
    .payment-order-row strong,
    .payment-order-row small {
      display: block;
      min-width: 0;
    }

    .payment-order-row strong {
      overflow: hidden;
      color: #d9f5ff;
      font-size: 12px;
      line-height: 16px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .payment-order-row small {
      color: #789db0;
      font-size: 10px;
      line-height: 14px;
    }

    .payment-order-row em,
    .payment-order-row b {
      color: #ffe7a0;
      font-size: 11px;
      font-style: normal;
      font-weight: 600;
      text-align: right;
    }

    .payment-order-row.paid b {
      color: #9cf0bd;
    }

    .payment-order-row.failed b {
      color: #ffadad;
    }

    .resource-callout {
      display: none;
      left: 244px;
      top: 116px;
      min-width: 74px;
      padding: 4px 9px;
      color: #f4ffe9;
      border: 2px solid rgba(255, 255, 255, 0.82);
      background: rgba(10, 48, 38, 0.36);
      text-shadow: 0 1px 2px #000;
      font-weight: 700;
    }

    .city-jump-rail {
      left: 56px;
      bottom: 18px;
      display: grid;
      gap: 8px;
    }

    .city-jump-rail .hud-button.active {
      color: #5f6b70;
      border-color: rgba(45, 58, 64, 0.92);
      background: linear-gradient(180deg, rgba(7, 10, 12, 0.94), rgba(0, 0, 0, 0.96));
      box-shadow:
        inset 0 0 14px rgba(0, 0, 0, 0.72),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
      filter: grayscale(1) brightness(0.56);
    }

    .city-function-rail {
      left: 636px;
      right: auto;
      top: 2px;
      display: flex;
      gap: 1px;
      align-items: center;
      padding: 1px 2px;
      border: 1px solid rgba(5, 31, 14, 0.9);
      background: linear-gradient(180deg, rgba(4, 22, 12, 0.82), rgba(1, 8, 5, 0.92));
      box-shadow: inset 0 1px 0 rgba(174, 255, 141, 0.18), 0 1px 3px rgba(0, 0, 0, 0.62);
    }

    .city-function-panel {
      position: absolute;
      left: 0;
      right: auto;
      top: 42px;
      width: 312px;
      display: none;
      grid-template-rows: 24px minmax(0, 1fr);
      max-height: max(200px, calc(100vh - var(--bottom-ui-safe-height) - 92px));
      gap: 7px;
      padding: 8px;
      border: 1px solid rgba(117, 255, 87, 0.58);
      background:
        linear-gradient(180deg, rgba(9, 32, 18, 0.96), rgba(1, 9, 6, 0.98)),
        radial-gradient(circle at 20% 0%, rgba(117, 255, 87, 0.18), transparent 58%);
      box-shadow:
        inset 0 1px 0 rgba(226, 255, 207, 0.22),
        0 10px 22px rgba(0, 0, 0, 0.55),
        0 0 12px rgba(74, 255, 75, 0.22);
      color: #f4ffe9;
      pointer-events: auto;
    }

    .city-function-panel.open {
      display: grid;
    }

    .city-function-panel.military-mode { width: min(430px, calc(100vw - 24px)); }

    .city-function-panel:has(.dispatch-window) {
      width: min(630px, calc(100vw - 32px));
      border: 2px ridge #8d9b8d;
      background: linear-gradient(125deg, #101a21, #101820 48%, #162619);
    }

    @media (min-width: 761px) {
      .city-function-panel {
        left: auto;
        right: 0;
      }

    }

    .city-function-rail:has(.city-function-panel.open .dispatch-window, .city-function-panel.open .city-transfer-console) {
      z-index: 30;
    }

    .dispatch-window {
      display: grid;
      gap: 8px;
      padding: 8px;
      background: #101820;
      color: #e0ecf4;
      font-size: 12px;
    }
    .dispatch-selects, .dispatch-columns {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .dispatch-window label { display: flex; align-items: center; gap: 5px; }
    .dispatch-window select {
      min-width: 0; flex: 1; padding: 3px; color: white;
      background: #112e56; border: 1px solid #667e9e;
    }
    .dispatch-columns > section {
      display: grid; align-content: start; gap: 7px; min-width: 0;
      padding: 8px; border: 1px solid #4c7454; background: #071516;
    }
    .dispatch-identity { display: flex; align-items: center; gap: 8px; }
    .dispatch-identity > img { width: 54px; height: 60px; object-fit: contain; background: #061014; }
    .dispatch-window p { margin: 3px 0; }
    .dispatch-manifest { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
    .dispatch-manifest > strong { grid-column: 1 / -1; }
    .dispatch-manifest > div { display: flex; justify-content: space-between; border-bottom: 1px solid #385046; }
    .dispatch-slots { display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; }
    .dispatch-slot {
      display: grid; place-items: center; position: relative; height: 34px; color: #829898;
      background: #081111; border: 1px solid #59774e; box-shadow: inset 0 0 0 2px #1a2d1f;
    }
    .dispatch-slot img { max-width: 95%; height: 31px; object-fit: contain; }
    .dispatch-slot b { position: absolute; right: 2px; bottom: 0; color: white; background: #132219; }
    .dispatch-window button {
      padding: 3px 9px; border: 1px solid #79956b; color: #eff6df;
      background: linear-gradient(#355332,#12291b); cursor: pointer;
    }
    .dispatch-window button:disabled { opacity: .5; cursor: default; }
    .dispatch-window footer { display: flex; align-items: center; gap: 6px; }
    .dispatch-window footer small { flex: 1; color: #bdcdd3; }

    .city-function-panel-head {
      display: grid;
      grid-template-columns: 28px 1fr 22px;
      align-items: center;
      gap: 6px;
      min-width: 0;
      color: #dfffcf;
      text-shadow: 0 1px 1px #001a07;
      font-size: 13px;
      font-weight: 700;
    }

    .city-function-panel-head span {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .city-function-panel-close {
      width: 22px;
      height: 20px;
      border: 1px solid rgba(117, 255, 87, 0.52);
      background: rgba(2, 18, 7, 0.78);
      color: #dfffcf;
      cursor: pointer;
      line-height: 16px;
    }

    .city-function-panel-body {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 6px;
      min-width: 0;
      min-height: 0;
      align-content: start;
      overflow-y: auto;
    }

    .city-function-panel.military-mode .city-function-panel-body {
      max-height: min(430px, calc(100vh - 180px));
      overflow-y: auto;
    }

    .military-mode .city-incoming-marches:first-child > strong { color: #b3eaa7; }
    .military-mode .city-military-report strong { font-size: 12px; }
    .military-mode .city-military-report span, .military-mode .city-military-report small { font-size: 11px; }
    .military-mode .city-military-report small { color: #d8e8d4; font-variant-numeric: tabular-nums; }
    .military-mode progress { width: 100%; height: 5px; margin-top: 2px; accent-color: #82d46b; }
    .military-mode .city-military-report button, .military-mode [data-city-intel] { width: auto; min-width: 60px; height: 26px; }
    .military-mode [data-city-intel] { justify-self: end; }

    .city-incoming-marches { display: grid; gap: 5px; min-width: 0; }
    .city-incoming-marches > strong { color: #ffd39b; font-size: 12px; }
    .city-incoming-march { border-color: #de9155; }
    .city-incoming-march button { min-width: 76px; height: 28px; white-space: nowrap; }

    .city-military-report {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 7px;
      min-width: 0;
      padding: 6px 7px;
      border: 1px solid rgba(117, 255, 87, 0.2);
      background: rgba(0, 0, 0, 0.32);
    }

    .city-military-report > div {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .city-military-report strong,
    .city-military-report span {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .city-military-report strong {
      color: #f4ffe9;
      font-size: 10px;
    }

    .city-military-report span {
      color: #86a77e;
      font-size: 9px;
    }

    .city-military-report button {
      width: 46px;
      height: 23px;
      border: 1px solid rgba(117, 255, 87, 0.5);
      background: rgba(9, 46, 18, 0.9);
      color: #dfffcf;
      cursor: pointer;
    }

    .city-feature-card {
      min-width: 0;
      min-height: 34px;
      padding: 5px 8px;
      border: 1px solid rgba(117, 255, 87, 0.28);
      background: rgba(0, 0, 0, 0.28);
      box-shadow: inset 0 0 10px rgba(117, 255, 87, 0.06);
    }

    .city-feature-card strong,
    .city-feature-card span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .city-feature-card strong {
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
    }

    .city-feature-card span {
      color: #aee7a0;
      font-size: 11px;
      line-height: 16px;
    }

    .city-feature-card.queue-feature-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 6px;
    }

    .queue-speed-button,
    .queue-cancel-button,
    .queue-inline-speed {
      height: 18px;
      min-width: 44px;
      padding: 0 7px;
      border: 1px solid rgba(255, 206, 95, 0.72);
      background: linear-gradient(180deg, rgba(89, 52, 9, 0.95), rgba(24, 10, 2, 0.96));
      color: #ffe8a3;
      box-shadow: inset 0 0 8px rgba(255, 196, 70, 0.18);
      font-size: 11px;
      line-height: 16px;
      cursor: pointer;
    }

    .queue-cancel-button {
      border-color: rgba(255, 117, 96, 0.72);
      background: linear-gradient(180deg, rgba(91, 24, 17, 0.96), rgba(31, 7, 5, 0.98));
      color: #ffd1c8;
      box-shadow: inset 0 0 8px rgba(255, 92, 68, 0.2);
    }

    .queue-speed-button:disabled,
    .queue-inline-speed:disabled {
      cursor: default;
      opacity: 0.46;
      filter: grayscale(0.35);
    }

    .city-function-panel-body:has(> .city-card) {
      grid-auto-rows: max-content;
    }

    .city-feature-card.city-card {
      display: grid;
      gap: 6px;
      padding: 7px 8px;
    }

    .city-card-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 4px 8px;
      min-width: 0;
    }

    .city-card-head > strong {
      max-width: 100%;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .city-card-head em {
      color: #aee7a0;
      font-style: normal;
      font-size: 11px;
    }

    .city-feature-card .city-card-head-actions {
      display: inline-flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
      gap: 5px;
      min-width: 0;
      margin-inline-start: auto;
      overflow: visible;
      white-space: nowrap;
    }

    .city-card-head:has(.city-abandon-button) {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
    }

    .city-card-head:has(.city-abandon-button) .city-card-head-actions {
      display: contents;
    }

    .city-card-head:has(.city-abandon-button) :is(strong, em) {
      grid-column: span 2;
    }

    .city-card-head:has(.city-abandon-button) em {
      text-align: end;
      white-space: normal;
    }

    .city-go-button,
    .city-transport-button,
    .city-abandon-button {
      height: 18px;
      min-width: 38px;
      padding: 0 7px;
      border: 1px solid rgba(117, 255, 87, 0.54);
      background: linear-gradient(180deg, rgba(21, 74, 27, 0.96), rgba(4, 23, 8, 0.98));
      color: #dfffcf;
      box-shadow: inset 0 0 8px rgba(117, 255, 87, 0.14);
      font-size: 11px;
      line-height: 16px;
      cursor: pointer;
    }

    .city-transport-button {
      border-color: rgba(87, 212, 255, 0.6);
      background: linear-gradient(180deg, rgba(12, 63, 82, 0.96), rgba(2, 22, 31, 0.98));
      color: #c9f4ff;
      box-shadow: inset 0 0 8px rgba(87, 212, 255, 0.15);
    }

    .city-abandon-button {
      border-color: rgba(255, 105, 105, 0.68);
      background: linear-gradient(180deg, rgba(91, 25, 25, 0.96), rgba(34, 5, 5, 0.98));
      color: #ffd0d0;
      box-shadow: inset 0 0 8px rgba(255, 87, 87, 0.16);
    }

    .city-go-button:hover,
    .city-transport-button:hover,
    .city-abandon-button:hover {
      border-color: rgba(180, 255, 132, 0.82);
      color: #ffffff;
    }

    .city-transfer-console {
      display: grid;
      gap: 5px;
      min-width: 0;
      padding: 8px 4px 2px;
      border-top: 1px solid rgba(87, 212, 255, 0.44);
      color: #dffaff;
    }

    .city-transfer-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 30px 22px;
      align-items: center;
      gap: 7px;
    }

    .city-transfer-head strong {
      overflow: hidden;
      color: #ffffff;
      font-size: 12px;
      line-height: 18px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .city-transfer-head button {
      width: 22px;
      height: 20px;
      padding: 0;
      border: 1px solid rgba(87, 212, 255, 0.52);
      background: rgba(2, 18, 25, 0.9);
      color: #dffaff;
      cursor: pointer;
    }

    .city-transfer-unit {
      position: relative;
      display: block;
      width: 28px;
      height: 28px;
    }

    .city-transfer-unit img {
      display: block;
      width: 28px;
      height: 28px;
      object-fit: contain;
      filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 5px rgba(87, 212, 255, 0.3));
    }

    .city-transfer-unit em {
      position: absolute;
      right: -3px;
      bottom: -2px;
      min-width: 15px;
      padding: 0 3px;
      border: 1px solid rgba(87, 212, 255, 0.6);
      background: rgba(0, 12, 18, 0.94);
      color: #ffffff;
      font-size: 9px;
      font-style: normal;
      line-height: 13px;
      text-align: center;
    }

    .city-transfer-modes {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 5px;
    }

    .city-transfer-modes button {
      height: 24px;
      border: 1px solid rgba(87, 212, 255, 0.3);
      background: rgba(2, 20, 28, 0.78);
      color: #9fd9e8;
      cursor: pointer;
    }

    .city-transfer-modes button.active {
      border-color: rgba(87, 212, 255, 0.78);
      background: rgba(10, 70, 91, 0.88);
      color: #ffffff;
    }

    .city-transfer-fields {
      display: grid;
      grid-template-columns: minmax(112px, 1fr) 82px 78px;
      align-items: end;
      gap: 6px;
      min-width: 0;
    }

    .city-transfer-fields label {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .city-transfer-fields label > span {
      color: #9fd9e8;
      font-size: 10px;
      line-height: 12px;
    }

    .city-transfer-fields select,
    .city-transfer-fields input,
    .city-transfer-submit {
      width: 100%;
      height: 26px;
      min-width: 0;
      padding: 0 6px;
      border: 1px solid rgba(87, 212, 255, 0.42);
      background: rgba(0, 12, 18, 0.92);
      color: #e8fbff;
      font-size: 11px;
    }

    .city-transfer-submit {
      cursor: pointer;
      background: linear-gradient(180deg, rgba(12, 78, 101, 0.96), rgba(2, 26, 37, 0.98));
    }

    .city-transfer-submit:disabled,
    .city-transfer-fields select:disabled,
    .city-transfer-fields input:disabled {
      cursor: default;
      opacity: 0.48;
    }

    .city-transfer-status {
      overflow-wrap: anywhere;
      color: #ffe7a0;
      font-size: 10px;
      line-height: 14px;
    }

    .city-card-desc,
    .city-card-meta {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 11px;
      line-height: 14px;
    }

    .city-card-desc {
      color: #dfffcf;
    }

    .city-card-meta {
      color: #ffe7a0;
    }

    .evacuation-card .city-card-desc,
    .evacuation-card .city-card-meta,
    .evacuation-card .city-card-head strong {
      overflow: visible;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .city-storage-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
      min-width: 0;
    }

    .city-wallet .city-storage-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .city-wallet .city-resource-chip span {
      overflow-wrap: anywhere;
    }

    .city-resource-chip {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      align-items: center;
      column-gap: 2px;
      min-width: 0;
      padding: 3px 2px;
      border: 1px solid rgba(117, 255, 87, 0.22);
      background: rgba(3, 12, 18, 0.54);
      box-shadow: inset 0 0 8px rgba(117, 255, 87, 0.05);
    }

    .city-resource-chip img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      display: block;
    }

    .city-resource-chip span {
      max-width: 100%;
      color: #dfffcf;
      font-size: 10px;
      line-height: 13px;
      text-align: center;
    }

    .city-army-summary {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .city-army-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(42px, 1fr));
      gap: 6px;
      min-width: 0;
    }

    .city-army-chip {
      display: grid;
      grid-template-rows: 38px 14px 12px;
      place-items: center;
      min-width: 0;
      padding: 4px 3px 3px;
      border: 1px solid rgba(117, 255, 87, 0.28);
      background:
        radial-gradient(circle at 50% 22%, rgba(117, 255, 87, 0.16), transparent 48%),
        rgba(3, 12, 18, 0.66);
      box-shadow: inset 0 0 10px rgba(117, 255, 87, 0.08), 0 0 10px rgba(0, 0, 0, 0.28);
    }

    .city-army-chip img {
      width: 38px;
      height: 38px;
      object-fit: cover;
      display: block;
      border: 1px solid rgba(214, 255, 194, 0.24);
      background: rgba(0, 0, 0, 0.34);
    }

    .city-army-chip span {
      max-width: 100%;
      color: #dfffcf;
      font-size: 10px;
      line-height: 14px;
      text-align: center;
    }

    .city-army-chip em {
      max-width: 100%;
      color: #8ea7c0;
      font-size: 9px;
      font-style: normal;
      line-height: 12px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      text-align: center;
    }

    .city-army-empty {
      min-height: 42px;
      display: grid;
      place-items: center;
      color: #aee7a0;
      font-size: 12px;
    }

    .city-queue-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: repeat(4, minmax(54px, auto));
      gap: 6px;
      min-width: 0;
    }

    .city-queue-slot {
      min-width: 0;
    }

    .city-queue-chip {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 46px;
      grid-template-rows: 20px 20px;
      align-items: center;
      gap: 2px 6px;
      min-width: 0;
      min-height: 52px;
      padding: 5px;
      border: 1px solid rgba(255, 206, 95, 0.34);
      background:
        radial-gradient(circle at 50% 20%, rgba(255, 206, 95, 0.18), transparent 52%),
        rgba(3, 12, 18, 0.68);
      box-shadow: inset 0 0 10px rgba(255, 206, 95, 0.08), 0 0 10px rgba(0, 0, 0, 0.3);
    }

    .city-queue-chip img {
      grid-column: 1;
      grid-row: 1 / 3;
      width: 42px;
      height: 42px;
      object-fit: cover;
      display: block;
      border: 1px solid rgba(255, 229, 162, 0.28);
      background: rgba(0, 0, 0, 0.36);
    }

    .city-queue-chip span,
    .city-queue-chip em {
      max-width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      text-align: left;
    }

    .city-queue-chip span {
      grid-column: 2;
      grid-row: 1;
      color: #fff0b8;
      font-size: 10px;
      line-height: 14px;
    }

    .city-queue-chip em {
      grid-column: 2;
      grid-row: 2;
      color: #aee7a0;
      font-size: 10px;
      font-style: normal;
      line-height: 15px;
    }

    .city-queue-chip-actions {
      grid-column: 3;
      grid-row: 1 / 3;
      display: grid;
      grid-template-rows: repeat(2, 18px);
      align-content: center;
      gap: 3px;
      min-width: 0;
    }

    .city-queue-chip-actions button {
      width: 100%;
      min-width: 0;
      padding: 0 3px;
      font-size: 10px;
    }

    .city-queue-slot-empty {
      min-height: 52px;
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      padding: 5px 8px;
      border: 1px dashed rgba(117, 255, 87, 0.22);
      background: rgba(0, 0, 0, 0.16);
      color: #79a978;
    }

    .city-queue-slot-empty strong {
      display: grid;
      width: 26px;
      height: 26px;
      place-items: center;
      border: 1px solid rgba(117, 255, 87, 0.2);
      color: #aee7a0;
      font-size: 11px;
    }

    .city-queue-slot-empty span {
      font-size: 10px;
    }

    .city-queue-split {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      min-width: 0;
    }

    .city-queue-column {
      display: grid;
      grid-template-rows: auto minmax(76px, 1fr);
      gap: 5px;
      min-width: 0;
      padding: 5px;
      border: 1px solid rgba(117, 255, 87, 0.28);
      background: rgba(0, 0, 0, 0.24);
    }

    .city-queue-column-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 5px;
      min-width: 0;
      color: #dfffcf;
      font-size: 11px;
      line-height: 18px;
    }

    .city-queue-column-head strong {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .city-queue-column-head span {
      flex: 0 0 auto;
      min-width: 30px;
      padding: 0 4px;
      border: 1px solid rgba(117, 255, 87, 0.3);
      background: rgba(37, 116, 41, 0.24);
      color: #f4ffe9;
      text-align: center;
    }

    .city-queue-column-list {
      display: grid;
      grid-template-rows: repeat(4, minmax(54px, auto));
      align-content: start;
      gap: 5px;
      min-width: 0;
    }

    .city-queue-column .city-queue-chip {
      grid-template-columns: 32px minmax(0, 1fr) 40px;
      grid-template-rows: 16px 16px;
      gap: 2px 4px;
      padding: 4px;
    }

    .city-queue-column .city-queue-chip img {
      grid-column: 1;
      grid-row: 1 / 3;
      width: 32px;
      height: 32px;
    }

    .city-queue-column-empty {
      min-height: 74px;
      display: grid;
      place-content: center;
      gap: 2px;
      border: 1px dashed rgba(117, 255, 87, 0.22);
      color: #aee7a0;
      text-align: center;
    }

    .city-queue-column-empty strong {
      color: #f4ffe9;
      font-size: 16px;
      line-height: 20px;
    }

    .city-queue-column-empty span {
      font-size: 10px;
      line-height: 14px;
    }

    @media (min-width: 900px) {
      .city-function-panel-body:has(> .hero-list-card) {
        grid-auto-rows: max-content;
      }
    }

    .hero-list-card {
      display: grid;
      grid-template-columns: 56px 1fr 64px;
      grid-template-rows: auto 8px auto;
      align-items: center;
      gap: 5px 10px;
      min-height: 0;
      padding: 8px;
      border-color: var(--hero-quality, rgba(117, 255, 87, 0.24));
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.72), 0 0 12px color-mix(in srgb, var(--hero-quality, var(--faction)) 42%, transparent);
    }

    .hero-list-summary {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
      padding: 5px 8px;
      border: 1px solid rgba(117, 255, 87, 0.24);
      background: rgba(3, 12, 18, 0.44);
      min-width: 0;
    }

    .hero-list-summary .hero-view-button {
      grid-area: auto;
      justify-self: end;
      width: auto;
      min-width: 56px;
    }

    .hero-list-summary strong,
    .hero-list-summary span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-portrait {
      grid-row: 1 / 4;
      width: 50px;
      height: 50px;
      display: grid;
      place-items: center;
      border: 2px solid var(--hero-quality, rgba(183, 247, 255, 0.32));
      background: rgba(0, 0, 0, 0.35);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.72), 0 0 10px color-mix(in srgb, var(--hero-quality, var(--faction)) 38%, transparent);
    }

    .hero-portrait img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .hero-row-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .hero-row-head em {
      color: #ffd46b;
      font-style: normal;
      font-size: 11px;
    }

    .hero-progress {
      grid-column: 2 / 4;
      height: 7px;
      border: 1px solid rgba(255, 62, 54, 0.68);
      background: rgba(0, 0, 0, 0.5);
      overflow: hidden;
    }

    .hero-progress i {
      display: block;
      width: 78%;
      height: 100%;
      background: linear-gradient(90deg, #b90012, #ff293b);
      box-shadow: 0 0 8px rgba(255, 41, 59, 0.5);
    }

    .hero-row-stats {
      grid-column: 2;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px 10px;
      min-width: 0;
      color: #aee7a0;
      font-size: 11px;
      line-height: 14px;
    }

    .hero-row-stats span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-view-button {
      grid-column: 3;
      grid-row: 3;
      align-self: end;
      justify-self: end;
      width: 56px;
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.42);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.86), rgba(3, 12, 22, 0.92));
      color: #effcff;
      cursor: pointer;
      box-shadow: 0 0 8px color-mix(in srgb, var(--hero-quality, var(--faction)) 34%, transparent);
    }

    .hero-garrison { grid-column: 2 / 4; display: inline-flex; align-items: center; gap: 6px; color: #dfffcf; font-size: 12px; }
    .hero-garrison input { width: 16px; height: 16px; margin: 0; accent-color: #62c99a; }

    .hero-detail-dialog {
      position: fixed;
      left: 50%;
      top: 48px;
      z-index: 34;
      display: none;
      width: min(900px, calc(100vw - 34px));
      height: min(560px, calc(100vh - 84px));
      transform: translateX(-50%);
      grid-template-rows: 42px 1fr;
      border: 1px solid rgba(183, 247, 255, 0.5);
      background:
        linear-gradient(180deg, rgba(9, 25, 37, 0.98), rgba(0, 5, 12, 0.98)),
        radial-gradient(circle at 18% 0%, var(--faction-soft), transparent 58%);
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.56), inset 0 0 0 1px rgba(32, 216, 255, 0.16);
      color: #effcff;
      clip-path: var(--cut);
    }

    .hero-detail-dialog.open {
      display: grid;
    }

    .hero-detail-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      padding: 8px 12px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.24);
      background: linear-gradient(180deg, rgba(10, 34, 54, 0.82), rgba(0, 0, 0, 0.38));
      cursor: move;
      user-select: none;
    }

    .hero-detail-head strong {
      justify-self: center;
      color: #ffffff;
      font-size: 16px;
      letter-spacing: 0;
    }

    .hero-detail-close {
      width: 56px;
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.42);
      background: rgba(0, 0, 0, 0.42);
      color: #effcff;
      cursor: pointer;
      white-space: nowrap;
    }

    .hero-detail-body {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      min-height: 0;
      padding: 10px;
    }

    .hero-config-panel {
      display: grid;
      gap: 8px;
      min-height: 0;
      padding: 9px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background:
        linear-gradient(180deg, rgba(3, 16, 24, 0.76), rgba(0, 0, 0, 0.28)),
        linear-gradient(90deg, rgba(117, 255, 87, 0.05), transparent 54%);
      box-shadow: inset 0 0 14px rgba(32, 216, 255, 0.06);
    }

    .hero-config-panel.equipment-mode {
      grid-template-rows: auto minmax(0, 1fr);
    }

    .hero-config-panel.skill-mode {
      grid-template-rows: auto auto 1fr;
      overflow: hidden;
    }

    .hero-config-panel.equipment-mode .hero-army-box {
      min-height: 0;
      grid-template-rows: auto minmax(0, 1fr);
    }

    .hero-config-tabs {
      display: flex;
      gap: 6px;
    }

    .hero-config-tabs button,
    .hero-army-tabs button {
      padding: 4px 11px;
      border: 1px solid rgba(117, 255, 87, 0.28);
      background: rgba(3, 32, 20, 0.58);
      color: #aee7a0;
      font-size: 11px;
      cursor: pointer;
    }

    .hero-config-tabs button.dim,
    .hero-army-tabs button.dim {
      border-color: rgba(183, 247, 255, 0.2);
      background: rgba(3, 12, 18, 0.46);
      color: var(--muted);
    }

    .hero-summary-box {
      display: grid;
      grid-template-columns: 58px 1fr auto;
      gap: 8px;
      align-items: center;
      min-width: 0;
      padding: 7px;
      border: 1px solid var(--hero-quality, rgba(183, 247, 255, 0.28));
      background: rgba(3, 12, 18, 0.54);
    }

    .hero-summary-box .hero-portrait {
      grid-row: auto;
    }

    .hero-summary-text {
      display: grid;
      gap: 3px;
      min-width: 0;
      color: #dfffcf;
      font-size: 11px;
      line-height: 14px;
    }

    .hero-summary-text strong {
      color: #ffffff;
      font-size: 13px;
    }

    .hero-small-actions {
      display: grid;
      gap: 5px;
    }

    .hero-small-actions button,
    .hero-config-actions button {
      min-width: 48px;
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.38);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.76), rgba(3, 12, 22, 0.92));
      color: #effcff;
      cursor: pointer;
      font-size: 11px;
    }

    .hero-points-box,
    .hero-army-box {
      position: relative;
      display: grid;
      gap: 7px;
      padding: 8px;
      border: 1px solid rgba(117, 255, 87, 0.18);
      background: rgba(3, 12, 18, 0.44);
    }

    .hero-points-head {
      display: grid;
      grid-template-columns: 1fr auto;
      color: #dfffcf;
      font-size: 11px;
    }

    .hero-points-layout {
      display: grid;
      gap: 7px;
    }

    .hero-attr-main {
      display: grid;
      gap: 7px;
      min-width: 0;
    }

    .hero-point-side {
      display: flex;
      gap: 4px;
      justify-content: end;
    }

    .hero-point-side button {
      min-width: 38px;
      height: 22px;
      padding: 0 6px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.72), rgba(3, 12, 22, 0.9));
      color: #effcff;
      cursor: pointer;
      font-size: 10px;
    }

    .hero-assign-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }

    .hero-assign-stat {
      display: grid;
      gap: 3px;
      color: #dfffcf;
      font-size: 10px;
    }

    .hero-assign-stat b {
      color: #ffd46b;
      font-weight: 600;
    }

    .hero-stat-stepper {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      min-width: 0;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.34);
    }

    .hero-stat-stepper span {
      display: block;
      text-align: center;
      line-height: 20px;
    }

    .hero-stat-controls {
      display: grid;
      grid-template-rows: 10px 10px;
      border-left: 1px solid rgba(183, 247, 255, 0.18);
    }

    .hero-stat-controls button {
      width: 16px;
      height: 10px;
      padding: 0;
      border: 0;
      background: transparent;
      color: #78e5ff;
      cursor: pointer;
      font-size: 9px;
      line-height: 10px;
    }

    .hero-stat-controls button:hover {
      color: #ffffff;
      background: rgba(32, 216, 255, 0.16);
    }

    #heroDetailDialog .hero-away-control:disabled,
    [data-dispatch-carry]:disabled {
      filter: grayscale(1);
      opacity: .5;
      cursor: not-allowed;
    }

    .hero-stat-controls button:disabled,
    .hero-point-side button:disabled {
      opacity: 0.42;
      cursor: default;
    }

    .hero-config-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .hero-formation-actions {
      display: grid;
      grid-template-columns: minmax(104px, 1fr) 54px 54px;
      gap: 5px;
      align-items: center;
    }

    .hero-formation-actions select,
    .hero-formation-actions button {
      height: 22px;
      min-width: 0;
      padding: 0 5px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.72), rgba(3, 12, 22, 0.9));
      color: #effcff;
      font-size: 10px;
      line-height: 11px;
    }

    .hero-formation-actions button {
      white-space: normal;
      cursor: pointer;
    }

    .hero-army-tabs {
      display: flex;
      gap: 6px;
    }

    .hero-army-slots {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      grid-auto-rows: minmax(54px, 1fr);
      gap: 8px;
      min-height: 116px;
      width: 100%;
    }

    .hero-army-slot {
      position: relative;
      display: grid;
      place-items: center;
      border: 1px solid rgba(117, 255, 87, 0.35);
      background: rgba(0, 0, 0, 0.48);
      color: #78e5ff;
      font-size: 12px;
      line-height: 16px;
      font-family: inherit;
      cursor: pointer;
      min-width: 0;
      min-height: 54px;
    }

    .hero-army-slot img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .hero-army-slot em {
      position: absolute;
      right: 3px;
      bottom: 2px;
      background: rgba(0, 0, 0, 0.76);
      color: #fff;
      font-size: 10px;
      line-height: 13px;
      font-style: normal;
      padding: 0 4px;
      pointer-events: none;
    }

    .hero-army-slot.locked {
      color: #2f7dff;
      filter: saturate(0.7);
      cursor: default;
    }

    [data-hero-unlock-slot]:enabled { cursor: pointer; }

    .hero-army-slot.active {
      border-color: rgba(255, 214, 107, 0.72);
      color: #ffe7a0;
      box-shadow: inset 0 0 12px rgba(255, 214, 107, 0.12), 0 0 12px rgba(255, 214, 107, 0.14);
    }

    .hero-army-picker {
      position: absolute;
      left: var(--hero-army-picker-x, 8px);
      top: var(--hero-army-picker-y, 86px);
      z-index: 6;
      display: grid;
      gap: 7px;
      width: min(280px, calc(100% - 16px));
      max-height: 176px;
      overflow: hidden;
      padding: 6px;
      border: 1px solid rgba(117, 255, 87, 0.28);
      background: rgba(0, 8, 10, 0.94);
      box-shadow: inset 0 0 18px rgba(117, 255, 87, 0.05);
    }

    .hero-army-picker-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #dfffcf;
      font-size: 10px;
      line-height: 14px;
      cursor: move;
      user-select: none;
    }

    .hero-army-picker-head button {
      width: 22px;
      height: 18px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.32);
      color: #effcff;
      cursor: pointer;
      font-size: 11px;
    }

    .hero-army-pool {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 6px;
      grid-auto-rows: 44px;
      max-height: 94px;
      overflow-x: hidden;
      overflow-y: auto;
      padding-right: 2px;
    }

    .hero-army-pick-tile {
      position: relative;
      height: 44px;
      min-width: 0;
      border: 1px solid rgba(117, 255, 87, 0.26);
      background: rgba(0, 0, 0, 0.42);
      padding: 2px;
      cursor: pointer;
    }

    .hero-army-pick-tile.active {
      border-color: rgba(255, 214, 107, 0.72);
      box-shadow: 0 0 10px rgba(255, 214, 107, 0.24), inset 0 0 10px rgba(255, 214, 107, 0.12);
    }

    .hero-army-pick-tile:disabled {
      opacity: 0.42;
      filter: grayscale(0.72);
      cursor: default;
    }

    .hero-army-pick-tile img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .hero-army-pick-tile em,
    .hero-army-pick-tile b {
      position: absolute;
      right: 2px;
      background: rgba(0, 0, 0, 0.78);
      font-style: normal;
      font-size: 9px;
      line-height: 12px;
      padding: 0 3px;
    }

    .hero-army-pick-tile em {
      bottom: 2px;
      color: #dfffcf;
    }

    .hero-army-pick-tile b {
      top: 2px;
      color: #ffe7a0;
      font-weight: 700;
    }

    .hero-army-amount-bar {
      display: grid;
      grid-template-columns: 96px minmax(0, 1fr) 52px;
      gap: 5px;
      align-items: center;
      padding: 5px;
      border: 1px solid rgba(255, 214, 107, 0.28);
      background: rgba(48, 31, 6, 0.28);
      color: #ffe7a0;
      font-size: 10px;
    }

    .hero-army-amount-bar span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-army-amount-bar button {
      height: 22px;
      border: 1px solid rgba(255, 214, 107, 0.36);
      background: rgba(35, 20, 3, 0.72);
      color: #ffe7a0;
      cursor: pointer;
      font-size: 10px;
    }

    .hero-army-amount-bar button.confirm {
      border-color: rgba(117, 255, 87, 0.42);
      background: rgba(3, 32, 20, 0.78);
      color: #dfffcf;
    }

    .hero-army-amount-bar input[type="range"] {
      width: 100%;
      accent-color: #78ff57;
    }

    .hero-carry-content {
      min-height: 178px;
      display: grid;
      align-content: start;
      gap: 7px;
      overflow: hidden;
    }

    .hero-carry-content .hero-resource-carry {
      min-height: 126px;
      max-height: 126px;
    }

    .hero-army-picker .hero-army-pool {
      min-height: 0;
      max-height: 94px;
    }

    .hero-carry-content .hero-resource-carry {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      grid-auto-rows: minmax(58px, auto);
      gap: 6px;
      overflow: hidden;
    }

    .hero-army-row {
      display: grid;
      grid-template-columns: 1fr auto auto auto;
      align-items: center;
      gap: 6px;
      min-width: 0;
      padding: 4px 5px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.28);
      color: #dfffcf;
      font-size: 10px;
    }

    button.hero-army-row {
      width: 100%;
      text-align: left;
      font-family: inherit;
      cursor: pointer;
    }

    button.hero-army-row:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .hero-army-row.active {
      border-color: rgba(255, 214, 107, 0.52);
      background: rgba(52, 33, 5, 0.42);
      color: #ffe7a0;
    }

    .hero-army-row span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-army-row b {
      color: #ffe7a0;
      font-weight: 700;
      font-size: 10px;
    }

    .hero-army-row button {
      height: 20px;
      min-width: 38px;
      border: 1px solid rgba(117, 255, 87, 0.32);
      background: rgba(3, 32, 20, 0.62);
      color: #effcff;
      cursor: pointer;
      font-size: 10px;
    }

    .hero-army-row button:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .hero-equipment-bag {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
      grid-auto-rows: 52px;
      gap: 6px;
      min-height: 0;
      align-content: start;
      overflow-y: auto;
      scrollbar-gutter: stable;
    }

    .hero-equipment-filter {
      grid-template-columns: minmax(0, 1fr) auto auto;
      align-items: center;
      gap: 8px;
    }

    .hero-equipment-filter select {
      max-width: 100%;
      padding: 3px 6px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background: #102b47;
      color: #effcff;
      font: inherit;
    }

    .hero-equipment-empty {
      grid-column: 1 / -1;
      margin: 0;
      padding: 8px 0;
      color: #a7becc;
    }

    .hero-equipment-item {
      min-width: 0;
      min-height: 0;
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr);
      align-items: center;
      gap: 4px;
      padding: 4px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.34);
      color: #dfffcf;
      cursor: pointer;
      font-size: 10px;
      text-align: left;
      overflow: hidden;
    }

    .hero-equipment-copy,
    .hero-equipment-copy strong,
    .hero-equipment-copy > span {
      display: block;
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-equipment-copy > span {
      color: #ffd46b;
      font-size: 9px;
    }

    .hero-equipment-item:disabled {
      cursor: default;
      opacity: 0.82;
    }

    .hero-equipment-item.level-locked {
      border-color: rgba(255, 179, 94, 0.34);
      opacity: 0.72;
    }

    .hero-equipment-item.menu-open,
    .equip-slot.menu-open {
      outline: 1px solid rgba(255, 220, 112, 0.88);
      outline-offset: 2px;
    }

    .hero-equipment-bag-icon {
      width: 32px;
      height: 32px;
    }

    .hero-skill-bag-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      padding: 6px 8px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.24);
      color: #b7f7ff;
      font-size: 11px;
    }

    .hero-skill-bag-head span {
      color: var(--muted);
      font-size: 10px;
    }

    .hero-skill-bag {
      display: grid;
      gap: 6px;
      min-height: 0;
      align-content: start;
      overflow-y: auto;
    }

    .hero-skill-bag-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 48px;
      gap: 5px;
      min-height: 54px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.28);
    }

    .hero-skill-bag-row.selected {
      border-color: rgba(255, 212, 107, 0.62);
      box-shadow: inset 0 0 12px rgba(255, 212, 107, 0.08);
    }

    .hero-skill-select {
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr);
      gap: 7px;
      align-items: center;
      min-width: 0;
      padding: 6px;
      border: 0;
      background: transparent;
      color: #effcff;
      text-align: left;
      cursor: pointer;
    }

    .hero-skill-copy,
    .hero-skill-copy strong,
    .hero-skill-copy small {
      display: block;
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-skill-copy strong {
      font-size: 11px;
    }

    .hero-skill-copy strong em {
      color: #ffd46b;
      font-style: normal;
    }

    .hero-skill-copy small {
      margin-top: 3px;
      color: var(--muted);
      font-size: 9px;
    }

    .hero-skill-equip {
      margin: 7px 5px 7px 0;
      border: 1px solid rgba(117, 255, 87, 0.34);
      background: rgba(3, 32, 20, 0.7);
      color: #dfffcf;
      font-size: 10px;
      cursor: pointer;
    }

    .hero-skill-icon {
      display: grid;
      place-items: center;
      width: 36px;
      height: 36px;
      border: 1px solid rgba(183, 247, 255, 0.46);
      background: linear-gradient(145deg, rgba(17, 84, 111, 0.88), rgba(2, 13, 24, 0.96));
      box-shadow: inset 0 0 10px rgba(32, 216, 255, 0.16);
      color: #effcff;
      font-size: 15px;
      font-weight: 800;
      overflow: hidden;
    }

    .hero-skill-icon img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .hero-skill-icon.active {
      border-color: rgba(255, 114, 84, 0.7);
      background: linear-gradient(145deg, rgba(126, 38, 24, 0.92), rgba(31, 8, 7, 0.98));
      color: #ffd4c8;
    }

    .hero-skill-icon.passive {
      border-color: rgba(117, 255, 87, 0.6);
      background: linear-gradient(145deg, rgba(25, 91, 47, 0.92), rgba(3, 24, 15, 0.98));
      color: #dfffcf;
    }

    .hero-skill-icon.large {
      width: 46px;
      height: 46px;
      font-size: 18px;
    }

    .hero-skill-panel {
      display: grid;
      grid-template-rows: auto auto minmax(108px, auto) 1fr;
      gap: 8px;
      min-height: 0;
      padding: 10px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: linear-gradient(180deg, rgba(3, 16, 28, 0.8), rgba(0, 0, 0, 0.34));
      overflow: hidden;
    }

    .hero-skill-slots {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 5px;
    }

    .hero-skill-slot {
      position: relative;
      min-width: 0;
      height: 82px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.28);
      overflow: hidden;
    }

    .hero-skill-slot.selected {
      border-color: rgba(255, 212, 107, 0.68);
      box-shadow: 0 0 10px rgba(255, 212, 107, 0.14);
    }

    .hero-skill-slot > button:first-child {
      display: grid;
      grid-template-rows: 36px auto auto;
      justify-items: center;
      gap: 2px;
      width: 100%;
      height: 100%;
      padding: 5px 3px;
      border: 0;
      background: transparent;
      color: #effcff;
      cursor: pointer;
    }

    .hero-skill-slot .hero-skill-icon {
      width: 34px;
      height: 34px;
      font-size: 13px;
    }

    .hero-skill-slot strong {
      max-width: 100%;
      overflow: hidden;
      color: #effcff;
      font-size: 9px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-skill-slot em {
      color: #ffd46b;
      font-size: 9px;
      font-style: normal;
    }

    .hero-skill-slot.empty {
      display: grid;
      place-items: center;
      align-content: center;
      gap: 4px;
      color: rgba(183, 247, 255, 0.38);
      font-size: 9px;
    }

    .hero-skill-slot.empty span {
      display: grid;
      place-items: center;
      width: 30px;
      height: 30px;
      border: 1px dashed rgba(183, 247, 255, 0.28);
    }

    .hero-skill-remove {
      position: absolute;
      right: 2px;
      top: 2px;
      z-index: 2;
      width: 18px;
      height: 18px;
      padding: 0;
      border: 1px solid rgba(255, 114, 84, 0.45);
      background: rgba(42, 4, 4, 0.88);
      color: #ffd4c8;
      line-height: 16px;
      cursor: pointer;
    }

    .hero-skill-detail {
      display: grid;
      gap: 6px;
      padding: 9px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.26);
      overflow: hidden;
    }

    .hero-skill-detail-head {
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .hero-skill-detail-head div {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .hero-skill-detail-head strong {
      overflow: hidden;
      color: #ffffff;
      font-size: 13px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-skill-detail-head span,
    .hero-skill-detail small {
      color: var(--muted);
      font-size: 9px;
    }

    .hero-skill-detail-head > b {
      color: #ffd46b;
      font-size: 18px;
    }

    .hero-skill-detail p {
      margin: 0;
      color: #dfffcf;
      font-size: 11px;
      line-height: 16px;
    }

    .hero-skill-enhance {
      display: grid;
      align-content: start;
      gap: 9px;
      min-height: 0;
      padding: 10px;
      border: 1px solid rgba(255, 212, 107, 0.28);
      background: rgba(18, 13, 3, 0.38);
    }

    .hero-skill-enhance-head,
    .hero-skill-enhance-meta,
    .hero-skill-enhance-actions {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: center;
    }

    .hero-skill-enhance-head strong {
      color: #ffd46b;
      font-size: 12px;
    }

    .hero-skill-enhance-head span,
    .hero-skill-enhance-meta {
      color: var(--muted);
      font-size: 10px;
    }

    .hero-skill-enhance-meta {
      grid-template-columns: 1fr auto auto;
    }

    .hero-skill-enhance-meta b,
    .hero-skill-enhance-meta strong {
      color: #effcff;
    }

    .hero-skill-enhance input[type="range"] {
      width: 100%;
      accent-color: #ffd46b;
    }

    .hero-skill-enhance-actions button {
      min-height: 30px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(3, 18, 30, 0.84);
      color: #effcff;
      cursor: pointer;
    }

    .hero-skill-enhance-actions button.primary {
      border-color: rgba(255, 212, 107, 0.62);
      background: rgba(75, 47, 4, 0.76);
      color: #fff1bd;
    }

    .hero-skill-enhance-actions button:disabled {
      opacity: 0.42;
      cursor: default;
    }

    .hero-skill-empty {
      padding: 18px 10px;
      border: 1px dashed rgba(183, 247, 255, 0.22);
      color: var(--muted);
      font-size: 10px;
      text-align: center;
    }

    .hero-skill-empty-panel {
      align-self: stretch;
      display: grid;
      place-items: center;
    }

    @media (max-width: 760px) {
      .hero-detail-body {
        grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
      }

      .hero-skill-slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .hero-skill-slot {
        height: 70px;
      }
    }

    .hero-resource-carry {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      overflow: hidden;
    }

    .hero-resource-card {
      display: grid;
      grid-template-columns: 24px 1fr;
      gap: 3px 5px;
      align-items: center;
      min-width: 0;
      padding: 4px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.3);
      color: #dfffcf;
      font-size: 10px;
    }

    .hero-resource-card img {
      grid-row: 1 / 3;
      width: 22px;
      height: 22px;
      object-fit: contain;
      filter: drop-shadow(0 0 5px rgba(120, 229, 255, 0.32));
    }

    .hero-resource-card strong,
    .hero-resource-card span {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-resource-card span {
      color: #aee7a0;
      font-size: 9px;
      line-height: 11px;
    }

    .hero-resource-card-actions {
      grid-column: 1 / 3;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
    }

    .hero-resource-card button {
      height: 18px;
      border: 1px solid rgba(117, 255, 87, 0.32);
      background: rgba(3, 32, 20, 0.62);
      color: #effcff;
      cursor: pointer;
      font-size: 9px;
    }

    .hero-resource-card button:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .hero-equipment-panel {
      display: grid;
      grid-template-rows: auto minmax(244px, 1fr) auto auto;
      gap: 8px;
      min-height: 0;
      padding: 10px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background:
        linear-gradient(180deg, rgba(3, 16, 28, 0.76), rgba(0, 0, 0, 0.28)),
        radial-gradient(circle at 50% 28%, rgba(47, 125, 255, 0.14), transparent 45%);
      overflow: hidden;
    }

    .hero-equipment-title {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      padding: 4px 6px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.22);
      color: #b7f7ff;
      font-size: 12px;
    }

    .hero-equipment-title span {
      color: var(--muted);
      font-size: 10px;
    }

    .hero-equipment-stage {
      position: relative;
      min-height: 244px;
      border: 1px solid rgba(183, 247, 255, 0.22);
      background:
        radial-gradient(circle at 50% 45%, rgba(47, 125, 255, 0.18), transparent 42%),
        linear-gradient(180deg, rgba(7, 20, 45, 0.62), rgba(2, 6, 18, 0.84)),
        repeating-linear-gradient(0deg, rgba(183, 247, 255, 0.04), rgba(183, 247, 255, 0.04) 2px, transparent 2px, transparent 7px);
      overflow: hidden;
    }

    .hero-silhouette {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 118px;
      height: 260px;
      transform: translate(-50%, -50%);
      z-index: 0;
      opacity: 0.22;
      background: linear-gradient(180deg, #b7f7ff, #20304a);
      clip-path: polygon(42% 0, 66% 0, 66% 18%, 56% 28%, 70% 38%, 62% 55%, 62% 100%, 42% 100%, 42% 56%, 30% 38%, 42% 28%);
    }

    .hero-bust {
      position: absolute;
      left: 50%;
      top: 49%;
      width: 176px;
      height: 236px;
      transform: translate(-50%, -50%);
      z-index: 1;
      border: 1px solid color-mix(in srgb, var(--hero-quality, var(--faction)) 62%, rgba(183, 247, 255, 0.24));
      background: rgba(0, 0, 0, 0.34);
      box-shadow: 0 0 22px color-mix(in srgb, var(--hero-quality, var(--faction)) 30%, transparent);
      object-fit: cover;
      object-position: center top;
      opacity: 0.88;
    }

    .equip-slot {
      position: absolute;
      z-index: 2;
      width: 46px;
      height: 40px;
      display: grid;
      place-items: center;
      padding: 4px;
      border: 2px solid rgba(47, 125, 255, 0.62);
      background: rgba(0, 0, 0, 0.28);
      box-shadow: 0 0 10px rgba(47, 125, 255, 0.18);
      color: #78e5ff;
      font-size: 10px;
      line-height: 12px;
      text-align: center;
      overflow: hidden;
      font-family: inherit;
      cursor: default;
    }

    button.equip-slot.filled {
      cursor: pointer;
    }

    .equip-slot.filled {
      padding: 0;
      border-color: var(--hero-quality, rgba(183, 247, 255, 0.62));
      background: linear-gradient(180deg, rgba(12, 35, 52, 0.78), rgba(0, 0, 0, 0.46));
      color: #f5fbff;
      box-shadow: 0 0 12px color-mix(in srgb, var(--hero-quality, var(--faction)) 42%, transparent);
      overflow: visible;
    }

    .equip-slot.filled:hover,
    .equip-slot.filled:focus-visible {
      z-index: 12;
      outline: 1px solid rgba(183, 247, 255, 0.72);
      outline-offset: 2px;
    }

    .equipment-hover-card {
      position: absolute;
      z-index: 70;
      display: grid;
      gap: 7px;
      width: 260px;
      box-sizing: border-box;
      padding: 9px;
      border: 1px solid rgba(183, 247, 255, 0.54);
      background: linear-gradient(180deg, rgba(8, 24, 38, 0.98), rgba(1, 7, 13, 0.99));
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.66), inset 0 0 16px rgba(32, 216, 255, 0.08);
      color: #dff6ff;
      font-size: 10px;
      font-style: normal;
      font-weight: 400;
      line-height: 14px;
      text-align: left;
      white-space: normal;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(4px);
      transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
    }

    .equipment-hover-card.open {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }

    .equipment-hover-head {
      position: relative;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 2px 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.18);
    }

    .equipment-hover-head strong {
      min-width: 0;
      overflow: hidden;
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .equipment-hover-head > em {
      color: #ffd46b;
      font-size: 12px;
      font-style: normal;
      font-weight: 700;
    }

    .equipment-hover-head small {
      grid-column: 1 / -1;
      color: #8eb2c2;
      font-size: 9px;
    }

    .equipment-hover-section {
      display: grid;
      gap: 4px;
    }

    .equipment-hover-section > b {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: #8deeff;
      font-size: 10px;
    }

    .equipment-hover-section > b em {
      color: #ffd46b;
      font-style: normal;
    }

    .equipment-hover-section > span {
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr);
      gap: 5px;
      color: #d7e9ef;
    }

    .equipment-hover-section > span > i {
      color: #88a9b7;
      font-style: normal;
    }

    .equipment-hover-set > span {
      grid-template-columns: 42px minmax(0, 1fr) auto;
      color: #8299a8;
    }

    .equipment-hover-set > span.active {
      color: #8dff75;
    }

    .equipment-hover-set > span small {
      align-self: start;
      color: #ffd46b;
      font-size: 8px;
      white-space: nowrap;
    }

    .equipment-hover-unidentified {
      padding: 7px;
      border: 1px dashed rgba(255, 212, 107, 0.34);
      color: #ffd46b;
    }

    .hero-equipment-action-popover {
      position: absolute;
      z-index: 90;
      width: 148px;
      display: grid;
      gap: 5px;
      padding: 7px;
      border: 1px solid rgba(183, 247, 255, 0.62);
      background: rgba(3, 10, 18, 0.99);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.64), inset 0 0 12px rgba(32, 216, 255, 0.08);
    }

    .hero-equipment-action-popover.detail {
      width: 300px;
    }

    .hero-equipment-action-title {
      overflow: hidden;
      padding: 2px 3px 5px;
      color: #effcff;
      font-size: 11px;
      line-height: 15px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .hero-equipment-action-popover button {
      width: 100%;
      height: 29px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(13, 36, 52, 0.92);
      color: #effcff;
      font-size: 11px;
      cursor: pointer;
    }

    .hero-equipment-action-popover button:hover:not(:disabled) {
      border-color: rgba(117, 255, 87, 0.62);
      color: #eaffdf;
    }

    .hero-equipment-action-popover button.danger {
      border-color: rgba(255, 108, 108, 0.52);
      color: #ffb1b1;
    }

    .hero-equipment-action-popover button:disabled {
      opacity: 0.42;
      cursor: default;
    }

    .hero-equipment-action-detail {
      display: grid;
      gap: 4px;
      padding: 4px 3px 7px;
    }

    .hero-equipment-action-detail span,
    .hero-equipment-action-warning {
      color: var(--muted);
      font-size: 10px;
      line-height: 15px;
    }

    .hero-equipment-action-warning {
      padding: 2px 3px 5px;
      color: #ffb1b1;
    }

    .equip-slot em {
      display: block;
      color: #ffd46b;
      font-style: normal;
      font-size: 9px;
    }

    .equip-slot.filled em {
      position: absolute;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 2;
      padding: 1px 2px;
      background: rgba(0, 0, 0, 0.72);
      font-size: 8px;
      line-height: 11px;
    }

    .equipment-slot-icon {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .equip-slot b {
      display: block;
      max-width: 100%;
      font-weight: 500;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .equip-weapon { left: 8px; top: 14px; }
    .equip-bracer { left: 8px; top: 76px; }
    .equip-legs { left: 8px; top: 138px; }
    .equip-boots { left: 8px; top: 200px; }
    .equip-helmet { right: 8px; top: 14px; }
    .equip-armor { right: 8px; top: 76px; }
    .equip-ring { right: 8px; top: 138px; }
    .equip-trinket { right: 8px; top: 200px; }

    .hero-derived-stats {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 5px 12px;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.22);
      background: rgba(3, 12, 18, 0.54);
      color: #dfffcf;
      font-size: 11px;
      line-height: 15px;
    }

    .hero-derived-stats span {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-equipment-set-summary {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px;
      max-height: 62px;
      min-height: 28px;
      padding-right: 2px;
      overflow-x: hidden;
      overflow-y: auto;
    }

    .hero-equipment-set-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2px 6px;
      min-width: 0;
      padding: 4px 6px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.3);
      color: #8299a8;
      font-size: 9px;
      line-height: 12px;
    }

    .hero-equipment-set-row strong {
      grid-column: 1 / -1;
      display: flex;
      justify-content: space-between;
      gap: 6px;
      min-width: 0;
      overflow: hidden;
      color: #d9f8ff;
      font-size: 10px;
      font-weight: 600;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-equipment-set-row strong b {
      flex: 0 0 auto;
      color: #ffd46b;
      font-size: 9px;
    }

    .hero-equipment-set-row span.active {
      color: #8dff75;
    }

    .hero-equipment-set-empty {
      grid-column: 1 / -1;
      align-self: center;
      padding: 5px 7px;
      border: 1px solid rgba(183, 247, 255, 0.14);
      color: #8299a8;
      font-size: 10px;
    }

    .main-console {
      display: none;
      left: 50%;
      top: 88px;
      width: 360px;
      transform: translateX(-50%);
      padding: 14px 16px;
      color: var(--text);
      background: rgba(12, 64, 38, 0.54);
      border: 2px solid rgba(255, 69, 69, 0.78);
      box-shadow: inset 0 0 22px rgba(255, 54, 54, 0.16), 0 0 24px rgba(0, 0, 0, 0.45);
      clip-path: none;
    }

    .main-console strong {
      display: block;
      margin-bottom: 6px;
      color: #b7f7ff;
      font-size: 15px;
    }

    .main-console span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      line-height: 18px;
    }

    .hud-button {
      pointer-events: auto;
      min-width: 96px;
      height: 30px;
      text-align: left;
      color: #f6ffe9;
      background: rgba(38, 80, 33, 0.54);
      border: 2px solid rgba(255, 255, 255, 0.72);
      text-shadow: 0 1px 2px #000;
      backdrop-filter: blur(2px);
    }

    .city-function-rail .hud-button {
      position: relative;
      display: grid;
      place-items: center;
      min-width: 42px;
      width: 42px;
      height: 28px;
      padding: 0;
      color: #dfffcf;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      font-size: 0;
      line-height: 20px;
      text-shadow: 0 1px 1px #001a07;
      backdrop-filter: none;
    }

    .training-queue-emblem {
      position: relative;
      height: 100%;
      aspect-ratio: 1;
      max-width: 100%;
    }

    .training-queue-emblem::before {
      content: "";
      position: absolute;
      inset: 0 11% 50%;
      background: linear-gradient(105deg, #001503, #031e08 65%, #001001);
    }

    .training-queue-emblem .trainee {
      position: absolute;
      width: 73%;
      height: 73%;
      top: 0;
      left: 27%;
      clip-path: polygon(31% 0, 68% 0, 70% 42%, 84% 49%, 78% 65%, 22% 65%, 16% 49%, 30% 42%);
    }

    .training-queue-emblem .trainee-front {
      left: -3%;
      top: 1%;
      width: 79%;
      height: 79%;
    }

    .queue-hud-count {
      position: absolute;
      right: 1px;
      bottom: 0;
      min-width: 13px;
      padding: 0 2px;
      border: 1px solid #608957;
      background: #112712;
      color: #e1ffbf;
      font: bold 10px/12px Arial, sans-serif;
      text-align: center;
      pointer-events: none;
    }

    .city-function-rail .hud-button.active {
      border-color: rgba(230, 255, 185, 1);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.56),
        inset 0 -1px 0 rgba(0, 0, 0, 0.62),
        0 0 10px rgba(117, 255, 87, 0.48);
    }

    .city-function-icon {
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      grid-template: minmax(0, 1fr) / minmax(0, 1fr);
      display: grid;
      place-items: center;
      color: #f6ffe9;
      font-size: 13px;
      font-style: normal;
      line-height: 28px;
      filter: drop-shadow(0 1px 1px #001a07);
    }

    .city-function-icon img {
      display: block;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      object-fit: contain;
      pointer-events: none;
    }

    .city-function-icon svg {
      display: block;
      width: 100%;
      height: 100%;
      overflow: visible;
    }

    .city-function-icon path,
    .city-function-icon rect,
    .city-function-icon circle,
    .city-function-icon line,
    .city-function-icon polyline,
    .city-function-icon polygon {
      fill: none;
      stroke: currentColor;
      stroke-width: 1.6;
      stroke-linecap: square;
      stroke-linejoin: miter;
      vector-effect: non-scaling-stroke;
    }

    .city-function-icon .icon-fill {
      fill: rgba(215, 255, 178, 0.18);
    }

    .city-function-rail .hud-button:hover {
      border-color: rgba(215, 255, 178, 0.96);
      color: #ffffff;
      background:
        linear-gradient(180deg, rgba(216, 255, 171, 0.5) 0, rgba(58, 178, 48, 0.94) 42%, rgba(11, 92, 22, 0.98) 100%);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.46),
        0 0 8px rgba(74, 255, 75, 0.42);
    }

    .stage {
      --resource-art-rotation: -30deg;
      --resource-art-ground-skew: -30deg;
      --resource-art-height-scale: 0.866;
      position: absolute;
      left: 0;
      top: 0;
      width: 3494px;
      height: 1643px;
      transform: translate(0, 0);
      transform-style: preserve-3d;
      transform-origin: 0 0;
      border: 0;
      --city-terrain: url("../game_design/art_reference/generated_cities/original_recolor_v1_20261118/terran-city-ground.webp?v=original-ground-recolor-v19");
      background: var(--city-terrain) center / 100% 100% no-repeat;
      box-shadow: inset 0 0 54px rgba(32, 216, 255, 0.08);
      cursor: crosshair;
      touch-action: none;
    }

    .stage.zerg {
      --city-terrain: url("../game_design/art_reference/generated_cities/native_terrain_v1_20261118/zerg-city-ground.webp?v=city-floor-v31");
    }

    .stage.protoss {
      --city-terrain: url("../game_design/art_reference/generated_cities/native_terrain_v1_20261118/protoss-city-ground.webp?v=city-floor-v31");
    }

    .cell-hover {
      position: absolute;
      width: var(--cell-x);
      height: var(--cell-y);
      display: none;
      pointer-events: none;
      background: rgba(32, 216, 255, 0.1);
      border: 1px solid rgba(183, 247, 255, 0.7);
      border-radius: 4px;
      box-shadow: 0 0 14px rgba(32, 216, 255, 0.22);
      z-index: 4;
    }

    .cell-hover.invalid {
      background: rgba(255, 62, 54, 0.18);
      border-color: var(--bad);
    }

    .build-overlay {
      position: absolute;
      inset: 0;
      display: none;
      pointer-events: none;
      z-index: 1;
    }

    .build-overlay.active {
      display: block;
    }

    .build-cell {
      position: absolute;
      width: calc(var(--cell-x) - 4px);
      height: calc(var(--cell-y) - 4px);
      margin: 2px;
      border: 1px solid rgba(148, 255, 158, 0.2);
      border-radius: 4px;
      background: rgba(148, 255, 158, 0.1);
      box-shadow: inset 0 0 10px rgba(98, 240, 106, 0.08);
    }

    .stage.protoss .build-cell:not(.invalid):not(.footprint) {
      border-color: rgba(0, 104, 42, 0.76);
      background: rgba(20, 166, 64, 0.2);
      box-shadow:
        inset 0 0 0 1px rgba(0, 76, 28, 0.2),
        inset 0 0 14px rgba(0, 112, 42, 0.18);
    }

    .build-cell.invalid {
      background: rgba(255, 62, 54, 0.09);
      border-color: rgba(255, 62, 54, 0.3);
      box-shadow: inset 0 0 10px rgba(255, 62, 54, 0.08);
    }

    .build-cell.footprint {
      border-color: rgba(183, 247, 255, 0.82);
      background: rgba(32, 216, 255, 0.22);
      box-shadow: inset 0 0 12px rgba(32, 216, 255, 0.18), 0 0 10px rgba(32, 216, 255, 0.14);
    }

    .build-cell.invalid.footprint {
      border-color: rgba(255, 62, 54, 0.72);
      background: rgba(255, 62, 54, 0.2);
      box-shadow: inset 0 0 12px rgba(255, 62, 54, 0.16), 0 0 10px rgba(255, 62, 54, 0.12);
    }

    .harvester-layer {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 4;
    }

    .resource-node-layer {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 2;
    }

    .resource-node {
      position: absolute;
      width: calc(var(--cell-x) * var(--node-cols, 3) + 16px);
      height: calc(var(--cell-y) * var(--node-rows, 2) + 24px);
      transform: translate(-8px, -12px);
      transform-origin: 50% 78%;
      filter: none;
    }

    .resource-node::before {
      content: "";
      position: absolute;
      left: 20px;
      right: 20px;
      bottom: 15px;
      height: 20px;
      background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.32) 58%, transparent 80%);
      transform: scaleX(1.12) scaleY(0.25);
      transform-origin: 50% 50%;
      filter: blur(1px);
      opacity: 0.88;
      z-index: 0;
    }

    .resource-node::after {
      content: "";
      position: absolute;
      left: 12px;
      top: 12px;
      width: calc(var(--cell-x) * var(--node-cols, 3));
      height: calc(var(--cell-y) * var(--node-rows, 2));
      border: 1px solid rgba(183, 247, 255, 0.12);
      background:
        radial-gradient(ellipse at center, rgba(32, 216, 255, 0.1), rgba(32, 216, 255, 0.035) 45%, transparent 72%);
      box-shadow: none;
      clip-path: polygon(4% 50%, 50% 20%, 96% 50%, 50% 80%);
      transform: scaleX(1.02) scaleY(0.88);
      transform-origin: 50% 78%;
      z-index: 0;
    }

    .stage.zerg .resource-node::after {
      border-color: rgba(126, 64, 160, 0.08);
      background:
        radial-gradient(ellipse at center, rgba(91, 214, 64, 0.09), rgba(96, 48, 128, 0.06) 46%, transparent 76%);
      opacity: 0.55;
    }

    .stage.protoss .resource-node::after {
      border-color: rgba(95, 170, 255, 0.08);
      background:
        radial-gradient(ellipse at center, rgba(85, 178, 255, 0.08), rgba(238, 207, 112, 0.035) 48%, transparent 76%);
      opacity: 0.42;
    }

    .stage.zerg .resource-node {
      filter: none;
    }

    .stage.protoss .resource-node {
      filter: none;
    }

    .stage.zerg .resource-node,
    .stage.protoss .resource-node {
      width: calc(var(--cell-x) * var(--node-cols, 3));
      height: calc(var(--cell-y) * var(--node-rows, 2));
      transform: none;
    }

    .stage:not(.zerg):not(.protoss) .resource-node {
      width: calc(var(--cell-x) * var(--node-cols, 3));
      height: calc(var(--cell-y) * var(--node-rows, 2));
      transform: none;
    }

    .stage.zerg .resource-node::after,
    .stage.protoss .resource-node::after {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }

    .stage:not(.zerg):not(.protoss) .resource-node::after {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }

    .resource-node img {
      display: block;
      width: var(--node-art-width, 100%);
      height: var(--node-art-height, 100%);
      object-fit: contain;
      position: absolute;
      left: 50%;
      bottom: var(--node-art-bottom, 0px);
      z-index: 1;
      transform: translateX(-50%);
      transform-origin: 50% 100%;
      filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.92)) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.58));
      user-select: none;
      -webkit-user-drag: none;
    }

    .resource-node.covered {
      display: none;
    }

    .resource-node-label {
      position: absolute;
      left: 50%;
      bottom: 6px;
      min-width: 58px;
      transform: translateX(-50%);
      z-index: 2;
      padding: 2px 6px;
      color: var(--good);
      background: rgba(5, 9, 22, 0.76);
      border: 1px solid rgba(98, 240, 106, 0.45);
      font-size: 11px;
      text-align: center;
      white-space: nowrap;
    }

    .harvester {
      position:absolute; top:0; left:0; width:68px; height:68px; margin:-34px;
      pointer-events:none;
    }
    .harvester canvas {
      display:block; width:100%; height:100%;
      filter:drop-shadow(1px 4px 2px #13152188);
    }
    .stage.zerg .harvester canvas {
      filter: sepia(1) saturate(3.1) hue-rotate(230deg) brightness(1.28) drop-shadow(1px 4px 2px #24132ecc);
    }
    .harvester.carrying::after {
      content:""; position:absolute; left:44%; top:22%; width:18px; height:20px;
      background:linear-gradient(120deg,#cbffff,#4edbff 42%,#2266ac 46%,#98fbff);
      clip-path:polygon(45% 0,100% 33%,75% 95%,25% 100%,0 40%);
    }
    .harvester.cargo-alloy.carrying::after {
      background: linear-gradient(135deg,#e2f2b6,#84964e 45%,#44593a 48%,#cee793);
    }
    .harvester.cargo-rare.carrying::after {
      background: linear-gradient(135deg,#ffe5ab,#cb984e 45%,#885424 48%,#f3c877);
    }
    .harvester.cargo-shard.carrying::after {
      background: linear-gradient(135deg,#ffd3ce,#ed6767 45%,#a12445 48%,#ffb3b5);
    }
    .harvester.cargo-gas.carrying::after {
      background:radial-gradient(at 35% 25%,#d2ffc1,#62c873 45%,#205530 80%);
      clip-path:none; border-radius:44%; height:15px;
    }

    .building {
      position: absolute;
      display: grid;
      place-items: center;
      overflow: visible;
      clip-path: none;
      width: var(--cell-x);
      height: var(--cell-y);
      margin: 0;
      padding: 0;
      gap: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      cursor: grab;
      transform-style: preserve-3d;
      user-select: none;
      z-index: 3;
    }

    .building::before {
      content: "";
      position: absolute;
      left: 10%;
      right: 10%;
      bottom: -4px;
      height: 22%;
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.32) 45%, rgba(0, 0, 0, 0.08) 68%, transparent 82%);
      filter: blur(1px);
      transform: scale(var(--city-building-scale, 1)) scaleX(1.02) scaleY(0.5);
      pointer-events: none;
      z-index: 0;
    }

    .building::after {
      content: "";
      position: absolute;
      left: 3%;
      right: 3%;
      bottom: -8px;
      height: 32%;
      border-radius: 50%;
      border: 1px solid transparent;
      background:
        radial-gradient(ellipse at center, rgba(42, 24, 12, 0.28), rgba(42, 24, 12, 0.12) 45%, transparent 74%);
      transform: scale(var(--city-building-scale, 1)) scaleX(1.08) scaleY(0.58);
      pointer-events: none;
      z-index: -1;
    }

    .building.large::before {
      left: 8%;
      right: 8%;
      bottom: -5px;
      height: 20%;
    }

    .building.large::after {
      left: 2%;
      right: 2%;
      bottom: -10px;
      height: 29%;
    }

    .building.large {
      width: calc(var(--cell-x) * var(--cols));
      height: calc(var(--cell-y) * var(--rows));
    }

    .building.selected {
      background: transparent;
      box-shadow: none;
    }

    .building.busy .building-art {
      opacity: 0.72;
      filter:
        grayscale(0.28)
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.62))
        drop-shadow(0 0 9px rgba(255, 214, 107, 0.18));
    }

    .building.selected::after {
      border-color: rgba(183, 247, 255, 0.46);
      background:
        radial-gradient(ellipse at center, rgba(42, 24, 12, 0.26), rgba(42, 24, 12, 0.12) 44%, transparent 74%),
        radial-gradient(ellipse at center, var(--faction-soft), rgba(32, 216, 255, 0.06) 50%, transparent 76%);
      box-shadow: 0 0 12px var(--faction-soft);
    }

    .building.grounded::before,
    .building.grounded::after,
    .building.grounded.selected::after {
      display: none;
    }

    .building-art {
      position: absolute;
      left: var(--art-left, 50%);
      bottom: var(--art-bottom, -8px);
      width: var(--art-width, calc(100% - 8px));
      height: var(--art-height, calc(100% + 18px));
      object-fit: contain;
      object-position: 50% 100%;
      transform: translateX(-50%) scale(var(--city-building-scale, 1));
      transform-origin: 50% 100%;
      pointer-events: none;
      filter:
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.55))
        drop-shadow(0 6px 4px rgba(0, 0, 0, 0.38))
        drop-shadow(0 0 7px var(--faction-soft));
      z-index: 1;
    }

    .stage {
      --ground-ambient: rgb(41 31 21 / .72);
      --city-art-light: brightness(.91) saturate(.91);
    }
    .stage.protoss {
      --ground-ambient: rgb(32 33 51 / .78);
      --city-art-light: brightness(.86) saturate(.86);
    }
    .stage.zerg {
      --ground-ambient: rgb(41 26 35 / .72);
      --city-art-light: brightness(.93) saturate(.92);
    }
    .stage {
      --collector-color: contrast(1.13) saturate(1.55) brightness(1.03);
    }
    .stage.zerg {
      --collector-color: hue-rotate(42deg) contrast(1.14) saturate(1.55);
    }
    .stage.protoss {
      --collector-color: contrast(1.1) saturate(1.85) brightness(.93);
    }
    .stage .building.resource > .building-art {
      filter: var(--collector-color);
    }
    .stage .building.resource.busy > .building-art {
      filter: var(--collector-color) saturate(.86) brightness(.94);
    }

    .building.grounded .building-art,
    .building-gear-section img,
    .building-gate-crown img {
      object-fit: contain;
      filter: var(--city-art-light);
    }

    /* A soft body shadow and a tighter contact shadow belong to the terrain,
       behind the unchanged sprite. Their box follows its measured padding. */
    .building-ground-shadow,
    .building-gear-section,
    .building-terrain-edge,
    .building-gate-layers,
    .building-socket-rim {
      position: absolute;
      left: var(--art-left, 50%);
      bottom: var(--ground-art-bottom, 0px);
      width: var(--art-width);
      height: var(--art-height);
      transform: translateX(-50%) scale(var(--city-building-scale, 1));
      transform-origin: 50% 100%;
      pointer-events: none;
      z-index: 0;
    }

    .building.landed-deck .building-art {
      object-position: 50% var(--deck-drop);
      clip-path: inset(0 0 calc(100% - var(--landed-seam) - .5px));
    }
    .building-gear-section { z-index: 1; }
    .building-gear-section img {
      display: block;
      width: 100%;
      height: 100%;
      transform: scaleY(var(--gear-scale));
      transform-origin: bottom;
      clip-path: inset(var(--gear-seam) 0 0);
    }
    .building.busy .building-gear-section { opacity: .72; }
    .building-terrain-edge {
      z-index: 2;
      background: var(--city-terrain) var(--terrain-origin) / var(--terrain-size) no-repeat;
      clip-path: var(--soil-edge);
      opacity: .72;
    }

    .building-ground-shadow {
      background:
        radial-gradient(ellipse 42% 6% at 50% var(--shadow-ground-line, 96%), rgba(9, 8, 7, .54), rgba(9, 8, 7, .22) 48%, transparent 85%),
        radial-gradient(ellipse 49% 17% at 53% calc(var(--shadow-ground-line, 96%) - 6%), rgba(8, 10, 12, .32), rgba(8, 10, 12, .13) 52%, transparent 86%);
      filter: blur(1.8px);
    }

    /* Reuse each sprite's alpha silhouette for a consistent cast direction.
       The projection stays at its measured base even when the body levitates. */
    .building-shadow-silhouette {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      transform: skewX(-16deg) scaleY(.34);
      transform-origin: 50% var(--shadow-ground-line, 96%);
      filter: brightness(0) blur(3px);
      opacity: .28;
      pointer-events: none;
    }

    .building.floating .building-ground-shadow {
      background: radial-gradient(ellipse 49% 17% at 53% calc(var(--shadow-ground-line, 96%) - 5%), rgba(5, 12, 22, .34), rgba(5, 12, 22, .14) 50%, transparent 88%);
      filter: blur(3px);
    }

    .building.floating .building-shadow-silhouette {
      opacity: .23;
      filter: brightness(0) blur(5px);
    }

    .stage.zerg .building-ground-shadow {
      opacity: .88;
    }

    /* The raised platform shades the open ground BETWEEN its four supports.
       Keep the shadow inside them, away from the outer/front edges of the feet. */
    .stage .building[data-blueprint="relay"] .building-ground-shadow {
      background:
        radial-gradient(ellipse 25% 7% at 56% 79%, rgba(6, 8, 10, .62), rgba(6, 8, 10, .32) 48%, transparent 88%),
        radial-gradient(ellipse 31% 10% at 56% 79%, rgba(6, 8, 10, .23), transparent 88%);
      filter: blur(1.4px);
    }

    .stage .building[data-blueprint="relay"] .building-shadow-silhouette {
      display: none;
    }

    /* Cast shadows use the original light direction. The short contact shadow
       uses just the bottom of the sprite, so toes and roots meet the terrain. */
    .building-ground-shadow[data-native-shadow="true"],
    .stage.zerg .building-ground-shadow[data-native-shadow="true"],
    .stage .building[data-blueprint="relay"] .building-ground-shadow[data-native-shadow="true"] {
      background: none;
      filter: none;
      opacity: 1;
    }

    .building.grounded .building-ground-shadow[data-native-shadow]::before {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(
        ellipse 47% calc(var(--ground-base-depth) * .49)
        at 50% calc(var(--shadow-ground-line) - var(--ground-base-depth) * .47),
        rgb(10 8 7 / .65) 36%, rgb(10 8 7 / .37) 69%, transparent 100%
      );
      pointer-events: none;
    }

    .building.grounded.busy .building-art {
      opacity: 1;
      filter: saturate(.86) brightness(.94);
    }

    /* Match the ground texture through the worn margin of the footprint. */
    .building-worked-ground {
      position: absolute;
      inset: 0;
      --front: calc(var(--shadow-ground-line) + 1.5%);
      --depth: min(calc(var(--art-height) * .5), calc(var(--art-width) * .42));
      clip-path: polygon(2% calc(var(--front) - var(--depth) * .58),
        20% calc(var(--front) - var(--depth) * .90), 67% calc(var(--front) - var(--depth)),
        95% calc(var(--front) - var(--depth) * .72), 98% calc(var(--front) - var(--depth) * .37),
        79% calc(var(--front) - var(--depth) * .08), 38% var(--front), 7% calc(var(--front) - var(--depth) * .24));
      background: var(--city-terrain) var(--terrain-origin) / var(--terrain-size) no-repeat;
      mask-image: radial-gradient(ellipse 56% 46% at 50% 73%, #000 52%, transparent);
      pointer-events: none;
    }
    .building-worked-ground::after {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(135deg, rgb(120 103 78 / .14), rgb(51 41 31 / .38));
    }
    .stage.protoss .building-worked-ground::after {
      background:
        linear-gradient(135deg, rgb(113 115 139 / .13), rgb(34 35 53 / .42));
    }

    .building-cast-plane {
      position: absolute;
      inset: 0;
      /* Project height onto the map plane, keeping the nearest edge at the base. */
      transform: matrix(1, 0, -.18, .48, 0, 0);
      transform-origin: 50% calc(var(--shadow-ground-line) - 4%);
    }

    .building-native-shadow {
      position: absolute;
      left: var(--native-shadow-left);
      bottom: calc(100% - var(--shadow-ground-line));
      width: var(--native-shadow-width);
      height: var(--native-shadow-height);
      max-width: none;
      object-fit: fill;
      filter: brightness(0) blur(1.8px);
      opacity: .54;
      pointer-events: none;
    }

    .building-foot-contact {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      transform: translate(.65%, .6%) scaleX(1.012);
      transform-origin: 50% var(--shadow-ground-line);
      filter: brightness(0) blur(.85px);
      mask-image: linear-gradient(transparent 52%, #000 79%);
      opacity: .86;
      pointer-events: none;
    }

    /* The open decks shade the floor inside their legs. The radius ends
       before the front toes, even as the city scales or the building moves. */
    .stage .building.landed-deck
      .building-ground-shadow[data-native-shadow="true"]::after {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse var(--deck-size) at var(--deck-center),
        rgb(12 10 9 / .88) 12%, rgb(20 17 15 / .72) 45%, rgb(24 20 18 / .32) 73%, transparent);
      clip-path: var(--deck-contact);
    }

    .landed-deck .building-cast-plane {
      transform: none;
      clip-path: var(--deck-contact);
      mask-image: radial-gradient(ellipse var(--deck-size) at var(--deck-center), #000 35%, transparent 97%);
    }
    .landed-deck .building-native-shadow { top: var(--native-shadow-top); bottom: auto; opacity: .42; }
    .landed-deck .building-foot-contact { opacity: 0; }
    .landed-deck .building-terrain-edge { opacity: .42; }

    .building-landing-foot {
      position: absolute;
      width: 16%;
      height: 5%;
      transform: translate(-45%, -10%);
      background: radial-gradient(ellipse closest-side, #181512 30%, rgb(26 19 13 / .73) 60%, transparent);
      pointer-events: none;
    }

    /* Grow the building's own lower roots into the creep. Flatten only the
       outer tissue and let the existing terrain show through at its edge. */
    .building-root-bed {
      position: absolute;
      inset: 0;
      transform: scale(1.075, .72);
      transform-origin: 50% var(--shadow-ground-line);
      mask-image: linear-gradient(transparent 57%, #000 84%);
      pointer-events: none;
    }
    .building-root-bed img {
      width: 100%;
      height: 100%;
      filter: grayscale(.83) sepia(.46) hue-rotate(292deg) brightness(.58);
      opacity: .8;
      pointer-events: none;
    }

    .building-socket-floor {
      position: absolute;
      left: var(--footing-center, 50%);
      bottom: calc(100% - var(--shadow-ground-line) - 4%);
      width: var(--floor-width, 84%);
      height: var(--floor-depth, 35%);
      transform: translateX(-50%);
      filter: saturate(.38) brightness(.59);
      mask-image: radial-gradient(ellipse closest-side, #000 58%, transparent);
      pointer-events: none;
    }

    .building-footing {
      position: absolute;
      left: var(--footing-center, 50%);
      bottom: calc(100% - var(--shadow-ground-line) - 2%);
      width: var(--footing-width, 76%);
      height: var(--footing-depth, 37%);
      transform: translateX(-50%);
      filter: brightness(.72) saturate(.72) drop-shadow(0 1px 0 #514b3c) drop-shadow(0 1px 0 #302e29);
      pointer-events: none;
    }

    /* The near lip occludes the lowest part of the crystal or pedestal. */
    .building-socket-rim { z-index: 2; }
    .building-socket-rim .building-footing {
      mask-image: linear-gradient(transparent var(--socket-lip, 58%), #000 calc(var(--socket-lip, 58%) + 9%));
    }
    .building-rear-pier {
      position: absolute;
      left: 11%;
      top: 32%;
      width: 76%;
      height: 62%;
      filter: brightness(.76) saturate(.63);
      pointer-events: none;
    }
    .stage.protoss .building[data-blueprint="pylon"] { --footing-center: 53%; --floor-width: 90%; --footing-width: 79%; --socket-lip: 73%; }
    .stage.protoss .building[data-blueprint="obelisk"] { --footing-width: 76%; --floor-width: 93%; --socket-lip: 85%; }
    .stage.protoss .building[data-blueprint="court"] { --floor-width: 78%; --footing-width: 66%; --socket-lip: 66%; }

    /* Keep shadows and selection on the occupied ground cells. Only the body
       and its alpha-derived click outline move above that fixed footprint. */
    .building.grounded.floating::before {
      display: block;
      left: 6%; right: 6%; bottom: 0; height: 18%;
      background: radial-gradient(ellipse, rgba(0, 7, 16, .18), rgba(0, 7, 16, .07) 48%, transparent 76%);
      filter: blur(2px);
      transform: scale(var(--city-building-scale, 1)) scaleY(.6);
    }

    .building.grounded.floating::after {
      display: block;
      left: 20%; right: 20%; bottom: 2%; height: 10%;
      border: 1px solid rgba(100, 202, 255, .18);
      background: radial-gradient(ellipse, rgba(75, 175, 255, .20), rgba(75, 175, 255, .08) 38%, transparent 76%);
      box-shadow: none;
      transform: scale(var(--city-building-scale, 1)) scaleY(.6);
      z-index: 0;
    }

    .building.grounded.floating.selected::after {
      display: block;
      border-color: rgba(132, 219, 255, .54);
      background: radial-gradient(ellipse, rgba(75, 175, 255, .25), transparent 76%);
    }

    .building.shaped-hit .building-art-hit {
      position: absolute;
      left: var(--art-left, 50%); bottom: var(--art-bottom);
      width: var(--art-width); height: var(--art-height);
      transform: translateX(-50%) scale(var(--city-building-scale, 1));
      transform-origin: 50% 100%;
      clip-path: var(--art-hit-clip);
      pointer-events: auto;
      z-index: 2;
    }

    /* The same patch of soil tints just the lower surfaces. This is clipped
       to the visible body, including the gaps between landing struts. */
    .building-art-hit::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(var(--ground-ambient), var(--ground-ambient)),
        var(--city-terrain) var(--terrain-origin) / var(--terrain-size) no-repeat;
      mask-image: linear-gradient(transparent 38%, rgb(0 0 0 / .08) 66%, rgb(0 0 0 / .20) 83%, rgb(0 0 0 / .42) 99%);
      pointer-events: none;
    }
    .building-gate-crown .building-art-hit::before { background: var(--ground-ambient); }

    /* The gate artwork has two detached alpha islands. The dividing line
       lies wholly in the transparent gap; both hit areas use the same split. */
    .seated-gate {
      --gate-bottom: polygon(0 75%, 100% 23%, 100% 100%, 0 100%);
    }
    .seated-gate .building-foot-contact,
    .seated-gate .building-art,
    .building-gate-base { clip-path: var(--gate-bottom); }
    .building-gate-layers { z-index: 2; }
    .building-gate-base, .building-gate-crown, .building-gate-crown img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }
    .building-gate-crown {
      clip-path: polygon(0 0, 100% 0, 100% 23%, 0 75%);
      transform: translate(5%, 17%);
    }
    .building.busy .building-gate-crown img { opacity: .72; }
    .building.shaped-hit .building-gate-layers .building-art-hit {
      inset: 0;
      width: 100%;
      height: 100%;
      transform: none;
    }

    .building.core .building-art {
      bottom: var(--art-bottom, -14px);
      width: var(--art-width, calc(100% - 10px));
      height: var(--art-height, calc(100% + 54px));
    }

    .building.resource .building-art,
    .building.military.large .building-art {
      width: var(--art-width, calc(100% - 8px));
      height: var(--art-height, calc(100% + 38px));
    }

    .building.supply .building-art,
    .building.detector .building-art,
    .building.defense .building-art {
      width: var(--art-width, calc(100% - 6px));
      height: var(--art-height, calc(100% + 16px));
    }

    .building-label {
      position: absolute;
      left: 0;
      top: 0;
      min-width: 64px;
      padding: 2px 6px 3px;
      border: 1px solid rgba(100, 218, 255, 0.48);
      background: rgba(4, 10, 20, 0.9);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.72);
      color: #f4fbff;
      font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
      font-size: 12px;
      font-weight: 600;
      line-height: 18px;
      letter-spacing: 0;
      text-align: center;
      text-rendering: optimizeLegibility;
      text-shadow: 0 1px 0 #000, 0 0 2px rgba(0, 0, 0, 0.9);
      white-space: nowrap;
      pointer-events: none;
    }

    .building-label-layer {
      position: absolute;
      inset: 0;
      z-index: 5;
      overflow: hidden;
      pointer-events: none;
      contain: layout paint;
    }

    .building-label.busy {
      color: #ffe7a0;
      border-color: rgba(255, 214, 107, 0.46);
      background: rgba(28, 20, 8, 0.92);
    }

    .rightbar {
      grid-column: 3;
      grid-row: 2 / 4;
      display: grid;
      grid-template-rows: auto auto 1fr;
      border-width: 0 0 0 1px;
      min-height: 0;
    }

    .stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      padding: 12px;
      border-bottom: 1px solid var(--line);
    }

    .stat {
      display: flex;
      align-items: center;
      height: 42px;
      padding: 0 10px;
      gap: 8px;
      background: rgba(5, 9, 22, 0.52);
      border: 1px solid var(--line);
      clip-path: var(--cut);
      font-size: 12px;
    }

    .stat strong {
      display: block;
      color: #b7f7ff;
      font-size: 14px;
      line-height: 16px;
    }

    .detail {
      padding: 14px;
      border-bottom: 1px solid var(--line);
    }

    .detail h2 {
      margin: 0 0 8px;
      font-size: 18px;
      letter-spacing: 0;
    }

    .detail p {
      min-height: 42px;
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 21px;
    }

    .detail-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
    }

    .tag {
      padding: 4px 8px;
      border: 1px solid var(--line);
      color: var(--muted);
      background: rgba(5, 9, 22, 0.5);
      font-size: 12px;
      clip-path: var(--cut);
    }

    .commands {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      padding: 12px 14px;
      align-self: end;
    }

    .command-button {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      height: 38px;
      padding: 0 10px;
      color: var(--text);
    }

    .command-button.danger {
      border-color: rgba(255, 62, 54, 0.58);
      color: #ffb3ad;
    }

    .bottom-panel {
      position: relative;
      min-width: 0;
      min-height: 0;
      border: 2px solid rgba(205, 242, 255, 0.82);
      background:
        linear-gradient(180deg, rgba(18, 32, 40, 0.92), rgba(2, 5, 11, 0.96)),
        radial-gradient(circle at 50% 0, rgba(32, 216, 255, 0.2), transparent 64%);
      box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.82),
        inset 0 0 18px rgba(32, 216, 255, 0.16),
        0 0 0 1px rgba(11, 26, 38, 0.9);
      clip-path: none;
    }

    .minimap {
      position: relative;
      overflow: visible;
      background-color: rgba(5, 9, 22, 0.82);
      background-position: center;
      background-size: cover;
      border-color: rgba(232, 248, 255, 0.9);
    }

    .chat-button {
      position: fixed;
      left: 8px;
      bottom: calc(var(--bottom-ui-safe-height) + 5px);
      z-index: 29;
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      border: 0;
      background: transparent;
      box-shadow: none;
      color: #f4ffe9;
      font-size: 22px;
      cursor: pointer;
      pointer-events: auto;
    }

    .chat-button[hidden] {
      display: none;
    }

    .stage-wrap:has(.battle-view.open) :is(.chat-dialog, .chat-button) {
      z-index: 51;
      bottom: 189px;
    }

    .minimap::after {
      content: "";
      position: absolute;
      inset: 0;
      border: 1px solid rgba(32, 216, 255, 0.24);
      background:
        linear-gradient(rgba(183, 247, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(183, 247, 255, 0.07) 1px, transparent 1px);
      background-size: 32px 32px;
      pointer-events: none;
    }

    .minimap.universe-minimap {
      overflow: hidden;
      background:
        radial-gradient(circle at 50% 50%, rgba(255, 227, 138, 0.18), transparent 7%),
        radial-gradient(circle at 20% 28%, rgba(255, 107, 91, 0.16), transparent 22%),
        radial-gradient(circle at 78% 29%, rgba(103, 216, 255, 0.16), transparent 24%),
        radial-gradient(circle at 52% 80%, rgba(181, 108, 255, 0.13), transparent 25%),
        linear-gradient(180deg, #030913, #00040a);
    }

    .mini-orbit {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      border: 1px solid rgba(183, 247, 255, 0.18);
      border-radius: 50%;
      pointer-events: none;
    }

    .mini-orbit.faction {
      border-color: rgba(255, 255, 255, 0.28);
    }

    .mini-dot {
      position: absolute;
      width: 7px;
      height: 7px;
      margin: -3px 0 0 -3px;
      background: var(--faction);
      box-shadow: 0 0 10px var(--faction);
    }

    .universe-dot {
      width: 5px;
      height: 5px;
      margin: -2px 0 0 -2px;
      border-radius: 50%;
      background: #ffe38a;
      box-shadow: 0 0 8px rgba(255, 227, 138, 0.85);
    }

    .universe-dot.terran {
      background: #ff6b5b;
      box-shadow: 0 0 9px rgba(255, 107, 91, 0.95);
    }

    .universe-dot.zerg {
      background: #b56cff;
      box-shadow: 0 0 9px rgba(181, 108, 255, 0.95);
    }

    .universe-dot.protoss {
      background: #67d8ff;
      box-shadow: 0 0 9px rgba(103, 216, 255, 0.95);
    }

    .universe-dot.selected {
      width: 9px;
      height: 9px;
      margin: -4px 0 0 -4px;
      border: 1px solid #ffffff;
    }

    .universe-core-dot {
      width: 8px;
      height: 8px;
      margin: -4px 0 0 -4px;
      border-radius: 50%;
      background: #fff0a8;
      box-shadow: 0 0 12px rgba(255, 222, 112, 0.95);
    }

    .nav-dock {
      display: grid;
      grid-template-rows: repeat(3, minmax(0, 1fr));
      gap: 5px;
      padding: 6px 8px;
      background: linear-gradient(180deg, rgba(2, 8, 12, 0.92), rgba(0, 0, 0, 0.96));
      overflow: hidden;
    }

    .nav-icon {
      display: grid;
      place-items: center;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      border: 0;
      background: transparent;
      color: #eefcff;
      box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.28), 0 0 10px rgba(32, 216, 255, 0.42);
      cursor: pointer;
      font-size: 18px;
      text-shadow: 0 1px 2px #000;
    }

    .nav-icon.dim {
      opacity: 1;
      background: linear-gradient(180deg, rgba(6, 8, 10, 0.96), rgba(0, 0, 0, 0.98));
      box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.88), inset 0 0 5px rgba(255, 255, 255, 0.08);
      filter: grayscale(1) brightness(0.45);
      cursor: default;
    }

    .queue {
      padding: 23px 10px 8px;
      min-width: 0;
      background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.96), rgba(1, 7, 18, 0.96)),
        radial-gradient(circle at 50% 60%, rgba(32, 216, 255, 0.08), transparent 58%);
    }

    .queue-title {
      position: absolute;
      left: 50%;
      top: -2px;
      transform: translateX(-50%);
      min-width: 128px;
      height: 20px;
      padding: 0 18px;
      color: #b7f7ff;
      border: 1px solid rgba(205, 242, 255, 0.82);
      background: linear-gradient(180deg, rgba(20, 45, 65, 0.98), rgba(2, 8, 18, 0.98));
      box-shadow: inset 0 0 10px rgba(32, 216, 255, 0.16);
      font-size: 12px;
      line-height: 18px;
      text-align: center;
      margin-bottom: 0;
    }

    .queue-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(122px, 1fr));
      gap: 5px 7px;
      min-width: 0;
    }

    .queue-item {
      min-width: 0;
      height: 23px;
      padding: 6px 8px;
      border: 1px solid rgba(205, 242, 255, 0.8);
      background: rgba(1, 5, 14, 0.9);
      clip-path: none;
      color: var(--muted);
      font-size: 12px;
      line-height: 8px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .queue-item strong {
      display: inline;
      color: var(--text);
      font-size: 13px;
      margin-right: 8px;
    }

    .queue-item.has-action {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 6px;
      padding: 2px 5px 2px 8px;
      line-height: 14px;
    }

    .queue-item.has-action span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .commander-card {
      position: relative;
      display: grid;
      grid-template-columns: 132px 30px;
      gap: 6px;
      align-items: stretch;
      padding: 5px;
      color: var(--muted);
      font-size: 12px;
      background: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(2, 7, 14, 0.96));
      overflow: visible;
    }

    .network-status {
      position: absolute;
      left: 10px;
      bottom: 10px;
      width: 120px;
      min-height: 20px;
      padding: 2px 4px;
      border: 1px solid rgba(143, 178, 190, 0.65);
      border-radius: 3px;
      background: rgba(2, 10, 18, 0.94);
      color: #e2d59c;
      font-size: 11px;
      line-height: 16px;
      text-align: center;
      white-space: nowrap;
      pointer-events: none;
    }

    [data-network-state="connected"] { color: #9ee8c1; }
    [data-network-state="offline"],
    [data-network-state="disconnected"],
    [data-network-state="server-error"] { color: #ffb5a4; }

    .commander-avatar {
      width: 132px;
      height: 100%;
      display: grid;
      place-items: center;
      color: var(--line-bright);
      border: 2px solid rgba(232, 248, 255, 0.9);
      background:
        radial-gradient(circle at 50% 34%, rgba(255, 244, 211, 0.9) 0 12%, transparent 13%),
        radial-gradient(circle at 50% 62%, var(--faction-soft), rgba(5, 9, 22, 0.9) 58%);
      clip-path: none;
      font-size: 34px;
      cursor: pointer;
      pointer-events: auto;
    }

    .commander-avatar.portrait-1 {
      background:
        radial-gradient(circle at 50% 34%, #fff2c3 0 13%, transparent 14%),
        linear-gradient(180deg, rgba(8, 22, 36, 0.92), rgba(2, 7, 14, 0.98));
    }

    .commander-avatar.portrait-2 {
      background:
        radial-gradient(circle at 50% 34%, #32dbef 0 13%, transparent 14%),
        linear-gradient(180deg, rgba(6, 34, 38, 0.92), rgba(2, 7, 14, 0.98));
    }

    .commander-avatar.portrait-3 {
      background:
        radial-gradient(circle at 50% 34%, var(--faction) 0 13%, transparent 14%),
        linear-gradient(180deg, rgba(32, 10, 38, 0.92), rgba(2, 7, 14, 0.98));
    }

    .commander-avatar.has-image {
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      color: transparent;
    }

    .commander-popover {
      position: absolute;
      left: 5px;
      bottom: calc(100% + 8px);
      z-index: 24;
      display: none;
      width: 188px;
      padding: 8px;
      border: 1px solid rgba(205, 242, 255, 0.58);
      background: linear-gradient(180deg, rgba(5, 15, 24, 0.98), rgba(0, 5, 12, 0.98));
      box-shadow: 0 0 18px rgba(32, 216, 255, 0.2), inset 0 0 12px rgba(255, 255, 255, 0.04);
      color: var(--text);
    }


    .commander-popover.open {
      display: grid;
      gap: 7px;
    }

    .commander-popover::after {
      content: "";
      position: absolute;
      left: 22px;
      bottom: -7px;
      width: 12px;
      height: 12px;
      border-right: 1px solid rgba(205, 242, 255, 0.58);
      border-bottom: 1px solid rgba(205, 242, 255, 0.58);
      background: rgba(0, 5, 12, 0.98);
      transform: rotate(45deg);
    }

    .commander-popover-head {
      display: grid;
      grid-template-columns: 42px 1fr;
      gap: 8px;
      align-items: center;
      min-width: 0;
    }

    .commander-popover-avatar {
      width: 42px;
      height: 42px;
      border: 1px solid rgba(205, 242, 255, 0.8);
      background: linear-gradient(180deg, rgba(8, 22, 36, 0.92), rgba(2, 7, 14, 0.98));
      background-position: center;
      background-size: cover;
    }

    .commander-popover-avatar.portrait-1 {
      background:
        radial-gradient(circle at 50% 34%, #fff2c3 0 13%, transparent 14%),
        linear-gradient(180deg, rgba(8, 22, 36, 0.92), rgba(2, 7, 14, 0.98));
    }

    .commander-popover-avatar.portrait-2 {
      background:
        radial-gradient(circle at 50% 34%, #32dbef 0 13%, transparent 14%),
        linear-gradient(180deg, rgba(6, 34, 38, 0.92), rgba(2, 7, 14, 0.98));
    }

    .commander-popover-avatar.portrait-3 {
      background:
        radial-gradient(circle at 50% 34%, var(--faction) 0 13%, transparent 14%),
        linear-gradient(180deg, rgba(32, 10, 38, 0.92), rgba(2, 7, 14, 0.98));
    }

    .commander-popover strong,
    .commander-popover span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .commander-popover strong {
      color: #b7f7ff;
      font-size: 13px;
      line-height: 17px;
    }

    .commander-popover span {
      color: var(--muted);
      font-size: 11px;
      line-height: 15px;
    }

    .commander-avatar-options {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 5px;
    }

    .commander-avatar-option,
    .commander-popover button {
      height: 24px;
      border: 1px solid rgba(205, 242, 255, 0.48);
      background: rgba(3, 8, 18, 0.86);
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
    }

    .commander-avatar-option {
      display: grid;
      place-items: center;
      color: var(--faction);
      font-size: 16px;
    }

    .commander-avatar-option.active {
      border-color: var(--faction);
      box-shadow: 0 0 8px var(--faction-soft);
    }

    .commander-popover-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
    }

    .commander-card strong {
      display: block;
      margin-bottom: 5px;
      color: var(--text);
      font-size: 13px;
    }

    .commander-role {
      color: #b7f7ff;
      line-height: 18px;
    }

    .commander-edit {
      margin-top: 6px;
      width: 100%;
      height: 24px;
      border: 1px solid rgba(205, 242, 255, 0.72);
      background: rgba(3, 8, 18, 0.86);
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
    }

    .vital-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      line-height: 18px;
    }

    .action-meter {
      position: relative;
      display: grid;
      grid-template-rows: 1fr;
      justify-items: center;
      min-width: 0;
    }

    .action-bar {
      position: relative;
      width: 10px;
      min-height: 76px;
      border: 1px solid rgba(255, 228, 138, 0.62);
      background: rgba(3, 8, 18, 0.86);
      overflow: hidden;
    }

    .action-bar-fill {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 93%;
      background: linear-gradient(0deg, #c5231f 0%, #ff5a24 36%, #ffb331 72%, #fff16a 100%);
      box-shadow: 0 0 10px rgba(255, 179, 49, 0.46);
    }

    .action-meter b {
      position: absolute;
      right: calc(100% + 8px);
      top: 50%;
      transform: translateY(-50%);
      padding: 3px 7px;
      border: 1px solid rgba(183, 247, 255, 0.6);
      background: rgba(3, 8, 18, 0.94);
      box-shadow: 0 0 12px rgba(32, 216, 255, 0.22);
      color: #b7f7ff;
      font-size: 11px;
      line-height: 14px;
      white-space: nowrap;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.12s ease, transform 0.12s ease;
      z-index: 4;
    }

    .action-meter:hover b,
    .action-meter:focus-within b,
    .action-bar:hover + b {
      opacity: 1;
      transform: translateY(-50%) translateX(-2px);
    }

    .tool-dock {
      position: relative;
      display: grid;
      grid-template-rows: 20px 1fr;
      gap: 3px;
      padding: 5px 7px;
      background: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(2, 7, 14, 0.96));
      overflow: visible;
    }

    .universe-console {
      display: grid;
      grid-template-columns: 68px 1fr 68px;
      grid-template-rows: 1fr;
      gap: 8px;
      height: 100%;
      align-items: center;
      padding: 4px 8px;
      background:
        radial-gradient(circle at 50% 50%, rgba(183, 247, 255, 0.08), transparent 60%),
        linear-gradient(180deg, rgba(2, 12, 20, 0.96), rgba(0, 0, 0, 0.98));
    }

    .universe-console button {
      border: 1px solid rgba(183, 247, 255, 0.42);
      background: linear-gradient(180deg, rgba(27, 72, 92, 0.86), rgba(2, 12, 22, 0.96));
      color: #dff8ff;
      font-weight: 800;
      text-shadow: 0 1px 3px #000;
      cursor: pointer;
      box-shadow: inset 0 0 10px rgba(32, 216, 255, 0.12), 0 0 8px rgba(32, 216, 255, 0.16);
    }

    .universe-console button:hover {
      border-color: rgba(255, 255, 255, 0.88);
      color: #ffffff;
      box-shadow: inset 0 0 14px rgba(32, 216, 255, 0.2), 0 0 12px rgba(32, 216, 255, 0.32);
    }

    .universe-console-side {
      width: 68px;
      height: 68px;
      font-size: 24px;
    }

    .universe-filter-placeholder {
      align-self: start;
      justify-self: end;
    }

    .universe-console-center {
      display: grid;
      grid-template-columns: repeat(3, 54px);
      grid-template-rows: repeat(3, 42px);
      justify-content: center;
      align-content: center;
      gap: 2px 6px;
      width: 100%;
      height: 100%;
    }

    .universe-console-center button {
      min-width: 0;
      min-height: 0;
      font-size: 13px;
      line-height: 1;
    }

    .universe-console .universe-console-icon {
      display: grid;
      grid-template: minmax(0, 1fr) / minmax(0, 1fr);
      place-items: center;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      overflow: visible;
    }

    .universe-console .universe-console-icon:hover {
      border-color: transparent;
      background: transparent;
      box-shadow: none;
      filter: brightness(1.18) drop-shadow(0 0 8px rgba(123, 255, 190, 0.55));
    }

    .universe-console .universe-console-icon img {
      display: block;
      max-width: 100%;
      max-height: 100%;
      width: 70px;
      height: 70px;
      object-fit: contain;
      pointer-events: none;
    }

    .universe-console-center .universe-console-icon img {
      width: 60px;
      height: 60px;
    }

    .universe-console-center [data-universe-pan="up"] {
      grid-column: 2;
      grid-row: 1;
    }

    .universe-console-center [data-universe-pan="left"] {
      grid-column: 1;
      grid-row: 2;
    }

    .universe-console-center .home {
      grid-column: 2;
      grid-row: 2;
      border-radius: 50%;
      color: #fff0a8;
    }

    .universe-console-center [data-universe-pan="right"] {
      grid-column: 3;
      grid-row: 2;
    }

    .universe-console-center [data-universe-pan="down"] {
      grid-column: 2;
      grid-row: 3;
    }

    .console-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 8px;
      min-width: 0;
      color: #b7f7ff;
      font-size: 12px;
      line-height: 18px;
    }

    .console-head strong,
    .console-head span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .console-head span {
      color: var(--muted);
      font-size: 11px;
    }

    .console-grid {
      display: grid;
      grid-template-columns: repeat(3, 44px);
      grid-auto-rows: 44px;
      gap: 6px;
      min-height: 0;
      align-content: start;
      justify-content: start;
    }

    .console-selected-panel {
      position: relative;
      display: grid;
      grid-template-rows: minmax(0, 1fr) 32px;
      min-height: 0;
      height: 100%;
      overflow: visible;
    }

    .console-selected-panel.busy-state {
      grid-template-rows: 16px minmax(0, 1fr) 32px;
      row-gap: 2px;
    }

    .console-selected-panel.busy-state > .feature-summary {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 11px;
      line-height: 16px;
    }

    .console-selected-panel .console-grid {
      grid-template-columns: repeat(6, 38px);
      grid-auto-rows: 38px;
      gap: 4px;
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 2px;
    }

    .console-selected-panel .console-grid .console-button {
      width: 38px;
      height: 38px;
    }

    .console-hero-list {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(3, minmax(32px, 1fr));
      gap: 4px;
      min-height: 0;
      overflow: hidden;
      align-content: start;
    }

    .console-selected-panel.hero-mode {
      grid-template-rows: 1fr;
    }

    .console-selected-panel.hero-mode .console-common-actions {
      display: none;
    }

    .console-hero-option {
      display: grid;
      grid-template-columns: 30px 1fr;
      grid-template-rows: 1fr auto;
      align-items: center;
      gap: 2px 5px;
      min-width: 0;
      min-height: 0;
      padding: 3px 5px;
      border: 1px solid var(--hero-quality, rgba(183, 247, 255, 0.26));
      background: linear-gradient(180deg, rgba(8, 20, 31, 0.74), rgba(0, 5, 12, 0.84));
      box-shadow: 0 0 10px color-mix(in srgb, var(--hero-quality, var(--faction)) 42%, transparent), inset 0 0 8px rgba(255, 255, 255, 0.04);
      color: #effcff;
      cursor: pointer;
      text-align: left;
    }

    .console-hero-option:hover,
    .console-hero-option.active {
      border-color: var(--hero-quality, var(--faction));
      box-shadow: 0 0 15px color-mix(in srgb, var(--hero-quality, var(--faction)) 68%, transparent), inset 0 0 8px rgba(255, 255, 255, 0.06);
    }

    .console-hero-option.disabled {
      opacity: 0.58;
      filter: grayscale(0.45);
    }

    .console-hero-option .console-icon {
      grid-row: 1 / 3;
      width: 28px;
      height: 28px;
      border: 1px solid var(--hero-quality, rgba(183, 247, 255, 0.26));
      box-shadow: 0 0 8px color-mix(in srgb, var(--hero-quality, var(--faction)) 45%, transparent);
    }

    .console-hero-option strong,
    .console-hero-option span,
    .console-hero-option em {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .console-hero-info {
      display: grid;
      gap: 1px;
      min-width: 0;
    }

    .console-hero-info strong {
      color: #ffffff;
      font-size: 11px;
      line-height: 13px;
    }

    .console-hero-info span {
      color: #aee7a0;
      font-size: 9px;
      line-height: 11px;
    }

    .console-hero-cost {
      grid-column: 2;
      color: #ffd46b;
      font-size: 9px;
      line-height: 11px;
      max-width: 100%;
      text-align: left;
      font-style: normal;
    }

    .console-button[data-unit-id] {
      border-color: rgba(255, 255, 255, 0.22);
      background: rgba(0, 0, 0, 0.34);
      box-shadow: 0 0 10px var(--faction-soft), inset 0 0 8px rgba(255, 255, 255, 0.04);
    }

    .console-button[data-unit-id] .console-icon {
      width: 38px;
      height: 38px;
      grid-template: minmax(0, 1fr) / minmax(0, 1fr);
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(0, 0, 0, 0.32);
    }

    .console-button[data-unit-id] .console-icon img {
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      margin: 0;
      object-fit: contain;
      object-position: center;
      transform: none;
    }

    .console-button[data-unit-id] > span {
      display: none;
    }

    .console-common-actions {
      display: grid;
      grid-template-columns: repeat(3, 32px);
      gap: 4px;
      align-items: end;
      justify-content: start;
      min-height: 0;
    }

    .console-common-actions .console-button {
      width: 32px;
      height: 32px;
    }

    .console-common-actions .console-remove {
      color: #ffb5a8;
      font-size: 22px;
      line-height: 1;
    }

    .console-common-actions .console-icon {
      width: 100%;
      height: 100%;
    }

    .console-common-actions .console-button span {
      display: none;
    }

    .console-grid.build-mode-grid {
      grid-template-columns: repeat(2, minmax(0, 86px));
      grid-auto-rows: 32px;
      align-self: end;
      align-content: end;
      justify-content: start;
    }

    .console-build-panel {
      position: relative;
      display: grid;
      grid-template-rows: minmax(0, 1fr) 34px;
      min-height: 0;
      height: 100%;
    }

    .console-build-list {
      display: grid;
      grid-template-columns: repeat(5, 52px);
      grid-auto-rows: 52px;
      gap: 4px;
      align-content: start;
      justify-content: start;
      min-height: 0;
      overflow: auto;
      padding-right: 0;
      scrollbar-width: none;
      scrollbar-color: rgba(32, 216, 255, 0.38) transparent;
    }

    .console-build-list::-webkit-scrollbar {
      display: none;
    }

    .console-build-button {
      display: grid;
      place-items: center;
      width: 52px;
      height: 52px;
      padding: 0;
      border: 1px solid rgba(32, 216, 255, 0.24);
      background: rgba(0, 0, 0, 0.18);
      box-shadow: 0 0 8px rgba(32, 216, 255, 0.18);
      overflow: hidden;
      cursor: pointer;
    }

    .console-build-button img,
    .console-back-button img {
      display: block;
      width: 36px;
      height: 36px;
      object-fit: contain;
    }

    .console-build-button img {
      width: 100%;
      height: 100%;
    }

    .console-build-button:hover,
    .console-build-button.active,
    .console-button:hover {
      border-color: var(--faction);
      box-shadow: 0 0 14px var(--faction-soft), inset 0 0 8px rgba(255, 255, 255, 0.08);
    }

    .console-build-button.disabled {
      opacity: 0.58;
      cursor: not-allowed;
    }

    .console-build-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 4px;
      min-height: 0;
      padding-top: 1px;
    }

    .console-back-button {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      padding: 0;
      border: 0;
      background: transparent;
      cursor: pointer;
      filter: drop-shadow(0 0 8px var(--faction-soft));
      transform: translateY(-15px);
    }

    .console-button {
      display: grid;
      place-items: center;
      min-width: 0;
      width: 44px;
      height: 44px;
      padding: 0;
      color: #effcff;
      border: 1px solid rgba(32, 216, 255, 0.24);
      background: rgba(0, 0, 0, 0.18);
      clip-path: none;
      cursor: pointer;
      text-align: center;
      font-size: 10px;
      line-height: 11px;
      box-shadow: 0 0 8px rgba(32, 216, 255, 0.18);
      overflow: hidden;
    }

    .console-grid.build-mode-grid .console-button {
      width: 100%;
      height: 32px;
      grid-template-columns: 25px minmax(0, 1fr);
      gap: 2px;
      padding: 1px 3px;
      border: 1px solid #36675f;
      border-radius: 2px;
      background: linear-gradient(180deg, #1a3535, #0b1c27);
      box-shadow: inset 0 1px #77b29845;
      text-align: left;
    }

    .console-grid.build-mode-grid .console-button:is(:hover, [aria-pressed="true"]) {
      border-color: #75c589;
      background: linear-gradient(180deg, #285348, #102820);
      box-shadow: inset 0 1px #a4e3a573, 0 0 6px #4db87855;
    }

    .console-grid.build-mode-grid .console-button > span,
    .console-grid.build-mode-grid .console-button strong {
      display: block;
      color: #e5f6ee;
      line-height: 1.2;
    }

    .console-build-footer .build-mode-grid {
      flex: 1;
    }

    .console-build-footer .console-back-button {
      display: grid;
      flex: 0 0 30px;
      place-items: center;
      width: 30px;
      height: 30px;
      transform: none;
    }

    .console-build-footer .console-back-button img {
      width: 28px;
      height: 28px;
    }

    .console-grid.build-mode-grid .console-icon {
      width: 100%;
      height: 100%;
    }

    .console-button:hover,
    .console-button.active {
      border-color: var(--faction);
      box-shadow: 0 0 14px var(--faction-soft), inset 0 0 8px rgba(255, 255, 255, 0.08);
    }

    .console-button.disabled {
      opacity: 0.42;
      cursor: default;
      box-shadow: none;
    }

    .console-icon {
      display: grid;
      place-items: center;
      width: 100%;
      height: 100%;
      border: 0;
      background: transparent;
      font-style: normal;
      font-size: 20px;
      line-height: 30px;
    }

    .console-button strong {
      display: none;
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 10px;
    }

    .console-button span {
      display: none;
      color: var(--muted);
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 9px;
      line-height: 10px;
    }

    .planet-console-operation {
      display: grid;
      grid-template-columns: 52px minmax(0, 1fr) auto;
      gap: 8px;
      min-height: 0;
      height: 100%;
      align-items: start;
    }

    .planet-console-operation > img {
      width: 52px;
      height: 48px;
      object-fit: contain;
      filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
    }

    .planet-console-info {
      display: grid;
      gap: 4px;
      min-width: 0;
      color: #effcff;
      font-size: 11px;
      line-height: 14px;
    }

    .planet-console-title {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .planet-console-title strong,
    .planet-console-title span,
    .planet-console-line span,
    .planet-console-line strong {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .planet-console-title strong {
      color: #b7f7ff;
      font-size: 13px;
    }

    .planet-console-title span,
    .planet-console-line span,
    .planet-console-hint {
      color: var(--muted);
    }

    .planet-field-risk {
      color: #ffcf72;
      font-size: 11px;
      line-height: 14px;
    }

    .planet-field-info {
      min-height: 0;
      height: 100%;
      max-height: 100%;
      align-content: start;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-right: 4px;
    }
    .planet-field-info .planet-console-lines {
      grid-template-columns: minmax(0, 1fr);
    }
    .planet-field-info .planet-console-line {
      grid-template-columns: 4em minmax(0, 1fr);
    }
    .planet-field-hero { display: flex; align-items: center; gap: 6px; min-width: 0; }
    .planet-field-hero select {
      flex: 1;
      min-width: 0;
      height: 24px;
      border: 1px solid #4d8995;
      background: #101f25;
      color: #effcff;
      font: inherit;
    }
    .planet-field-coverage { color: #b7d5d8; overflow-wrap: anywhere; }
    .planet-console-actions .planet-field-roster { grid-column: 1 / -1; }
    .tool-dock:has(.planet-field-info) { grid-template-rows: 20px minmax(0, 1fr); min-height: 0; }

    .planet-console-lines {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 3px 8px;
    }

    .outpost-console-lines { grid-template-columns: minmax(0, 1fr); }
    .outpost-console-actions:empty { display: none; }
    .outpost-defense-button { display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 0; }
    .outpost-defense-button img { width: 15px; height: 15px; }
    .outpost-console-actions.single-action { grid-template-columns: 48px; }

    .outpost-scout-dialog {
      width: min(620px, calc(100vw - 32px));
      max-height: min(640px, calc(100vh - 48px));
      padding: 0;
      border: 1px solid #4d8995;
      color: #effcff;
      background: #101f25;
    }
    .outpost-scout-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
    .social-application-dialog { width: min(392px, calc(100vw - 32px)); }
    .social-application-dialog form { display: grid; gap: 12px; padding: 14px 20px 16px; }
    .social-application-dialog .guild-application-name { font-weight: 700; overflow-wrap: anywhere; }
    .social-application-dialog label { display: grid; gap: 6px; }
    .social-application-dialog :is(input, textarea) {
      box-sizing: border-box;
      width: 100%;
      padding: 8px;
      border: 1px solid var(--panel-border, #42606a);
      background: #08131e;
      color: #eef5fd;
      font: inherit;
    }
    .social-application-dialog textarea { min-height: 96px; max-height: 44vh; resize: vertical; }
    .friend-application-error { color: #ffb4ad; }
    .friend-application-dialog button:disabled { opacity: .55; cursor: wait; }
    .social-application-dialog footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .social-application-dialog footer button {
      min-height: 28px;
      padding: 3px 12px;
      border: 1px solid #536577;
      background: #131e2b;
      color: #e3edf6;
      cursor: pointer;
    }
    .social-application-dialog footer button[value="submit"] {
      border-color: #78bd76;
      background: var(--classic-green, #204033);
      color: #f0ffe8;
    }
    .social-application-dialog :is(input, textarea, button):focus-visible { outline: 2px solid #a2e8a6; outline-offset: 2px; }
    .social-application-dialog button:enabled:hover { filter: brightness(1.2); }
    .outpost-scout-dialog header { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #42606a; }
    .outpost-scout-dialog h2, .outpost-scout-dialog h3, .outpost-scout-dialog h4, .outpost-scout-dialog p { margin: 0; }
    .outpost-scout-dialog h2 { font-size: 18px; }
    .outpost-scout-dialog header p { margin-top: 4px; color: #b7d5d8; overflow-wrap: anywhere; }
    .outpost-scout-dialog header button { width: 36px; height: 36px; border: 1px solid #66858a; background: #203840; color: white; font-size: 22px; cursor: pointer; }
    .outpost-scout-content { max-height: calc(min(640px, 100vh - 48px) - 83px); overflow-y: auto; padding: 16px 20px 24px; }
    .outpost-scout-content h3 { margin: 16px 0 8px; font-size: 15px; color: #8fe1d3; }
    .outpost-scout-content h4 { margin: 12px 0 6px; overflow-wrap: anywhere; }
    .outpost-scout-content ul { list-style: none; margin: 0; padding: 0; }
    .outpost-scout-content li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid #31484c; overflow-wrap: anywhere; }
    .outpost-scout-content li strong { flex-shrink: 0; }
    .outpost-scout-time { color: #b7d5d8; line-height: 1.5; }

    .planet-console-line {
      display: grid;
      grid-template-columns: 42px 1fr;
      gap: 5px;
      min-width: 0;
      border-bottom: 1px solid rgba(183, 247, 255, 0.12);
    }

    .planet-console-line strong {
      text-align: right;
      color: #effcff;
    }
    .planet-console-city-protection { grid-column: 1 / -1; }

    .planet-console-actions {
      display: grid;
      grid-template-columns: repeat(2, 48px);
      gap: 6px;
      align-content: start;
    }

    .planet-console-actions button {
      height: 34px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.86), rgba(3, 12, 22, 0.92));
      color: #effcff;
      cursor: pointer;
      font-size: 12px;
    }

    .planet-console-actions button.danger {
      border-color: rgba(255, 86, 86, 0.42);
      background: linear-gradient(180deg, rgba(112, 34, 34, 0.78), rgba(22, 5, 8, 0.9));
    }

    .quick-actions {
      position: fixed;
      grid-column: 1 / -1;
      right: 8px;
      bottom: 200px;
      width: min(520px, calc(100vw - 18px));
      z-index: 19;
      display: none;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      align-content: stretch;
      padding: 12px;
      border: 1px solid rgba(183, 247, 255, 0.68);
      background: rgba(5, 13, 22, 0.88);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
      backdrop-filter: blur(2px);
      clip-path: var(--cut);
    }

    .quick-actions.open {
      display: grid;
    }

    .build-pick-column {
      display: grid;
      grid-template-rows: auto repeat(4, 1fr);
      gap: 6px;
      min-width: 0;
    }

    .build-pick-title {
      color: #b7f7ff;
      font-size: 12px;
      line-height: 16px;
    }

    .build-pick-button {
      display: grid;
      grid-template-columns: 20px 1fr;
      align-items: center;
      gap: 5px;
      width: auto;
      min-width: 0;
      height: 28px;
      padding: 0 7px 0 4px;
      color: var(--text);
      background: rgba(5, 9, 22, 0.58);
      border: 1px solid var(--line);
      clip-path: var(--cut);
      cursor: pointer;
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .build-pick-button span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .build-pick-button:hover,
    .build-pick-button.active {
      border-color: var(--line-bright);
      box-shadow: 0 0 12px rgba(32, 216, 255, 0.2);
    }

    .build-pick-button.disabled {
      opacity: 0.42;
      cursor: not-allowed;
    }

    .toast {
      position: absolute;
      left: 50%;
      top: 16px;
      transform: translateX(-50%);
      min-width: 280px;
      padding: 9px 14px;
      color: var(--text);
      background: rgba(5, 9, 22, 0.86);
      border: 1px solid var(--line-bright);
      box-shadow: 0 0 24px rgba(32, 216, 255, 0.24);
      text-align: center;
      font-size: 13px;
      clip-path: var(--cut);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.18s ease;
      z-index: 20;
    }

    .toast.show {
      opacity: 1;
    }

    .feature-modal {
      position: fixed;
      inset: 74px 118px 162px 118px;
      z-index: 30;
      display: none;
      grid-template-rows: 42px 1fr;
      border: 1px solid rgba(183, 247, 255, 0.48);
      background: linear-gradient(180deg, rgba(19, 36, 56, 0.96), rgba(5, 10, 20, 0.97));
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(32, 216, 255, 0.08);
      clip-path: var(--cut);
    }

    .feature-modal.open {
      display: grid;
    }

    .hero-recruit-dialog {
      position: fixed;
      left: 50%;
      top: 92px;
      z-index: 31;
      display: none;
      width: min(760px, calc(100vw - 36px));
      transform: translateX(-50%);
      grid-template-rows: 38px 1fr;
      border: 1px solid rgba(183, 247, 255, 0.5);
      background:
        linear-gradient(180deg, rgba(10, 22, 34, 0.98), rgba(2, 7, 14, 0.98)),
        radial-gradient(circle at 14% 0%, var(--faction-soft), transparent 58%);
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(32, 216, 255, 0.1);
      color: #effcff;
      clip-path: var(--cut);
    }

    .hero-recruit-dialog.open {
      display: grid;
    }

    .hero-recruit-head {
      display: grid;
      grid-template-columns: 1fr auto 30px;
      align-items: center;
      min-width: 0;
      gap: 8px;
      padding: 7px 10px 7px 12px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.36);
      cursor: move;
      user-select: none;
    }

    .hero-recruit-title strong,
    .hero-recruit-title span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-recruit-title strong {
      color: #b7f7ff;
      font-size: 14px;
      line-height: 16px;
    }

    .hero-recruit-title span {
      color: var(--muted);
      font-size: 11px;
      line-height: 14px;
    }

    .hero-recruit-close {
      width: 26px;
      height: 24px;
      padding: 0;
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: rgba(0, 0, 0, 0.42);
      color: #effcff;
      cursor: pointer;
    }

    .hero-recruit-tools,
    .hero-recruit-close {
      cursor: auto;
    }

    .hero-recruit-body {
      display: grid;
      grid-template-columns: minmax(330px, 1fr) 220px;
      gap: 10px;
      padding: 10px;
    }

    .hero-recruit-roster { min-width: 0; }

    .hero-recruit-capacity {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 7px;
      padding: 6px 9px;
      border: 1px solid #405463;
      background: linear-gradient(100deg, #19332f, #102233);
      color: #bdd4d3;
    }

    .hero-recruit-capacity strong { color: #e1f6d6; font-variant-numeric: tabular-nums; }

    .hero-recruit-dialog .console-hero-list {
      grid-template-rows: none;
      grid-auto-rows: minmax(64px, auto);
      gap: 7px;
      overflow: visible;
    }

    .hero-recruit-dialog .console-hero-option {
      grid-template-columns: 42px 1fr;
      min-height: 64px;
      padding: 6px 8px;
    }

    .hero-recruit-dialog .console-hero-option.active {
      outline: 1px solid rgba(255, 255, 255, 0.5);
      outline-offset: -3px;
    }

    .hero-recruit-dialog .console-hero-option .console-icon {
      width: 38px;
      height: 38px;
      overflow: hidden;
    }

    .hero-recruit-dialog .console-hero-option .console-icon img {
      object-fit: cover;
    }

    .hero-recruit-dialog .console-hero-info strong {
      font-size: 12px;
      line-height: 15px;
    }

    .hero-recruit-dialog .console-hero-info span,
    .hero-recruit-dialog .console-hero-cost {
      font-size: 10px;
      line-height: 13px;
    }

    .hero-recruit-dialog .hero-recruit-candidate-attrs {
      display: flex;
      flex-wrap: wrap;
      column-gap: 7px;
      color: #c0d7de;
      font-variant-numeric: tabular-nums;
    }

    .hero-recruit-tools {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #ffd46b;
      font-size: 11px;
      white-space: nowrap;
    }

    .hero-recruit-tools button,
    .hero-detail-actions button {
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.42);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.88), rgba(3, 12, 22, 0.92));
      color: #effcff;
      cursor: pointer;
    }

    .hero-detail-card {
      display: grid;
      grid-template-rows: auto 1fr auto;
      gap: 8px;
      min-width: 0;
      min-height: 0;
      padding: 9px;
      border: 1px solid var(--hero-quality, rgba(183, 247, 255, 0.28));
      background: linear-gradient(180deg, rgba(4, 13, 24, 0.92), rgba(0, 4, 10, 0.96));
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.78), 0 0 14px color-mix(in srgb, var(--hero-quality, var(--faction)) 36%, transparent);
    }

    .hero-detail-card h3 {
      margin: 0;
      color: #ffffff;
      font-size: 15px;
      line-height: 18px;
    }

    .hero-detail-card p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 15px;
    }

    .hero-detail-card > div > small {
      display: block;
      margin-top: 3px;
      color: #d9f8ff;
      font-size: 10px;
      line-height: 14px;
    }

    .hero-detail-bust {
      width: 100%;
      min-height: 0;
      height: 176px;
      border: 1px solid var(--hero-quality, rgba(183, 247, 255, 0.28));
      background: rgba(0, 0, 0, 0.42);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.62), 0 0 12px color-mix(in srgb, var(--hero-quality, var(--faction)) 30%, transparent);
      object-fit: cover;
      object-position: center 16%;
    }

    .hero-attr-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
    }

    .hero-attr-grid span,
    .hero-detail-line {
      min-width: 0;
      padding: 4px 5px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(255, 255, 255, 0.04);
      color: #dfffcf;
      font-size: 10px;
      line-height: 13px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hero-detail-actions {
      display: grid;
      gap: 6px;
    }

    .hero-detail-actions button {
      width: 100%;
      height: 30px;
      border-color: var(--hero-quality, rgba(183, 247, 255, 0.42));
      box-shadow: 0 0 10px color-mix(in srgb, var(--hero-quality, var(--faction)) 42%, transparent);
    }

    .feature-head {
      display: grid;
      grid-template-columns: 1fr 36px;
      align-items: center;
      min-width: 0;
      padding: 8px 12px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.22);
      background: rgba(5, 9, 22, 0.52);
      cursor: move;
      user-select: none;
    }

    .feature-title strong,
    .feature-title span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .feature-title strong {
      color: #b7f7ff;
      font-size: 15px;
    }

    .feature-title span {
      color: var(--muted);
      font-size: 11px;
      line-height: 16px;
    }

    .feature-close {
      width: 30px;
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.38);
      background: rgba(5, 9, 22, 0.62);
      color: #effcff;
      cursor: pointer;
      clip-path: var(--cut);
    }

    .feature-body {
      display: grid;
      grid-template-columns: 250px 1fr;
      gap: 12px;
      min-height: 0;
      padding: 12px;
    }

    .feature-side,
    .feature-main {
      min-height: 0;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(5, 9, 22, 0.34);
    }

    .feature-side {
      display: grid;
      grid-template-rows: auto auto 1fr;
      gap: 10px;
      padding: 10px;
    }

    .feature-main {
      display: grid;
      grid-template-rows: auto 1fr auto;
      gap: 10px;
      padding: 10px;
      overflow: hidden;
    }

    .feature-kicker {
      color: var(--warn);
      font-size: 11px;
    }

    .feature-summary {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .feature-stats,
    .feature-list {
      display: grid;
      gap: 6px;
      min-height: 0;
    }

    .feature-stat,
    .feature-card {
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(18, 29, 46, 0.58);
      padding: 7px 8px;
      min-width: 0;
    }

    .feature-stat {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
    }

    .feature-stat strong {
      color: #effcff;
      font-size: 12px;
    }

    .feature-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      overflow: auto;
      padding-right: 4px;
    }

    .feature-card {
      display: grid;
      grid-template-rows: auto 1fr auto;
      gap: 6px;
      min-height: 116px;
    }

    .feature-card strong {
      color: #b7f7ff;
      font-size: 13px;
    }

    .feature-card p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.45;
    }

    .feature-card button,
    .feature-footer button {
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.45);
      background: linear-gradient(180deg, rgba(29, 91, 126, 0.72), rgba(5, 18, 34, 0.9));
      color: #effcff;
      cursor: pointer;
      clip-path: var(--cut);
      font-size: 11px;
    }

    .trade-panel {
      display: grid;
      grid-template-rows: none;
      grid-auto-rows: max-content;
      align-content: start;
      gap: 10px;
      min-height: 0;
      overflow: auto;
    }

    .trade-toolbar,
    .trade-form {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
      gap: 8px;
      align-items: end;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.22);
      clip-path: var(--cut);
    }

    .trade-toolbar label,
    .trade-form label {
      display: grid;
      gap: 4px;
      color: var(--muted);
      font-size: 10px;
      line-height: 14px;
      min-width: 0;
    }

    .trade-toolbar select,
    .trade-toolbar input,
    .trade-form select,
    .trade-form input {
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: rgba(3, 10, 18, 0.82);
      color: #effcff;
      padding: 0 8px;
      outline: none;
      clip-path: var(--cut);
    }

    .trade-toolbar button,
    .trade-form button {
      height: 28px;
      min-width: 82px;
      border: 1px solid rgba(255, 212, 107, 0.58);
      background: linear-gradient(180deg, rgba(106, 78, 22, 0.96), rgba(22, 12, 3, 0.96));
      color: #ffe8a3;
      cursor: pointer;
      clip-path: var(--cut);
    }

    .trade-market-list {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      min-height: 0;
    }

    .trade-target-card {
      display: grid;
      gap: 7px;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(18, 29, 46, 0.58);
      clip-path: var(--cut);
    }

    .trade-target-card strong {
      color: #b7f7ff;
      font-size: 12px;
    }

    .trade-target-card span {
      color: var(--muted);
      font-size: 10px;
      line-height: 14px;
    }

    .trade-order-list {
      display: grid;
      gap: 6px;
      overflow: auto;
      padding-right: 4px;
    }

    .trade-order-row {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr 0.8fr 0.7fr;
      gap: 8px;
      align-items: center;
      padding: 7px 8px;
      border: 1px solid rgba(183, 247, 255, 0.14);
      background: rgba(3, 10, 18, 0.46);
      color: var(--muted);
      font-size: 11px;
      clip-path: var(--cut);
    }

    .trade-order-row strong {
      color: #effcff;
      font-size: 11px;
    }

    .equipment-market-row {
      grid-template-columns: minmax(150px, 1.2fr) minmax(170px, 1fr) minmax(110px, 0.7fr) auto;
    }

    .equipment-market-row input {
      min-width: 0;
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: rgba(3, 10, 18, 0.82);
      color: #effcff;
      padding: 0 8px;
    }

    .equipment-market-row button {
      height: 28px;
      min-width: 64px;
      border: 1px solid rgba(255, 212, 107, 0.58);
      background: rgba(60, 44, 14, 0.9);
      color: #ffe8a3;
      cursor: pointer;
    }

    .equipment-market-row button:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .recruit-card-market-row strong {
      color: var(--card-accent, #ffd46a);
    }

    .recruit-card-market-inputs {
      display: grid;
      grid-template-columns: minmax(58px, 0.6fr) minmax(92px, 1fr);
      gap: 5px;
      min-width: 0;
    }

    .recruit-card-market-inputs input {
      width: 100%;
      min-width: 0;
    }

    .auction-side h3 {
      margin: 5px 0 0;
      color: #effcff;
      font-size: 18px;
      font-weight: 700;
      letter-spacing: 0;
    }

    .feature-stat.warning strong {
      color: #ffb36b;
    }

    .auction-panel {
      grid-template-rows: 30px minmax(0, 1fr);
      overflow: hidden;
    }

    .auction-tabs {
      display: grid;
      grid-template-columns: repeat(4, minmax(88px, 1fr)) 32px;
      gap: 5px;
      min-width: 0;
    }

    .auction-tabs button {
      height: 30px;
      border: 1px solid rgba(183, 247, 255, 0.22);
      background: rgba(3, 10, 18, 0.82);
      color: #9fb4c7;
      cursor: pointer;
      font-size: 11px;
    }

    .auction-tabs button.active {
      border-color: rgba(255, 212, 107, 0.72);
      background: rgba(88, 61, 17, 0.78);
      color: #ffe8a3;
    }

    .auction-tabs .auction-refresh {
      min-width: 32px;
      color: #b7f7ff;
      font-size: 18px;
    }

    .auction-tab-content {
      display: grid;
      align-content: start;
      gap: 10px;
      min-height: 0;
      overflow: auto;
      padding-right: 3px;
    }

    .auction-filter-bar,
    .auction-order-fields {
      display: grid;
      grid-template-columns: 1.15fr repeat(3, minmax(112px, 0.85fr)) auto;
      gap: 7px;
      align-items: end;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.22);
    }

    .auction-filter-bar label,
    .auction-order-fields label {
      display: grid;
      gap: 4px;
      min-width: 0;
      color: #879db0;
      font-size: 10px;
    }

    .auction-filter-bar select,
    .auction-filter-bar input,
    .auction-order-fields select,
    .auction-order-fields input,
    .auction-market-row input,
    .auction-market-row select {
      width: 100%;
      min-width: 0;
      height: 28px;
      box-sizing: border-box;
      border: 1px solid rgba(183, 247, 255, 0.26);
      background: rgba(3, 10, 18, 0.9);
      color: #effcff;
      padding: 0 7px;
      outline: none;
    }

    .auction-level-range {
      display: grid;
      grid-template-columns: minmax(44px, 1fr) 18px minmax(44px, 1fr);
      gap: 3px;
      align-items: center;
    }

    .auction-level-range i {
      color: #71889b;
      font-style: normal;
      text-align: center;
    }

    .auction-filter-actions {
      display: grid;
      grid-template-columns: repeat(2, 58px);
      gap: 5px;
    }

    .auction-filter-actions button,
    .auction-order-fields button,
    .auction-row-action button {
      height: 28px;
      border: 1px solid rgba(255, 212, 107, 0.58);
      background: rgba(76, 52, 13, 0.9);
      color: #ffe8a3;
      cursor: pointer;
      font-size: 11px;
    }

    .auction-filter-actions button.secondary {
      border-color: rgba(183, 247, 255, 0.28);
      background: rgba(11, 29, 43, 0.86);
      color: #b7f7ff;
    }

    .auction-row-action button.danger,
    .auction-row-action .danger {
      border-color: rgba(255, 113, 113, 0.5);
      background: rgba(82, 25, 25, 0.82);
      color: #ffc1c1;
    }

    .auction-section,
    .auction-order-composer {
      display: grid;
      gap: 6px;
      min-width: 0;
    }

    .auction-section > header,
    .auction-order-composer > header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-height: 24px;
      color: #effcff;
      font-size: 11px;
    }

    .auction-section > header span,
    .auction-order-composer > header span {
      color: #8299ac;
      font-size: 10px;
      text-align: right;
    }

    .auction-market-list {
      display: grid;
      gap: 5px;
      min-width: 0;
      overflow-x: auto;
    }

    .auction-market-row {
      display: grid;
      grid-template-columns: minmax(190px, 1.35fr) minmax(100px, 0.75fr) minmax(100px, 0.75fr) minmax(110px, 0.8fr) minmax(128px, 0.9fr);
      gap: 8px;
      align-items: center;
      min-width: 760px;
      min-height: 48px;
      padding: 6px 8px;
      box-sizing: border-box;
      border: 1px solid rgba(183, 247, 255, 0.13);
      background: rgba(3, 10, 18, 0.5);
      color: #effcff;
      font-size: 11px;
    }

    .auction-market-row > span,
    .auction-item-cell > span {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .auction-market-row strong {
      overflow: hidden;
      color: #effcff;
      font-size: 11px;
      font-weight: 650;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .auction-market-row small {
      overflow: hidden;
      color: #7f96a9;
      font-size: 9px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .auction-item-cell {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .auction-item-cell img {
      width: 38px;
      height: 38px;
      flex: 0 0 38px;
      object-fit: cover;
      border: 1px solid rgba(183, 247, 255, 0.32);
      background: rgba(8, 19, 30, 0.86);
    }

    .auction-resource-swatch {
      width: 30px;
      height: 30px;
      flex: 0 0 30px;
      border: 1px solid rgba(255, 255, 255, 0.35);
      box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.15);
    }

    .auction-resource-swatch.resource-crystal { background: #59d7ef; }
    .auction-resource-swatch.resource-gas { background: #76d38b; }
    .auction-resource-swatch.resource-alloy { background: #aab7c4; }
    .auction-resource-swatch.resource-rare { background: #d8a754; }
    .auction-resource-swatch.resource-shard { background: #9f73dc; }

    .auction-row-action {
      display: grid !important;
      grid-template-columns: minmax(62px, 1fr) 58px;
      gap: 5px !important;
      align-items: center;
    }

    .auction-row-action:has(> button:only-child),
    .auction-row-action:has(> em:only-child) {
      grid-template-columns: 1fr;
    }

    .auction-row-action em {
      color: #7ed8a4;
      font-size: 10px;
      font-style: normal;
      text-align: center;
    }

    .auction-empty {
      min-height: 48px;
      display: grid;
      place-items: center;
      border: 1px dashed rgba(183, 247, 255, 0.16);
      color: #6f8699;
      font-size: 11px;
    }

    .auction-order-fields {
      grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(90px, auto);
    }

    .auction-equipment-order-fields {
      grid-template-columns: repeat(5, minmax(90px, 1fr)) minmax(90px, auto);
    }

    @media (max-width: 980px) {
      .feature-body.auction-feature-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 8px;
        overflow: hidden;
      }

      .auction-feature-body .auction-side {
        grid-template-rows: auto auto;
        gap: 6px;
        padding: 8px;
      }

      .auction-feature-body .auction-side > div:first-child {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 10px;
      }

      .auction-feature-body .auction-side .feature-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
      }

      .auction-feature-body .auction-side .feature-stat {
        padding: 5px 6px;
      }

      .auction-feature-body .auction-panel {
        min-width: 0;
      }

      .auction-feature-body .auction-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr)) 32px;
      }

      .auction-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .auction-filter-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        width: 100%;
      }

      .auction-order-fields,
      .auction-equipment-order-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .auction-market-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
      }

      .auction-market-row .auction-item-cell,
      .auction-market-row .auction-row-action {
        grid-column: 1 / -1;
      }
    }

    @media (max-width: 560px) {
      .auction-feature-body .auction-side .feature-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .auction-feature-body .auction-tabs button {
        padding-inline: 3px;
        font-size: 10px;
      }
    }

    .tech-tree-main {
      grid-template-rows: auto 1fr;
    }

    .tech-tree-grid {
      position: relative;
      display: block;
      min-height: 0;
      overflow: auto;
      padding: 12px 14px 22px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background:
        linear-gradient(rgba(126, 232, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 232, 255, 0.045) 1px, transparent 1px),
        linear-gradient(180deg, rgba(9, 24, 39, 0.82), rgba(1, 5, 12, 0.62));
      background-size: 34px 34px, 34px 34px, auto;
      box-shadow: inset 0 0 0 1px rgba(32, 216, 255, 0.06), inset 0 0 36px rgba(32, 216, 255, 0.06);
    }

    .tech-branch {
      position: relative;
      min-width: 0;
      padding: 6px 0 8px;
    }

    .tech-mega-tree {
      min-width: 1100px;
    }

    .tech-mega-tree::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 74px;
      bottom: 52px;
      width: 5px;
      background:
        linear-gradient(180deg, rgba(255, 212, 107, 0.86), rgba(126, 232, 255, 0.76) 34%, rgba(98, 240, 106, 0.42)),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
      box-shadow: 0 0 18px rgba(126, 232, 255, 0.34), 0 0 36px rgba(32, 216, 255, 0.1);
      transform: translateX(-50%);
      pointer-events: none;
    }

    .tech-mega-tree::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 68px;
      bottom: 48px;
      width: 38px;
      border-left: 1px solid rgba(126, 232, 255, 0.08);
      border-right: 1px solid rgba(126, 232, 255, 0.08);
      transform: translateX(-50%);
      pointer-events: none;
    }

    .tech-tree-crown {
      position: sticky;
      left: 0;
      z-index: 3;
      display: grid;
      justify-items: center;
      gap: 5px;
      width: max-content;
      margin: 0 auto 12px;
      padding: 7px 18px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background:
        linear-gradient(90deg, rgba(255, 212, 107, 0.08), transparent 34%, rgba(126, 232, 255, 0.08)),
        linear-gradient(180deg, rgba(19, 44, 65, 0.96), rgba(2, 10, 20, 0.96));
      color: #e9fbff;
      clip-path: var(--cut);
      box-shadow: inset 0 0 18px rgba(32, 216, 255, 0.08), 0 0 16px rgba(32, 216, 255, 0.1);
    }

    .tech-tree-crown h3 {
      margin: 0;
      color: #fff2b6;
      font-size: 14px;
      line-height: 16px;
      letter-spacing: 0;
    }

    .tech-tree-crown span {
      color: #b7f7ff;
      font-size: 11px;
      line-height: 13px;
    }

    .tech-tree-canvas {
      position: relative;
      padding: 4px 12px 14px;
    }

    .tech-spine-label {
      position: relative;
      z-index: 2;
      width: max-content;
      margin: 0 auto 8px;
      padding: 4px 12px;
      border: 1px solid rgba(255, 212, 107, 0.32);
      background: rgba(5, 10, 18, 0.84);
      color: #ffe8a3;
      font-size: 11px;
      clip-path: var(--cut);
    }

    .tech-mainline {
      position: relative;
      display: grid;
      grid-template-columns: minmax(138px, 164px);
      justify-content: center;
      gap: 10px;
      margin: 0 auto 22px;
      padding: 18px 20px 22px;
      max-width: 250px;
      border: 1px solid rgba(255, 212, 107, 0.16);
      background: linear-gradient(180deg, rgba(47, 39, 18, 0.22), rgba(5, 11, 20, 0.08));
      clip-path: var(--cut);
    }

    .tech-mainline::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 24px;
      bottom: 24px;
      width: 2px;
      background: linear-gradient(180deg, rgba(255, 212, 107, 0.72), rgba(126, 232, 255, 0.54));
      box-shadow: 0 0 12px rgba(255, 212, 107, 0.18);
      transform: translateX(-50%);
      pointer-events: none;
    }

    .tech-mainline::before,
    .tech-lane::before {
      content: "";
      position: absolute;
      left: 7%;
      right: 7%;
      top: 0;
      height: 2px;
      background: linear-gradient(90deg, transparent, rgba(255, 212, 107, 0.74), rgba(126, 232, 255, 0.78), transparent);
      box-shadow: 0 0 14px rgba(126, 232, 255, 0.28);
      pointer-events: none;
    }

    .tech-branch-stack {
      position: relative;
      display: grid;
      gap: 18px;
    }

    .tech-lane {
      position: relative;
      padding: 28px 14px 14px;
      border: 1px solid rgba(183, 247, 255, 0.12);
      background: linear-gradient(180deg, rgba(7, 17, 29, 0.42), rgba(0, 0, 0, 0.08));
      box-shadow: inset 0 0 22px rgba(32, 216, 255, 0.035);
    }

    .tech-lane::after {
      content: "";
      position: absolute;
      left: 50%;
      top: -18px;
      width: 2px;
      height: 18px;
      background: linear-gradient(180deg, rgba(126, 232, 255, 0.54), var(--tech-lane-color, rgba(126, 232, 255, 0.48)));
      box-shadow: 0 0 10px color-mix(in srgb, var(--tech-lane-color, #7ee8ff) 28%, transparent);
      transform: translateX(-50%);
      pointer-events: none;
    }

    .tech-lane-label {
      position: relative;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: max-content;
      min-width: 168px;
      margin: -10px auto 16px;
      padding: 5px 14px;
      border: 1px solid var(--tech-lane-color, rgba(255, 212, 107, 0.44));
      background: linear-gradient(180deg, rgba(8, 18, 31, 0.96), rgba(0, 0, 0, 0.86));
      color: var(--tech-lane-text, #ffe8a3);
      font-size: 12px;
      text-align: center;
      clip-path: var(--cut);
      box-shadow: 0 0 16px color-mix(in srgb, var(--tech-lane-color, #ffd46b) 22%, transparent);
    }

    .tech-lane-label strong,
    .tech-lane-label span {
      font-size: 12px;
      line-height: 14px;
      font-weight: 700;
    }

    .tech-lane-label span {
      min-width: 42px;
      padding-left: 8px;
      border-left: 1px solid color-mix(in srgb, var(--tech-lane-color, #ffd46b) 42%, transparent);
      color: #dcebff;
      font-size: 11px;
      text-align: right;
    }

    .tech-lane[data-tech-lane="infantry"] {
      --tech-lane-color: rgba(255, 212, 107, 0.6);
      --tech-lane-text: #ffe8a3;
    }

    .tech-lane[data-tech-lane="vehicle"] {
      --tech-lane-color: rgba(126, 232, 255, 0.6);
      --tech-lane-text: #b7f7ff;
    }

    .tech-lane[data-tech-lane="flight"] {
      --tech-lane-color: rgba(98, 240, 106, 0.5);
      --tech-lane-text: #dfffcf;
    }

    .tech-unit-forest {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
      gap: 15px 13px;
      align-items: start;
    }

    .tech-chain {
      position: relative;
      display: grid;
      justify-items: center;
      gap: 10px;
      min-height: 96px;
      padding: 12px 5px 11px;
      border: 1px solid rgba(183, 247, 255, 0.08);
      background: linear-gradient(180deg, rgba(2, 9, 18, 0.38), rgba(0, 0, 0, 0.04));
      clip-path: var(--cut);
    }

    .tech-chain-progress {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 6px;
      height: 3px;
      background: rgba(96, 117, 139, 0.28);
      overflow: hidden;
    }

    .tech-chain-progress span {
      display: block;
      width: var(--chain-progress, 0%);
      height: 100%;
      background: linear-gradient(90deg, rgba(255, 212, 107, 0.88), rgba(98, 240, 106, 0.82));
      box-shadow: 0 0 8px rgba(98, 240, 106, 0.22);
    }

    .tech-chain + .tech-chain {
      margin-top: 0;
      padding-top: 10px;
      border-top: 0;
    }

    .tech-chain.linear {
      min-height: 0;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-items: center;
      gap: 6px;
      padding: 4px 0;
    }

    .tech-root,
    .tech-fork {
      position: relative;
      display: flex;
      justify-content: center;
      width: 100%;
    }

    .tech-fork,
    .tech-advance-fork {
      position: relative;
      display: flex;
      justify-content: space-around;
      gap: 18px;
      padding-top: 18px;
      width: 100%;
    }

    .tech-fork::before,
    .tech-advance-fork::before {
      content: "";
      position: absolute;
      left: 25%;
      right: 25%;
      top: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(126, 232, 255, 0.75), transparent);
      box-shadow: 0 0 10px rgba(126, 232, 255, 0.25);
    }

    .tech-fork::after,
    .tech-advance-fork::after {
      content: "";
      position: absolute;
      left: 50%;
      top: -14px;
      width: 1px;
      height: 14px;
      background: rgba(126, 232, 255, 0.72);
      box-shadow: 0 0 10px rgba(126, 232, 255, 0.24);
    }

    .tech-chain.unit-skill-tree {
      min-height: 0;
      gap: 8px;
    }

    .tech-chain.unit-skill-tree::before {
      content: "";
      position: absolute;
      left: 50%;
      top: -22px;
      width: 1px;
      height: 22px;
      background: rgba(126, 232, 255, 0.52);
      box-shadow: 0 0 8px rgba(126, 232, 255, 0.18);
    }

    .tech-attr-grid {
      position: relative;
      display: grid;
      gap: 5px;
      width: 100%;
      padding: 14px 0 8px;
    }

    .tech-attr-grid::before {
      content: "";
      position: absolute;
      top: -2px;
      left: 50%;
      width: 1px;
      height: 16px;
      background: rgba(126, 232, 255, 0.62);
      box-shadow: 0 0 8px rgba(126, 232, 255, 0.2);
    }

    .tech-attr-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 5px;
      padding-bottom: 2px;
    }

    .tech-attr-row .tech-node {
      width: 128px;
      grid-template-columns: 34px minmax(0, 1fr);
      padding: 4px;
    }

    .tech-attr-row .tech-node i {
      width: 34px;
      height: 34px;
      font-size: 12px;
    }

    .tech-attr-row .tech-node strong {
      font-size: 11px;
      line-height: 13px;
    }

    .tech-branch-line {
      position: absolute;
      top: 0;
      width: 1px;
      height: 18px;
      background: rgba(126, 232, 255, 0.62);
      box-shadow: 0 0 8px rgba(126, 232, 255, 0.22);
      transform: translateY(-1px);
    }

    .tech-branch-line.left {
      left: 25%;
    }

    .tech-branch-line.right {
      right: 25%;
    }

    .tech-node {
      position: relative;
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr);
      align-items: center;
      text-align: left;
      gap: 6px;
      width: min(132px, 100%);
      min-width: 0;
      min-height: 46px;
      padding: 5px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(18, 34, 54, 0.82), rgba(1, 6, 13, 0.74));
      color: inherit;
      cursor: pointer;
      clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.62), 0 8px 18px rgba(0, 0, 0, 0.16);
      transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, filter 0.16s ease;
    }

    .tech-node::before,
    .tech-node::after {
      content: "";
      position: absolute;
      pointer-events: none;
    }

    .tech-node::before {
      left: 5px;
      right: 5px;
      top: 4px;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(183, 247, 255, 0.5), transparent);
    }

    .tech-node::after {
      left: 0;
      top: 0;
      bottom: 0;
      width: 3px;
      background: var(--tech-state-color, rgba(126, 232, 255, 0.36));
      box-shadow: 0 0 12px var(--tech-state-glow, rgba(126, 232, 255, 0.18));
    }

    .tech-mainline .tech-node {
      z-index: 1;
      width: min(154px, 100%);
      min-height: 50px;
      border-color: rgba(255, 212, 107, 0.3);
      background:
        linear-gradient(135deg, rgba(255, 212, 107, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(41, 37, 27, 0.88), rgba(4, 8, 15, 0.78));
    }

    .tech-node:not(:disabled):hover {
      border-color: rgba(255, 212, 107, 0.72);
      box-shadow: 0 0 18px rgba(255, 212, 107, 0.18), inset 0 0 18px rgba(126, 232, 255, 0.1), 0 10px 20px rgba(0, 0, 0, 0.24);
      transform: translateY(-2px);
    }

    .tech-fork .tech-node,
    .tech-advance-fork .tech-node {
      width: min(128px, calc(50% - 8px));
    }

    .tech-node.researched {
      --tech-state-color: rgba(98, 240, 106, 0.82);
      --tech-state-glow: rgba(98, 240, 106, 0.28);
      border-color: rgba(98, 240, 106, 0.42);
      box-shadow: inset 0 0 16px rgba(98, 240, 106, 0.11), 0 0 14px rgba(98, 240, 106, 0.08);
      cursor: default;
    }

    .tech-node.locked {
      --tech-state-color: rgba(105, 123, 142, 0.52);
      --tech-state-glow: rgba(105, 123, 142, 0.14);
      opacity: 0.62;
      filter: grayscale(0.48) saturate(0.72);
      cursor: default;
    }

    .tech-node.affordable {
      --tech-state-color: rgba(255, 212, 107, 0.9);
      --tech-state-glow: rgba(255, 212, 107, 0.32);
      border-color: rgba(255, 212, 107, 0.52);
      box-shadow: inset 0 0 16px rgba(255, 212, 107, 0.08), 0 0 14px rgba(255, 212, 107, 0.08);
    }

    .tech-node.selected {
      border-color: rgba(255, 212, 107, 0.92);
      box-shadow: 0 0 22px rgba(255, 212, 107, 0.25), inset 0 0 18px rgba(126, 232, 255, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.2);
    }

    .tech-node.expensive {
      --tech-state-color: rgba(255, 98, 86, 0.72);
      --tech-state-glow: rgba(255, 98, 86, 0.22);
      border-color: rgba(255, 98, 86, 0.28);
      cursor: default;
    }

    .tech-node i {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background:
        linear-gradient(135deg, rgba(183, 247, 255, 0.14), transparent 42%),
        rgba(0, 0, 0, 0.42);
      color: #eaffff;
      font-style: normal;
      font-weight: 700;
      text-shadow: 0 0 8px rgba(126, 232, 255, 0.48);
      overflow: hidden;
      clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
      box-shadow: inset 0 0 12px rgba(126, 232, 255, 0.08);
    }

    .tech-node img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .tech-node strong,
    .tech-node span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .tech-node strong {
      color: #dfffcf;
      font-size: 11px;
      line-height: 14px;
      padding-right: 0;
    }

    .tech-node.has-level strong {
      padding-right: 34px;
    }

    .tech-node span {
      display: block;
      color: var(--muted);
      font-size: 10px;
      line-height: 13px;
    }

    .tech-node em {
      position: absolute;
      right: 5px;
      top: 5px;
      min-width: 28px;
      height: 18px;
      padding: 0 5px;
      border: 1px solid color-mix(in srgb, var(--tech-state-color, #ffd46b) 64%, rgba(255, 255, 255, 0.14));
      background: rgba(7, 12, 20, 0.9);
      color: #ffe8a3;
      font-style: normal;
      font-size: 9px;
      line-height: 16px;
      text-align: center;
      pointer-events: none;
      clip-path: var(--cut);
      box-shadow: 0 0 10px var(--tech-state-glow, rgba(255, 212, 107, 0.18));
    }

    .feature-side.tech-side {
      grid-template-rows: none;
      grid-auto-rows: max-content;
      align-content: start;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .tech-side .feature-stat {
      grid-template-columns: 56px minmax(0, 1fr);
      align-items: start;
    }

    .tech-side .feature-stat strong {
      overflow-wrap: anywhere;
    }

    .tech-selected-card {
      position: relative;
      border: 1px solid rgba(255, 212, 107, 0.42);
      background:
        linear-gradient(135deg, rgba(255, 212, 107, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(31, 35, 44, 0.82), rgba(5, 10, 18, 0.92));
      padding: 10px;
      display: grid;
      gap: 8px;
      clip-path: var(--cut);
      box-shadow: inset 0 0 20px rgba(255, 212, 107, 0.06), 0 0 16px rgba(255, 212, 107, 0.08);
    }

    .tech-selected-card::before {
      content: "";
      position: absolute;
      left: 8px;
      right: 8px;
      top: 6px;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 212, 107, 0.58), transparent);
      pointer-events: none;
    }

    .tech-selected-card strong {
      color: #fff2b6;
      font-size: 14px;
      line-height: 18px;
    }

    .tech-selected-card span {
      color: var(--muted);
      font-size: 11px;
      line-height: 15px;
    }

    .tech-selected-card .tech-detail-line {
      display: grid;
      grid-template-columns: 56px minmax(0, 1fr);
      gap: 7px;
      align-items: start;
      padding: 6px 7px;
      border: 1px solid rgba(183, 247, 255, 0.12);
      background: rgba(3, 10, 18, 0.38);
      clip-path: var(--cut);
    }

    .tech-selected-card .tech-detail-line b {
      color: #b7f7ff;
      font-size: 10px;
      line-height: 14px;
      font-weight: 700;
    }

    .tech-selected-card .tech-detail-line em {
      white-space: pre-line;
      color: #dfffcf;
      font-size: 10px;
      line-height: 14px;
      font-style: normal;
    }

    .tech-selected-card button {
      height: 32px;
      border: 1px solid rgba(255, 212, 107, 0.72);
      background: linear-gradient(180deg, rgba(106, 78, 22, 0.96), rgba(22, 12, 3, 0.96));
      color: #ffe8a3;
      cursor: pointer;
      clip-path: var(--cut);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 12px rgba(255, 212, 107, 0.12);
    }

    .tech-selected-card button:disabled {
      opacity: 0.55;
      cursor: default;
    }

    .tech-arrow {
      color: rgba(183, 247, 255, 0.6);
      font-size: 14px;
      line-height: 42px;
    }

    .tech-tree-legend {
      position: sticky;
      left: 0;
      z-index: 3;
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-top: 12px;
      padding: 8px 10px;
      border: 1px solid rgba(183, 247, 255, 0.12);
      background: rgba(3, 10, 18, 0.7);
      clip-path: var(--cut);
    }

    .tech-tree-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 11px;
      line-height: 14px;
    }

    .tech-tree-legend i {
      width: 10px;
      height: 10px;
      border: 1px solid rgba(255, 255, 255, 0.24);
      background: rgba(126, 232, 255, 0.45);
      box-shadow: 0 0 8px rgba(126, 232, 255, 0.22);
    }

    .tech-tree-legend i.researched {
      background: rgba(98, 240, 106, 0.78);
    }

    .tech-tree-legend i.affordable {
      background: rgba(255, 212, 107, 0.82);
    }

    .tech-tree-legend i.locked {
      background: rgba(105, 123, 142, 0.62);
    }

    .tech-tree-legend i.expensive {
      background: rgba(255, 98, 86, 0.78);
    }

    .tech-node:disabled {
      cursor: default;
    }

    .formation-main {
      grid-template-rows: auto 1fr auto;
    }

    .formation-layout {
      display: grid;
      grid-template-columns: 230px 1fr;
      gap: 10px;
      min-height: 0;
    }

    .formation-unit-list,
    .formation-squad-list {
      display: grid;
      align-content: start;
      gap: 7px;
      min-height: 0;
      overflow: auto;
      padding-right: 4px;
    }

    .formation-unit,
    .formation-squad {
      display: grid;
      grid-template-columns: 38px 1fr auto;
      align-items: center;
      gap: 7px;
      min-width: 0;
      padding: 6px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(18, 29, 46, 0.58);
      color: #effcff;
      cursor: pointer;
    }

    .formation-unit img,
    .formation-squad img {
      width: 38px;
      height: 38px;
      object-fit: cover;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.38);
    }

    .formation-unit span,
    .formation-squad span {
      min-width: 0;
      display: grid;
      gap: 2px;
      font-size: 11px;
      color: var(--muted);
    }

    .formation-unit strong,
    .formation-squad strong {
      min-width: 0;
      color: #b7f7ff;
      font-size: 12px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .formation-unit em,
    .formation-squad em {
      font-style: normal;
      color: var(--warn);
      font-size: 11px;
    }

    .formation-squad.active {
      border-color: var(--faction);
      box-shadow: inset 0 0 14px var(--faction-soft), 0 0 10px color-mix(in srgb, var(--faction) 32%, transparent);
    }

    .formation-field {
      position: relative;
      min-height: 380px;
      overflow: hidden;
      border: 1px solid rgba(183, 247, 255, 0.22);
      background:
        linear-gradient(90deg, rgba(98, 240, 106, 0.12), transparent 49%, rgba(255, 62, 54, 0.1) 51%, transparent),
        repeating-linear-gradient(15deg, rgba(183, 247, 255, 0.08) 0 1px, transparent 1px 38px),
        radial-gradient(circle at 28% 52%, rgba(47, 125, 255, 0.16), transparent 36%),
        rgba(3, 7, 18, 0.88);
      transform: perspective(900px) rotateX(9deg);
      transform-origin: center bottom;
      cursor: crosshair;
    }

    .formation-half-label {
      position: absolute;
      top: 8px;
      z-index: 2;
      color: rgba(239, 252, 255, 0.7);
      font-size: 11px;
      pointer-events: none;
    }

    .formation-half-label.own { left: 12px; }
    .formation-half-label.enemy { right: 12px; color: rgba(255, 190, 150, 0.72); }

    .formation-midline {
      position: absolute;
      inset: 0 auto 0 50%;
      width: 1px;
      background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.55), transparent);
      pointer-events: none;
    }

    .formation-token {
      position: absolute;
      width: 42px;
      height: 42px;
      translate: -50% -50%;
      z-index: 4;
      border: 1px solid var(--faction);
      background: rgba(5, 18, 34, 0.86);
      box-shadow: 0 0 12px color-mix(in srgb, var(--faction) 42%, transparent);
      display: grid;
      place-items: center;
      overflow: hidden;
      clip-path: polygon(10% 0, 100% 0, 100% 82%, 88% 100%, 0 100%, 0 18%);
    }

    .formation-token.active {
      z-index: 6;
      border-color: #ffd46b;
      box-shadow: 0 0 18px rgba(255, 212, 107, 0.44), inset 0 0 12px rgba(255, 212, 107, 0.14);
    }

    .formation-token.empty {
      opacity: 0.52;
      filter: grayscale(0.7);
      border-style: dashed;
    }

    .formation-token img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .formation-token em {
      position: absolute;
      right: 2px;
      bottom: 1px;
      padding: 0 3px;
      background: rgba(0, 0, 0, 0.72);
      color: #fff;
      font-size: 10px;
      font-style: normal;
    }

    .formation-path {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 2;
    }

    .formation-path polyline {
      fill: none;
      stroke: var(--faction);
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      vector-effect: non-scaling-stroke;
      filter: drop-shadow(0 0 4px rgba(120, 229, 255, 0.72));
    }

    .formation-path .formation-path-core {
      stroke: var(--faction-soft);
      stroke-width: 6;
      filter: drop-shadow(0 0 9px rgba(47, 125, 255, 0.28));
    }

    svg.formation-path { opacity: 0.35; }
    svg.formation-path.active { opacity: 1; }
    .formation-token, .formation-point { touch-action: none; }
    .formation-battlefield.point-dragging { cursor: grabbing; }
    .formation-battlefield.drawing-route,
    .formation-battlefield.drawing-route .formation-token,
    .formation-battlefield.drawing-route .formation-point { cursor: crosshair; }

    .formation-point {
      position: absolute;
      width: 14px;
      height: 14px;
      translate: -50% -50%;
      border: 1px solid rgba(137, 239, 255, 0.92);
      background:
        linear-gradient(135deg, transparent 0 18%, rgba(110, 229, 255, 0.22) 18% 28%, transparent 28%),
        linear-gradient(180deg, rgba(31, 118, 158, 0.98), rgba(5, 35, 60, 0.98));
      border-radius: 3px;
      box-shadow: 0 0 7px rgba(120, 229, 255, 0.62), inset 0 0 5px rgba(255, 255, 255, 0.16);
      pointer-events: auto;
      cursor: pointer;
      z-index: 5;
    }

    .formation-point[data-formation-point-index="-1"] {
      margin-left: 30px;
    }

    .formation-point.active { z-index: 7; }

    .formation-point::before,
    .formation-point::after {
      content: "";
      position: absolute;
      left: 3px;
      right: 3px;
      height: 1px;
      background: rgba(199, 255, 255, 0.86);
      box-shadow: 0 0 2px rgba(199, 255, 255, 0.6);
    }

    .formation-point::before { top: 4px; }
    .formation-point::after { bottom: 4px; }

    .formation-point-menu {
      position: absolute;
      left: var(--x);
      top: var(--y);
      translate: 10px -50%;
      z-index: 8;
      display: flex;
      gap: 4px;
      padding: 4px;
      border: 1px solid rgba(120, 229, 255, 0.56);
      background: rgba(0, 12, 28, 0.94);
      box-shadow: 0 0 12px rgba(47, 125, 255, 0.32);
      clip-path: var(--cut);
    }

    .formation-point-menu button {
      height: 22px;
      min-width: 38px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background: linear-gradient(180deg, rgba(29, 91, 126, 0.78), rgba(5, 18, 34, 0.94));
      color: #effcff;
      cursor: pointer;
      font-size: 11px;
    }

    .formation-point-menu button:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .formation-screen {
      grid-template-columns: 245px 1fr;
      gap: 8px;
      background: linear-gradient(90deg, rgba(3, 8, 18, 0.92), rgba(5, 14, 28, 0.82));
    }

    .formation-side-panel {
      display: grid;
      grid-template-rows: auto auto minmax(100px, 1fr) auto;
      gap: 8px;
      min-height: 0;
      border-right: 1px solid rgba(47, 125, 255, 0.38);
      background: rgba(0, 5, 16, 0.56);
      padding: 10px;
    }

    .formation-name-row {
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: center;
      gap: 6px;
      color: #ffd46b;
      font-size: 12px;
    }

    .formation-name-row input,
    .formation-name-row select {
      height: 24px;
      min-width: 0;
      border: 1px solid rgba(47, 125, 255, 0.62);
      background: rgba(0, 12, 32, 0.86);
      color: #effcff;
      padding: 0 6px;
    }

    .formation-name-tools {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px;
      min-width: 0;
    }

    .formation-preset-name-row {
      grid-template-columns: minmax(0, 1fr);
      gap: 4px;
    }

    .formation-name-tools select {
      grid-column: 1 / -1;
      width: 100%;
    }

    .formation-unit-picker {
      display: flex;
      flex-direction: column;
      min-height: 0;
      gap: 6px;
    }

    .formation-name-tools button {
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: linear-gradient(180deg, rgba(29, 91, 126, 0.72), rgba(5, 18, 34, 0.9));
      color: #effcff;
      cursor: pointer;
      clip-path: var(--cut);
      font-size: 11px;
    }

    .formation-preset-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 5px;
      margin-bottom: 8px;
    }

    .formation-preset-row button {
      height: 25px;
      border: 1px solid rgba(255, 212, 107, 0.34);
      background: linear-gradient(180deg, rgba(82, 58, 16, 0.72), rgba(8, 14, 24, 0.92));
      color: #ffe8a3;
      cursor: pointer;
      font-size: 11px;
      clip-path: var(--cut);
    }

    .formation-saved-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 6px;
      align-items: center;
      margin-bottom: 8px;
    }

    .formation-saved-list {
      display: flex;
      gap: 5px;
      overflow: hidden;
      min-width: 0;
    }

    .formation-saved-list button,
    .formation-squad-tools button {
      min-width: 42px;
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: rgba(0, 0, 0, 0.32);
      color: #effcff;
      cursor: pointer;
      font-size: 10px;
      clip-path: var(--cut);
    }

    .formation-saved-list button.active {
      border-color: rgba(255, 212, 107, 0.68);
      color: #ffe8a3;
      background: linear-gradient(180deg, rgba(82, 58, 16, 0.72), rgba(8, 14, 24, 0.92));
    }

    .formation-squad-tools {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 5px;
      align-items: center;
      padding: 6px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.22);
      color: var(--muted);
      font-size: 10px;
      min-width: 0;
    }

    .formation-squad-tools strong {
      color: #dfffcf;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .formation-squad-tools label {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      white-space: nowrap;
    }

    .formation-squad-tools select {
      flex: 1;
      min-width: 0;
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.4);
      background: #091a28;
      color: #effcff;
    }

    .formation-squad-tools button[aria-pressed="true"] {
      border-color: #ffd46b;
      color: #ffe8a3;
      background: rgba(82, 58, 16, 0.72);
    }

    .formation-squad-config {
      display: grid;
      gap: 6px;
      min-width: 0;
    }

    .formation-combat-options {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      padding: 0 6px;
      color: #dff4ff;
      font-size: 11px;
    }

    .formation-combat-options label {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }

    .formation-combat-options select {
      flex: 1;
      min-width: 0;
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.4);
      background: #091a28;
      color: #effcff;
    }

    .formation-squad-route-status {
      min-width: 0;
      padding: 7px 8px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: rgba(0, 0, 0, 0.28);
      color: #b9d8e8;
      font-size: 10px;
      line-height: 1.45;
    }

    .formation-unit-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      align-content: start;
      min-height: 0;
      overflow: auto;
    }

    .formation-unit-tile {
      position: relative;
      aspect-ratio: 1;
      border: 1px solid rgba(98, 240, 106, 0.56);
      background: rgba(0, 20, 24, 0.78);
      box-shadow: inset 0 0 10px rgba(98, 240, 106, 0.12), 0 0 8px rgba(98, 240, 106, 0.12);
      cursor: pointer;
      padding: 2px;
    }

    .formation-unit-tile:active {
      cursor: grabbing;
    }

    .formation-unit-tile.active {
      border-color: #ffd46b;
      box-shadow: 0 0 12px rgba(255, 212, 107, 0.32), inset 0 0 12px rgba(255, 212, 107, 0.16);
    }

    .formation-unit-tile.unowned:not(.active) {
      opacity: 0.68;
      filter: saturate(0.55);
      border-style: dashed;
    }

    .formation-unit-tile img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .formation-unit-tile em {
      position: absolute;
      right: 2px;
      bottom: 1px;
      background: rgba(0, 0, 0, 0.72);
      color: #fff;
      font-size: 10px;
      font-style: normal;
      padding: 0 3px;
    }

    .formation-note {
      max-height: clamp(96px, 18vh, 220px);
      min-height: 0;
      overflow: auto;
      border: 1px solid rgba(47, 125, 255, 0.38);
      background: rgba(0, 18, 34, 0.72);
      box-shadow: inset 0 0 14px rgba(47, 125, 255, 0.12);
      padding: 8px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.55;
    }

    .formation-note strong {
      display: block;
      color: #ffd46b;
      margin-bottom: 4px;
    }

    .formation-board-panel {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr) auto auto;
      min-height: 0;
      padding: 8px 10px 10px;
    }

    .formation-zone-band {
      display: grid;
      grid-template-columns: 3fr 1fr 2fr 6fr;
      height: 22px;
      margin-bottom: 5px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.42);
      overflow: hidden;
      color: #effcff;
      font-size: 12px;
      line-height: 22px;
      text-align: center;
    }

    .formation-zone-band span {
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.05);
    }

    .formation-zone-back {
      background: rgba(47, 125, 255, 0.3);
    }

    .formation-zone-mid {
      background: rgba(98, 240, 106, 0.24);
    }

    .formation-zone-front {
      background: rgba(255, 212, 107, 0.26);
    }

    .formation-zone-enemy { background: rgba(177, 58, 58, 0.23); color: #ffb2aa; }

    .formation-back-row {
      display: grid;
      grid-template-columns: 1fr minmax(160px, 42%);
      align-items: center;
      gap: 8px;
      color: #ffd46b;
      font-size: 12px;
      margin-bottom: 5px;
    }

    .formation-back-meter {
      height: 8px;
      border: 1px solid rgba(98, 240, 106, 0.42);
      background: rgba(0, 0, 0, 0.5);
      overflow: hidden;
    }

    .formation-back-meter span {
      display: block;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, #62f06a, #c7ff7e);
    }

    .formation-battlefield {
      position: relative;
      min-height: 0;
      height: 100%;
      overflow: hidden;
      border: 1px solid rgba(47, 125, 255, 0.48);
      background:
        radial-gradient(circle at 52% 40%, rgba(190, 226, 118, 0.32), transparent 28%),
        linear-gradient(90deg, rgba(47, 125, 255, 0.22) 0 25%, rgba(98, 240, 106, 0.16) 25% 33.333%, rgba(255, 212, 107, 0.18) 33.333% 50%, rgba(128, 28, 28, 0.3) 50% 100%),
        linear-gradient(135deg, rgba(78, 126, 52, 0.72), rgba(37, 75, 41, 0.86) 48%, rgba(94, 91, 39, 0.78));
      box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.36), 0 0 18px rgba(47, 125, 255, 0.16);
    }

    .formation-zone-guide {
      position: absolute;
      top: 0;
      bottom: 0;
      border-right: 1px solid rgba(255, 255, 255, 0.16);
      pointer-events: none;
    }

    .formation-zone-guide.back { left: 0; width: 25%; background: rgba(47, 125, 255, 0.08); }
    .formation-zone-guide.mid { left: 25%; width: 8.333%; background: rgba(98, 240, 106, 0.06); }
    .formation-zone-guide.front { left: 33.333%; width: 16.667%; background: rgba(255, 212, 107, 0.07); }
    .formation-zone-guide.enemy { left: 50%; width: 50%; border-left: 2px dashed rgba(255, 143, 127, 0.75); }

    .formation-lane {
      position: absolute;
      left: 9%;
      right: 9%;
      top: 50%;
      height: 3px;
      translate: 0 -50%;
      background: rgba(183, 247, 255, 0.38);
      box-shadow: 0 0 8px rgba(183, 247, 255, 0.25);
    }

    .formation-lane::before,
    .formation-lane::after {
      content: "";
      position: absolute;
      top: 50%;
      width: 14px;
      height: 14px;
      translate: 0 -50%;
      border: 1px solid rgba(183, 247, 255, 0.72);
      background: rgba(0, 32, 48, 0.8);
    }

    .formation-lane::before { left: -7px; }
    .formation-lane::after { right: -7px; }

    .formation-slot {
      position: absolute;
      left: var(--x);
      top: var(--y);
      width: 52px;
      height: 52px;
      translate: -50% -50%;
      border: 2px solid rgba(98, 240, 106, 0.72);
      background: rgba(0, 28, 22, 0.28);
      box-shadow: inset 0 0 12px rgba(98, 240, 106, 0.12), 0 0 10px rgba(98, 240, 106, 0.18);
      cursor: pointer;
      padding: 2px;
    }

    .formation-slot.active {
      border-color: #ffd46b;
      box-shadow: 0 0 16px rgba(255, 212, 107, 0.4), inset 0 0 14px rgba(255, 212, 107, 0.16);
    }

    .formation-slot img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .formation-slot em {
      position: absolute;
      right: 2px;
      bottom: 1px;
      background: rgba(0, 0, 0, 0.72);
      color: #fff;
      font-size: 10px;
      font-style: normal;
      padding: 0 3px;
    }

    .battle-screen {
      grid-template-columns: 250px 1fr;
      gap: 10px;
      background: linear-gradient(90deg, rgba(3, 8, 18, 0.94), rgba(6, 18, 31, 0.86));
    }

    .battle-view {
      position: fixed;
      inset: 34px 0 0;
      z-index: 50;
      display: none;
      background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.46)),
        rgba(1, 6, 13, 0.92);
    }

    .battle-view.open {
      display: block;
    }

    body:has(.battle-view.open) .mission-panel {
      display: none;
    }

    .battle-view .battle-screen {
      display: grid;
      grid-template-rows: minmax(0, 1fr) 184px;
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
      width: 100%;
      height: 100%;
      border: 0;
      background: #020813;
      box-shadow: inset 0 0 0 1px rgba(32, 216, 255, 0.12);
    }

    .battle-view .battle-arena {
      width: 100%;
      height: 100%;
      min-height: 0;
      border-width: 0 0 1px;
      transform: none;
      transform-origin: center;
      perspective: 980px;
      overflow: clip;
    }

    .battle-view .battle-unit {
      cursor: pointer;
    }

    .battle-view .battle-unit.selected {
      border-color: #ffd46b;
      box-shadow: 0 0 0 2px rgba(255, 212, 107, 0.35), 0 0 18px rgba(255, 212, 107, 0.46);
      z-index: 7;
      filter: brightness(1.25) saturate(1.18);
    }

    .battle-top-hud {
      position: absolute;
      left: 10px;
      right: 10px;
      top: 10px;
      z-index: 9;
      display: grid;
      grid-template-columns: minmax(260px, 340px) auto minmax(260px, 340px);
      align-items: start;
      gap: 12px;
      pointer-events: none;
    }

    .battle-top-hud[hidden] {
      display: none;
    }

    .battle-roster-card {
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr);
      gap: 8px;
      min-height: 76px;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.56);
      background:
        linear-gradient(180deg, rgba(7, 21, 34, 0.92), rgba(0, 5, 12, 0.84)),
        radial-gradient(circle at 0 0, rgba(32, 216, 255, 0.18), transparent 55%);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.62), 0 8px 24px rgba(0, 0, 0, 0.28);
      color: #dcebff;
    }

    .battle-roster-card.enemy {
      grid-template-columns: minmax(0, 1fr) 54px;
      text-align: right;
      background:
        linear-gradient(180deg, rgba(35, 10, 13, 0.9), rgba(0, 5, 12, 0.84)),
        radial-gradient(circle at 100% 0, rgba(255, 98, 86, 0.2), transparent 55%);
    }

    .battle-roster-card img {
      width: 54px;
      height: 54px;
      object-fit: cover;
      border: 1px solid rgba(183, 247, 255, 0.5);
      background: rgba(0, 0, 0, 0.38);
    }

    .battle-roster-body {
      display: grid;
      gap: 3px;
      min-width: 0;
      font-size: 12px;
      line-height: 1.25;
    }

    .battle-roster-body strong {
      color: #f4fbff;
      font-size: 14px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-roster-body span {
      color: #9eb9d0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-roster-body b {
      color: #ffd46b;
      font-weight: 700;
    }

    .battle-countdown {
      min-width: 156px;
      padding: 8px 16px 9px;
      border: 1px solid rgba(255, 212, 107, 0.62);
      background: linear-gradient(180deg, rgba(62, 44, 8, 0.9), rgba(2, 8, 15, 0.86));
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), 0 8px 24px rgba(0, 0, 0, 0.32);
      color: #ffe8a3;
      text-align: center;
    }

    .battle-countdown span {
      display: block;
      color: #dcebff;
      font-size: 11px;
      line-height: 14px;
    }

    .battle-countdown strong {
      display: block;
      color: #fff7d0;
      font-size: 28px;
      line-height: 32px;
      font-family: Consolas, "Microsoft YaHei", monospace;
      letter-spacing: 0;
    }

    .battle-hud {
      display: grid;
      grid-template-columns: 226px 66px minmax(420px, 1fr) 250px 180px;
      gap: 5px;
      padding: 4px 7px 5px;
      border-top: 2px solid rgba(185, 232, 255, 0.78);
      background:
        linear-gradient(180deg, rgba(48, 63, 66, 0.82), rgba(3, 8, 15, 0.96) 18%, rgba(0, 0, 0, 0.94)),
        linear-gradient(90deg, rgba(185, 232, 255, 0.16), transparent 20%, transparent 80%, rgba(185, 232, 255, 0.15));
      box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32), inset 0 -2px 0 rgba(0, 0, 0, 0.82);
      min-height: 0;
    }

    .battle-hud-panel {
      min-width: 0;
      min-height: 0;
      border: 1px solid rgba(183, 247, 255, 0.55);
      background: rgba(2, 10, 20, 0.78);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.72);
    }

    .battle-hud-map {
      position: relative;
      overflow: hidden;
      background:
        linear-gradient(90deg, rgba(47, 125, 255, 0.12), transparent 48%, rgba(255, 86, 86, 0.12)),
        url("../game_design/art_reference/generated_ui/battle/battlefield_colony_frontier.png") center / cover no-repeat;
    }

    .battle-hud-map::after {
      content: "";
      position: absolute;
      inset: 0;
      background: rgba(1, 8, 15, 0.42);
      pointer-events: none;
    }

    .battle-map-viewport {
      position: absolute;
      left: var(--vx, 14%);
      top: var(--vy, 24%);
      z-index: 2;
      width: max(18px, var(--vw, 72%));
      height: max(12px, var(--vh, 52%));
      border: 2px solid rgba(255, 255, 255, 0.95);
      background: rgba(255, 255, 255, 0.06);
      box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.72),
        0 0 10px rgba(255, 255, 255, 0.58),
        inset 0 0 0 1px rgba(0, 0, 0, 0.5);
      pointer-events: none;
    }

    .battle-map-dot {
      position: absolute;
      left: var(--x);
      top: var(--y);
      z-index: 3;
      width: 7px;
      height: 7px;
      translate: -50% -50%;
      background: #65d8ff;
      box-shadow: 0 0 7px rgba(101, 216, 255, 0.8);
      transition: left 190ms linear, top 190ms linear;
      will-change: left, top;
    }

    .battle-map-dot.enemy {
      background: #ff6256;
      box-shadow: 0 0 7px rgba(255, 98, 86, 0.78);
    }

    .battle-map-dot.selected {
      width: 9px;
      height: 9px;
      border: 1px solid #fff2a8;
      background: #ffd46b;
      box-shadow: 0 0 10px rgba(255, 212, 107, 0.9);
    }

    .battle-camera-controls {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 7px;
      z-index: 4;
      display: grid;
      grid-template-columns: 25px minmax(34px, 1fr) 25px 34px 25px 25px;
      gap: 3px;
      align-items: center;
      padding: 4px;
      border: 1px solid rgba(183, 247, 255, 0.35);
      background: rgba(0, 6, 13, 0.78);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.68);
    }

    .battle-camera-controls button {
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.52);
      background: linear-gradient(180deg, rgba(15, 51, 75, 0.95), rgba(0, 9, 18, 0.95));
      color: #dffcff;
      font-size: 13px;
      line-height: 20px;
      font-weight: 800;
      cursor: pointer;
    }

    .battle-camera-controls button:hover {
      border-color: rgba(255, 212, 107, 0.85);
      color: #fff4bb;
    }

    .battle-camera-controls strong {
      min-width: 0;
      color: #fff7d0;
      text-align: center;
      font-size: 12px;
      line-height: 20px;
      font-family: Consolas, "Microsoft YaHei", monospace;
      letter-spacing: 0;
    }

    .battle-hud-icons {
      display: grid;
      grid-template-rows: repeat(3, 1fr);
      gap: 5px;
      border: 0;
      background: transparent;
    }

    .battle-hud-icon {
      display: grid;
      place-items: center;
      border: 1px solid rgba(183, 247, 255, 0.55);
      background: linear-gradient(180deg, rgba(9, 29, 47, 0.92), rgba(0, 5, 12, 0.95));
      box-shadow: inset 0 0 12px rgba(32, 216, 255, 0.1);
    }

    .battle-hud-icon img {
      width: 38px;
      height: 38px;
      object-fit: cover;
      border: 1px solid rgba(183, 247, 255, 0.22);
    }

    .battle-hud-main {
      display: grid;
      grid-template-rows: 22px minmax(0, 1fr);
      gap: 4px;
      padding: 4px 7px 6px;
    }

    .battle-hud-title {
      height: 20px;
      border: 1px solid rgba(183, 247, 255, 0.58);
      background: linear-gradient(180deg, rgba(12, 43, 66, 0.92), rgba(1, 9, 17, 0.92));
      color: #dffcff;
      text-align: center;
      font-size: 13px;
      line-height: 18px;
      font-weight: 700;
    }

    .battle-hud-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      align-content: start;
      gap: 4px 8px;
      min-height: 0;
    }

    .battle-hud-field {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-width: 0;
      height: 22px;
      padding: 0 8px;
      border: 1px solid rgba(183, 247, 255, 0.38);
      color: #dcebff;
      font-size: 12px;
      line-height: 20px;
      background: rgba(0, 4, 10, 0.45);
    }

    .battle-hud-field span {
      color: #9eb9d0;
    }

    .battle-hud-field strong {
      color: #f4fbff;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-unit-info {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr);
      gap: 8px;
      padding: 6px;
      align-items: start;
    }

    .battle-unit-info img {
      width: 54px;
      height: 54px;
      object-fit: cover;
      border: 1px solid rgba(183, 247, 255, 0.55);
      background: rgba(0, 0, 0, 0.45);
    }

    .battle-unit-info-body {
      display: grid;
      gap: 4px;
      min-width: 0;
      color: #dcebff;
      font-size: 12px;
    }

    .battle-unit-info-body strong {
      color: #b7f7ff;
      font-size: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .battle-unit-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 3px 8px;
      color: #9eb9d0;
      font-size: 11px;
    }

    .battle-exit-panel {
      display: grid;
      grid-template-rows: 22px 1fr 28px;
      gap: 5px;
      padding: 6px;
      color: #dcebff;
      font-size: 12px;
    }

    .battle-exit-panel p {
      margin: 0;
      color: #9eb9d0;
      line-height: 1.45;
    }

    .battle-exit-panel button {
      border: 1px solid rgba(255, 98, 86, 0.58);
      background: linear-gradient(180deg, rgba(116, 25, 30, 0.9), rgba(25, 3, 6, 0.95));
      color: #fff2ef;
      cursor: pointer;
      clip-path: var(--cut);
    }

    .battle-exit-panel.battle-replay-panel {
      grid-template-rows: 20px minmax(0, 1fr) auto 28px;
      gap: 4px;
    }

    .battle-replay-controls {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
    }

    .battle-replay-controls button {
      min-height: 24px;
      font-size: 11px;
    }

    .battle-replay-controls [data-report-playback="finish"] {
      grid-column: 1 / -1;
    }

    .battle-replay-controls button:disabled {
      opacity: 0.5;
      cursor: default;
    }

    .battle-side-panel {
      display: grid;
      grid-template-rows: auto auto 1fr auto;
      gap: 9px;
      min-height: 0;
      padding: 10px;
      border-right: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 5, 14, 0.58);
    }

    .battle-side-panel h3 {
      margin: 0;
      color: #b7f7ff;
      font-size: 14px;
      line-height: 18px;
    }

    .battle-side-panel p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }

    .battle-preset-list {
      display: grid;
      gap: 6px;
    }

    .battle-preset-list button,
    .battle-actions button {
      min-height: 30px;
      border: 1px solid rgba(183, 247, 255, 0.32);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.86), rgba(3, 12, 22, 0.92));
      color: #effcff;
      cursor: pointer;
      clip-path: var(--cut);
    }

    .battle-preset-list button.active {
      border-color: #ffd46b;
      color: #ffe8a3;
      box-shadow: inset 0 0 12px rgba(255, 212, 107, 0.14), 0 0 12px rgba(255, 212, 107, 0.14);
    }

    .battle-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
    }

    .battle-actions button.danger {
      border-color: rgba(255, 86, 86, 0.42);
      background: linear-gradient(180deg, rgba(112, 34, 34, 0.78), rgba(22, 5, 8, 0.9));
    }

    .battle-actions button:disabled {
      opacity: 0.48;
      cursor: default;
    }

    .battle-main {
      display: grid;
      grid-template-rows: auto 1fr auto;
      gap: 8px;
      min-height: 0;
      padding: 10px;
    }

    .battle-score-row {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 10px;
      align-items: center;
      color: #effcff;
      font-size: 12px;
    }

    .battle-score-row strong {
      color: #ffd46b;
      font-size: 14px;
    }

    .battle-result-card {
      display: grid;
      gap: 6px;
      padding: 8px;
      border: 1px solid rgba(255, 212, 107, 0.3);
      background: rgba(48, 31, 6, 0.22);
      color: #ffe8a3;
      font-size: 11px;
      line-height: 1.45;
    }

    .battle-result-card strong {
      color: #ffffff;
      font-size: 14px;
    }

    .battle-arena {
      position: relative;
      min-height: 440px;
      overflow: hidden;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: #111612;
      box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.42);
      transform: none;
      transform-origin: center bottom;
      cursor: grab;
      touch-action: none;
      user-select: none;
    }

    .battle-arena.dragging {
      cursor: grabbing;
    }

    .battle-arena::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: 28%;
      z-index: 1;
      background:
        linear-gradient(180deg, rgba(225, 238, 188, 0.34), rgba(225, 238, 188, 0.12) 38%, transparent 100%),
        radial-gradient(ellipse at 50% 0%, rgba(255, 250, 206, 0.22), transparent 72%);
      pointer-events: none;
      mix-blend-mode: screen;
    }

    .battle-map-world {
      position: absolute;
      left: 50%;
      top: 50%;
        width: 2128px;
        height: 1197px;
      z-index: 0;
      transform: translate3d(calc(-50% + var(--battle-pan-x, 0px)), calc(-50% + var(--battle-pan-y, 0px)), 0) scale(var(--battle-zoom, 1));
      transform-origin: center center;
      will-change: transform;
      contain: layout paint style;
      backface-visibility: hidden;
    }

    .battle-terrain-grid {
      position: absolute;
      inset: 0;
      z-index: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(2, minmax(0, 1fr));
      background: url("assets/battle/maps/neutral-grass-plain-v1/neutral-grass-plain-2128x1197.png") center / 100% 100% no-repeat;
      pointer-events: none;
    }

    .battle-three-canvas {
      position: absolute;
      inset: 0;
      z-index: 2;
      display: none;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .battle-terrain-grid::after {
      content: "";
      position: absolute;
      inset: 0;
      background: none;
      opacity: 0;
      box-shadow: none;
      pointer-events: none;
    }

    .battle-terrain-tile {
      display: none;
      min-width: 0;
      min-height: 0;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      image-rendering: auto;
    }

    .battle-terrain-tile.tile-tl {
      background-image: url("assets/battle/backgrounds/topdown-rts-grass-battlefield-4screen-tl-v1.png");
    }

    .battle-terrain-tile.tile-tr {
      background-image: url("assets/battle/backgrounds/topdown-rts-grass-battlefield-4screen-tr-v1.png");
    }

    .battle-terrain-tile.tile-bl {
      background-image: url("assets/battle/backgrounds/topdown-rts-grass-battlefield-4screen-bl-v1.png");
    }

    .battle-terrain-tile.tile-br {
      background-image: url("assets/battle/backgrounds/topdown-rts-grass-battlefield-4screen-br-v1.png");
    }

    .battle-midline {
      position: absolute;
      inset: 0 auto 0 50%;
      z-index: 3;
      width: 1px;
      background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.58), transparent);
      pointer-events: none;
    }

    .battle-route {
      position: absolute;
      inset: 0;
      z-index: 4;
      width: 100%;
      height: 100%;
      pointer-events: none;
      opacity: 0.9;
    }

    .battle-route polyline {
      fill: none;
      stroke: rgba(126, 235, 255, 0.78);
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      vector-effect: non-scaling-stroke;
      filter: drop-shadow(0 0 5px rgba(32, 216, 255, 0.62));
    }

    .battle-route.enemy polyline {
      stroke: rgba(255, 124, 112, 0.78);
      filter: drop-shadow(0 0 5px rgba(255, 86, 86, 0.5));
    }

    .battle-unit {
      position: absolute;
      left: var(--x);
      top: var(--y);
      width: 46px;
      height: 46px;
      translate: -50% -100%;
      z-index: 4;
      border: 1px solid var(--unit-color, var(--faction));
      background: rgba(0, 8, 18, 0.86);
      box-shadow: 0 0 12px color-mix(in srgb, var(--unit-color, var(--faction)) 45%, transparent);
      overflow: hidden;
      clip-path: polygon(10% 0, 100% 0, 100% 82%, 88% 100%, 0 100%, 0 18%);
      transition:
        left 190ms linear,
        top 190ms linear,
        opacity 180ms ease,
        transform 220ms ease,
        filter 180ms ease;
      transform: scale(var(--depth-scale, 1));
      transform-origin: 50% 100%;
      will-change: left, top, transform;
    }

    .battle-three-canvas ~ .battle-unit {
      opacity: 1;
    }

    .battle-unit.enemy {
      --unit-color: #ff6256;
    }

    .battle-unit.single {
      width: 24px;
      height: 24px;
      border-width: 1px;
      box-shadow: 0 0 7px color-mix(in srgb, var(--unit-color, var(--faction)) 48%, transparent);
    }

    .battle-unit.ground-token-unit {
      width: 28px;
      height: 22px;
      border: 0;
      background: transparent;
      box-shadow: none;
      overflow: visible;
      clip-path: none;
    }

    .battle-unit.ground-token-unit.single {
      width: 24px;
      height: 19px;
    }

    .battle-ground-token {
      position: absolute;
      left: 50%;
      bottom: 0;
      width: calc(22px * var(--token-size, 1));
      height: calc(16px * var(--token-size, 1));
      translate: -50% 0;
      pointer-events: none;
      transform: rotate(var(--token-angle, -12deg)) scaleX(var(--token-width, 1)) scaleY(var(--token-height, 1));
      transform-origin: 50% 78%;
    }

    .battle-ground-token .token-body,
    .battle-ground-token .token-mark,
    .battle-ground-token .token-weapon {
      position: absolute;
      display: block;
      box-sizing: border-box;
    }

    .battle-ground-token .token-body {
      left: 50%;
      bottom: 3px;
      width: 15px;
      height: 11px;
      translate: -50% 0;
      border: 1px solid rgba(255, 255, 255, 0.55);
      background:
        radial-gradient(circle at 36% 26%, rgba(255, 255, 255, 0.92), transparent 17%),
        linear-gradient(135deg, var(--unit-accent, #9eefff), var(--unit-secondary, #51a8ff) 55%, rgba(20, 39, 47, 0.96));
      box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.32), 0 0 5px color-mix(in srgb, var(--unit-accent, #9eefff) 42%, transparent);
      clip-path: polygon(22% 0, 78% 0, 100% 38%, 82% 100%, 20% 100%, 0 40%);
    }

    .battle-ground-token .token-mark {
      left: 50%;
      bottom: 10px;
      width: 7px;
      height: 7px;
      translate: -50% 0;
      border-radius: 50%;
      background: radial-gradient(circle, #ffffff 0 22%, var(--unit-accent, #9eefff) 52%, rgba(0, 0, 0, 0.45) 100%);
      box-shadow: 0 0 5px color-mix(in srgb, var(--unit-accent, #9eefff) 72%, transparent);
    }

    .battle-ground-token .token-weapon {
      right: -2px;
      bottom: 8px;
      width: 10px;
      height: 3px;
      border-radius: 3px;
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), var(--unit-accent, #9eefff));
      transform: rotate(-7deg);
      box-shadow: 0 0 4px color-mix(in srgb, var(--unit-accent, #9eefff) 58%, transparent);
    }

    .battle-ground-token.faction-zerg .token-body {
      width: 17px;
      height: 13px;
      border-color: rgba(255, 215, 255, 0.62);
      border-radius: 46% 54% 42% 58%;
      clip-path: polygon(48% 0, 88% 18%, 100% 68%, 64% 100%, 20% 88%, 0 48%, 18% 14%);
      background:
        radial-gradient(circle at 50% 18%, rgba(255, 230, 255, 0.95), transparent 15%),
        linear-gradient(135deg, var(--unit-accent, #ff8cff), var(--unit-secondary, #7dff92) 52%, #4b174f);
    }

    .battle-ground-token.faction-zerg .token-mark {
      bottom: 12px;
      width: 8px;
      height: 6px;
      border-radius: 48% 52% 36% 64%;
      background: radial-gradient(circle, #fff0ff 0 18%, var(--unit-accent, #ff8cff) 48%, #4b174f 100%);
    }

    .battle-ground-token.faction-zerg .token-weapon {
      right: -4px;
      bottom: 7px;
      width: 13px;
      height: 5px;
      border-radius: 50%;
      clip-path: polygon(0 50%, 68% 0, 100% 50%, 68% 100%);
      background: linear-gradient(90deg, var(--unit-secondary, #7dff92), var(--unit-accent, #ff8cff));
    }

    .battle-ground-token.faction-protoss .token-body {
      width: 15px;
      height: 14px;
      border-color: rgba(255, 232, 142, 0.72);
      clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
      background:
        radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.95), transparent 16%),
        linear-gradient(145deg, var(--unit-accent, #80e8ff), var(--unit-secondary, #ffd768) 54%, #183b73);
    }

    .battle-ground-token.faction-protoss .token-mark {
      bottom: 12px;
      width: 6px;
      height: 10px;
      border-radius: 50% 50% 40% 40%;
      clip-path: polygon(50% 0, 100% 62%, 50% 100%, 0 62%);
      background: linear-gradient(180deg, #ffffff, var(--unit-accent, #80e8ff) 62%, var(--unit-secondary, #ffd768));
    }

    .battle-ground-token.faction-protoss .token-weapon {
      right: -3px;
      bottom: 8px;
      width: 11px;
      height: 4px;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--unit-secondary, #ffd768), #ffffff, var(--unit-accent, #80e8ff));
    }

    .battle-ground-token.branch-vehicle {
      width: calc(27px * var(--token-size, 1));
      height: calc(17px * var(--token-size, 1));
    }

    .battle-ground-token.branch-vehicle .token-body {
      width: 22px;
      height: 12px;
      bottom: 3px;
      border-radius: 5px;
      clip-path: polygon(8% 20%, 70% 0, 100% 36%, 90% 100%, 14% 100%, 0 52%);
    }

    .battle-ground-token.branch-vehicle .token-mark {
      bottom: 12px;
      width: 10px;
      height: 6px;
      border-radius: 3px;
    }

    .battle-ground-token.branch-vehicle .token-weapon {
      right: -5px;
      bottom: 9px;
      width: 15px;
    }

    .battle-ground-token.branch-flight {
      bottom: 2px;
    }

    .battle-ground-token.branch-flight .token-body {
      width: 22px;
      height: 13px;
      clip-path: polygon(50% 0, 100% 74%, 64% 64%, 50% 100%, 36% 64%, 0 74%);
    }

    .battle-ground-token.branch-flight .token-mark {
      bottom: 11px;
      width: 6px;
      height: 6px;
    }

    .battle-ground-token.branch-flight .token-weapon {
      right: 0;
      bottom: 7px;
      width: 8px;
      opacity: 0.7;
    }

    .battle-unit.sprite {
      width: 32px;
      height: 34px;
      border: 0;
      background: transparent;
      box-shadow: none;
      overflow: visible;
      clip-path: none;
    }

    .battle-unit.sprite.single {
      width: 30px;
      height: 32px;
      box-shadow: none;
    }

    .battle-unit.sprite.selected {
      filter: none;
    }

    .battle-unit.sprite.selected::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -4px;
      width: 24px;
      height: 8px;
      translate: -50% 0;
      border: 1px solid #ffd46b;
      border-radius: 50%;
      background: rgba(255, 212, 107, 0.12);
      box-shadow: 0 0 10px rgba(255, 212, 107, 0.45);
      pointer-events: none;
    }

    /* Battlefield contact pass: anchor every sprite to the grass with a soft,
       depth-aware footprint instead of a floating drop shadow. */
    .battle-unit.sprite:not(.destroyed)::before {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -2px;
      z-index: 0;
      width: clamp(18px, calc(var(--battle-move-size, 64px) * 0.42), 92px);
      height: clamp(5px, calc(var(--battle-move-size, 64px) * 0.105), 16px);
      translate: -50% 0;
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(38, 31, 15, 0.58), rgba(38, 31, 15, 0.24) 58%, transparent 78%);
      filter: blur(1.8px);
      opacity: clamp(0.48, calc(0.35 + var(--depth-scale, 1) * 0.35), 0.82);
      pointer-events: none;
    }

    .battle-unit.sprite:not(.destroyed):not(.selected)::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 1px;
      z-index: 2;
      width: clamp(12px, calc(var(--battle-move-size, 64px) * 0.24), 54px);
      height: clamp(7px, calc(var(--battle-move-size, 64px) * 0.16), 22px);
      translate: -50% 35%;
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(39, 38, 17, 0.2), transparent 74%);
      mix-blend-mode: multiply;
      filter: blur(2px);
      opacity: 0.48;
      pointer-events: none;
    }

    .battle-unit.sprite .battle-sprite,
    .battle-unit.sprite .battle-motion-sprite,
    .battle-unit.sprite .battle-horizontal-sprite,
    .battle-unit.sprite .battle-directional-sprite {
      transform-origin: 50% 100%;
    }

    /* Air units sit above the ground; their shadow is smaller and lighter. */
    .battle-unit.sprite:is(.unit-sentry-engineer, .unit-dualform-fighter, .unit-night-hawk-bomber, .unit-expedition-cruiser, .unit-sentinel-transport, .unit-observer-core, .unit-phoenix-fighter, .unit-void-ship, .unit-star-dome-mothership, .unit-lumen-prism, .unit-watcher-eye, .unit-blade-wing, .unit-corrosion-bomber, .unit-corrupt-wing, .unit-nav-sac)::before {
      width: clamp(14px, calc(var(--battle-move-size, 64px) * 0.28), 66px);
      height: clamp(4px, calc(var(--battle-move-size, 64px) * 0.065), 11px);
      bottom: -8px;
      opacity: 0.34;
      filter: blur(2.4px);
    }

    .battle-unit.sprite:is(.unit-sentry-engineer, .unit-dualform-fighter, .unit-night-hawk-bomber, .unit-expedition-cruiser, .unit-sentinel-transport, .unit-observer-core, .unit-phoenix-fighter, .unit-void-ship, .unit-star-dome-mothership, .unit-lumen-prism, .unit-watcher-eye, .unit-blade-wing, .unit-corrosion-bomber, .unit-corrupt-wing, .unit-nav-sac)::after {
      bottom: -3px;
      opacity: 0.22;
    }

    .battle-sprite {
      position: absolute;
      left: 50%;
      bottom: 0;
      z-index: 1;
      width: 38px;
      height: 38px;
      translate: -50% 0;
      background-image: url("../game_design/art_reference/generated_ui/battle/unit_sprites/terran_infantry_spritesheet.png");
      background-size: 300% 200%;
      background-position: calc(var(--sprite-col, 0) * 50%) calc(var(--sprite-row, 0) * 100%);
      background-repeat: no-repeat;
      filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.32));
      pointer-events: none;
    }

    .battle-sprite::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -1px;
      width: 18px;
      height: 5px;
      translate: -50% 15%;
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.16) 60%, transparent 76%);
      transform: scaleX(1.08);
      z-index: -1;
      pointer-events: none;
    }

    .battle-unit.sprite.moving .battle-sprite {
      animation: battleSpriteMarch 0.82s infinite alternate ease-in-out;
    }

    .battle-unit.sprite.attacking .battle-sprite {
      animation: battleSpriteAttack 0.24s infinite alternate ease-out;
    }

    .battle-unit.sprite.action-sprite .battle-sprite {
      width: 54px;
      height: 54px;
      background-image: url("assets/battle/units/terran_topdown_action_sheet_v2.png");
      background-size: 1600% 1200%;
      background-position: var(--action-frame-x, 0%) var(--sprite-row-y, 0%);
      animation: none;
    }

    .battle-unit.sprite.action-sprite.moving .battle-sprite,
    .battle-unit.sprite.action-sprite.attacking .battle-sprite {
      background-size: 100% 100%;
      background-position: center;
    }

    .battle-unit.sprite.action-sprite.moving .battle-sprite {
      width: 72px;
      height: 56px;
    }

    .battle-unit.sprite.action-sprite.attacking .battle-sprite {
      width: 82px;
      height: 58px;
    }

    .battle-unit.sprite.action-sprite.unit-mobile-bunker .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-rail-sniper .battle-sprite {
      width: 80px;
      height: 52px;
    }

    .battle-unit.sprite.action-sprite.unit-storm-trooper .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-assault-walker .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-ion-tank .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-zone-gunship .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-expedition-cruiser .battle-sprite {
      width: 96px;
      height: 64px;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_rifleman_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-rifleman.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_rifleman_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-flame-engineer.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_flame-engineer_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-flame-engineer.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_flame-engineer_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-missile-guard.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_missile-guard_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-missile-guard.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_missile-guard_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-field-medic.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_field-medic_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-field-medic.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_field-medic_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-siege-marine.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_siege-marine_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-siege-marine.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_siege-marine_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-mobile-bunker.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_mobile-bunker_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-mobile-bunker.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_mobile-bunker_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-rail-sniper.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_rail-sniper_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-rail-sniper.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_rail-sniper_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-storm-trooper.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_storm-trooper_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-storm-trooper.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_storm-trooper_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-assault-walker.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_assault-walker_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-assault-walker.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_assault-walker_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-ion-tank.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_ion-tank_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-ion-tank.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_ion-tank_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-zone-gunship.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_zone-gunship_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-zone-gunship.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_zone-gunship_attack.gif"); }
    .battle-unit.sprite.action-sprite.unit-expedition-cruiser.moving .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_expedition-cruiser_move.gif"); }
    .battle-unit.sprite.action-sprite.unit-expedition-cruiser.attacking .battle-sprite { background-image: url("assets/battle/units/animated_clean/terran_expedition-cruiser_attack.gif"); }

    .battle-unit.sprite.action-sprite.unit-rifleman .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-rifleman.moving .battle-sprite {
      width: 38px;
      height: 38px;
      background-image: url("assets/battle/units/animated_generated_oblique/terran_rifleman_hq_connected_walk_slow_v1.gif");
      background-size: 100% 100%;
      background-position: center;
      opacity: 0.92;
      filter:
        sepia(0.24)
        saturate(0.66)
        brightness(0.76)
        contrast(0.88)
        drop-shadow(0 1px 1px rgba(48, 37, 17, 0.45));
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.attacking .battle-sprite {
      width: 41px;
      height: 41px;
      background-image: url("assets/battle/units/animated_generated_oblique/terran_rifleman_hq_connected_attack_flash_v4.gif");
      background-size: 100% 100%;
      background-position: center;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.hit:not(.attacking):not(.destroyed) .battle-sprite {
      background-image: url("assets/battle/units/animated_generated_oblique/terran_rifleman_hq_hurt_flash_blood_v1.gif");
      background-size: 100% 100%;
      background-position: center;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.destroyed .battle-sprite {
      width: 40px;
      height: 40px;
      background-image: url("assets/battle/units/animated_generated_oblique/terran_rifleman_hq_connected_death_v1.gif");
      background-size: 100% 100%;
      background-position: center;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman .battle-sprite::after {
      bottom: 1px;
      width: 28px;
      height: 8px;
      background:
        radial-gradient(ellipse at center, rgba(34, 27, 13, 0.68), rgba(62, 51, 22, 0.34) 54%, transparent 78%);
      transform: scaleX(1.46);
      filter: blur(0.55px);
    }

    .battle-unit.sprite.action-sprite.unit-rifleman::before {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -1px;
      z-index: 0;
      width: 24px;
      height: 8px;
      translate: -50% 0;
      border-radius: 50%;
      background: rgba(46, 39, 18, 0.28);
      filter: blur(2px);
      pointer-events: none;
    }

    /* Temporary battlefield preview for the two imported 128px GIF units. */
    .battle-unit.sprite.action-sprite.unit-rifleman .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-rifleman.moving .battle-sprite,
    .battle-unit.sprite.action-sprite.unit-rifleman.attacking .battle-sprite {
      width: 46px;
      height: 46px;
      background-image: url("assets/battle/units/preview_imports/unit-01-rts-master-run.gif");
      background-size: 100% 100%;
      background-position: center;
      opacity: 1;
      filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.58));
    }

    .battle-unit.sprite.action-sprite:is(
      .unit-flame-engineer,
      .unit-armor-breaker,
      .unit-swift-fire-car,
      .unit-rail-tank,
      .unit-mine-mech,
      .unit-heavy-rail-siege
    ) .battle-sprite {
      width: 58px;
      height: 58px;
      background-image: url("assets/battle/units/preview_imports/unit-02-heavy-mech.gif");
      background-size: 100% 100%;
      background-position: center;
      opacity: 1;
      filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.62));
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.unit-slot-0 { translate: calc(-50% - 3px) calc(-100% + 1px); }
    .battle-unit.sprite.action-sprite.unit-rifleman.unit-slot-1 { translate: calc(-50% + 2px) calc(-100% - 2px); }
    .battle-unit.sprite.action-sprite.unit-rifleman.unit-slot-2 { translate: calc(-50% - 1px) calc(-100% + 3px); }
    .battle-unit.sprite.action-sprite.unit-rifleman.unit-slot-3 { translate: calc(-50% + 4px) calc(-100% + 1px); }
    .battle-unit.sprite.action-sprite.unit-rifleman.unit-slot-4 { translate: calc(-50% - 4px) calc(-100% - 1px); }
    .battle-unit.sprite.action-sprite.unit-rifleman.unit-slot-5 { translate: calc(-50% + 1px) calc(-100% + 4px); }

    .battle-unit.sprite.action-sprite.unit-rifleman.single {
      width: 26px;
      height: 27px;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.moving {
      transition-duration: 620ms, 620ms, 180ms, 220ms, 180ms;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.moving.unit-slot-0,
    .battle-unit.sprite.action-sprite.unit-rifleman.moving.unit-slot-3 {
      transition-timing-function:
        cubic-bezier(0.18, 0.62, 0.28, 1),
        cubic-bezier(0.2, 0.58, 0.3, 1),
        ease,
        ease,
        ease;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.moving.unit-slot-1,
    .battle-unit.sprite.action-sprite.unit-rifleman.moving.unit-slot-4 {
      transition-duration: 700ms, 700ms, 180ms, 220ms, 180ms;
    }

    .battle-unit.sprite.action-sprite.unit-flame-engineer .battle-sprite {
      width: 58px;
      height: 58px;
    }

    .battle-unit.sprite.action-sprite.moving .battle-sprite {
      animation: none;
    }

    .battle-unit.sprite.action-sprite.attacking .battle-sprite {
      animation: none;
    }

    .battle-unit.enemy .battle-sprite {
      transform: scaleX(-1);
      filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)) sepia(0.2) saturate(1.08);
    }

    .battle-unit.enemy.sprite.action-sprite.unit-rifleman .battle-sprite {
      transform: scaleX(-1);
      filter:
        sepia(0.26)
        saturate(0.68)
        brightness(0.76)
        contrast(0.9)
        drop-shadow(0 1px 1px rgba(48, 37, 17, 0.48));
    }

    .battle-unit.enemy.sprite.attacking .battle-sprite {
      animation-name: battleSpriteAttackEnemy;
    }

    .battle-unit.enemy.sprite.action-sprite.attacking .battle-sprite {
      animation: none;
    }

    .battle-unit.sprite.action-sprite.unit-rifleman.attacking::before {
      content: none;
    }

    .battle-unit.sprite.ranged.attacking::before,
    .battle-unit.sprite.support.attacking::before,
    .battle-unit.sprite.control.attacking::before {
      content: "";
      position: absolute;
      right: -9px;
      top: 18px;
      z-index: 8;
      width: 18px;
      height: 7px;
      border-radius: 999px;
      background: radial-gradient(circle at 20% 50%, #ffffff, #7eefff 38%, rgba(32, 216, 255, 0) 72%);
      filter: drop-shadow(0 0 8px rgba(126, 235, 255, 0.9));
      pointer-events: none;
      animation: battleMuzzle 0.18s ease-out infinite alternate;
    }

    .battle-unit.enemy.sprite.ranged.attacking::before,
    .battle-unit.enemy.sprite.support.attacking::before,
    .battle-unit.enemy.sprite.control.attacking::before {
      right: auto;
      left: -9px;
      transform: scaleX(-1);
      background: radial-gradient(circle at 20% 50%, #fff0e8, #ff8b72 42%, rgba(255, 98, 86, 0) 74%);
      filter: drop-shadow(0 0 8px rgba(255, 98, 86, 0.9));
    }

    .battle-unit.sprite.melee.attacking::before {
      content: "";
      position: absolute;
      right: -6px;
      top: 12px;
      z-index: 8;
      width: 20px;
      height: 20px;
      border-top: 2px solid rgba(255, 244, 180, 0.95);
      border-right: 2px solid rgba(255, 244, 180, 0.65);
      border-radius: 50%;
      transform: rotate(28deg);
      filter: drop-shadow(0 0 6px rgba(255, 212, 107, 0.8));
      pointer-events: none;
      animation: battleSlash 0.22s ease-out infinite alternate;
    }

    .battle-unit.sprite.action-sprite.unit-flame-engineer.attacking::before {
      right: -12px;
      top: 10px;
      width: 30px;
      height: 24px;
      border-top-color: rgba(255, 198, 79, 0.98);
      border-right-color: rgba(255, 92, 42, 0.78);
      box-shadow: 8px 1px 12px rgba(255, 101, 35, 0.45);
      filter: drop-shadow(0 0 9px rgba(255, 120, 38, 0.9));
    }

    .battle-unit.enemy.sprite.melee.attacking::before {
      right: auto;
      left: -6px;
      transform: scaleX(-1) rotate(28deg);
    }

    .battle-unit.single em {
      display: none;
    }

    .battle-unit.moving {
      animation: battleUnitMove 0.42s infinite alternate ease-in-out;
    }

    .battle-unit.sprite.moving {
      animation: none;
    }

    .battle-unit.attacking {
      filter: brightness(1.32) saturate(1.2);
      box-shadow: 0 0 18px color-mix(in srgb, var(--unit-color, var(--faction)) 70%, transparent);
      animation: battleUnitAttack 0.34s infinite alternate ease-out;
    }

    .battle-unit.hit {
      border-color: #ffd46b;
      filter: brightness(1.45) saturate(1.4);
      animation: none;
    }

    .battle-unit.destroyed {
      opacity: 0.72;
      filter: grayscale(0.25) brightness(0.88);
      transform: scale(0.92);
    }

    .battle-unit img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .battle-unit.enemy:not(.sprite) img {
      transform: scaleX(-1);
    }

    .battle-unit em {
      position: absolute;
      right: 2px;
      bottom: 1px;
      padding: 0 3px;
      background: rgba(0, 0, 0, 0.72);
      color: #fff;
      font-size: 10px;
      font-style: normal;
    }

    .battle-shot {
      position: absolute;
      left: var(--x1);
      top: var(--y1);
      width: var(--len);
      height: 12px;
      z-index: 3;
      transform-origin: left center;
      rotate: var(--angle);
      margin-top: -6px;
      background:
        url("assets/battle/effects/topdown_projectile_fx_sheet_v1.png") 0 0 / 400% 400% no-repeat,
        linear-gradient(90deg, transparent, rgba(126, 235, 255, 0.95), transparent);
      border-radius: 999px;
      box-shadow: 0 0 12px rgba(32, 216, 255, 0.78);
      pointer-events: none;
      animation: battleShot 0.28s ease-out forwards;
    }

    .battle-shot.enemy {
      background:
        url("assets/battle/effects/topdown_projectile_fx_sheet_v1.png") 33.333% 0 / 400% 400% no-repeat,
        linear-gradient(90deg, transparent, rgba(255, 124, 112, 0.95), transparent);
      box-shadow: 0 0 10px rgba(255, 86, 86, 0.72);
    }

    .battle-shot.melee {
      height: 24px;
      border-radius: 999px;
      margin-top: -12px;
      background:
        url("assets/battle/effects/topdown_projectile_fx_sheet_v1.png") 66.666% 0 / 400% 400% no-repeat,
        linear-gradient(90deg, transparent, rgba(255, 244, 180, 0.94), transparent);
      box-shadow: 0 0 9px rgba(255, 212, 107, 0.72);
    }

    @keyframes battleUnitMove {
      from { transform: translateY(-1px); }
      to { transform: translateY(2px); }
    }

    @keyframes battleUnitAttack {
      from { transform: scale(1); }
      to { transform: scale(1.08); }
    }

    @keyframes battleUnitHit {
      0%, 100% { transform: none; }
    }

    @keyframes battleShot {
      from { opacity: 0.95; scale: 1 1; }
      to { opacity: 0; scale: 0.45 1; }
    }

    .battle-effects-layer,
    .battle-effects-world {
      pointer-events: none;
    }

    .battle-effects-layer {
      overflow: hidden;
    }

    .battle-view .battle-effects-layer {
      clip-path: inset(88px 0 0 0);
    }

    .battle-effects-world {
      width: 100%;
      height: 100%;
      isolation: isolate;
    }

    .battle-fx {
      z-index: 1;
      border: 0;
      background-color: transparent;
      mix-blend-mode: screen;
      image-rendering: auto;
      backface-visibility: hidden;
    }

    .battle-fx-atlas {
      background-color: transparent;
      filter:
        saturate(1.12)
        contrast(1.08)
        drop-shadow(0 0 5px var(--fx-glow-color, #73ecff));
    }

    .battle-fx-muzzle:not(.battle-fx-atlas) {
      border-radius: 50%;
      background:
        radial-gradient(circle, var(--fx-core-color, #fff) 0 13%, var(--fx-color, #73ecff) 24%, transparent 66%),
        conic-gradient(from 45deg, transparent 0 9%, var(--fx-color, #73ecff) 10% 13%, transparent 14% 34%, var(--fx-color, #73ecff) 35% 38%, transparent 39% 100%);
      filter: drop-shadow(0 0 7px var(--fx-glow-color, #73ecff));
    }

    .battle-fx-type-rifle-flash:not(.battle-fx-atlas),
    .battle-fx-type-rider-muzzle-flash:not(.battle-fx-atlas),
    .battle-fx-type-cannon-blast:not(.battle-fx-atlas),
    .battle-fx-type-heavy-cannon-blast:not(.battle-fx-atlas) {
      border-radius: 2px;
      clip-path: polygon(0 42%, 34% 35%, 18% 2%, 51% 28%, 68% 8%, 63% 38%, 100% 50%, 63% 62%, 68% 92%, 51% 72%, 18% 98%, 34% 65%, 0 58%);
      background: radial-gradient(ellipse at 46% 50%, #ffffff 0 15%, #fff3b0 25%, #ffb347 48%, transparent 72%);
      filter: drop-shadow(0 0 5px #ff8a36) drop-shadow(0 0 9px rgba(255, 93, 35, 0.7));
    }

    .battle-fx-muzzle::after {
      content: "";
      position: absolute;
      inset: 18%;
      border: 1px solid color-mix(in srgb, var(--fx-core-color, #fff) 82%, transparent);
      border-radius: 50%;
    }

    .battle-fx-projectile:not(.battle-fx-atlas) {
      border-radius: 999px;
      background: linear-gradient(90deg, transparent, var(--fx-color, #73ecff) 24%, var(--fx-core-color, #fff) 62%, transparent);
      box-shadow: 0 0 9px var(--fx-glow-color, #73ecff);
    }

    .battle-fx-projectile {
      overflow: visible;
    }

    .battle-fx-type-rifle-tracer:not(.battle-fx-atlas),
    .battle-fx-type-pistol-tracer:not(.battle-fx-atlas) {
      background: linear-gradient(90deg, transparent 0 8%, var(--fx-color) 24%, var(--fx-core-color) 60% 82%, transparent 100%);
      box-shadow: 0 0 5px var(--fx-glow-color);
    }

    .battle-fx-type-heavy-missile:not(.battle-fx-atlas),
    .battle-fx-type-tank-shell:not(.battle-fx-atlas),
    .battle-fx-type-heavy-shell:not(.battle-fx-atlas) {
      overflow: visible;
      border: 1px solid rgba(255, 221, 160, 0.52);
      background: linear-gradient(90deg, #2d3339 0 22%, #8b948e 23% 58%, #ffd27b 66%, #fff8dd 82%, transparent 100%);
      box-shadow: 0 0 6px var(--fx-glow-color);
    }

    .battle-fx-type-protoss-energy-bolt:not(.battle-fx-atlas) {
      border: 1px solid rgba(104, 225, 255, 0.82);
      border-radius: 50%;
      background: radial-gradient(circle at 62% 50%, #ffffff 0 20%, #8ceeff 30%, #39c8ff 52%, rgba(38, 116, 255, 0.42) 70%, transparent 75%);
      box-shadow: 0 0 7px #56ddff, 0 0 14px rgba(38, 116, 255, 0.78);
    }

    .battle-fx-type-protoss-energy-bolt:not(.battle-fx-atlas) .battle-fx-trail {
      height: 7px;
      background: linear-gradient(90deg, transparent, rgba(38, 116, 255, 0.18) 12%, #39c8ff 78%, #eaffff);
      filter: blur(1px) drop-shadow(0 0 5px #2674ff);
    }

    .battle-fx-type-terran-laser-bolt:not(.battle-fx-atlas),
    .battle-fx-type-laser-bolt:not(.battle-fx-atlas) {
      border-radius: 999px;
      background: linear-gradient(90deg, transparent 0 5%, #45dcff 20%, #ffffff 56% 88%, transparent 100%);
      box-shadow: 0 0 5px #53e6ff, 0 0 9px rgba(38, 116, 255, 0.82);
    }

    .battle-fx-type-zerg-acid-glob:not(.battle-fx-atlas),
    .battle-fx-type-zerg-bio-bolt:not(.battle-fx-atlas) {
      border: 1px solid rgba(222, 255, 180, 0.78);
      border-radius: 52% 48% 61% 39%;
      background:
        radial-gradient(circle at 61% 38%, #efffd8 0 12%, transparent 16%),
        radial-gradient(circle at 48% 52%, #b8ff79 0 28%, #75e84f 48%, #32b94f 72%, transparent 76%);
      box-shadow: 0 0 7px #8dff63, 0 0 13px rgba(50, 214, 90, 0.76);
    }

    .battle-fx-type-zerg-acid-glob .battle-fx-trail,
    .battle-fx-type-zerg-bio-bolt .battle-fx-trail {
      width: 38px;
      height: 8px;
      border-radius: 58% 0 0 45%;
      background:
        radial-gradient(circle at 18% 65%, rgba(141, 255, 99, 0.42) 0 9%, transparent 12%),
        linear-gradient(90deg, transparent, rgba(50, 214, 90, 0.5) 38%, #8dff63 85%);
      filter: blur(0.7px) drop-shadow(0 0 4px #32d65a);
    }

    .battle-fx-trail {
      position: absolute;
      right: 58%;
      top: 50%;
      width: 32px;
      height: 4px;
      translate: 0 -50%;
      border-radius: 999px;
      background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fx-color, #73ecff) 72%, transparent));
      filter: blur(1px) drop-shadow(0 0 4px var(--fx-glow-color, #73ecff));
      opacity: 0.78;
    }

    .battle-fx-type-micro-missile .battle-fx-trail,
    .battle-fx-type-heavy-missile .battle-fx-trail,
    .battle-fx-type-tank-shell .battle-fx-trail,
    .battle-fx-type-heavy-shell .battle-fx-trail {
      width: 46px;
      height: 6px;
      background: linear-gradient(90deg, transparent, rgba(111, 104, 96, 0.52) 35%, #ff9c4b 78%, #fff4cf);
      mix-blend-mode: normal;
    }

    .battle-fx-type-heavy-missile .battle-fx-trail,
    .battle-fx-type-heavy-shell .battle-fx-trail {
      width: 66px;
      height: 9px;
      opacity: 0.9;
    }

    .battle-fx-beam,
    .battle-fx-flame {
      overflow: visible;
      border-radius: 999px;
      --fx-height: 18px;
    }

    .battle-fx-beam {
      background: linear-gradient(90deg, transparent, var(--fx-color, #4cdfff) 8%, var(--fx-core-color, #fff) 45% 72%, var(--fx-color, #4cdfff) 92%, transparent);
      box-shadow:
        0 0 7px var(--fx-color, #4cdfff),
        0 0 18px var(--fx-glow-color, #3152ff);
    }

    .battle-fx-beam .battle-fx-core {
      position: absolute;
      inset: 34% 0;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 0 10px #fff;
      animation: battleFxBeamPulse 90ms linear infinite alternate;
    }

    .battle-fx-beam.battle-fx-type-zerg-ground-spines {
      overflow: visible;
      background: transparent;
      box-shadow: none;
      mix-blend-mode: normal;
    }

    .battle-fx-type-zerg-ground-spines .battle-fx-core {
      display: none;
    }

    .battle-fx-ground-spine-atlas {
      position: absolute;
      left: 0;
      bottom: calc(var(--fx-height, 34px) * -1.42);
      z-index: 2;
      width: 100%;
      height: calc(var(--fx-height, 34px) * 4.15);
      overflow: hidden;
      pointer-events: none;
      filter:
        hue-rotate(72deg)
        saturate(1.35)
        drop-shadow(0 5px 5px rgba(7, 29, 11, 0.64))
        drop-shadow(0 0 5px rgba(141, 255, 99, 0.38))
        drop-shadow(0 0 3px rgba(50, 214, 90, 0.34));
    }

    .battle-fx-ground-spine-atlas-sprite {
      position: absolute;
      left: var(--ground-spine-atlas-left, 0%);
      top: var(--ground-spine-atlas-top, 0%);
      display: block;
      width: 400%;
      height: 200%;
      max-width: none;
      max-height: none;
      pointer-events: none;
      user-select: none;
    }

    .battle-fx-flame {
      --fx-height: 46px;
      isolation: isolate;
      border-radius: 0;
      clip-path: none;
      background: transparent;
      filter: drop-shadow(0 0 4px rgba(255, 122, 35, 0.72)) drop-shadow(0 0 9px rgba(196, 40, 20, 0.42));
    }

    .battle-fx-flame::before,
    .battle-fx-flame::after {
      content: "";
      position: absolute;
      transform-origin: 0 50%;
      pointer-events: none;
    }

    .battle-fx-flame::before {
      inset: 2% -1% 2% 0;
      z-index: 0;
      clip-path: polygon(0 42%, 11% 30%, 23% 37%, 36% 14%, 51% 30%, 65% 7%, 81% 25%, 100% 49%, 83% 74%, 66% 66%, 51% 92%, 36% 70%, 22% 82%, 10% 62%, 0 58%);
      background:
        radial-gradient(ellipse at 15% 48%, rgba(255, 244, 164, 0.92) 0 8%, transparent 22%),
        radial-gradient(ellipse at 38% 28%, rgba(255, 174, 51, 0.86) 0 11%, transparent 27%),
        radial-gradient(ellipse at 58% 69%, rgba(255, 105, 31, 0.82) 0 13%, transparent 31%),
        radial-gradient(ellipse at 78% 34%, rgba(231, 48, 22, 0.72) 0 14%, transparent 34%);
      filter: blur(0.45px);
      animation: battleFxFlameOuter 96ms ease-in-out infinite alternate;
    }

    .battle-fx-flame::after {
      inset: 24% 24% 24% 0;
      z-index: 1;
      clip-path: polygon(0 38%, 16% 23%, 29% 35%, 43% 12%, 58% 34%, 73% 20%, 100% 50%, 75% 78%, 58% 64%, 43% 88%, 29% 64%, 15% 77%, 0 62%);
      background:
        radial-gradient(ellipse at 24% 50%, #fff7b0 0 10%, transparent 27%),
        radial-gradient(ellipse at 52% 37%, #ffd95c 0 12%, transparent 30%),
        radial-gradient(ellipse at 72% 64%, rgba(255, 111, 30, 0.9) 0 15%, transparent 36%);
      animation: battleFxFlameMiddle 74ms ease-in-out infinite alternate-reverse;
    }

    .battle-fx-flame-lobe {
      position: absolute;
      left: var(--flame-lobe-left);
      top: calc(50% + var(--flame-lobe-y, 0px));
      z-index: 2;
      display: block;
      width: var(--flame-lobe-width);
      height: var(--flame-lobe-height);
      translate: -8% -50%;
      clip-path: polygon(0 43%, 19% 22%, 43% 34%, 71% 8%, 100% 50%, 72% 91%, 44% 66%, 18% 79%, 0 57%);
      border-radius: 34% 64% 56% 36%;
      background:
        radial-gradient(ellipse at 18% 50%, var(--flame-lobe-core) 0 10%, transparent 30%),
        linear-gradient(90deg, var(--flame-lobe-hot), var(--flame-lobe-color) 48%, transparent 100%);
      filter: blur(var(--flame-lobe-blur, 0.3px)) drop-shadow(0 0 3px var(--flame-lobe-glow));
      transform-origin: 0 50%;
      animation: battleFxFlameLobe var(--flame-lobe-speed) ease-in-out infinite alternate;
      animation-delay: var(--flame-lobe-delay);
      pointer-events: none;
    }

    .battle-fx-flame-lobe.lobe-1 {
      --flame-lobe-left: 0%;
      --flame-lobe-width: 26%;
      --flame-lobe-height: 32%;
      --flame-lobe-y: 0px;
      --flame-lobe-rotate-from: -2deg;
      --flame-lobe-rotate-to: 2deg;
      --flame-lobe-opacity-min: 0.68;
      --flame-lobe-opacity-max: 0.94;
      --flame-lobe-core: #ffffff;
      --flame-lobe-hot: #fff8b8;
      --flame-lobe-color: #ffb538;
      --flame-lobe-glow: rgba(255, 240, 150, 0.92);
      --flame-lobe-speed: 64ms;
      --flame-lobe-delay: -18ms;
    }

    .battle-fx-flame-lobe.lobe-2 {
      --flame-lobe-left: 16%;
      --flame-lobe-width: 28%;
      --flame-lobe-height: 52%;
      --flame-lobe-y: -4px;
      --flame-lobe-rotate-from: -5deg;
      --flame-lobe-rotate-to: 1deg;
      --flame-lobe-opacity-min: 0.62;
      --flame-lobe-opacity-max: 0.9;
      --flame-lobe-core: #fffbd0;
      --flame-lobe-hot: #ffd95d;
      --flame-lobe-color: #ff8a27;
      --flame-lobe-glow: rgba(255, 145, 42, 0.86);
      --flame-lobe-speed: 82ms;
      --flame-lobe-delay: -41ms;
    }

    .battle-fx-flame-lobe.lobe-3 {
      --flame-lobe-left: 36%;
      --flame-lobe-width: 26%;
      --flame-lobe-height: 72%;
      --flame-lobe-y: 3px;
      --flame-lobe-rotate-from: 4deg;
      --flame-lobe-rotate-to: -2deg;
      --flame-lobe-opacity-min: 0.56;
      --flame-lobe-opacity-max: 0.86;
      --flame-lobe-core: #fff09a;
      --flame-lobe-hot: #ffb43b;
      --flame-lobe-color: #f35a20;
      --flame-lobe-glow: rgba(245, 78, 29, 0.8);
      --flame-lobe-speed: 96ms;
      --flame-lobe-delay: -63ms;
      --flame-lobe-blur: 0.55px;
    }

    .battle-fx-flame-lobe.lobe-4 {
      --flame-lobe-left: 58%;
      --flame-lobe-width: 23%;
      --flame-lobe-height: 48%;
      --flame-lobe-y: -3px;
      --flame-lobe-rotate-from: -4deg;
      --flame-lobe-rotate-to: 3deg;
      --flame-lobe-opacity-min: 0.48;
      --flame-lobe-opacity-max: 0.78;
      --flame-lobe-core: #ffd55c;
      --flame-lobe-hot: #ff922a;
      --flame-lobe-color: #dc351b;
      --flame-lobe-glow: rgba(219, 50, 23, 0.76);
      --flame-lobe-speed: 76ms;
      --flame-lobe-delay: -27ms;
    }

    .battle-fx-flame-lobe.lobe-5 {
      --flame-lobe-left: 80%;
      --flame-lobe-width: 20%;
      --flame-lobe-height: 30%;
      --flame-lobe-y: 4px;
      --flame-lobe-rotate-from: 5deg;
      --flame-lobe-rotate-to: -3deg;
      --flame-lobe-opacity-min: 0.34;
      --flame-lobe-opacity-max: 0.66;
      --flame-lobe-core: #ffac39;
      --flame-lobe-hot: #f45e22;
      --flame-lobe-color: #bd2418;
      --flame-lobe-glow: rgba(200, 36, 20, 0.62);
      --flame-lobe-speed: 88ms;
      --flame-lobe-delay: -52ms;
      --flame-lobe-blur: 0.7px;
    }

    .battle-fx-flame .battle-fx-core {
      position: absolute;
      inset: 39% 42% 39% 0;
      z-index: 2;
      clip-path: polygon(0 32%, 18% 18%, 34% 34%, 51% 8%, 68% 38%, 100% 50%, 69% 67%, 51% 92%, 34% 66%, 17% 82%, 0 68%);
      background:
        radial-gradient(ellipse at 20% 50%, #ffffff 0 13%, transparent 33%),
        radial-gradient(ellipse at 48% 42%, #fffbd0 0 16%, transparent 38%),
        linear-gradient(90deg, #ffffff, #fff3a0 50%, rgba(255, 168, 55, 0));
      filter: blur(0.35px) drop-shadow(0 0 4px rgba(255, 246, 170, 0.92));
      transform-origin: 0 50%;
      animation: battleFxFlamePulse 68ms ease-in-out infinite alternate;
    }

    .battle-fx-impact:not(.battle-fx-atlas) {
      border-radius: 50%;
      background:
        radial-gradient(circle, var(--fx-core-color, #fff) 0 8%, var(--fx-color, #73ecff) 16%, transparent 48%),
        conic-gradient(from 12deg, transparent 0 7%, var(--fx-color, #73ecff) 8% 11%, transparent 12% 24%, var(--fx-color, #73ecff) 25% 28%, transparent 29% 100%);
      filter: drop-shadow(0 0 10px var(--fx-glow-color, #73ecff));
    }

    .battle-fx-impact::after {
      content: "";
      position: absolute;
      inset: 14%;
      border: 1px solid color-mix(in srgb, var(--fx-color, #73ecff) 78%, transparent);
      border-radius: 50%;
      box-shadow: 0 0 8px var(--fx-glow-color, #73ecff);
    }

    .battle-fx-type-protoss-energy-impact:not(.battle-fx-atlas) {
      background:
        radial-gradient(circle, #ffffff 0 9%, #7be8ff 16%, #39c8ff 28%, transparent 52%),
        conic-gradient(from 8deg, transparent 0 7%, #76e8ff 8% 11%, transparent 12% 24%, #3185ff 25% 28%, transparent 29% 100%);
      filter: drop-shadow(0 0 9px #39c8ff) drop-shadow(0 0 15px #2674ff);
    }

    .battle-fx-type-zerg-acid-impact:not(.battle-fx-atlas),
    .battle-fx-type-zerg-bio-impact:not(.battle-fx-atlas),
    .battle-fx-type-zerg-ground-spine-impact:not(.battle-fx-atlas),
    .battle-fx-type-zerg-melee-impact:not(.battle-fx-atlas),
    .battle-fx-type-zerg-heavy-impact:not(.battle-fx-atlas),
    .battle-fx-type-zerg-claw-impact:not(.battle-fx-atlas),
    .battle-fx-type-zerg-bio-explosion:not(.battle-fx-atlas) {
      border-radius: 42% 58% 48% 52%;
      background:
        radial-gradient(circle at 50% 50%, #efffd8 0 7%, #aaff72 13%, transparent 34%),
        conic-gradient(from 18deg, transparent 0 6%, #8dff63 7% 12%, transparent 13% 25%, #39d85a 26% 31%, transparent 32% 48%, #b6ff7b 49% 54%, transparent 55% 100%);
      filter: drop-shadow(0 0 8px #8dff63) drop-shadow(0 0 14px rgba(50, 214, 90, 0.78));
    }

    .battle-fx-type-protoss-melee-slash:not(.battle-fx-atlas),
    .battle-fx-type-zerg-melee-slash:not(.battle-fx-atlas) {
      border-radius: 50%;
      clip-path: polygon(0 43%, 72% 0, 100% 50%, 72% 100%, 0 57%, 60% 50%);
      background: linear-gradient(90deg, transparent, var(--fx-color) 34%, var(--fx-core-color) 72%, transparent);
      box-shadow: 0 0 8px var(--fx-glow-color);
    }

    .battle-fx-type-emp-ring,
    .battle-fx-type-particle-charge {
      border-radius: 50%;
    }

    .battle-fx-side-enemy {
      filter: hue-rotate(155deg) saturate(1.08);
    }

    .battle-fx-type-pistol-flash {
      overflow: visible;
    }

    .battle-fx-type-pistol-flash::before {
      content: "";
      position: absolute;
      right: 48%;
      top: 50%;
      width: 17px;
      height: 4px;
      border: 1px solid rgba(188, 218, 235, 0.9);
      border-radius: 1px;
      background: linear-gradient(90deg, #171c24 0 64%, #8295a4 65% 100%);
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.8), 0 0 4px rgba(111, 190, 226, 0.45);
      transform-origin: 100% 50%;
      animation: battleFxRiderDrawPistol 170ms cubic-bezier(.18,.72,.24,1) both;
    }

    .battle-fx-type-pistol-flash::after {
      content: "";
      position: absolute;
      right: calc(48% + 9px);
      top: calc(50% + 2px);
      width: 4px;
      height: 7px;
      border-radius: 0 0 2px 2px;
      background: #222a34;
      transform: rotate(-18deg);
      transform-origin: 50% 0;
    }

    @keyframes battleFxRiderDrawPistol {
      0% { opacity: 0; transform: translate(-7px, 7px) rotate(42deg) scale(.58); }
      42% { opacity: 1; transform: translate(-2px, 2px) rotate(10deg) scale(.9); }
      100% { opacity: 1; transform: translate(0, -50%) rotate(0) scale(1); }
    }

    .battle-unit.movement-gif-unit.attacking .battle-move-sprite {
      animation: battleFxUnitRecoil 180ms ease-out 1;
    }

    .battle-unit.enemy.movement-gif-unit.attacking .battle-move-sprite {
      animation-name: battleFxUnitRecoilEnemy;
    }

    .battle-unit.unit-heavy-rail-siege.attacking .battle-move-sprite,
    .battle-unit.unit-mine-mech.attacking .battle-move-sprite,
    .battle-unit.unit-skyhammer-armor.attacking .battle-move-sprite {
      animation-duration: 280ms;
    }

    .battle-unit.unit-expedition-cruiser.attacking .battle-move-sprite {
      animation: battleFxParticleCharge 620ms ease-in-out 1;
    }

    @keyframes battleFxUnitRecoil {
      0%, 100% { translate: -50% 0; }
      45% { translate: calc(-50% - 3px) 1px; }
    }

    @keyframes battleFxUnitRecoilEnemy {
      0%, 100% { translate: -50% 0; }
      45% { translate: calc(-50% + 3px) 1px; }
    }

    @keyframes battleFxParticleCharge {
      0%, 100% { filter: brightness(1) saturate(1); }
      70% { filter: brightness(1.5) saturate(1.45) drop-shadow(0 0 10px #51e8ff); }
    }

    @keyframes battleFxBeamPulse {
      from { opacity: 0.72; scale: 1 0.72; }
      to { opacity: 1; scale: 1 1.16; }
    }

    @keyframes battleFxFlamePulse {
      from { opacity: 0.62; transform: scaleX(0.94) scaleY(0.72) translateX(-1%); }
      to { opacity: 0.88; transform: scaleX(1.01) scaleY(1.08) translateX(2%); }
    }

    @keyframes battleFxFlameOuter {
      from { opacity: 0.34; transform: scaleX(0.96) scaleY(0.76) skewX(-1deg); }
      to { opacity: 0.56; transform: scaleX(1.01) scaleY(1.06) skewX(1deg); }
    }

    @keyframes battleFxFlameMiddle {
      from { opacity: 0.48; transform: scaleX(0.97) scaleY(0.8) translateX(-1%); }
      to { opacity: 0.76; transform: scaleX(1.01) scaleY(1.08) translateX(1.5%); }
    }

    @keyframes battleFxFlameLobe {
      from { opacity: var(--flame-lobe-opacity-min, 0.52); transform: rotate(var(--flame-lobe-rotate-from, -3deg)) scaleX(0.88) scaleY(0.72); }
      to { opacity: var(--flame-lobe-opacity-max, 0.9); transform: rotate(var(--flame-lobe-rotate-to, 3deg)) scaleX(1.06) scaleY(1.12); }
    }

    @keyframes battleSpriteMarch {
      from { translate: calc(-50% - 1px) 0; }
      to { translate: calc(-50% + 1px) 0; }
    }

    @keyframes battleSpriteAttack {
      from { translate: calc(-50% - 3px) 0; }
      to { translate: -50% 0; }
    }

    @keyframes battleSpriteAttackEnemy {
      from { translate: calc(-50% + 3px) 0; }
      to { translate: -50% 0; }
    }

    @keyframes terranInfantryRunFrames {
      0%, 24.99% { background-position: 0 var(--sprite-row-y, 0%); }
      25%, 49.99% { background-position: 14.2857% var(--sprite-row-y, 0%); }
      50%, 74.99% { background-position: 28.5714% var(--sprite-row-y, 0%); }
      75%, 100% { background-position: 42.8571% var(--sprite-row-y, 0%); }
    }

    @keyframes terranInfantryAttackFrames {
      0%, 24.99% { background-position: 57.1429% var(--sprite-row-y, 0%); }
      25%, 49.99% { background-position: 71.4286% var(--sprite-row-y, 0%); }
      50%, 74.99% { background-position: 85.7143% var(--sprite-row-y, 0%); }
      75%, 100% { background-position: 100% var(--sprite-row-y, 0%); }
    }

    @keyframes battleMuzzle {
      from { opacity: 0.95; scale: 1; }
      to { opacity: 0.35; scale: 0.7; }
    }

    @keyframes battleSlash {
      from { opacity: 0.9; scale: 1; }
      to { opacity: 0.35; scale: 0.72; }
    }

    .battle-log {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      color: var(--muted);
      font-size: 11px;
    }

    .battle-log div {
      min-width: 0;
      padding: 6px;
      border: 1px solid rgba(183, 247, 255, 0.12);
      background: rgba(0, 0, 0, 0.22);
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .battle-log div.victory {
      border-color: rgba(117, 255, 87, 0.3);
      color: #dfffcf;
      background: rgba(3, 32, 20, 0.32);
    }

    .battle-log div.defeat {
      border-color: rgba(255, 86, 86, 0.32);
      color: #ffd3d0;
      background: rgba(64, 12, 16, 0.28);
    }

    .battle-log div.draw {
      border-color: rgba(255, 212, 107, 0.34);
      color: #ffe8a3;
      background: rgba(58, 37, 6, 0.3);
    }

    .recruit-qty-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .recruit-qty-card {
      display: grid;
      gap: 6px;
      min-height: 132px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(18, 29, 46, 0.58);
      padding: 8px;
    }

    .recruit-qty-card strong {
      color: #b7f7ff;
      font-size: 13px;
    }

    .recruit-qty-card span {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.45;
    }

    .console-recruit-popover {
      position: fixed;
      right: 8px;
      bottom: calc(var(--bottom-ui-safe-height) + 8px);
      z-index: 22;
      width: min(360px, calc(100vw - 20px));
      max-height: min(720px, calc(100dvh - var(--bottom-ui-safe-height) - 52px));
      padding: 10px;
      border: 1px solid rgba(183, 247, 255, 0.42);
      background:
        linear-gradient(180deg, rgba(8, 20, 31, 0.98), rgba(0, 5, 12, 0.98)),
        radial-gradient(circle at 16% 0%, var(--faction-soft), transparent 58%);
      box-shadow: 0 0 18px rgba(32, 216, 255, 0.2), inset 0 0 14px rgba(255, 255, 255, 0.04);
      color: #effcff;
      overflow-x: hidden;
      overflow-y: auto;
    }

    .console-recruit-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 22px;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
      color: #b7f7ff;
      font-size: 13px;
      line-height: 17px;
    }

    .console-recruit-head > div {
      display: grid;
      min-width: 0;
      gap: 1px;
    }

    .console-recruit-head span {
      color: #8ea7c0;
      font-size: 10px;
      line-height: 13px;
    }

    .console-recruit-head strong,
    .console-recruit-cost {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .console-recruit-close {
      width: 22px;
      height: 22px;
      padding: 0;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: rgba(0, 0, 0, 0.34);
      color: #effcff;
      cursor: pointer;
    }

    .console-recruit-showcase {
      display: grid;
      grid-template-columns: 136px minmax(0, 1fr);
      min-height: 136px;
      align-items: center;
      gap: 10px;
      padding: 4px 0 9px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.16);
    }

    .console-recruit-portrait {
      display: block;
      width: 136px;
      height: 136px;
      object-fit: contain;
      filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 8px var(--faction-soft));
    }

    .console-recruit-media {
      position: relative;
      width: 136px;
      height: 136px;
    }

    .current-unit-preview {
      position: relative;
      display: inline-block;
      width: 54px;
      height: 54px;
      overflow: hidden;
      flex: 0 0 auto;
    }

    .current-unit-preview > canvas,
    .current-unit-preview > .current-unit-preview-fallback {
      position: absolute;
      inset: 0;
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .current-unit-preview[data-preview-ready="true"] > .current-unit-preview-fallback {
      visibility: hidden;
    }

    .city-transfer-unit .current-unit-preview {
      width: 28px;
      height: 28px;
    }

    .console-recruit-movement {
      position: absolute;
      right: 0;
      bottom: 0;
      display: block;
      width: 54px;
      height: 54px;
      object-fit: contain;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: rgba(0, 7, 13, 0.76);
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55), inset 0 0 8px var(--faction-soft);
    }

    .console-recruit-summary {
      min-width: 0;
      align-self: stretch;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .console-recruit-desc {
      margin-bottom: 5px;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.35;
    }

    .console-recruit-options {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 5px;
    }

    .console-recruit-options.route-options {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      margin: 6px 0 2px;
    }

    .console-recruit-options button {
      height: 26px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: linear-gradient(180deg, rgba(24, 77, 108, 0.78), rgba(4, 13, 24, 0.94));
      color: #effcff;
      font-size: 11px;
      cursor: pointer;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .console-recruit-options button:disabled,
    .console-recruit-options button[aria-disabled="true"] {
      opacity: 0.38;
      cursor: default;
      filter: grayscale(0.75);
    }

    .console-recruit-cost {
      margin-top: 6px;
      color: #ffd46b;
      font-size: 10px;
      line-height: 14px;
    }

    .console-recruit-cost-list { white-space: pre-line; }

    .console-recruit-summary .console-recruit-cost {
      white-space: normal;
    }

    .unit-attribute-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px;
      margin-top: 6px;
    }

    .unit-attribute-grid.compact {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin-top: 4px;
    }

    .unit-attribute {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-width: 0;
      min-height: 22px;
      padding: 0 6px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 4, 10, 0.42);
      color: #dcebff;
      font-size: 11px;
      line-height: 20px;
    }

    .unit-attribute span {
      color: #8ea7c0;
    }

    .unit-attribute strong {
      color: #f4fbff;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 700;
    }

    .unit-trait-row {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 6px;
    }

    .unit-trait-chip {
      padding: 2px 6px;
      border: 1px solid rgba(255, 212, 107, 0.28);
      background: rgba(58, 37, 6, 0.28);
      color: #ffe8a3;
      font-size: 11px;
      line-height: 16px;
      white-space: nowrap;
    }

    .feature-footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      border-top: 1px solid rgba(183, 247, 255, 0.16);
      padding-top: 8px;
    }

    .feature-footer > span {
      min-width: 0;
      padding: 4px 8px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      color: #9ec9df;
      font-size: 11px;
      line-height: 16px;
      overflow-wrap: anywhere;
    }

    .system-feature-list {
      display: grid;
      gap: 8px;
      align-content: start;
    }

    .system-mail-view .feature-main {
      grid-template-rows: auto minmax(0, 1fr);
      align-content: start;
    }

    .system-mail-view .auction-tabs {
      grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(44px, auto);
      margin: 0;
    }

    .system-mail-view .auction-tabs button[aria-pressed="true"] {
      border-color: #74bc80;
      color: #e3f9e5;
      box-shadow: inset 0 1px #7ab48b66;
    }

    .system-mail-view .system-feature-list {
      min-height: 0;
      overflow: auto;
    }

    .system-mail-view .system-feature-row span {
      white-space: pre-wrap;
    }

    .system-mail-view [hidden] {
      display: none;
    }

    .mail-compose-form {
      display: grid;
      grid-template-rows: auto auto minmax(76px, 1fr) auto;
      gap: 7px;
      min-height: 0;
      overflow: auto;
      padding: 10px;
      border: 1px solid var(--panel-border);
      background: linear-gradient(150deg, #101d2c, #0b131d 60%);
    }

    .mail-compose-form label {
      display: grid;
      gap: 4px;
      font-size: 12px;
      color: #c9d9e8;
    }

    .mail-compose-form :is(input, textarea) {
      min-width: 0;
      width: 100%;
      padding: 6px 8px;
      border: 1px solid #41647b;
      border-radius: 2px;
      background: #091521;
      color: #eef6ff;
      font: inherit;
      line-height: 1.5;
    }

    .mail-compose-form label:has(textarea) {
      min-height: 0;
      grid-template-rows: auto minmax(0, 1fr);
    }

    .mail-compose-form textarea {
      min-height: 0;
      resize: none;
    }

    .mail-compose-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
    }

    .mail-compose-actions button {
      min-height: 28px;
      padding: 3px 12px;
      cursor: pointer;
    }

    @media (min-width: 760px) and (max-height: 660px) {
      .mail-compose-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        grid-template-rows: auto minmax(76px, 1fr) auto;
      }

      .mail-compose-form :is(label:has(textarea), .mail-compose-actions) {
        grid-column: 1 / -1;
      }
    }

    .system-feature-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.24);
      min-width: 0;
    }

    .system-feature-row strong,
    .system-feature-row span,
    .system-feature-row em {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .system-feature-row strong {
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
    }

    .system-feature-row span {
      color: var(--muted);
      font-size: 11px;
      line-height: 15px;
    }

    .system-feature-row em {
      color: #ffd46b;
      font-size: 11px;
      font-style: normal;
      line-height: 15px;
    }

    .system-feature-row button {
      min-width: 54px;
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.72), rgba(3, 12, 22, 0.9));
      color: #effcff;
      cursor: pointer;
      font-size: 11px;
    }

    .system-feature-row button:disabled {
      opacity: 0.45;
      cursor: default;
    }

    .system-feature-row-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 5px;
      min-width: 0;
    }

    .social-inline-form {
      display: grid;
      grid-template-columns: minmax(110px, 0.7fr) minmax(130px, 0.9fr) minmax(180px, 1.4fr) 66px;
      gap: 6px;
      margin-bottom: 10px;
      min-width: 0;
    }

    .guild-panel > .feature-main {
      grid-template-rows: none;
      grid-auto-rows: max-content;
      align-content: start;
      overflow: auto;
    }
    .territory-help, .territory-treasury small { color: #b8cdd0; font-size: 12px; line-height: 1.6; }
    .territory-treasury { display: grid; gap: 8px; margin: 8px 0 12px; padding: 12px; border: 1px solid #47666c; background: #14272d; }
    .territory-treasury strong { font-size: 12px; overflow-wrap: anywhere; }
    .territory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
    .territory-card { min-width: 0; padding: 12px; border: 1px solid #3b535e; background: #111e28; }
    .territory-card.territory-owned { border-color: #629b8b; background: #152b2b; }
    .territory-card header, .territory-defender { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
    .territory-card header span { color: #9dd3c1; font-size: 11px; }
    .territory-card p { color: #becfd6; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
    .territory-warning { color: #e9b573; font-size: 11px; margin: 7px 0; overflow-wrap: anywhere; }
    .territory-defender { margin: 7px 0; font-size: 11px; }
    .territory-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
    .territory-form select { flex: 1 1 90px; min-width: 0; }
    .territory-form select, .territory-form button, .territory-card button, .territory-treasury button { min-height: 32px; padding: 6px 9px; border: 1px solid #607c89; background: #1c3442; color: #e3edf0; font-size: 11px; }
    .territory-card button, .territory-treasury button { cursor: pointer; }
    .territory-card button:disabled, .territory-treasury button:disabled { opacity: .5; cursor: default; }
    .territory-abandon { margin-top: 8px; color: #edb6a6 !important; }
    @media (max-width: 1400px) { .territory-grid { grid-template-columns: minmax(0, 1fr); } }

    .fleet-create-form {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      min-width: 0;
    }
    .fleet-create-form label { display: grid; gap: 3px; color: #b8d7d9; font-size: 11px; min-width: 0; }
    .fleet-create-form input, .fleet-create-form select, .fleet-create-form button,
    .fleet-row button, .guild-panel .social-section-title button {
      min-width: 0; min-height: 28px; padding: 4px 7px; border: 1px solid rgba(183, 247, 255, 0.3);
      background: #071720; color: #effcff; font-size: 11px;
    }
    .fleet-create-form button, .fleet-row button, .guild-panel .social-section-title button { cursor: pointer; }
    .fleet-create-form button:disabled, .fleet-row button:disabled { opacity: 0.5; cursor: default; }
    .fleet-row { min-width: 0; padding: 9px; border: 1px solid rgba(183, 247, 255, 0.22); background: rgba(5, 20, 28, 0.65); }
    .fleet-row-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: #d2f3ee; font-size: 11px; }
    .fleet-timing, .fleet-members { margin: 7px 0; color: #a8c4cb; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
    .fleet-members { display: flex; flex-wrap: wrap; gap: 4px 12px; }
    .fleet-row [data-fleet-join] { grid-template-columns: minmax(0, 1fr) 66px; margin: 7px 0; }
    .guild-panel .social-section-title button { float: right; }

    .social-inline-form input,
    .social-inline-form select,
    .social-inline-form button {
      width: 100%;
      height: 28px;
      min-width: 0;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #effcff;
      font-size: 11px;
    }

    .social-inline-form input {
      padding: 0 7px;
    }

    .social-inline-form select {
      padding: 0 6px;
    }

    .social-inline-form button {
      cursor: pointer;
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.82), rgba(3, 12, 22, 0.94));
    }

    .player-block-form,
    .guild-create-form {
      grid-template-columns: minmax(0, 1fr) 74px;
    }

    .guild-goal-form {
      grid-template-columns: minmax(90px, 0.7fr) minmax(100px, 1fr) 74px;
      margin-top: 8px;
    }

    .social-goal-button {
      min-width: 120px;
      height: 26px;
      margin-bottom: 8px;
      border: 1px solid rgba(255, 214, 107, 0.5);
      background: rgba(76, 53, 12, 0.84);
      color: #ffe7a0;
      cursor: pointer;
      font-size: 10px;
    }

    .social-goal-button:disabled {
      opacity: 0.48;
      cursor: default;
    }

    .guild-create-form {
      margin-top: 12px;
      margin-bottom: 0;
    }

    .social-section-title {
      margin: 5px 0;
      color: #ffe7a0;
      font-size: 11px;
      line-height: 15px;
    }

    .social-list-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 7px;
      min-width: 0;
      padding: 7px 8px;
      border-top: 1px solid rgba(183, 247, 255, 0.14);
    }

    .friend-add-button {
      padding: 4px 12px;
      margin-bottom: 7px;
      border: 1px solid #78bd76;
      background: var(--classic-green, #204033);
      color: #f0ffe8;
      cursor: pointer;
    }

    .friend-request-message {
      grid-column: 1 / -1;
      margin: 0;
      color: #c3dce8;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .social-list-row span,
    .social-list-row strong,
    .social-list-row small {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .social-list-row strong {
      color: #ffffff;
      font-size: 11px;
      line-height: 15px;
    }

    .social-list-row small,
    .social-list-row em {
      color: #9fd9e8;
      font-size: 10px;
      font-style: normal;
      line-height: 14px;
    }

    .social-list-row button,
    .social-danger-button {
      min-width: 48px;
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.34);
      background: rgba(5, 35, 52, 0.9);
      color: #effcff;
      cursor: pointer;
      font-size: 10px;
    }

    .social-row-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 5px;
      min-width: 0;
    }

    .guild-goal-progress {
      height: 8px;
      overflow: hidden;
      border: 1px solid rgba(255, 214, 107, 0.38);
      background: rgba(0, 0, 0, 0.42);
    }

    .guild-goal-progress span {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, #55c8ff, #ffe07a);
    }

    .social-danger-button {
      width: 100%;
      margin-top: 12px;
      border-color: rgba(255, 115, 115, 0.5);
      background: rgba(76, 17, 22, 0.86);
    }

    .social-empty {
      padding: 8px;
      color: #8cb8c3;
      font-size: 11px;
      line-height: 15px;
    }

    .feature-body.admin-moderation-view {
      grid-template-columns: 220px minmax(0, 1fr);
    }

    .admin-moderation-side {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      align-content: start;
      overflow: auto;
    }

    .admin-moderation-side > * {
      flex-shrink: 0;
    }

    .admin-moderation-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px;
    }

    .admin-moderation-tabs button {
      height: 28px;
      min-width: 0;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #9fd9e8;
      cursor: pointer;
      font-size: 10px;
    }

    .admin-moderation-tabs button[aria-selected="true"] {
      border-color: rgba(255, 212, 107, 0.62);
      background: rgba(76, 53, 12, 0.72);
      color: #ffe7a0;
    }

    .admin-report-filter {
      display: grid;
      gap: 5px;
      color: #9fd9e8;
      font-size: 10px;
    }

    .admin-report-filter select,
    .admin-report-refresh,
    .admin-report-row textarea,
    .admin-player-row textarea,
    .admin-report-actions button,
    .admin-player-mail-button,
    .admin-player-resource-button,
    .admin-sanction-controls select,
    .admin-sanction-controls button {
      width: 100%;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #effcff;
      font: inherit;
    }

    .admin-report-filter select,
    .admin-report-refresh {
      height: 28px;
      padding: 0 7px;
    }

    .admin-report-refresh,
    .admin-report-actions button,
    .admin-player-mail-button,
    .admin-player-resource-button,
    .admin-sanction-controls button {
      cursor: pointer;
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.82), rgba(3, 12, 22, 0.94));
    }

    .admin-report-refresh:disabled,
    .admin-report-actions button:disabled,
    .admin-player-mail-button:disabled,
    .admin-player-resource-button:disabled,
    .admin-sanction-controls button:disabled,
    .admin-sanction-controls select:disabled {
      cursor: default;
      opacity: 0.5;
    }

    .admin-report-list {
      display: block;
      overflow: auto;
    }

    .admin-report-row {
      display: grid;
      gap: 7px;
      padding: 10px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(3, 13, 23, 0.54);
    }

    .admin-report-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
    }

    .admin-report-head span,
    .admin-report-head strong,
    .admin-report-head small {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .admin-report-head strong {
      color: #ffffff;
      font-size: 12px;
    }

    .admin-report-head small,
    .admin-report-meta {
      color: #91c5d2;
      font-size: 10px;
      line-height: 14px;
    }

    .admin-report-status {
      padding: 3px 6px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      color: #b7f7ff;
      font-size: 10px;
      font-style: normal;
      white-space: nowrap;
    }

    .admin-report-status.status-resolved {
      border-color: rgba(255, 188, 92, 0.48);
      color: #ffd98b;
    }

    .admin-report-status.status-dismissed {
      color: #9fb1b8;
    }

    .admin-report-row blockquote {
      margin: 0;
      padding: 8px 9px;
      border-left: 2px solid rgba(255, 212, 107, 0.68);
      background: rgba(0, 0, 0, 0.28);
      color: #effcff;
      font-size: 11px;
      line-height: 16px;
      overflow-wrap: anywhere;
    }

    .admin-report-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 5px 14px;
    }

    .admin-report-row textarea {
      min-height: 54px;
      resize: vertical;
      padding: 7px;
      font-size: 10px;
      line-height: 14px;
    }

    .admin-report-actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .admin-report-actions button {
      min-width: 0;
      height: 26px;
      font-size: 10px;
    }

    .admin-target-moderation {
      color: #ffd98b;
    }

    .admin-sanction-controls {
      display: grid;
      grid-template-columns: minmax(120px, 1fr) minmax(86px, 0.7fr) minmax(86px, 0.7fr);
      gap: 6px;
    }

    .admin-sanction-controls select,
    .admin-sanction-controls button {
      min-width: 0;
      height: 28px;
      padding: 0 7px;
      font-size: 10px;
    }

    .admin-sanction-controls button.danger {
      border-color: rgba(255, 115, 115, 0.5);
      background: rgba(76, 17, 22, 0.86);
    }

    .admin-player-search {
      display: grid;
      gap: 7px;
    }

    .admin-player-search label {
      display: grid;
      gap: 4px;
      color: #9fd9e8;
      font-size: 10px;
    }

    .admin-player-search input,
    .admin-player-search select,
    .admin-player-search button {
      width: 100%;
      height: 28px;
      min-width: 0;
      padding: 0 7px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #effcff;
      font: inherit;
      font-size: 10px;
    }

    .admin-player-search button {
      cursor: pointer;
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.82), rgba(3, 12, 22, 0.94));
    }

    .admin-player-search button:disabled {
      cursor: default;
      opacity: 0.5;
    }

    .admin-player-row {
      display: grid;
      gap: 7px;
      padding: 10px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(3, 13, 23, 0.54);
    }

    .admin-player-row header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
    }

    .admin-player-row header span,
    .admin-player-row header strong,
    .admin-player-row header small {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .admin-player-row header strong {
      color: #ffffff;
      font-size: 12px;
    }

    .admin-player-row header small,
    .admin-player-row header em,
    .admin-player-meta {
      color: #91c5d2;
      font-size: 10px;
      font-style: normal;
      line-height: 14px;
    }

    .admin-player-row header em {
      padding: 3px 6px;
      border: 1px solid rgba(255, 212, 107, 0.42);
      color: #ffd98b;
      white-space: nowrap;
    }

    .admin-player-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 5px 14px;
      overflow-wrap: anywhere;
    }

    .admin-player-row textarea {
      min-height: 54px;
      padding: 7px;
      resize: vertical;
      font-size: 10px;
      line-height: 14px;
    }

    .admin-player-protected {
      padding: 8px 9px;
      border-left: 2px solid rgba(255, 212, 107, 0.68);
      background: rgba(76, 53, 12, 0.34);
      color: #ffe7a0;
      font-size: 10px;
      line-height: 14px;
    }

    .admin-player-mail-button {
      height: 28px;
      padding: 0 7px;
      font-size: 10px;
    }

    .admin-player-operation-buttons {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .admin-player-resource-button {
      height: 28px;
      min-width: 0;
      padding: 0 7px;
      font-size: 10px;
    }

    .admin-mail-main {
      overflow: auto;
    }

    .admin-system-mail-form {
      display: grid;
      gap: 10px;
      padding: 10px;
    }

    .admin-system-mail-form label {
      display: grid;
      gap: 4px;
      min-width: 0;
      color: #9fd9e8;
      font-size: 10px;
    }

    .admin-system-mail-form input,
    .admin-system-mail-form select,
    .admin-system-mail-form textarea,
    .admin-system-mail-form > button {
      width: 100%;
      min-width: 0;
      padding: 0 7px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #effcff;
      font: inherit;
      font-size: 10px;
    }

    .admin-system-mail-form input,
    .admin-system-mail-form select,
    .admin-system-mail-form > button {
      height: 30px;
    }

    .admin-system-mail-form textarea {
      min-height: 100px;
      padding: 8px;
      resize: vertical;
      line-height: 15px;
    }

    .admin-system-mail-form > button {
      cursor: pointer;
      background: linear-gradient(180deg, rgba(76, 53, 12, 0.86), rgba(22, 16, 4, 0.96));
      color: #ffe7a0;
    }

    .admin-system-mail-form > button:disabled {
      cursor: default;
      opacity: 0.5;
    }

    .admin-system-mail-form fieldset {
      min-width: 0;
      margin: 0;
      padding: 9px;
      border: 1px solid rgba(183, 247, 255, 0.18);
    }

    .admin-system-mail-form legend {
      padding: 0 5px;
      color: #ffd98b;
      font-size: 10px;
    }

    .admin-mail-target-grid,
    .admin-mail-item-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .admin-mail-grant-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(100px, 1fr));
      gap: 8px;
    }

    .admin-mail-success {
      margin: 10px 10px 0;
      padding: 8px;
      border: 1px solid rgba(125, 255, 147, 0.36);
      background: rgba(14, 74, 36, 0.46);
      color: #b8ffc3;
      font-size: 10px;
      overflow-wrap: anywhere;
    }

    .admin-resource-main {
      overflow: auto;
    }

    .admin-resource-balance-list {
      display: grid;
      gap: 4px;
    }

    .admin-resource-balance-list div {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      padding: 5px 7px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.13);
      color: #9fd9e8;
      font-size: 10px;
    }

    .admin-resource-balance-list strong {
      color: #ffffff;
      font-variant-numeric: tabular-nums;
    }

    .admin-resource-correction-form {
      display: grid;
      gap: 10px;
      padding: 10px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.18);
    }

    .admin-resource-correction-form label {
      display: grid;
      gap: 4px;
      min-width: 0;
      color: #9fd9e8;
      font-size: 10px;
    }

    .admin-resource-correction-form input,
    .admin-resource-correction-form select,
    .admin-resource-correction-form textarea,
    .admin-resource-correction-form > button,
    .admin-resource-history button,
    .admin-resource-operation-row > button {
      width: 100%;
      min-width: 0;
      padding: 0 7px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #effcff;
      font: inherit;
      font-size: 10px;
    }

    .admin-resource-correction-form input,
    .admin-resource-correction-form select,
    .admin-resource-correction-form > button,
    .admin-resource-history button,
    .admin-resource-operation-row > button {
      height: 30px;
    }

    .admin-resource-correction-form input[readonly] {
      color: #91c5d2;
      background: rgba(0, 10, 18, 0.58);
    }

    .admin-resource-correction-form textarea {
      min-height: 72px;
      padding: 8px;
      resize: vertical;
      line-height: 15px;
    }

    .admin-resource-correction-form > button,
    .admin-resource-operation-row > button {
      cursor: pointer;
      border-color: rgba(255, 212, 107, 0.5);
      background: linear-gradient(180deg, rgba(76, 53, 12, 0.86), rgba(22, 16, 4, 0.96));
      color: #ffe7a0;
    }

    .admin-resource-correction-form > button:disabled,
    .admin-resource-history button:disabled,
    .admin-resource-operation-row > button:disabled {
      cursor: default;
      opacity: 0.5;
    }

    .admin-resource-correction-form fieldset {
      min-width: 0;
      margin: 0;
      padding: 9px;
      border: 1px solid rgba(183, 247, 255, 0.18);
    }

    .admin-resource-correction-form legend {
      padding: 0 5px;
      color: #ffd98b;
      font-size: 10px;
    }

    .admin-resource-history > header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 80px;
      align-items: center;
      gap: 8px;
      padding: 10px;
      color: #ffffff;
      font-size: 11px;
    }

    .admin-resource-history button {
      cursor: pointer;
    }

    .admin-resource-operation-row {
      display: grid;
      gap: 7px;
      padding: 10px;
      border-top: 1px solid rgba(183, 247, 255, 0.14);
      background: rgba(3, 13, 23, 0.54);
    }

    .admin-resource-operation-row header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
    }

    .admin-resource-operation-row header span,
    .admin-resource-operation-row header strong,
    .admin-resource-operation-row header small {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .admin-resource-operation-row header strong {
      color: #ffffff;
      font-size: 11px;
    }

    .admin-resource-operation-row header small,
    .admin-resource-operation-row header em,
    .admin-resource-operation-meta {
      color: #91c5d2;
      font-size: 10px;
      font-style: normal;
      line-height: 14px;
    }

    .admin-resource-operation-row header em {
      padding: 3px 6px;
      border: 1px solid rgba(255, 212, 107, 0.42);
      color: #ffd98b;
      white-space: nowrap;
    }

    .admin-resource-operation-meta,
    .admin-resource-operation-deltas {
      display: flex;
      flex-wrap: wrap;
      gap: 5px 12px;
      overflow-wrap: anywhere;
    }

    .admin-resource-operation-deltas span {
      padding: 3px 6px;
      border: 1px solid rgba(125, 255, 147, 0.25);
      color: #b8ffc3;
      font-size: 10px;
      font-variant-numeric: tabular-nums;
    }

    .admin-resource-operation-row p {
      margin: 0;
      color: #cde8ed;
      font-size: 10px;
      line-height: 15px;
      overflow-wrap: anywhere;
    }

    .admin-audit-filter {
      display: grid;
      gap: 7px;
    }

    .admin-audit-filter label {
      display: grid;
      gap: 4px;
      color: #9fd9e8;
      font-size: 10px;
    }

    .admin-audit-filter input,
    .admin-audit-filter select,
    .admin-audit-filter button,
    .admin-audit-more {
      width: 100%;
      height: 28px;
      min-width: 0;
      padding: 0 7px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(0, 10, 18, 0.9);
      color: #effcff;
      font-size: 10px;
    }

    .admin-audit-filter button,
    .admin-audit-more {
      cursor: pointer;
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.82), rgba(3, 12, 22, 0.94));
    }

    .admin-audit-filter button:disabled,
    .admin-audit-more:disabled {
      cursor: default;
      opacity: 0.5;
    }

    .admin-audit-row {
      display: grid;
      gap: 7px;
      padding: 9px 10px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(3, 13, 23, 0.54);
    }

    .admin-audit-row header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
    }

    .admin-audit-row header span,
    .admin-audit-row header strong,
    .admin-audit-row header small {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .admin-audit-row header strong {
      color: #ffffff;
      font-size: 11px;
    }

    .admin-audit-row header small,
    .admin-audit-row header em {
      color: #91c5d2;
      font-size: 10px;
      font-style: normal;
      line-height: 14px;
    }

    .admin-audit-row > div {
      display: flex;
      flex-wrap: wrap;
      gap: 5px 12px;
      color: #b9dfe8;
      font-size: 10px;
      line-height: 14px;
      overflow-wrap: anywhere;
    }

    .admin-audit-more {
      margin-top: 8px;
    }

    .admin-report-error {
      margin-bottom: 8px;
      padding: 8px;
      border: 1px solid rgba(255, 115, 115, 0.42);
      background: rgba(76, 17, 22, 0.56);
      color: #ffd0d0;
      font-size: 11px;
    }

    .feature-body.battle-report-view {
      grid-template-columns: 260px minmax(0, 1fr);
      min-height: 520px;
    }

    .battle-report-summary .feature-summary {
      font-size: 13px;
      line-height: 18px;
      color: #effcff;
    }

    .report-outcome.win {
      color: #7dff93;
    }

    .report-outcome.draw {
      color: #ffe48a;
    }

    .report-outcome.lose {
      color: #ff9b8c;
    }

    .battle-report-detail {
      display: grid;
      grid-template-rows: auto auto auto 1fr;
      gap: 10px;
      min-height: 0;
    }

    .battle-report-toolbar {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .battle-report-toolbar button {
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.72), rgba(3, 12, 22, 0.9));
      color: #effcff;
      cursor: pointer;
      padding: 0 12px;
    }

    .battle-report-score {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .battle-report-score div,
    .battle-report-line,
    .battle-report-side {
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.24);
      box-shadow: inset 0 0 16px rgba(76, 198, 255, 0.04);
    }

    .battle-report-score div {
      display: grid;
      grid-template-columns: auto 1fr auto;
      align-items: center;
      gap: 8px;
      padding: 10px;
    }

    .battle-report-score span,
    .battle-report-line span {
      color: var(--muted);
      font-size: 11px;
    }

    .battle-report-score strong {
      color: #ffffff;
      font-size: 18px;
      text-align: center;
    }

    .battle-report-score em {
      color: #ffd46b;
      font-size: 11px;
      font-style: normal;
    }

    .battle-report-lines {
      display: grid;
      gap: 7px;
    }

    .battle-report-line {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
    }

    .battle-report-line strong {
      color: #effcff;
      font-size: 12px;
      line-height: 16px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-sides {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      min-height: 0;
    }

    .battle-report-side {
      display: grid;
      grid-template-rows: auto 1fr;
      min-height: 0;
    }

    .battle-report-side h4 {
      margin: 0;
      padding: 8px 10px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.14);
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
    }

    .battle-report-squads {
      display: grid;
      align-content: start;
      gap: 6px;
      padding: 8px;
      overflow: auto;
      min-height: 0;
    }

    .battle-report-squad {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      padding: 7px 8px;
      border: 1px solid rgba(117, 255, 87, 0.18);
      background: rgba(5, 18, 24, 0.52);
    }

    .battle-report-squad strong,
    .battle-report-squad span,
    .battle-report-empty {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 11px;
      line-height: 15px;
    }

    .battle-report-squad strong {
      color: #dfffcf;
    }

    .battle-report-squad span {
      color: #ffd46b;
    }

    .battle-report-empty {
      color: var(--muted);
      padding: 7px 8px;
    }

    .battle-report-swarm-loss,
    .battle-report-reward-item {
      display: grid;
      gap: 3px 8px;
      padding: 7px 8px;
      border: 1px solid rgba(117, 255, 87, 0.18);
      background: rgba(5, 18, 24, 0.52);
    }

    .battle-report-swarm-loss {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .battle-report-swarm-loss strong {
      color: #dfffcf;
      font-size: 11px;
    }

    .battle-report-swarm-loss span,
    .battle-report-swarm-loss em {
      color: #9db2ba;
      font-size: 10px;
      font-style: normal;
    }

    .battle-report-swarm-loss em {
      grid-column: 1 / -1;
      color: #ffd46b;
    }

    .battle-report-reward-item {
      grid-template-columns: 38px minmax(0, 1fr) auto;
      align-items: center;
    }

    .battle-report-reward-item span {
      color: #8aa1aa;
      font-size: 9px;
    }

    .battle-report-reward-item strong {
      color: #e9fbf7;
      font-size: 11px;
    }

    .battle-report-reward-item em {
      color: #ffd46b;
      font-size: 11px;
      font-style: normal;
    }

    .feature-body.battle-report-view {
      display: block;
      min-width: 0;
      min-height: 0;
      padding: 6px;
      overflow: hidden;
    }

    .feature-modal:has(> .feature-body.battle-report-view) {
      left: 50%;
      top: 50%;
      right: auto;
      bottom: auto;
      z-index: 60;
      width: min(1420px, calc(100vw - 48px));
      height: min(590px, calc(100vh - 28px));
      transform: translate(-50%, -50%);
      grid-template-rows: 42px minmax(0, 1fr);
    }

    body:has(.feature-modal.open > .battle-report-view) .mission-panel,
    body:has(.feature-modal.open > .battle-report-view) .newbie-guide,
    body:has(.feature-modal.open > .battle-report-view) .newbie-guide-pointer {
      visibility: hidden;
    }

    .battle-report-classic {
      display: grid;
      grid-template-rows: 34px 24px minmax(0, 1fr) auto 28px;
      width: 100%;
      max-width: none;
      height: 100%;
      min-height: 0;
      margin: 0 auto;
      border: 1px solid rgba(87, 221, 177, 0.38);
      background: linear-gradient(90deg, rgba(19, 84, 62, 0.16), transparent 28%, transparent 72%, rgba(111, 57, 31, 0.13)), linear-gradient(180deg, rgba(4, 20, 29, 0.98), rgba(2, 9, 16, 0.98));
      box-shadow: inset 0 0 36px rgba(45, 221, 180, 0.08), 0 14px 34px rgba(0, 0, 0, 0.3);
      overflow: hidden;
    }

    .battle-report-classic:has(.battle-report-skills) {
      grid-template-rows: 34px 24px minmax(0, 1fr) auto auto 28px;
    }

    .battle-report-banner {
      position: relative;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      align-items: center;
      min-height: 34px;
      padding: 0 10px;
      border-bottom: 1px solid rgba(113, 255, 205, 0.34);
      background: linear-gradient(180deg, rgba(23, 80, 96, 0.9), rgba(3, 23, 33, 0.95));
    }

    .battle-report-banner::before,
    .battle-report-banner::after {
      content: "";
      position: absolute;
      top: 5px;
      bottom: 5px;
      width: 46px;
      border-top: 1px solid rgba(114, 255, 208, 0.42);
      border-bottom: 1px solid rgba(114, 255, 208, 0.22);
    }

    .battle-report-banner::before {
      left: 8px;
      border-left: 3px solid #50ffb7;
    }

    .battle-report-banner::after {
      right: 8px;
      border-right: 3px solid #ff9b67;
    }

    .battle-report-banner > span,
    .battle-report-banner > em,
    .battle-report-banner > strong {
      position: relative;
      z-index: 1;
    }

    .battle-report-banner > span,
    .battle-report-banner > em {
      font-size: 11px;
      font-style: normal;
    }

    .battle-report-banner > span {
      padding-left: 50px;
      color: #9dd9db;
    }

    .battle-report-banner > strong {
      min-width: 122px;
      padding: 3px 18px;
      border: 1px solid rgba(170, 230, 255, 0.5);
      background: linear-gradient(180deg, rgba(36, 74, 135, 0.98), rgba(8, 25, 67, 0.98));
      box-shadow: inset 0 0 14px rgba(72, 181, 255, 0.18), 0 4px 10px rgba(0, 0, 0, 0.28);
      color: #ffffff;
      font-size: 16px;
      line-height: 18px;
      text-align: center;
    }

    .battle-report-banner > em {
      justify-self: end;
      padding-right: 50px;
      font-weight: 700;
    }

    .battle-report-meta {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
      align-items: center;
      gap: 4px 10px;
      min-height: 24px;
      padding: 2px 10px;
      border-bottom: 1px solid rgba(99, 244, 189, 0.24);
      background: rgba(0, 7, 12, 0.56);
      color: #bfd6d8;
      font-size: 11px;
      line-height: 14px;
    }

    .battle-report-meta span,
    .battle-report-meta time {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-meta time {
      color: #89a6ac;
      text-align: right;
    }

    .battle-report-versus {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
      align-items: stretch;
      min-width: 0;
      min-height: 0;
      padding: 4px 6px 5px;
    }

    .battle-report-force {
      display: grid;
      grid-template-rows: auto auto auto minmax(0, 1fr);
      min-width: 0;
      min-height: 0;
      border: 1px solid rgba(91, 246, 171, 0.46);
      background: linear-gradient(180deg, rgba(8, 47, 40, 0.72), rgba(1, 15, 20, 0.84));
      box-shadow: inset 0 0 24px rgba(52, 255, 172, 0.07);
    }

    .battle-report-force.enemy {
      border-color: rgba(255, 143, 98, 0.44);
      background: linear-gradient(180deg, rgba(62, 30, 25, 0.68), rgba(17, 10, 14, 0.86));
      box-shadow: inset 0 0 24px rgba(255, 104, 80, 0.06);
    }

    .battle-report-force > header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-height: 22px;
      padding: 2px 7px;
      border-bottom: 1px solid rgba(95, 240, 173, 0.26);
      background: rgba(5, 31, 28, 0.8);
      color: #9fe8c5;
      font-size: 11px;
    }

    .battle-report-force.enemy > header {
      border-bottom-color: rgba(255, 151, 112, 0.24);
      background: rgba(45, 23, 22, 0.8);
      color: #ffc1a7;
    }

    .battle-report-force > header strong {
      color: #ffffff;
      font-size: 12px;
    }

    .battle-report-commander {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr);
      align-items: center;
      gap: 6px;
      min-height: 52px;
      padding: 4px 7px;
    }

    .battle-report-commander > img {
      width: 42px;
      height: 42px;
      border: 1px solid rgba(101, 255, 180, 0.72);
      background: #061116;
      box-shadow: inset 0 0 12px rgba(83, 255, 177, 0.16), 0 0 10px rgba(39, 210, 145, 0.1);
      object-fit: cover;
    }

    .battle-report-force.enemy .battle-report-commander > img {
      border-color: rgba(255, 155, 112, 0.74);
    }

    .battle-report-commander > div {
      display: grid;
      align-content: center;
      gap: 3px;
      min-width: 0;
    }

    .battle-report-commander strong {
      overflow: hidden;
      color: #efffff;
      font-size: 12px;
      line-height: 15px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-commander span,
    .battle-report-commander em {
      color: #9ec2c3;
      font-size: 9px;
      font-style: normal;
      line-height: 13px;
      overflow-wrap: anywhere;
    }

    .battle-report-commander em {
      color: #ffd67d;
    }

    .battle-report-force-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px;
      padding: 0 7px 3px;
      color: #a6c6c6;
      font-size: 10px;
    }

    .battle-report-force-stats span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-force-stats b {
      margin-left: 3px;
      color: #ff8e87;
      font-size: 11px;
    }

    .battle-report-force-stats span:last-child {
      text-align: right;
    }

    .battle-report-force-stats span:last-child b {
      color: #f3f8f5;
    }

    .battle-report-unit-grid {
      display: grid;
      grid-template-columns: repeat(5, 70px);
      grid-auto-rows: minmax(62px, auto);
      gap: 3px;
      align-content: start;
      justify-content: start;
      padding: 0 4px 4px;
      min-height: 0;
      overflow-y: auto;
      scrollbar-gutter: stable;
    }

    .battle-report-unit-slot {
      display: grid;
      grid-template-rows: 34px auto auto;
      gap: 1px;
      min-height: 0;
      padding: 2px;
      border: 1px solid rgba(83, 255, 170, 0.34);
      background: linear-gradient(180deg, rgba(4, 29, 27, 0.94), rgba(0, 10, 15, 0.96));
      box-shadow: inset 0 0 10px rgba(65, 255, 170, 0.08);
      text-align: center;
    }

    .battle-report-force.enemy .battle-report-unit-slot {
      border-color: rgba(255, 135, 93, 0.34);
      background: linear-gradient(180deg, rgba(42, 21, 21, 0.94), rgba(12, 7, 12, 0.96));
    }

    .battle-report-unit-slot.empty {
      display: grid;
      place-items: center;
      opacity: 0.48;
    }

    .battle-report-unit-slot.empty i {
      display: block;
      width: 28px;
      height: 28px;
      border: 1px solid rgba(91, 226, 164, 0.26);
      background: rgba(0, 0, 0, 0.22);
    }

    .battle-report-unit-art {
      position: relative;
      width: 34px;
      height: 34px;
      margin: 0 auto;
      border: 1px solid rgba(112, 255, 191, 0.62);
      background: #040b0e;
      overflow: hidden;
    }

    .battle-report-force.enemy .battle-report-unit-art {
      border-color: rgba(255, 159, 116, 0.62);
    }

    .battle-report-unit-art img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .battle-report-unit-art b {
      position: absolute;
      right: 2px;
      bottom: 1px;
      max-width: calc(100% - 4px);
      padding: 0 3px;
      background: rgba(0, 0, 0, 0.78);
      color: #ffffff;
      font-size: 9px;
      line-height: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-unit-slot > strong,
    .battle-report-unit-slot > span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 12px;
    }

    .battle-report-unit-slot > strong {
      color: #dffbf1;
      font-size: 10px;
    }

    .battle-report-unit-slot > span {
      color: #ff9b8e;
      font-size: 8px;
    }

    .battle-report-versus-mark {
      position: relative;
      z-index: 1;
      display: grid;
      place-content: center;
      gap: 6px;
      min-width: 0;
      text-align: center;
    }

    .battle-report-versus-mark::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 0;
      bottom: 0;
      width: 1px;
      background: linear-gradient(180deg, transparent, rgba(131, 232, 209, 0.38) 22%, rgba(255, 151, 111, 0.32) 78%, transparent);
    }

    .battle-report-versus-mark span,
    .battle-report-versus-mark strong {
      position: relative;
      z-index: 1;
      justify-self: center;
      background: #07151c;
    }

    .battle-report-versus-mark span {
      width: 34px;
      height: 34px;
      border: 1px solid rgba(168, 230, 237, 0.4);
      border-radius: 50%;
      color: #edfaff;
      font-size: 14px;
      font-weight: 800;
      line-height: 32px;
      box-shadow: inset 0 0 15px rgba(55, 187, 214, 0.14), 0 0 14px rgba(0, 0, 0, 0.42);
    }

    .battle-report-versus-mark strong {
      padding: 3px 6px;
      font-size: 11px;
    }

    .battle-report-skills {
      display: grid;
      grid-template-columns: 112px minmax(0, 1fr);
      min-width: 0;
      border-top: 1px solid rgba(111, 176, 255, 0.24);
      background: rgba(3, 13, 25, 0.9);
    }

    .battle-report-skills > header {
      display: grid;
      align-content: center;
      gap: 2px;
      padding: 4px 8px;
      border-right: 1px solid rgba(111, 176, 255, 0.2);
      background: rgba(16, 38, 70, 0.48);
    }

    .battle-report-skills > header strong {
      color: #e8f4ff;
      font-size: 12px;
    }

    .battle-report-skills > header span {
      color: #8eb3d9;
      font-size: 9px;
      line-height: 13px;
    }

    .battle-report-skill-events {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 3px;
      min-width: 0;
      max-height: 48px;
      padding: 3px 5px;
      overflow-x: hidden;
      overflow-y: auto;
    }

    .battle-report-skill-event {
      display: grid;
      grid-template-columns: 30px minmax(0, 1fr);
      align-items: center;
      gap: 4px;
      min-width: 0;
      padding: 2px 4px;
      border: 1px solid rgba(111, 176, 255, 0.2);
      background: rgba(2, 10, 19, 0.72);
    }

    .battle-report-skill-icon {
      display: grid;
      place-items: center;
      width: 28px;
      height: 28px;
      overflow: hidden;
      border: 1px solid rgba(140, 199, 255, 0.4);
      color: #d9efff;
      font-size: 10px;
    }

    .battle-report-skill-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .battle-report-skill-event div,
    .battle-report-skill-event strong,
    .battle-report-skill-event small {
      min-width: 0;
    }

    .battle-report-skill-event strong,
    .battle-report-skill-event small {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-skill-event strong {
      color: #eaf6ff;
      font-size: 10px;
    }

    .battle-report-skill-event strong em {
      color: #ffd46b;
      font-style: normal;
    }

    .battle-report-skill-event small {
      margin-top: 2px;
      color: #88a8c3;
      font-size: 8px;
    }

    .battle-report-skill-empty {
      grid-column: 1 / -1;
      align-self: center;
      color: #7896ad;
      font-size: 10px;
      text-align: center;
    }

    .battle-report-loot {
      display: grid;
      grid-template-columns: 112px minmax(0, 1fr);
      min-width: 0;
      border-top: 1px solid rgba(107, 244, 198, 0.3);
      border-bottom: 1px solid rgba(107, 244, 198, 0.22);
      background: rgba(2, 17, 23, 0.88);
    }

    .battle-report-loot > header {
      display: grid;
      align-content: center;
      gap: 2px;
      padding: 4px 8px;
      border-right: 1px solid rgba(107, 244, 198, 0.24);
      background: rgba(11, 48, 45, 0.52);
    }

    .battle-report-loot > header strong {
      color: #e9fff5;
      font-size: 13px;
    }

    .battle-report-loot > header span {
      color: #91b6b5;
      font-size: 9px;
      line-height: 13px;
    }

    .battle-report-loot-rows {
      display: grid;
      min-width: 0;
    }

    .battle-report-plunder-loss { grid-column: 1 / -1; margin: 0; padding: 4px 8px; color: #ffc1a7; line-height: 1.4; overflow-wrap: anywhere; }

    .battle-report-loot-row {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr);
      min-width: 0;
      border-bottom: 1px solid rgba(107, 244, 198, 0.14);
    }

    .battle-report-loot-row:last-child {
      border-bottom: 0;
    }

    .battle-report-loot-row-title {
      display: grid;
      place-items: center;
      min-width: 0;
      padding: 3px 5px;
      border-right: 1px solid rgba(107, 244, 198, 0.16);
      background: rgba(7, 34, 34, 0.38);
      color: #a9d8d1;
      font-size: 10px;
      text-align: center;
    }

    .battle-report-loot-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(96px, 1fr));
      gap: 3px;
      align-items: stretch;
      min-width: 0;
      padding: 3px 5px;
    }

    .battle-report-loot-row.secondary .battle-report-loot-grid {
      grid-template-columns: repeat(3, minmax(110px, 1fr));
    }

    .battle-report-loot-row.items .battle-report-loot-grid {
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .battle-report-loot-slot {
      display: grid;
      grid-template-columns: 26px minmax(0, 1fr);
      grid-template-rows: auto auto;
      align-content: center;
      column-gap: 4px;
      min-width: 0;
      min-height: 34px;
      padding: 2px 5px;
      border: 1px solid rgba(96, 238, 187, 0.22);
      background: rgba(2, 12, 18, 0.74);
    }

    .battle-report-loot-slot > img,
    .battle-report-loot-slot > i {
      grid-row: 1 / 3;
      align-self: center;
      width: 24px;
      height: 24px;
      border: 1px solid rgba(113, 244, 200, 0.38);
      background: rgba(8, 37, 39, 0.84);
      object-fit: contain;
    }

    .battle-report-loot-slot > i {
      display: grid;
      place-items: center;
      color: #c9fff0;
      font-size: 10px;
      font-style: normal;
      font-weight: 700;
    }

    .battle-report-loot-slot.has-item-image > img {
      border: 0;
      background: transparent;
    }

    .battle-report-loot-slot > span,
    .battle-report-loot-slot > strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-loot-slot > span {
      color: #aac7c7;
      font-size: 9px;
    }

    .battle-report-loot-slot > strong {
      color: #f1ffff;
      font-size: 11px;
    }

    .battle-report-loot-slot.zero {
      opacity: 0.58;
    }

    .battle-report-loot-slot.zero > strong {
      color: #789398;
    }

    .battle-report-loot-empty {
      grid-column: 1 / -1;
      align-self: center;
      min-height: 34px;
      padding: 8px 6px;
      color: #78969b;
      font-size: 11px;
      text-align: center;
    }

    .battle-report-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-height: 28px;
      padding: 2px 8px;
      background: rgba(0, 8, 13, 0.74);
    }

    .battle-report-actions button {
      min-width: 96px;
      height: 22px;
      border: 1px solid rgba(105, 255, 199, 0.46);
      background: linear-gradient(180deg, rgba(20, 101, 73, 0.92), rgba(4, 38, 34, 0.96));
      color: #effff8;
      cursor: pointer;
    }

    .battle-report-actions span {
      min-width: 0;
      overflow: hidden;
      color: #78959a;
      font-size: 9px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .battle-report-analysis {
      display: grid;
      grid-template-rows: 38px minmax(0, 1fr) 28px;
      height: 100%;
      min-height: 0;
      border: 1px solid rgba(87, 221, 177, 0.38);
      background: #07151b;
    }

    .battle-analysis-header {
      display: flex;
      align-items: center;
      gap: 16px;
      min-width: 0;
      padding: 0 12px;
      border-bottom: 1px solid rgba(113, 255, 205, 0.34);
      background: #103441;
    }

    .battle-analysis-header strong { color: #eafff6; font-size: 15px; }
    .battle-analysis-header span { overflow: hidden; color: #adc6c7; text-overflow: ellipsis; white-space: nowrap; }

    .battle-analysis-scroll {
      min-height: 0;
      padding: 10px 12px;
      overflow: auto;
      scrollbar-gutter: stable;
    }

    .battle-analysis-side { margin-bottom: 14px; border: 1px solid #31564d; }
    .battle-analysis-side.enemy { border-color: #684d41; }
    .battle-analysis-side > header {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px 16px;
      padding: 7px 9px;
      background: #103b32;
      color: #d4e9e3;
    }
    .battle-analysis-side.enemy > header { background: #432e29; }
    .battle-analysis-side > header strong { color: #f1fff9; font-size: 13px; }
    .battle-analysis-side > header span { font-size: 11px; }
    .battle-analysis-table-wrap { overflow-x: auto; }
    .battle-analysis-table { width: 100%; min-width: 880px; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
    .battle-analysis-table col.unit { width: 18%; }
    .battle-analysis-table col.count { width: 7%; }
    .battle-analysis-table col.time { width: 9%; }
    .battle-analysis-table col.shots { width: 7%; }
    .battle-analysis-table col.damage { width: 12%; }
    .battle-analysis-table col.distance { width: 10%; }
    .battle-analysis-table col.targets { width: 23%; }
    .battle-analysis-table th, .battle-analysis-table td {
      padding: 6px 5px;
      border-top: 1px solid rgba(145, 185, 181, 0.16);
      color: #d7e9e8;
      text-align: left;
      vertical-align: top;
      overflow-wrap: anywhere;
    }
    .battle-analysis-table thead th { color: #a8c9c1; font-weight: 500; line-height: 1.3; }
    .battle-analysis-table tbody th { color: #f1f7ed; font-weight: 600; }
    .battle-analysis-table tbody tr:nth-child(even) { background: rgba(117, 157, 152, 0.06); }
    .battle-analysis-targets { color: #d9c49e !important; }
    .battle-analysis-totals { padding: 6px 9px; border-top: 1px solid #31564d; color: #adc9c2; font-size: 11px; }
    .battle-analysis-events h3 { margin: 0 0 7px; color: #dbefff; font-size: 13px; }
    .battle-analysis-events ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
    .battle-analysis-events li { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 9px; background: #142638; color: #bcd3e6; font-size: 11px; }
    .battle-analysis-events li strong { color: #eff7ff; }
    .battle-analysis-events li em { color: #ffcf86; font-style: normal; }
    .battle-analysis-empty { margin: 12px 0; color: #b6c9c5; }

    @media (max-width: 900px) {
      .feature-modal:has(> .feature-body.battle-report-view) {
        width: calc(100vw - 18px);
        height: calc(100vh - 18px);
      }

      .feature-body.battle-report-view {
        padding: 7px;
        overflow: auto;
      }

      .battle-report-classic {
        height: auto;
        min-height: auto;
      }

      .battle-report-banner {
        padding: 0 8px;
      }

      .battle-report-banner::before,
      .battle-report-banner::after {
        width: 34px;
      }

      .battle-report-banner > span {
        padding-left: 38px;
      }

      .battle-report-banner > em {
        padding-right: 38px;
      }

      .battle-report-banner > strong {
        min-width: 116px;
        padding: 7px 18px;
        font-size: 18px;
      }

      .battle-report-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 7px 10px;
      }

      .battle-report-meta time {
        text-align: left;
      }

      .battle-report-versus {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
      }

      .battle-report-versus-mark {
        grid-template-columns: auto auto;
        min-height: 38px;
      }

      .battle-report-versus-mark::before {
        left: 0;
        right: 0;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(131, 232, 209, 0.38), rgba(255, 151, 111, 0.32), transparent);
      }

      .battle-report-versus-mark span {
        width: 38px;
        height: 38px;
        font-size: 14px;
        line-height: 36px;
      }

      .battle-report-skills {
        grid-template-columns: 1fr;
      }

      .battle-report-skills > header {
        border-right: 0;
        border-bottom: 1px solid rgba(111, 176, 255, 0.2);
      }

      .battle-report-skill-events {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 150px;
      }

      .battle-report-loot {
        grid-template-columns: 1fr;
      }

      .battle-report-loot > header {
        border-right: 0;
        border-bottom: 1px solid rgba(107, 244, 198, 0.24);
      }
    }

    @media (max-width: 560px) {
      .battle-report-banner > span {
        visibility: hidden;
      }

      .battle-report-meta {
        grid-template-columns: minmax(0, 1fr);
      }

      .battle-report-unit-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding-right: 6px;
        padding-left: 6px;
      }

      .battle-report-unit-slot {
        grid-template-rows: 44px auto auto;
        padding: 4px 2px;
      }

      .battle-report-unit-art {
        width: 44px;
        height: 44px;
      }

      .battle-report-unit-slot > strong {
        font-size: 9px;
      }

      .battle-report-unit-slot > span {
        font-size: 8px;
      }

      .battle-report-skill-events {
        grid-template-columns: minmax(0, 1fr);
      }

      .battle-report-loot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        padding: 6px;
      }

      .battle-report-loot-row {
        grid-template-columns: 58px minmax(0, 1fr);
      }

      .battle-report-loot-row-title {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 9px;
      }

      .battle-report-loot-row.secondary .battle-report-loot-grid,
      .battle-report-loot-row.items .battle-report-loot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    .bag-section {
      display: grid;
      gap: 7px;
      min-width: 0;
    }

    .feature-body.bag-only {
      grid-template-columns: 1fr;
      align-items: stretch;
      min-height: 520px;
    }

    .bag-main {
      min-height: 0;
      display: grid;
      grid-template-rows: auto 1fr;
      gap: 10px;
    }

    .bag-tabs {
      display: flex;
      gap: 8px;
      padding-bottom: 2px;
    }

    .bag-tabs button {
      min-width: 82px;
      height: 28px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: linear-gradient(180deg, rgba(16, 47, 70, 0.82), rgba(2, 10, 18, 0.94));
      color: var(--muted);
      cursor: pointer;
      font-size: 12px;
    }

    .bag-tabs button.active {
      border-color: rgba(117, 255, 87, 0.56);
      color: #eaffdf;
      box-shadow: inset 0 0 14px rgba(117, 255, 87, 0.12), 0 0 12px rgba(117, 255, 87, 0.1);
    }

    .energy-tier-icon {
      width: 1.35em;
      height: 1.35em;
      margin-inline-end: .3em;
      vertical-align: -.3em;
      object-fit: contain;
    }

    .energy-bag-grid {
      display: grid;
      align-self: start;
      grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
      align-content: start;
      gap: 8px;
      margin: 0;
      padding: 4px;
      overflow: auto;
      list-style: none;
    }

    .energy-bag-tier {
      display: grid;
      grid-template-columns: 48px 1fr;
      align-content: center;
      gap: 2px 8px;
      padding: 8px;
      border: 1px solid #2d6176;
      background: #0d1b2a;
    }

    .energy-bag-tier .energy-tier-icon {
      grid-row: span 2;
      width: 48px;
      height: 48px;
      margin: 0;
    }

    .energy-bag-tier strong { align-self: end; color: #8ff5ff; }
    .energy-bag-tier span { color: #abbdd1; font-size: 12px; }
    .energy-bag-tier[data-empty="true"] { border-color: #253646; }
    .energy-bag-tier[data-empty="true"] img { opacity: .55; }

    .bag-section + .bag-section {
      margin-top: 10px;
    }

    .bag-section-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      padding: 5px 7px;
      border: 1px solid rgba(117, 255, 87, 0.18);
      background: rgba(0, 0, 0, 0.26);
      color: #dfffcf;
      font-size: 12px;
    }

    .bag-section-head em {
      color: #ffd46b;
      font-style: normal;
      font-size: 11px;
    }

    .bag-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
      gap: 8px;
      align-content: start;
      min-width: 0;
      overflow: auto;
      padding-right: 3px;
    }

    .bag-main .bag-grid {
      grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
      align-content: start;
      min-height: 0;
      height: 100%;
      padding: 4px;
      border: 1px solid rgba(117, 255, 87, 0.18);
      background:
        linear-gradient(135deg, rgba(32, 216, 255, 0.035), transparent 42%),
        rgba(0, 0, 0, 0.18);
    }

    .bag-cell {
      position: relative;
      min-width: 0;
      height: 86px;
      display: grid;
      grid-template-rows: 44px 24px;
      place-items: center;
      gap: 4px;
      padding: 6px 5px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background:
        radial-gradient(circle at 50% 20%, rgba(120, 229, 255, 0.12), transparent 56%),
        rgba(0, 0, 0, 0.3);
      box-shadow: inset 0 0 10px rgba(32, 216, 255, 0.04);
      color: inherit;
      font: inherit;
      cursor: pointer;
    }

    .bag-cell.usable {
      cursor: pointer;
    }

    .bag-cell.usable:hover {
      border-color: rgba(255, 214, 107, 0.58);
      box-shadow: inset 0 0 14px rgba(255, 214, 107, 0.1), 0 0 12px rgba(49, 221, 255, 0.14);
    }

    .bag-cell.menu-open {
      border-color: rgba(255, 214, 107, 0.82);
      box-shadow: inset 0 0 14px rgba(255, 214, 107, 0.14), 0 0 14px rgba(49, 221, 255, 0.2);
    }

    .bag-cell.hero-recruit-card {
      border-color: color-mix(in srgb, var(--bag-item-accent) 68%, transparent);
      background:
        radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--bag-item-accent) 34%, transparent), transparent 58%),
        rgba(0, 0, 0, 0.38);
      box-shadow: inset 0 0 14px color-mix(in srgb, var(--bag-item-accent) 16%, transparent);
    }

    .bag-cell.hero-recruit-card .bag-icon,
    .bag-cell.hero-recruit-card strong {
      color: var(--bag-item-accent);
      text-shadow: 0 0 9px color-mix(in srgb, var(--bag-item-accent) 72%, transparent);
    }

    .planet-node.capture-pirate {
      filter: drop-shadow(0 0 8px var(--capture-color));
    }

    .planet-node.capture-pirate .planet-node-caption {
      border-color: color-mix(in srgb, var(--capture-color) 72%, transparent);
      box-shadow: inset 3px 0 var(--capture-color), 0 0 12px color-mix(in srgb, var(--capture-color) 34%, transparent);
    }

    .planet-node.capture-pirate .planet-node-caption strong,
    .planet-node.capture-pirate .planet-node-caption span {
      color: var(--capture-color);
    }

    .dungeon-activity-row.capture-general-activity {
      border-color: rgba(255, 181, 47, 0.5);
      background: linear-gradient(180deg, rgba(85, 55, 8, 0.46), rgba(5, 13, 19, 0.78));
    }

    .bag-count {
      position: absolute;
      right: 5px;
      bottom: 4px;
      min-width: 18px;
      padding: 1px 4px;
      border: 1px solid rgba(255, 214, 107, 0.42);
      background: rgba(0, 0, 0, 0.8);
      color: #ffe8a3;
      font-size: 10px;
      line-height: 14px;
      text-align: center;
      pointer-events: none;
    }

    .bag-action-popover {
      position: absolute;
      z-index: 80;
      width: 132px;
      display: grid;
      gap: 5px;
      padding: 7px;
      border: 1px solid rgba(183, 247, 255, 0.58);
      background: rgba(3, 10, 18, 0.98);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.58), inset 0 0 12px rgba(32, 216, 255, 0.08);
    }

    .bag-action-popover.detail {
      width: 300px;
    }

    .bag-action-title {
      overflow: hidden;
      padding: 2px 3px 5px;
      color: #effcff;
      font-size: 11px;
      line-height: 15px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .bag-action-popover button,
    .bag-action-popover input {
      width: 100%;
      min-width: 0;
      height: 29px;
      border: 1px solid rgba(183, 247, 255, 0.3);
      background: rgba(13, 36, 52, 0.92);
      color: #effcff;
      font-size: 11px;
    }

    .bag-action-popover button {
      cursor: pointer;
    }

    .bag-action-popover button:hover:not(:disabled) {
      border-color: rgba(117, 255, 87, 0.62);
      color: #eaffdf;
    }

    .bag-action-popover button.danger {
      border-color: rgba(255, 108, 108, 0.48);
      color: #ffb1b1;
    }

    .bag-action-popover button:disabled {
      opacity: 0.42;
      cursor: default;
    }

    .bag-action-popover input {
      padding: 0 8px;
      outline: none;
    }

    .bag-action-detail {
      display: grid;
      gap: 4px;
      padding: 4px 3px 7px;
    }

    .bag-action-detail span,
    .bag-action-warning {
      color: var(--muted);
      font-size: 10px;
      line-height: 15px;
    }

    .bag-action-warning {
      padding: 2px 3px 5px;
      color: #ffb1b1;
    }

    .feature-body.equipment-enhance-view {
      grid-template-columns: minmax(190px, 220px) minmax(360px, 1fr) minmax(220px, 260px);
      gap: 10px;
      min-width: 0;
    }

    .equipment-enhance-equipment-panel,
    .equipment-enhance-bag-panel {
      grid-template-rows: auto minmax(0, 1fr);
      gap: 0;
      min-width: 0;
      padding: 0;
      overflow: hidden;
    }

    .equipment-enhance-panel-head {
      min-height: 38px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 0 10px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.24);
    }

    .equipment-enhance-panel-head > strong {
      color: #b7f7ff;
      font-size: 12px;
    }

    .equipment-enhance-panel-head > span {
      min-width: 24px;
      color: #ffe8a3;
      font-size: 11px;
      text-align: right;
    }

    .equipment-enhance-target-tabs {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 4px;
    }

    .feature-body.star-transfer-view {
      grid-template-columns: minmax(185px, 1fr) minmax(350px, 2fr);
      gap: 12px;
    }
    .star-transfer-workbench {
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 14px;
      text-align: center;
    }
    .star-transfer-workbench p { margin: 0; color: #b1cbd4; }
    .star-transfer-pair { display: flex; align-items: center; justify-content: center; gap: 10px; }
    .star-transfer-pair > b { color: #8ee6a8; font-size: 22px; }
    .star-transfer-slot {
      display: grid;
      justify-items: center;
      gap: 12px;
      padding: 14px 8px;
      border: 1px solid #3f626a;
      background: #0c202b;
    }
    .star-transfer-slot.drag-over { border-color: #8ee6a8; background: #15392e; }
    .star-transfer-icon {
      display: grid;
      place-items: center;
      width: 52px;
      height: 52px;
      border: 1px solid #47616a;
      background: #041018;
      color: #78949d;
    }
    .star-transfer-icon img { width: 44px; height: 44px; object-fit: contain; }
    .star-transfer-slot select { max-width: 160px; color: #dbefef; background: #102732; }

    .equipment-enhance-target-tab {
      min-width: 0;
      min-height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 3px 6px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(3, 18, 27, 0.72);
      color: rgba(224, 248, 252, 0.66);
      font-size: 11px;
    }

    .equipment-enhance-target-tab span {
      min-width: 18px;
      padding: 0 4px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.28);
      color: #ffe8a3;
      font-size: 9px;
      line-height: 14px;
      text-align: center;
    }

    .equipment-enhance-target-tab:hover,
    .equipment-enhance-target-tab.active {
      border-color: rgba(142, 230, 168, 0.62);
      background: rgba(20, 62, 51, 0.52);
      color: #effff4;
      box-shadow: inset 0 -2px 0 #8ee6a8;
    }

    .equipment-enhance-equipment-list {
      display: grid;
      align-content: start;
      gap: 6px;
      min-width: 0;
      overflow: auto;
      padding: 8px;
    }

    .equipment-enhance-equipment-row {
      min-width: 0;
      min-height: 58px;
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 34px;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.26);
      color: inherit;
      text-align: left;
      cursor: pointer;
    }

    .equipment-enhance-equipment-row:hover,
    .equipment-enhance-equipment-row.active {
      border-color: rgba(142, 230, 168, 0.58);
      background: rgba(20, 62, 51, 0.44);
      box-shadow: inset 3px 0 0 #8ee6a8;
    }

    .equipment-enhance-list-icon {
      position: relative;
      width: 42px;
      height: 42px;
    }

    .equipment-enhance-skill-icon {
      position: relative;
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(98, 191, 255, 0.62);
      background: rgba(5, 24, 38, 0.9);
      color: #bde8ff;
      font-size: 18px;
      font-weight: 800;
      line-height: 1;
      text-shadow: 0 0 9px rgba(92, 187, 255, 0.48);
      box-shadow: inset 0 0 14px rgba(72, 168, 255, 0.18);
      overflow: hidden;
    }

    .equipment-enhance-skill-icon > img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .equipment-enhance-skill-icon.active {
      border-color: rgba(255, 184, 79, 0.72);
      background: rgba(49, 28, 6, 0.9);
      color: #ffd27c;
      text-shadow: 0 0 9px rgba(255, 166, 62, 0.52);
      box-shadow: inset 0 0 14px rgba(255, 155, 54, 0.18);
    }

    .equipment-enhance-ritual .equipment-enhance-skill-icon {
      width: 72px;
      height: 72px;
      border-width: 2px;
      font-size: 30px;
    }

    .equipment-enhance-list-copy {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .equipment-enhance-list-copy strong,
    .equipment-enhance-list-copy span {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .equipment-enhance-list-copy strong {
      color: #effcff;
      font-size: 11px;
    }

    .equipment-enhance-list-copy span {
      color: var(--muted);
      font-size: 10px;
    }

    .equipment-enhance-equipment-row > em {
      color: #ffe8a3;
      font-size: 12px;
      font-style: normal;
      text-align: right;
    }

    .equipment-enhance-row-level {
      justify-self: end;
      min-width: 30px;
      padding: 2px 4px;
      border: 1px solid rgba(255, 225, 125, 0.72);
      background: rgba(4, 10, 16, 0.92);
      color: #ffe17d;
      font-size: 10px;
      font-weight: 800;
      line-height: 15px;
      text-align: center;
      text-shadow: 0 0 6px rgba(255, 196, 76, 0.55);
    }

    .equipment-enhance-icon {
      width: 86px;
      height: 86px;
      display: grid;
      place-items: center;
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .equipment-enhance-main {
      grid-template-rows: minmax(286px, 1fr) auto 6px auto auto;
      gap: 6px;
      min-width: 0;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      padding: 8px;
    }

    .equipment-enhance-level-badge {
      position: absolute;
      right: -4px;
      bottom: -4px;
      z-index: 3;
      min-width: 26px;
      padding: 1px 4px;
      border: 1px solid rgba(255, 225, 125, 0.72);
      background: rgba(4, 10, 16, 0.92);
      color: #ffe17d;
      font-size: 10px;
      font-weight: 800;
      line-height: 15px;
      text-align: center;
      text-shadow: 0 0 6px rgba(255, 196, 76, 0.55);
    }

    .equipment-enhance-ritual {
      position: relative;
      isolation: isolate;
      min-width: 0;
      min-height: 286px;
      display: grid;
      grid-template-rows: 68px 20px 16px 76px auto auto 28px;
      place-items: center;
      gap: 2px;
      overflow: hidden;
      padding: 8px 12px;
      border: 1px solid rgba(139, 231, 155, 0.48);
      background: rgba(2, 14, 15, 0.82);
      box-shadow: inset 0 0 42px rgba(71, 177, 105, 0.08);
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .equipment-enhance-ritual.drag-over {
      border-color: #b7ff9b;
      box-shadow: inset 0 0 48px rgba(111, 231, 117, 0.2), 0 0 14px rgba(111, 231, 117, 0.2);
    }

    .equipment-enhance-circuit {
      position: absolute;
      inset: 14px 10%;
      z-index: -1;
      opacity: 0.42;
      border: 1px solid rgba(157, 255, 139, 0.42);
      background:
        linear-gradient(90deg, transparent 11%, rgba(159, 255, 130, 0.72) 11% 11.4%, transparent 11.4% 34%, rgba(159, 255, 130, 0.5) 34% 34.4%, transparent 34.4% 78%, rgba(159, 255, 130, 0.62) 78% 78.4%, transparent 78.4%),
        linear-gradient(0deg, transparent 9%, rgba(159, 255, 130, 0.54) 9% 9.5%, transparent 9.5% 28%, rgba(159, 255, 130, 0.7) 28% 28.5%, transparent 28.5% 67%, rgba(159, 255, 130, 0.48) 67% 67.5%, transparent 67.5%);
      box-shadow: inset 0 0 18px rgba(95, 221, 102, 0.08);
      pointer-events: none;
    }

    .equipment-enhance-circuit::before,
    .equipment-enhance-circuit::after {
      content: "";
      position: absolute;
      border: 1px solid rgba(166, 255, 138, 0.64);
      pointer-events: none;
    }

    .equipment-enhance-circuit::before {
      inset: 12% 18% 27% 23%;
    }

    .equipment-enhance-circuit::after {
      inset: 30% 28% 11% 12%;
    }

    .equipment-enhance-gem-node {
      position: relative;
      width: 68px;
      height: 68px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 2px solid rgba(120, 203, 255, 0.8);
      background: rgba(4, 26, 38, 0.88);
      color: #ffb52e;
      cursor: pointer;
      box-shadow: inset 0 0 18px rgba(94, 194, 255, 0.26), 0 0 18px rgba(96, 201, 255, 0.12);
    }

    .equipment-enhance-gem-node:hover:not(:disabled) {
      border-color: #b4eaff;
      box-shadow: inset 0 0 22px rgba(94, 194, 255, 0.34), 0 0 20px rgba(255, 183, 54, 0.2);
    }

    .equipment-enhance-gem-node:disabled {
      cursor: default;
      opacity: 0.74;
    }

    .equipment-enhance-gem-shape {
      color: #ffb42a;
      font-size: 50px;
      line-height: 1;
      text-shadow: 0 0 8px #fff2a8, 0 0 18px rgba(255, 159, 34, 0.84);
      transform: scaleX(0.86);
    }

    .equipment-enhance-gem-shape.has-image {
      width: 60px;
      height: 60px;
      transform: none;
    }

    .equipment-enhance-gem-shape.has-image img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .equipment-enhance-gem-node > em {
      position: absolute;
      right: 4px;
      bottom: 3px;
      min-width: 31px;
      padding: 0 3px;
      background: rgba(0, 0, 0, 0.78);
      color: #fff4c2;
      font-size: 9px;
      font-style: normal;
      line-height: 14px;
      text-align: right;
    }

    .equipment-enhance-gem-label {
      color: #ffe17d;
      font-size: 13px;
      text-shadow: 0 0 8px rgba(255, 198, 66, 0.4);
    }

    .equipment-enhance-energy-link {
      width: 2px;
      height: 14px;
      background: #8fe782;
      box-shadow: 0 0 8px rgba(143, 231, 130, 0.72);
    }

    .equipment-enhance-ritual .equipment-enhance-icon {
      position: relative;
      width: 72px;
      height: 72px;
      border: 2px solid rgba(118, 187, 255, 0.76);
      background: rgba(4, 18, 34, 0.9);
      box-shadow: inset 0 0 16px rgba(92, 174, 255, 0.24), 0 0 12px rgba(92, 174, 255, 0.12);
    }

    .equipment-enhance-ritual .equipment-enhance-icon[data-rarity="epic"] {
      border-color: rgba(199, 134, 255, 0.82);
      box-shadow: inset 0 0 16px rgba(199, 134, 255, 0.24), 0 0 12px rgba(199, 134, 255, 0.14);
    }

    .equipment-enhance-ritual .equipment-enhance-icon[data-rarity="legendary"] {
      border-color: rgba(255, 212, 107, 0.86);
      box-shadow: inset 0 0 16px rgba(255, 212, 107, 0.24), 0 0 12px rgba(255, 212, 107, 0.14);
    }

    .equipment-enhance-ritual .equipment-enhance-level-badge {
      right: 2px;
      bottom: 2px;
      min-width: 31px;
      font-size: 12px;
      line-height: 18px;
    }

    .equipment-enhance-ritual-name {
      max-width: 100%;
      color: #ffc65a;
      font-size: 12px;
      text-align: center;
      overflow-wrap: anywhere;
    }

    .equipment-enhance-ritual-name span {
      color: #effcff;
      font-size: 11px;
    }

    .equipment-enhance-ritual-stat {
      max-width: min(100%, 440px);
      color: rgba(221, 244, 248, 0.72);
      font-size: 10px;
      line-height: 15px;
      text-align: center;
      overflow-wrap: anywhere;
    }

    .equipment-enhance-ritual-chance {
      align-self: end;
      justify-self: stretch;
      display: flex;
      align-items: baseline;
      justify-content: center;
      gap: 8px;
      color: #e6fbff;
      font-size: 12px;
    }

    .equipment-enhance-ritual-chance strong {
      color: #b7ff9b;
      font-size: 18px;
    }

    .equipment-enhance-investment {
      min-width: 0;
      display: grid;
      gap: 4px;
      padding: 6px 10px;
      border: 1px solid rgba(79, 181, 191, 0.34);
      background: rgba(2, 18, 24, 0.72);
    }

    .equipment-enhance-investment-head,
    .equipment-enhance-slider-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .equipment-enhance-investment-head {
      justify-content: space-between;
      color: #d8f5f8;
      font-size: 11px;
    }

    .equipment-enhance-investment-head strong {
      color: #ffe17d;
      font-size: 12px;
    }

    .equipment-enhance-investment-head b {
      font-size: 14px;
    }

    .equipment-enhance-slider-row input[type="range"] {
      min-width: 0;
      flex: 1 1 auto;
      height: 20px;
      margin: 0;
      accent-color: #8ee66f;
      cursor: pointer;
    }

    .equipment-enhance-stepper {
      width: 30px;
      height: 30px;
      flex: 0 0 30px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 1px solid rgba(93, 191, 209, 0.56);
      background: rgba(4, 38, 47, 0.86);
      color: #b9f7ff;
      font-size: 18px;
      line-height: 1;
    }

    .equipment-enhance-stepper:hover:not(:disabled) {
      border-color: #b9f7ff;
      color: #ffffff;
    }

    .equipment-enhance-investment small {
      color: rgba(216, 245, 248, 0.62);
      font-size: 9px;
      line-height: 14px;
    }

    .equipment-enhance-selected-card {
      min-width: 0;
      display: grid;
      grid-template-columns: 86px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      min-height: 98px;
      padding: 6px 12px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.24);
      box-shadow: inset 3px 0 0 rgba(183, 247, 255, 0.4);
    }

    .equipment-enhance-selected-card[data-rarity="rare"] {
      box-shadow: inset 3px 0 0 #5ab7ff;
    }

    .equipment-enhance-selected-card[data-rarity="epic"] {
      box-shadow: inset 3px 0 0 #c786ff;
    }

    .equipment-enhance-selected-card[data-rarity="legendary"] {
      box-shadow: inset 3px 0 0 #ffd46b;
    }

    .equipment-enhance-selected-card > div:nth-child(2) {
      min-width: 0;
      display: grid;
      gap: 7px;
    }

    .equipment-enhance-selected-card strong,
    .equipment-enhance-selected-card span {
      overflow-wrap: anywhere;
    }

    .equipment-enhance-selected-card strong {
      color: #effcff;
      font-size: 16px;
    }

    .equipment-enhance-selected-card span {
      color: var(--muted);
      font-size: 11px;
      line-height: 16px;
    }

    .equipment-enhance-selected-card > em {
      min-width: 54px;
      color: #ffe8a3;
      font-size: 24px;
      font-style: normal;
      text-align: right;
    }

    .equipment-enhance-progress {
      display: grid;
      grid-template-columns: minmax(80px, 1fr) 40px minmax(80px, 1fr);
      align-items: center;
      gap: 10px;
      min-height: 72px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.2);
      text-align: center;
    }

    .equipment-enhance-progress strong {
      color: #ffe8a3;
      font-size: 26px;
    }

    .equipment-enhance-progress span {
      color: #b7f7ff;
      font-size: 20px;
    }

    .equipment-enhance-metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      min-width: 0;
    }

    .equipment-enhance-metrics > div {
      min-width: 0;
      display: grid;
      gap: 4px;
      padding: 7px 8px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.2);
      text-align: center;
    }

    .equipment-enhance-metrics span {
      color: var(--muted);
      font-size: 10px;
    }

    .equipment-enhance-metrics strong {
      color: #effcff;
      font-size: 14px;
    }

    .equipment-enhance-material-section {
      min-width: 0;
      border: 1px solid rgba(142, 230, 168, 0.42);
      background: rgba(5, 24, 22, 0.54);
    }

    .equipment-enhance-material-section > header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 32px;
      padding: 0 9px;
      border-bottom: 1px solid rgba(142, 230, 168, 0.24);
    }

    .equipment-enhance-material-section > header strong {
      color: #bfffcf;
      font-size: 11px;
    }

    .equipment-enhance-material-section > header span {
      color: #ffe8a3;
      font-size: 11px;
    }

    .equipment-enhance-material-grid {
      display: grid;
      grid-template-columns: repeat(6, 48px);
      justify-content: center;
      gap: 7px;
      min-height: 174px;
      padding: 8px;
      transition: background 0.15s ease, box-shadow 0.15s ease;
    }

    .equipment-enhance-material-grid.drag-over {
      background: rgba(73, 180, 109, 0.16);
      box-shadow: inset 0 0 18px rgba(142, 230, 168, 0.18);
    }

    .equipment-enhance-material-slot {
      position: relative;
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 1px dashed rgba(142, 230, 168, 0.42);
      background: rgba(0, 0, 0, 0.3);
      color: #8ee6a8;
      cursor: pointer;
    }

    .equipment-enhance-material-slot:hover:not(:disabled) {
      border-style: solid;
      border-color: #8ee6a8;
      box-shadow: inset 0 0 12px rgba(142, 230, 168, 0.14);
    }

    .equipment-enhance-material-slot.filled {
      border-style: solid;
      border-color: rgba(255, 212, 107, 0.72);
      background: rgba(58, 42, 10, 0.58);
      color: #ffe17d;
      box-shadow: inset 0 0 14px rgba(255, 212, 107, 0.12);
    }

    .equipment-enhance-material-slot.locked {
      border-color: rgba(183, 247, 255, 0.1);
      color: rgba(183, 247, 255, 0.14);
      cursor: default;
    }

    .equipment-enhance-material-slot > span {
      font-size: 20px;
      line-height: 1;
    }

    .equipment-enhance-material-slot > em {
      position: absolute;
      right: 4px;
      bottom: 2px;
      color: rgba(239, 252, 255, 0.55);
      font-size: 8px;
      font-style: normal;
    }

    .equipment-enhance-chance-track {
      height: 6px;
      overflow: hidden;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.38);
    }

    .equipment-enhance-chance-track span {
      display: block;
      width: var(--enhance-chance);
      height: 100%;
      background: #8ee6a8;
      transition: width 0.16s ease;
    }

    .equipment-enhance-bag-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(42px, 1fr));
      grid-auto-rows: 62px;
      align-content: start;
      gap: 6px;
      min-width: 0;
      overflow: auto;
      padding: 8px;
    }

    .equipment-enhance-bag-cell {
      position: relative;
      min-width: 0;
      display: grid;
      grid-template-rows: 30px 14px;
      place-items: center;
      gap: 3px;
      padding: 5px 3px;
      border: 1px solid rgba(183, 247, 255, 0.15);
      background: rgba(0, 0, 0, 0.26);
      color: inherit;
      text-align: center;
      cursor: pointer;
    }

    .equipment-enhance-bag-cell.material:not(:disabled) {
      border-color: rgba(255, 212, 107, 0.58);
      background: rgba(58, 42, 10, 0.44);
      box-shadow: inset 0 0 12px rgba(255, 212, 107, 0.08);
    }

    .equipment-enhance-bag-cell.inactive {
      opacity: 0.56;
      cursor: default;
    }

    .equipment-enhance-bag-cell.empty {
      opacity: 0.34;
      background: rgba(0, 0, 0, 0.2);
    }

    .equipment-enhance-bag-cell.empty::before {
      content: "";
      width: 24px;
      height: 24px;
      border: 1px dashed rgba(183, 247, 255, 0.18);
    }

    .equipment-enhance-bag-icon {
      color: var(--enhance-item-accent, #ffe17d);
      font-size: 19px;
      line-height: 30px;
    }

    .equipment-enhance-bag-icon.has-image {
      width: 34px;
      height: 34px;
      line-height: 1;
    }

    .equipment-enhance-bag-icon.has-image img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .equipment-enhance-bag-cell strong {
      max-width: 100%;
      overflow: hidden;
      color: #dfffcf;
      font-size: 9px;
      font-weight: 600;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .equipment-enhance-bag-cell > em {
      position: absolute;
      right: 3px;
      bottom: 2px;
      min-width: 15px;
      padding: 0 3px;
      border: 1px solid rgba(255, 212, 107, 0.38);
      background: rgba(0, 0, 0, 0.76);
      color: #ffe8a3;
      font-size: 8px;
      font-style: normal;
      line-height: 12px;
    }

    .bag-icon {
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(255, 214, 107, 0.34);
      background: rgba(3, 12, 18, 0.68);
      color: #ffe7a0;
      font-size: 18px;
      box-shadow: inset 0 0 9px rgba(255, 214, 107, 0.08);
    }

    .equipment-icon-shell {
      position: relative;
      display: block;
      overflow: visible;
    }

    .equipment-icon-shell img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .bag-icon.equipment-icon-shell {
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .bag-icon.item-icon-shell {
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .bag-icon.item-icon-shell img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .equipment-icon-shell.unidentified img,
    .equip-slot.unidentified .equipment-slot-icon {
      filter: grayscale(1) saturate(0.08) brightness(0.62) contrast(1.08);
      opacity: 0.74;
    }

    .equipment-unknown-badge {
      position: absolute;
      right: -2px;
      bottom: -2px;
      z-index: 3;
      width: 15px;
      height: 15px;
      display: grid;
      place-items: center;
      border: 0;
      border-radius: 2px;
      background: rgba(4, 10, 16, 0.94);
      color: #eef6ff;
      font-style: normal;
      font-size: 11px;
      font-weight: 700;
      line-height: 15px;
      box-shadow: 0 0 0 1px rgba(183, 247, 255, 0.42);
      pointer-events: none;
    }

    .bag-cell strong {
      max-width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      color: #dfffcf;
      font-size: 11px;
      font-weight: 600;
      line-height: 16px;
      text-align: center;
    }

    .bag-cell.empty {
      opacity: 0.58;
      background:
        linear-gradient(135deg, rgba(183, 247, 255, 0.05), transparent 45%),
        rgba(0, 0, 0, 0.24);
    }

    .bag-cell.empty::before {
      content: "";
      width: 38px;
      height: 38px;
      border: 1px dashed rgba(183, 247, 255, 0.22);
      box-shadow: inset 0 0 10px rgba(32, 216, 255, 0.04);
    }

    .bag-empty {
      min-height: 72px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(0, 0, 0, 0.22);
      color: var(--muted);
      font-size: 12px;
    }

    .planet-view {
      position: absolute;
      inset: 0;
      z-index: 12;
      display: none;
      overflow: hidden;
      background:
        linear-gradient(180deg, #07111e, #02050c 72%);
    }

    .planet-view.open {
      display: block;
    }

    .universe-view {
      position: fixed;
      left: 0;
      right: 0;
      top: 34px;
      bottom: var(--bottom-ui-safe-height);
      z-index: 24;
      display: none;
      overflow: hidden;
      color: #effcff;
      perspective: 1100px;
      background:
        radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.82), transparent 9%),
        radial-gradient(circle at 28% 22%, rgba(35, 94, 164, 0.16), transparent 28%),
        radial-gradient(circle at 78% 34%, rgba(31, 72, 148, 0.12), transparent 30%),
        radial-gradient(circle at 42% 82%, rgba(37, 22, 88, 0.16), transparent 34%),
        linear-gradient(180deg, #030816, #02040a 72%, #050816);
    }

    .universe-view.open {
      display: block;
    }

    .universe-view::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
        radial-gradient(circle at 82% 15%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
        radial-gradient(circle at 44% 28%, rgba(122, 174, 255, 0.55) 0 1px, transparent 2px),
        radial-gradient(circle at 73% 62%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
        radial-gradient(circle at 26% 78%, rgba(183, 247, 255, 0.5) 0 1px, transparent 2px),
        radial-gradient(circle at 61% 41%, rgba(255, 255, 255, 0.32) 0 1px, transparent 2px),
        radial-gradient(circle at 35% 66%, rgba(255, 255, 255, 0.28) 0 1px, transparent 2px);
      opacity: 0.82;
      pointer-events: none;
    }

    .universe-map-viewport {
      position: absolute;
      inset: 0;
      overflow: hidden;
      cursor: grab;
      touch-action: none;
      user-select: none;
    }

    .universe-flight-layer {
      position: absolute;
      inset: 0;
      overflow: hidden;
      z-index: 6;
      pointer-events: none;
    }

    [data-flight-tone] { --flight-color: #ffc487; }
    [data-flight-tone="cargo"] { --flight-color: #83f0fc; }
    [data-flight-tone="returning"] { --flight-color: #a7ecc0; }

    .universe-flight-line {
      position: absolute;
      top: 0;
      left: 0;
      margin-top: -1px;
      border-top: 2px dashed var(--flight-color);
      filter: drop-shadow(0 0 4px var(--flight-color));
      opacity: .93;
      transform-origin: left center;
    }

    .universe-flight-line::before,
    .universe-flight-line::after {
      position: absolute;
      top: -5px;
      width: 8px;
      height: 8px;
      content: "";
      border: solid var(--flight-color);
      border-width: 2px 2px 0 0;
      transform: rotate(45deg);
    }

    .universe-flight-line::before { left: 32%; }
    .universe-flight-line::after { left: 66%; }

    .universe-flight-marker {
      position: absolute;
      top: 0;
      left: 0;
      display: grid;
      justify-items: start;
      gap: 6px;
      padding: 0;
      color: var(--flight-color);
      background: transparent;
      border: 0;
      cursor: pointer;
      pointer-events: auto;
      text-align: left;
    }

    .universe-flight-marker[hidden],
    .universe-flight-panel[hidden] { display: none; }

    .universe-flight-marker .universe-flight-carrier {
      display: block;
      width: 68px;
      height: 68px;
      margin: -34px 0 0 -34px;
      overflow: visible;
    }

    .universe-flight-marker.selected .universe-flight-carrier,
    .universe-flight-marker:focus-visible .universe-flight-carrier {
      filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 8px currentColor);
    }

    .universe-flight-marker > .universe-flight-caption {
      display: grid;
      gap: 2px;
      min-width: 110px;
      max-width: 220px;
      padding: 4px 7px;
      border: 1px solid currentColor;
      background: rgba(0, 9, 19, .94);
      box-shadow: 0 2px 6px #0009;
      font-family: inherit;
      font-size: 11px;
      line-height: 1.25;
      transform: translateX(-12px);
    }

    .universe-flight-marker small {
      overflow: hidden;
      color: #d7eaf5;
      font-size: 11px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .universe-flight-marker.selected,
    .universe-flight-marker:focus-visible { z-index: 2; }

    .universe-flight-panel {
      position: absolute;
      z-index: 8;
      inset: 124px auto auto 18px;
      width: clamp(215px, 23vw, 320px);
      background: rgba(0, 9, 19, .95);
      border: 1px solid #416680;
      color: #edf8ff;
      box-shadow: 0 3px 16px #000a;
    }

    .universe-flight-panel h3 {
      margin: 0;
      padding: 8px 10px;
      border-bottom: 1px solid #416680;
      background: #102739;
      font-size: 13px;
    }

    .universe-flight-list {
      display: grid;
      gap: 5px;
      max-height: min(44vh, 420px);
      overflow: auto;
      padding: 6px;
    }

    .universe-flight-card {
      min-width: 0;
      padding: 6px 7px;
      border: 1px solid #294456;
      border-left: 2px solid var(--flight-color);
      background: #0c1b2a;
      font-size: 11px;
    }

    .universe-flight-card.selected { background: #173047; }

    .universe-flight-heading,
    .universe-flight-footer {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .universe-flight-heading { color: var(--flight-color); justify-content: space-between; }
    .universe-flight-card time, .universe-flight-marker time { font-variant-numeric: tabular-nums; }

    .universe-flight-destination,
    .universe-flight-footer span {
      overflow: hidden;
      margin: 4px 0;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .universe-flight-footer span { flex: 1; color: #b9d4e4; }

    .universe-flight-footer button {
      flex: none;
      padding: 2px 6px;
      border: 1px solid #42657d;
      border-radius: 0;
      background: #172e43;
      color: #def7ff;
      font: inherit;
      cursor: pointer;
    }

    .universe-flight-footer button:hover:not(:disabled) { border-color: #a4defa; }
    .universe-flight-footer button:disabled { opacity: .5; cursor: default; }

    .planet-console-lore {
      margin: 4px 0;
      color: #bcd6e4;
      font-size: 11px;
      line-height: 1.45;
    }

    .game-dialog {
      box-sizing: border-box;
      width: min(520px, calc(100vw - 36px));
      max-height: min(640px, calc(100dvh - 36px));
      padding: 0;
      border: 1px solid #5a91ac;
      background: #0b1c2a;
      color: #e1f5fe;
      box-shadow: 0 12px 48px #000c;
    }

    .game-dialog::backdrop { background: #020911aa; }
    .game-dialog.compact { width: min(300px, calc(100vw - 36px)); }
    .game-dialog.compact h2 {
      padding: 23px 14px 17px;
      border: 0;
      background: transparent;
      text-align: center;
      font-size: 17px;
    }
    .game-dialog.compact footer { justify-content: center; border: 0; padding-bottom: 17px; }

    .game-dialog form {
      display: flex;
      flex-direction: column;
      max-height: min(638px, calc(100dvh - 38px));
      margin: 0;
    }

    .game-dialog h2 {
      margin: 0;
      padding: 12px 16px;
      border-bottom: 1px solid #345d76;
      background: #152f43;
      color: #a5e8f3;
      font-size: 15px;
      overflow-wrap: anywhere;
    }

    .game-dialog-content {
      min-height: 0;
      padding: 13px 16px;
      overflow-y: auto;
    }

    .game-dialog-content p {
      margin: 0;
      line-height: 1.65;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .game-dialog input {
      box-sizing: border-box;
      width: 100%;
      margin-top: 10px;
      padding: 7px 8px;
      border: 1px solid #577f95;
      background: #061320;
      color: #e1f5fe;
      font: inherit;
    }

    .game-dialog footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 10px 16px;
      border-top: 1px solid #345d76;
    }

    .game-dialog button {
      min-width: 74px;
      padding: 5px 10px;
      border: 1px solid #527b94;
      background: #192d40;
      color: #e1f5fe;
      font: inherit;
      cursor: pointer;
    }

    .game-dialog [data-game-dialog-confirm] {
      border-color: #58a6bd;
      background: #1e4d60;
    }

    .game-dialog button:focus-visible, .game-dialog input:focus-visible {
      outline: 2px solid #8edce9;
      outline-offset: 2px;
    }

    .planet-training-march-layer {
      position: absolute;
      inset: 0;
      z-index: 340;
      pointer-events: none;
    }

    .planet-training-march-layer > canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }

    .planet-training-march-panel {
      top: 86px;
      right: 18px;
      left: auto;
      z-index: 370;
    }

    .planet-training-dialog ~ .planet-training-march-panel { z-index: 5; }

    .universe-title {
      position: absolute;
      left: 18px;
      top: 58px;
      z-index: 4;
      display: grid;
      gap: 3px;
      padding: 10px 12px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(2, 8, 16, 0.74);
      box-shadow: inset 0 0 18px rgba(32, 216, 255, 0.08);
    }

    .universe-title strong {
      color: #ffffff;
      font-size: 16px;
      line-height: 20px;
    }

    .universe-title span {
      color: var(--muted);
      font-size: 12px;
      line-height: 16px;
    }

    .universe-map {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 600%;
      height: 600%;
      transform:
        translate(calc(-50% + var(--universe-pan-x, 0px)), calc(-50% + var(--universe-pan-y, 0px)))
        scale(var(--universe-zoom, 1))
        perspective(1400px)
        rotateX(var(--universe-pitch, 58deg))
        rotateZ(var(--universe-spin, -7deg));
      transform-style: preserve-3d;
      transition: transform 0.22s ease-out;
    }

    .universe-map.focusing {
      transition: transform 0.72s cubic-bezier(0.16, 0.84, 0.28, 1);
    }

    .universe-map.edge-camera {
      transform:
        translate(calc(-50% + var(--universe-pan-x, 0px)), calc(-50% + var(--universe-pan-y, 0px)))
        scale(var(--universe-zoom, 1))
        perspective(1400px)
        rotateX(var(--universe-pitch, 58deg))
        rotateZ(var(--universe-spin, -7deg));
      perspective-origin: 50% 100%;
    }

    .universe-three-layer {
      position: absolute;
      inset: 0;
      z-index: 0;
      overflow: hidden;
      pointer-events: auto;
      background:
        radial-gradient(circle at 50% 45%, rgba(49, 105, 186, 0.16), transparent 44%),
        linear-gradient(180deg, rgba(1, 7, 22, 0.86), rgba(0, 2, 9, 0.96));
      cursor: grab;
    }

    .universe-three-layer:active {
      cursor: grabbing;
    }

    .universe-three-layer canvas {
      display: block;
      width: 100% !important;
      height: 100% !important;
    }

    .universe-three-hover-card {
      position: absolute;
      z-index: 8;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.12s ease;
    }

    .universe-three-hover-card.visible {
      opacity: 1;
      visibility: visible;
    }

    .universe-three-selected-panel {
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 7;
      width: clamp(290px, 24vw, 390px);
      height: clamp(290px, 24vw, 390px);
      transform: translate(-50%, -50%);
      pointer-events: none;
    }

    .universe-three-selected-panel.hidden {
      display: none;
    }

    .universe-three-hover-card.visible ~ .universe-three-selected-panel .universe-info-card {
      visibility: hidden;
    }

    .universe-three-selected-panel .universe-info-card {
      position: absolute;
      left: calc(100% + 28px);
      top: 50%;
      transform: translateY(-50%);
      max-height: min(76vh, 540px);
      overflow-y: auto;
      pointer-events: auto;
    }

    .universe-info-card {
      width: 326px;
      padding: 10px 12px;
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: rgba(0, 5, 13, 0.88);
      box-shadow: 0 0 16px rgba(32, 216, 255, 0.18), inset 0 0 12px rgba(183, 247, 255, 0.06);
      color: #effcff;
      text-align: left;
    }

    .universe-info-card.hover {
      width: 296px;
      background: rgba(0, 5, 13, 0.93);
    }

    .universe-info-card strong,
    .universe-info-card span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .universe-info-card strong {
      margin-bottom: 5px;
      color: #fff4bd;
      font-size: 14px;
      line-height: 18px;
    }

    .universe-info-card.hover strong {
      color: #fff6b0;
      font-size: 16px;
      line-height: 20px;
    }

    .universe-info-card span {
      color: #b7f7ff;
      font-size: 11px;
      line-height: 15px;
    }

    .universe-info-card .universe-environment {
      white-space: normal;
      overflow: visible;
      line-height: 1.5;
    }

    .universe-map.dragging {
      transition: none;
    }

    .universe-map.dragging,
    .universe-map.dragging .universe-disk {
      cursor: grabbing;
    }

    .universe-zoom-chip {
      position: absolute;
      right: 18px;
      top: 58px;
      z-index: 5;
      padding: 6px 10px;
      border: 1px solid rgba(183, 247, 255, 0.22);
      background: rgba(2, 8, 16, 0.74);
      color: #b7f7ff;
      font-size: 12px;
      line-height: 14px;
      pointer-events: none;
      box-shadow: inset 0 0 14px rgba(32, 216, 255, 0.08);
    }

    .universe-disk {
      position: absolute;
      inset: 0;
      z-index: 1;
      transform-style: preserve-3d;
      border-radius: 42% 42% 48% 48%;
      background:
        radial-gradient(ellipse at 50% 24%, rgba(255, 222, 120, 0.08), transparent 7%),
        radial-gradient(ellipse at 50% 53%, rgba(71, 191, 255, 0.09), transparent 48%),
        radial-gradient(ellipse at 50% 82%, rgba(181, 108, 255, 0.06), transparent 52%),
        linear-gradient(180deg, transparent, rgba(183, 247, 255, 0.035) 42%, rgba(255, 255, 255, 0.02) 100%);
      box-shadow: inset 0 0 90px rgba(103, 216, 255, 0.06);
    }

    .universe-map.edge-camera .universe-disk {
      transform: none;
      background:
        radial-gradient(circle at 18% 24%, rgba(82, 171, 255, 0.12), transparent 1px),
        radial-gradient(circle at 66% 34%, rgba(255, 255, 255, 0.16), transparent 1px),
        radial-gradient(circle at 34% 72%, rgba(183, 247, 255, 0.14), transparent 1px),
        radial-gradient(circle at 82% 64%, rgba(255, 255, 255, 0.11), transparent 1px),
        radial-gradient(ellipse at 50% 50%, rgba(44, 120, 215, 0.08), transparent 54%),
        linear-gradient(180deg, rgba(0, 8, 24, 0.92), rgba(0, 3, 12, 0.98));
      background-size: 180px 160px, 260px 190px, 220px 210px, 300px 240px, auto, auto;
    }

    .universe-disk::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 72%;
      height: 82%;
      transform: translate(-50%, -50%) translateZ(-48px);
      border-radius: 45%;
      background: radial-gradient(ellipse at 50% 70%, rgba(32, 216, 255, 0.08), transparent 70%);
      filter: blur(10px);
      pointer-events: none;
    }

    .universe-nebula-arm,
    .universe-faction-wash {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 68%;
      height: 52%;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      filter: blur(14px);
      opacity: 0.2;
      pointer-events: none;
    }

    .universe-nebula-arm.arm-a {
      background: linear-gradient(90deg, transparent, rgba(70, 165, 255, 0.24), rgba(255, 255, 255, 0.16), transparent);
      transform: translate(-50%, -50%) rotate(18deg);
    }

    .universe-nebula-arm.arm-b {
      background: linear-gradient(90deg, transparent, rgba(181, 108, 255, 0.22), rgba(255, 210, 128, 0.14), transparent);
      transform: translate(-50%, -50%) rotate(138deg);
    }

    .universe-nebula-arm.arm-c {
      width: 78%;
      height: 24%;
      background: linear-gradient(90deg, transparent, rgba(106, 255, 202, 0.14), rgba(183, 247, 255, 0.12), transparent);
      transform: translate(-50%, -50%) rotate(258deg);
    }

    .universe-faction-wash {
      width: 92%;
      height: 92%;
      border-radius: 50%;
      opacity: 0.08;
      filter: blur(8px);
      mix-blend-mode: screen;
    }

    .universe-faction-wash.terran {
      background: conic-gradient(from 200deg, transparent 0 40%, rgba(255, 107, 91, 0.8) 42% 55%, transparent 58% 100%);
    }

    .universe-faction-wash.zerg {
      background: conic-gradient(from -30deg, transparent 0 40%, rgba(181, 108, 255, 0.8) 42% 55%, transparent 58% 100%);
    }

    .universe-faction-wash.protoss {
      background: conic-gradient(from 90deg, transparent 0 40%, rgba(103, 216, 255, 0.8) 42% 55%, transparent 58% 100%);
    }

    .universe-ring {
      position: absolute;
      left: 50%;
      top: 50%;
      width: var(--ring);
      height: var(--ring);
      border: 1px solid rgba(183, 247, 255, 0.07);
      border-radius: 50%;
      transform: translate(-50%, -50%);
      box-shadow: inset 0 0 20px rgba(32, 216, 255, 0.02), 0 0 20px rgba(32, 216, 255, 0.02);
      pointer-events: none;
    }

    .universe-ring.faction {
      border-color: rgba(255, 255, 255, 0.12);
      box-shadow: 0 0 22px rgba(255, 255, 255, 0.04);
    }

    .universe-map.edge-camera .universe-ring {
      left: var(--ring-x, 50%);
      top: var(--ring-y, 50%);
      width: var(--ring-w, var(--ring));
      height: var(--ring-h, var(--ring));
      transform: translate(-50%, -50%);
      border-color: rgba(183, 247, 255, 0.12);
      transition:
        left 0.42s cubic-bezier(0.16, 0.84, 0.28, 1),
        top 0.42s cubic-bezier(0.16, 0.84, 0.28, 1),
        width 0.42s cubic-bezier(0.16, 0.84, 0.28, 1),
        height 0.42s cubic-bezier(0.16, 0.84, 0.28, 1);
      box-shadow:
        inset 0 0 18px rgba(32, 216, 255, 0.026),
        0 0 20px rgba(32, 216, 255, 0.035);
      opacity: 0.08;
    }

    .universe-map.edge-camera .universe-ring.faction {
      border-color: rgba(255, 255, 255, 0.18);
      box-shadow: 0 0 28px rgba(255, 255, 255, 0.045);
    }

    .universe-hyperlanes {
      position: absolute;
      inset: 0;
      overflow: visible;
      opacity: 0.08;
      pointer-events: none;
    }

    .universe-hyperlanes line {
      stroke: rgba(115, 206, 255, 0.26);
      stroke-width: 0.09;
      vector-effect: non-scaling-stroke;
      filter: drop-shadow(0 0 2px rgba(83, 194, 255, 0.4));
    }

    .universe-hyperlanes line.radial {
      stroke: rgba(218, 235, 255, 0.16);
      stroke-dasharray: 0.8 0.65;
    }

    .universe-ring span {
      position: absolute;
      left: 50%;
      top: -9px;
      transform: translateX(-50%);
      padding: 1px 6px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(2, 8, 16, 0.78);
      color: #b7f7ff;
      font-size: 10px;
      white-space: nowrap;
      transform: translateX(-50%) rotateZ(var(--universe-counter-spin, 7deg)) rotateX(var(--universe-counter-tilt, -58deg));
    }

    .universe-sector-arcs {
      position: absolute;
      inset: 0;
      overflow: visible;
      opacity: 0.14;
      pointer-events: none;
    }

    .universe-sector-arcs circle {
      fill: none;
      stroke: rgba(183, 247, 255, 0.18);
      stroke-width: 0.18;
      vector-effect: non-scaling-stroke;
    }

    .universe-core {
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 2;
      width: 64px;
      height: 64px;
      display: grid;
      place-items: center;
      transform: translate(-50%, -50%) translateZ(80px) rotateZ(var(--universe-counter-spin, 7deg)) rotateX(var(--universe-counter-tilt, -58deg));
      border: 1px solid rgba(113, 172, 255, 0.55);
      border-radius: 50%;
      background:
        radial-gradient(circle at 50% 50%, #000 0 28%, rgba(0, 0, 0, 0.92) 30% 42%, transparent 44%),
        conic-gradient(from 40deg, rgba(255, 224, 137, 0.1), rgba(84, 174, 255, 0.92), rgba(181, 108, 255, 0.78), rgba(255, 224, 137, 0.1));
      color: #dff8ff;
      font-weight: 800;
      box-shadow:
        0 0 24px rgba(103, 216, 255, 0.48),
        0 0 56px rgba(181, 108, 255, 0.28),
        inset 0 0 16px #000;
      animation: universeBlackHoleSpin 12s linear infinite;
    }

    .universe-map.edge-camera .universe-core {
      left: 50%;
      top: 50%;
      width: 132px;
      height: 132px;
      transform:
        translate(-50%, -50%)
        translateZ(42px)
        scale(0.86);
      opacity: 0.92;
      filter: saturate(0.9);
      display: none;
    }

    .universe-core i {
      position: absolute;
      inset: 18px;
      border-radius: 50%;
      background: #000;
      box-shadow: inset 0 0 8px #000, 0 0 22px rgba(0, 0, 0, 0.92);
    }

    .universe-core span {
      position: absolute;
      top: calc(100% + 4px);
      left: 50%;
      transform: translateX(-50%);
      color: rgba(223, 248, 255, 0.82);
      font-size: 10px;
      line-height: 12px;
      text-shadow: 0 1px 3px #000;
      white-space: nowrap;
    }

    @keyframes universeBlackHoleSpin {
      from {
        filter: hue-rotate(0deg);
      }
      to {
        filter: hue-rotate(360deg);
      }
    }

    .universe-sector-label {
      position: absolute;
      left: var(--x);
      top: var(--y);
      z-index: 3;
      min-width: 118px;
      transform: translate(-50%, -50%) translateZ(56px);
      padding: 6px 8px;
      border: 1px solid color-mix(in srgb, var(--sector-color), white 20%);
      background: rgba(0, 0, 0, 0.45);
      box-shadow: 0 0 16px color-mix(in srgb, var(--sector-color), transparent 52%);
      text-align: center;
      pointer-events: none;
    }

    .universe-sector-label strong,
    .universe-sector-label span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .universe-sector-label strong {
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
    }

    .universe-sector-label span {
      color: var(--muted);
      font-size: 10px;
      line-height: 13px;
    }

    .universe-node {
      position: absolute;
      left: var(--x);
      top: var(--y);
      z-index: var(--node-z, 5);
      --ring-color: rgba(103, 216, 255, 0.78);
      --ring-soft: rgba(103, 216, 255, 0.2);
      --planet-hi: #ffffff;
      --planet-mid: #61d7ff;
      --planet-low: rgba(16, 86, 122, 0.9);
      --planet-dark: rgba(1, 9, 24, 0.96);
      --planet-glow: rgba(103, 216, 255, 0.58);
      --planet-sprite: none;
      --node-focus-scale: 1;
      width: 132px;
      height: 132px;
      display: grid;
      place-items: center;
      appearance: none;
      -webkit-appearance: none;
      padding: 0;
      transform:
        translate(-50%, -50%)
        translateZ(calc(46px + var(--depth, 0) * 1.6px))
        scale(var(--node-focus-scale));
      border: 3px solid var(--ring-color);
      border-radius: 50%;
      background: transparent;
      color: #dff8ff;
      cursor: pointer;
      outline: none;
      overflow: visible;
      clip-path: circle(50% at 50% 50%);
      box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ring-color), white 18%),
        0 0 18px var(--ring-soft),
        0 0 46px color-mix(in srgb, var(--ring-color), transparent 74%);
      pointer-events: auto;
      contain: layout paint;
      will-change: transform, opacity, filter;
      transition:
        left 0.42s cubic-bezier(0.16, 0.84, 0.28, 1),
        top 0.42s cubic-bezier(0.16, 0.84, 0.28, 1),
        transform 0.24s cubic-bezier(0.16, 0.84, 0.28, 1),
        opacity 0.22s ease,
        box-shadow 0.32s ease,
        filter 0.32s ease;
    }

    .universe-node:focus,
    .universe-node:focus-visible {
      outline: none;
    }

    .universe-map.edge-camera .universe-node {
      width: var(--node-size, 78px);
      height: var(--node-size, 78px);
      transform:
        translate(-50%, -50%)
        translateZ(calc(-18px + var(--edge-depth, 0) * 0.88px))
        scale(var(--near-scale, 1))
        scale(var(--node-focus-scale));
      opacity: var(--depth-opacity, 1);
      box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ring-color), white 20%),
        0 0 calc(8px + var(--edge-depth, 0) * 0.22px) var(--ring-soft),
        0 0 calc(18px + var(--edge-depth, 0) * 0.52px) color-mix(in srgb, var(--ring-color), transparent 80%);
    }

    .universe-map.edge-camera .universe-node::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: -1;
      width: 136%;
      height: 38%;
      transform: translate(-50%, -50%);
      border-radius: 50%;
      background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--ring-color), white 22%) 0 18%, var(--ring-soft) 40%, transparent 72%);
      filter: blur(5px);
      opacity: calc(0.18 + var(--depth-opacity, 1) * 0.28);
      pointer-events: none;
    }

    .universe-node i {
      position: relative;
      display: block;
      width: calc(100% - 10px);
      height: calc(100% - 10px);
      overflow: hidden;
      border-radius: 50%;
      clip-path: circle(50% at 50% 50%);
      background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.98) 0 6%, rgba(255, 255, 255, 0.58) 7% 11%, transparent 18%),
        radial-gradient(circle at 44% 38%, var(--planet-hi) 0 7%, var(--planet-mid) 25%, var(--planet-low) 58%, var(--planet-dark) 100%),
        var(--planet-sprite) !important;
      background-position: center;
      background-size: cover, cover, 100% 100%;
      background-repeat: no-repeat;
      box-shadow:
        inset -16px -18px 26px rgba(0, 0, 0, 0.62),
        inset 10px 9px 18px rgba(255, 255, 255, 0.22),
        0 0 14px var(--planet-glow),
        0 0 34px color-mix(in srgb, var(--planet-glow), transparent 20%);
      transform: rotate(-18deg);
    }

    .universe-node i::before,
    .universe-node i::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 50%;
      pointer-events: none;
    }

    .universe-node i::before {
      background:
        linear-gradient(128deg, transparent 0 28%, rgba(255, 255, 255, 0.13) 29% 32%, transparent 34% 100%),
        linear-gradient(18deg, transparent 0 43%, rgba(255, 255, 255, 0.1) 44% 47%, transparent 49% 100%),
        radial-gradient(ellipse at 66% 62%, rgba(255, 255, 255, 0.11) 0 10%, transparent 24%);
      mix-blend-mode: screen;
      opacity: 0.82;
    }

    .universe-node[class*="planet-sprite-"] i::before {
      opacity: 0.08;
    }

    .universe-node i::after {
      background:
        radial-gradient(circle at 32% 28%, transparent 0 38%, rgba(0, 0, 0, 0.12) 52%, rgba(0, 0, 0, 0.56) 100%),
        linear-gradient(130deg, rgba(255, 255, 255, 0.18), transparent 34%, rgba(0, 0, 0, 0.5) 100%);
      box-shadow: inset -5px -7px 10px rgba(0, 0, 0, 0.35);
    }

    .universe-node[class*="planet-sprite-"] i::after {
      background:
        radial-gradient(circle at 30% 24%, transparent 0 52%, rgba(0, 0, 0, 0.04) 68%, rgba(0, 0, 0, 0.18) 100%),
        linear-gradient(130deg, rgba(255, 255, 255, 0.05), transparent 44%, rgba(0, 0, 0, 0.12) 100%);
    }

    .universe-node[class*="planet-sprite-"] i {
      background: rgba(0, 0, 0, 0.08) !important;
      background-position: center;
      background-size: cover, 100% 100%;
      background-repeat: no-repeat;
    }

    .universe-planet-art {
      position: absolute;
      inset: 0;
      z-index: 1;
      display: block;
      width: 100% !important;
      height: 100% !important;
      max-width: none !important;
      max-height: none !important;
      object-fit: contain !important;
      border-radius: 50%;
      clip-path: circle(49.5% at 50% 50%);
      pointer-events: none;
      transform: scale(1.16);
      transform-origin: center;
    }

    .universe-node.selected .universe-planet-art {
      transform: scale(1.2);
    }

    .universe-node[class*="planet-sprite-"] i::before,
    .universe-node[class*="planet-sprite-"] i::after {
      z-index: 2;
    }

    .universe-map.edge-camera .universe-node i {
      transform: rotate(-18deg) scaleY(0.95);
      box-shadow:
        inset -10px -12px 18px rgba(0, 0, 0, 0.42),
        inset 8px 7px 12px rgba(255, 255, 255, 0.14),
        0 0 12px color-mix(in srgb, var(--planet-glow), white 22%),
        0 0 34px color-mix(in srgb, var(--planet-glow), transparent 20%);
    }

    .universe-node span {
      position: absolute;
      top: calc(100% + 4px);
      left: 50%;
      transform: translateX(-50%);
      color: #9fd8e7;
      font-size: 10px;
      line-height: 12px;
      text-shadow: 0 1px 2px #000;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.12s ease;
    }

    .universe-node:hover span,
    .universe-node.selected span {
      opacity: 1;
    }

    .universe-node .universe-hover-card {
      position: absolute;
      left: calc(100% + 18px);
      top: 50%;
      z-index: 220;
      display: grid;
      gap: 3px;
      width: 296px;
      padding: 10px 12px;
      transform: translateY(-50%);
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: rgba(0, 5, 13, 0.92);
      box-shadow: 0 0 16px rgba(32, 216, 255, 0.2), inset 0 0 12px rgba(183, 247, 255, 0.06);
      color: #effcff;
      text-align: left;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      white-space: normal;
    }

    .universe-node:hover .universe-hover-card,
    .universe-node.hover-active .universe-hover-card {
      opacity: 1;
      visibility: visible;
    }

    .universe-node.selected .universe-hover-card {
      display: none;
    }

    .universe-node .universe-hover-card strong,
    .universe-node .universe-hover-card small {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .universe-node .universe-hover-card strong {
      color: #fff6b0;
      font-size: 16px;
      line-height: 20px;
    }

    .universe-node .universe-hover-card small {
      color: #b7f7ff;
      font-size: 12px;
      line-height: 15px;
    }

    .universe-node .universe-hover-card .universe-resource-slots {
      position: static;
      left: auto;
      top: auto;
      transform: none;
      opacity: 1;
      visibility: visible;
      pointer-events: none;
    }

    .universe-node.terran {
      --ring-color: #ff3e36;
      --ring-soft: rgba(255, 62, 54, 0.28);
      --planet-hi: #fff7e8;
      --planet-mid: #ff6b5b;
      --planet-low: rgba(141, 35, 29, 0.92);
      --planet-dark: rgba(38, 5, 9, 0.98);
      --planet-glow: rgba(255, 107, 91, 0.68);
    }

    .universe-node.zerg {
      --ring-color: #b56cff;
      --ring-soft: rgba(181, 108, 255, 0.28);
      --planet-hi: #f7eaff;
      --planet-mid: #b56cff;
      --planet-low: rgba(74, 22, 120, 0.9);
      --planet-dark: rgba(19, 5, 32, 0.98);
      --planet-glow: rgba(181, 108, 255, 0.68);
    }

    .universe-node.protoss {
      --ring-color: #3ba6ff;
      --ring-soft: rgba(59, 166, 255, 0.28);
      --planet-hi: #effdff;
      --planet-mid: #67d8ff;
      --planet-low: rgba(21, 92, 146, 0.92);
      --planet-dark: rgba(3, 14, 34, 0.98);
      --planet-glow: rgba(103, 216, 255, 0.68);
    }

    .universe-node.neutral {
      --ring-color: #4dff86;
      --ring-soft: rgba(77, 255, 134, 0.24);
      --planet-hi: #fff9df;
      --planet-mid: #ffe38a;
      --planet-low: rgba(123, 95, 34, 0.9);
      --planet-dark: rgba(31, 22, 7, 0.98);
      --planet-glow: rgba(255, 227, 138, 0.66);
    }

    .universe-node.row-i {
      --ring-color: #4dff86;
      --ring-soft: rgba(77, 255, 134, 0.25);
      --planet-glow: rgba(77, 255, 134, 0.72);
    }

    .universe-node.row-h {
      --ring-color: #36d7ff;
      --ring-soft: rgba(54, 215, 255, 0.23);
      --planet-glow: rgba(54, 215, 255, 0.68);
    }

    .universe-node.row-g {
      --ring-color: #3478ff;
      --ring-soft: rgba(52, 120, 255, 0.23);
      --planet-glow: rgba(52, 120, 255, 0.64);
    }

    .universe-node.row-f {
      --ring-color: #7a4dff;
      --ring-soft: rgba(122, 77, 255, 0.22);
      --planet-glow: rgba(122, 77, 255, 0.6);
    }

    .universe-node.row-e {
      --ring-color: #8c2fb8;
      --ring-soft: rgba(140, 47, 184, 0.22);
      --planet-glow: rgba(140, 47, 184, 0.56);
    }

    .universe-node.row-d {
      --ring-color: #321044;
      --ring-soft: rgba(50, 16, 68, 0.3);
      --planet-glow: rgba(50, 16, 68, 0.62);
    }

    .universe-node.fortress {
      box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ring-color), white 20%),
        0 0 0 3px rgba(255, 78, 68, 0.12),
        0 0 42px color-mix(in srgb, var(--ring-color), transparent 58%);
    }

    .universe-node.fortress {
      --planet-hi: #ffe7df;
      --planet-mid: #ff4e44;
      --planet-low: rgba(120, 12, 20, 0.95);
      --planet-dark: rgba(37, 2, 8, 0.98);
      --planet-glow: rgba(255, 78, 68, 0.78);
    }

    .universe-node.resource {
      box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ring-color), white 20%),
        0 0 0 3px rgba(93, 255, 153, 0.12),
        0 0 42px color-mix(in srgb, var(--ring-color), transparent 58%);
    }

    .universe-node.resource {
      --planet-hi: #edfff0;
      --planet-mid: #5dff99;
      --planet-low: rgba(18, 112, 62, 0.92);
      --planet-dark: rgba(3, 31, 15, 0.98);
      --planet-glow: rgba(93, 255, 153, 0.76);
    }

    .universe-node.wild {
      border-color: var(--ring-color);
    }

    .universe-node.home-sector {
      border-color: var(--ring-color);
      box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ring-color), white 26%),
        0 0 0 4px color-mix(in srgb, var(--ring-color), transparent 82%),
        0 0 58px color-mix(in srgb, var(--ring-color), transparent 48%);
    }

    .universe-node.home-sector {
      --planet-hi: #ffffff;
      --planet-mid: #91e7ff;
      --planet-low: rgba(38, 94, 178, 0.94);
      --planet-dark: rgba(5, 17, 48, 0.98);
      --planet-glow: rgba(183, 247, 255, 0.86);
    }

    .universe-node.row-i,
    .universe-node.row-i.resource,
    .universe-node.row-i.fortress {
      --ring-color: #4dff86;
      --ring-soft: rgba(77, 255, 134, 0.25);
      --planet-glow: rgba(77, 255, 134, 0.72);
    }

    .universe-node.row-h,
    .universe-node.row-h.resource,
    .universe-node.row-h.fortress {
      --ring-color: #36d7ff;
      --ring-soft: rgba(54, 215, 255, 0.23);
      --planet-glow: rgba(54, 215, 255, 0.68);
    }

    .universe-node.row-g,
    .universe-node.row-g.resource,
    .universe-node.row-g.fortress {
      --ring-color: #3478ff;
      --ring-soft: rgba(52, 120, 255, 0.23);
      --planet-glow: rgba(52, 120, 255, 0.64);
    }

    .universe-node.row-f,
    .universe-node.row-f.resource,
    .universe-node.row-f.fortress {
      --ring-color: #7a4dff;
      --ring-soft: rgba(122, 77, 255, 0.22);
      --planet-glow: rgba(122, 77, 255, 0.6);
    }

    .universe-node.row-e,
    .universe-node.row-e.resource,
    .universe-node.row-e.fortress {
      --ring-color: #8c2fb8;
      --ring-soft: rgba(140, 47, 184, 0.22);
      --planet-glow: rgba(140, 47, 184, 0.56);
    }

    .universe-node.row-d,
    .universe-node.row-d.resource,
    .universe-node.row-d.fortress {
      --ring-color: #321044;
      --ring-soft: rgba(50, 16, 68, 0.3);
      --planet-glow: rgba(50, 16, 68, 0.62);
    }

    .universe-node.planet-sprite-fortress {
      --planet-sprite: url("assets/planets/planet-01-fortress-red.png");
    }

    .universe-node.planet-sprite-home-blue {
      --planet-sprite: url("assets/planets/planet-02-home-blue.png");
    }

    .universe-node.planet-sprite-hive-purple {
      --planet-sprite: url("assets/planets/planet-03-hive-purple.png");
    }

    .universe-node.planet-sprite-gate-cyan {
      --planet-sprite: url("assets/planets/planet-04-gate-cyan.png");
    }

    .universe-node.planet-sprite-resource {
      --planet-sprite: url("assets/planets/planet-05-resource-green.png");
    }

    .universe-node.planet-sprite-desert {
      --planet-sprite: url("assets/planets/planet-06-desert-gold.png");
    }

    .universe-node.planet-sprite-ice {
      --planet-sprite: url("assets/planets/planet-07-ice-white.png");
    }

    .universe-node.planet-sprite-lava {
      --planet-sprite: url("assets/planets/planet-08-lava-volcanic.png");
    }

    .universe-node.planet-sprite-barren {
      --planet-sprite: url("assets/planets/planet-09-barren-asteroid.png");
    }

    .universe-node.planet-sprite-metal {
      --planet-sprite: url("assets/planets/planet-10-metal-mineral.png");
    }

    .universe-node.planet-sprite-ocean {
      --planet-sprite: url("assets/planets/planet-11-ocean-blue.png");
    }

    .universe-node.planet-sprite-core {
      --planet-sprite: url("assets/planets/planet-12-core-blackhole.png");
    }

    .universe-node.selected {
      --node-focus-scale: 1;
      width: var(--node-size, 132px);
      height: var(--node-size, 132px);
      z-index: 130;
      border-color: var(--ring-color);
      box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.18),
        0 0 0 5px color-mix(in srgb, var(--ring-color), transparent 78%),
        0 0 30px color-mix(in srgb, var(--ring-color), white 18%);
    }

    .universe-node.locked:not(.selected) {
      filter: grayscale(0.78) brightness(0.62);
      opacity: 0.72;
    }

    .universe-map.edge-camera .universe-node.selected {
      width: var(--node-size, 132px);
      height: var(--node-size, 132px);
      opacity: 1;
      filter: saturate(1.12) brightness(1.08);
      box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.16),
        0 0 0 7px color-mix(in srgb, var(--ring-color), transparent 80%),
        0 0 38px color-mix(in srgb, var(--ring-color), white 12%),
        0 0 84px color-mix(in srgb, var(--ring-color), transparent 62%);
    }

    .universe-selected-overlay {
      position: absolute;
      left: var(--x);
      top: var(--y);
      z-index: 140;
      width: clamp(290px, 24vw, 390px);
      height: clamp(290px, 24vw, 390px);
      transform:
        translate(-50%, -50%)
        translateZ(calc(230px + var(--depth, 0) * 1.6px))
        rotateZ(var(--universe-counter-spin, 7deg))
        rotateX(var(--universe-counter-tilt, -58deg));
      pointer-events: none;
      animation: universeFocusIn 0.42s cubic-bezier(0.16, 0.84, 0.28, 1);
    }

    .universe-map.edge-camera .universe-selected-overlay {
      width: calc(clamp(290px, 24vw, 390px) + var(--edge-depth, 0) * 0.45px);
      height: calc(clamp(290px, 24vw, 390px) + var(--edge-depth, 0) * 0.45px);
      transform:
        translate(-50%, -50%)
        translateZ(calc(56px + var(--edge-depth, 0) * 0.9px));
    }

    .select-arrow {
      position: absolute;
      width: 0;
      height: 0;
      filter: drop-shadow(0 0 7px rgba(31, 255, 66, 0.95));
      animation: universeSelectPulse 1.2s ease-in-out infinite;
    }

    .select-arrow.top {
      left: 50%;
      top: 0;
      transform: translateX(-50%);
      border-left: 13px solid transparent;
      border-right: 13px solid transparent;
      border-bottom: 21px solid #23ff39;
    }

    .select-arrow.right {
      right: 0;
      top: 50%;
      transform: translateY(-50%);
      border-top: 13px solid transparent;
      border-bottom: 13px solid transparent;
      border-left: 21px solid #23ff39;
    }

    .select-arrow.bottom {
      left: 50%;
      bottom: 0;
      transform: translateX(-50%);
      border-left: 13px solid transparent;
      border-right: 13px solid transparent;
      border-top: 21px solid #23ff39;
    }

    .select-arrow.left {
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      border-top: 13px solid transparent;
      border-bottom: 13px solid transparent;
      border-right: 21px solid #23ff39;
    }

    @keyframes universeSelectPulse {
      0%, 100% {
        opacity: 0.72;
      }
      50% {
        opacity: 1;
      }
    }

    @keyframes universeFocusIn {
      from {
        opacity: 0;
        transform:
          translate(-50%, -50%)
          translateZ(calc(72px + var(--edge-depth, 0) * 0.8px))
          scale(0.78);
      }
      to {
        opacity: 1;
      }
    }

    .universe-selected-card {
      position: absolute;
      left: calc(100% + 28px);
      top: 50%;
      width: 326px;
      transform: translateY(-50%);
      padding: 10px 12px;
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: rgba(0, 5, 13, 0.88);
      box-shadow: 0 0 16px rgba(32, 216, 255, 0.18), inset 0 0 12px rgba(183, 247, 255, 0.06);
      color: #effcff;
      text-align: left;
    }

    .universe-selected-card strong,
    .universe-selected-card span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .universe-selected-card strong {
      margin-bottom: 5px;
      color: #fff4bd;
      font-size: 14px;
      line-height: 18px;
    }

    .universe-selected-card span {
      color: #b7f7ff;
      font-size: 11px;
      line-height: 15px;
    }

    .universe-resource-slots {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 6px;
      margin-top: 8px;
    }

    .universe-resource-slots em {
      display: grid;
      place-items: center;
      min-width: 0;
      min-height: 38px;
      padding: 6px 4px;
      border: 1px solid rgba(183, 247, 255, 0.26);
      background:
        linear-gradient(180deg, rgba(32, 216, 255, 0.08), rgba(0, 0, 0, 0.38)),
        rgba(3, 12, 22, 0.78);
      box-shadow: inset 0 0 10px rgba(32, 216, 255, 0.08);
      color: #dfffcf;
      font-style: normal;
      text-align: center;
    }

    .universe-resource-slots img {
      width: 26px;
      height: 26px;
      object-fit: contain;
      filter: drop-shadow(0 0 6px rgba(103, 216, 255, 0.42));
      pointer-events: none;
    }

    .universe-resource-slots b,
    .universe-resource-slots i {
      display: block;
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-style: normal;
    }

    .universe-resource-slots b {
      color: #fff4bd;
      font-size: 10px;
      line-height: 14px;
    }

    .universe-resource-slots i {
      color: #9fefff;
      font-size: 9px;
      line-height: 13px;
    }

    .universe-detail {
      position: absolute;
      right: 18px;
      top: 82px;
      z-index: 6;
      width: 296px;
      max-height: calc(100% - 160px);
      overflow: auto;
      padding: 12px;
      border: 1px solid rgba(183, 247, 255, 0.26);
      background: linear-gradient(180deg, rgba(8, 22, 36, 0.94), rgba(2, 7, 13, 0.97));
      box-shadow: 0 0 24px rgba(32, 216, 255, 0.14), inset 0 0 18px rgba(183, 247, 255, 0.04);
    }

    .universe-detail-head {
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }

    .universe-detail-icon {
      height: 46px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(183, 247, 255, 0.28);
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.3);
      color: #ffe38a;
      font-weight: 800;
    }

    .universe-detail-head strong,
    .universe-detail-head span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .universe-detail-head strong {
      color: #ffffff;
      font-size: 15px;
      line-height: 19px;
    }

    .universe-detail-head span,
    .universe-detail p {
      color: var(--muted);
      font-size: 11px;
      line-height: 15px;
    }

    .universe-detail-grid {
      display: grid;
      gap: 6px;
    }

    .universe-detail-grid div {
      display: grid;
      grid-template-columns: 64px minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      min-height: 27px;
      padding: 6px 8px;
      border: 1px solid rgba(183, 247, 255, 0.13);
      background: rgba(0, 0, 0, 0.2);
      font-size: 12px;
    }

    .universe-detail-grid span {
      color: var(--muted);
    }

    .universe-detail-grid strong {
      color: #effcff;
      text-align: right;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .universe-actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 7px;
      margin-top: 10px;
    }

    .universe-actions button {
      height: 30px;
      border: 1px solid rgba(183, 247, 255, 0.25);
      background: linear-gradient(180deg, rgba(22, 64, 92, 0.76), rgba(4, 13, 24, 0.88));
      color: #effcff;
      cursor: pointer;
      font-size: 12px;
    }

    .universe-actions button:disabled {
      cursor: default;
      opacity: 0.42;
    }

    .universe-legend {
      position: absolute;
      left: 18px;
      bottom: 20px;
      z-index: 4;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      max-width: 430px;
      padding: 8px 10px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(2, 8, 16, 0.68);
    }

    .universe-legend span {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: var(--muted);
      font-size: 11px;
      line-height: 14px;
    }

    .universe-legend i {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: #ffe38a;
      box-shadow: 0 0 10px currentColor;
    }

    .universe-legend i.terran {
      background: #ff6b5b;
    }

    .universe-legend i.zerg {
      background: #b56cff;
    }

    .universe-legend i.protoss {
      background: #67d8ff;
    }

    .universe-legend i.neutral {
      background: #ffe38a;
    }

    .planet-map-surface {
      position: absolute;
      inset: -25%;
      transform: translate(var(--planet-pan-x, 0px), var(--planet-pan-y, 0px)) scale(var(--planet-zoom, 1));
      transform-origin: var(--planet-zoom-x, 50%) var(--planet-zoom-y, 50%);
      transition: transform 0.08s ease-out;
      cursor: grab;
      touch-action: none;
      user-select: none;
      background:
        linear-gradient(180deg, rgba(18, 40, 52, 0.04), rgba(2, 10, 16, 0.12)),
        radial-gradient(circle at 50% 50%, rgba(98, 240, 210, 0.08), transparent 22%),
        url("../game_design/art_reference/generated_ui/planet/planet_empty_plain_large_v3.png") center / cover no-repeat,
        linear-gradient(180deg, #243845, #0e1822 72%);
    }

    .planet-map-surface.faction-terran {
      background:
        linear-gradient(180deg, rgba(24, 35, 22, 0.02), rgba(7, 13, 10, 0.1)),
        url("assets/planet/backgrounds/homeworld/terran-homeworld-surface-v7-edge-landscape-3840x2160.png?v=homeworld-terran-edge-landscape-v7") center / cover no-repeat,
        #7b873d;
    }

    .planet-map-surface.faction-zerg {
      background:
        linear-gradient(180deg, rgba(24, 35, 22, 0.02), rgba(7, 13, 10, 0.1)),
        url("assets/planet/backgrounds/homeworld/terran-homeworld-surface-v7-edge-landscape-3840x2160.png?v=homeworld-terran-edge-landscape-v7") center / cover no-repeat,
        #7b873d;
    }

    .planet-map-surface.faction-protoss {
      background:
        linear-gradient(180deg, rgba(24, 35, 22, 0.02), rgba(7, 13, 10, 0.1)),
        url("assets/planet/backgrounds/homeworld/terran-homeworld-surface-v7-edge-landscape-3840x2160.png?v=homeworld-terran-edge-landscape-v7") center / cover no-repeat,
        #7b873d;
    }

    .planet-map-surface.planet-row-i {
      --planet-node-scale: 0.45;
      inset: -9%;
      background:
        linear-gradient(180deg, rgba(255, 244, 205, 0.02), rgba(255, 255, 255, 0.04)),
        var(--planet-surface-bg, url("assets/planet/backgrounds/i_planets/planet-i-large-native-stitched-v1.png")) center / cover no-repeat;
    }

    .planet-map-surface.planet-row-h {
      --planet-node-scale: 0.45;
      inset: -9%;
      background:
        linear-gradient(180deg, rgba(80, 52, 9, 0.06), rgba(2, 4, 8, 0.24)),
        var(--planet-surface-bg, url("assets/planet/backgrounds/planet-row-h-surface-bg-v2-generated.png")) center / cover no-repeat;
    }

    .planet-map-surface.planet-row-g {
      --planet-node-scale: 0.45;
      inset: -9%;
      background:
        linear-gradient(180deg, rgba(66, 45, 26, 0.08), rgba(2, 4, 8, 0.26)),
        var(--planet-surface-bg, url("assets/planet/backgrounds/planet-row-g-surface-bg-v2-generated.png")) center / cover no-repeat;
    }

    .planet-map-surface.planet-row-f {
      --planet-node-scale: 0.45;
      inset: -9%;
      background:
        linear-gradient(180deg, rgba(7, 31, 58, 0.06), rgba(2, 4, 8, 0.22)),
        var(--planet-surface-bg, url("assets/planet/backgrounds/planet-row-f-surface-bg-v2-generated.png")) center / cover no-repeat;
    }

    .planet-map-surface.planet-row-e {
      --planet-node-scale: 0.45;
      inset: -9%;
      background:
        linear-gradient(180deg, rgba(91, 20, 8, 0.1), rgba(2, 4, 8, 0.28)),
        var(--planet-surface-bg, url("assets/planet/backgrounds/planet-row-e-surface-bg-v2-generated.png")) center / cover no-repeat;
    }

    .planet-map-surface.planet-row-d {
      --planet-node-scale: 0.45;
      inset: -9%;
      background:
        linear-gradient(180deg, rgba(25, 8, 72, 0.12), rgba(2, 4, 8, 0.28)),
        var(--planet-surface-bg, url("assets/planet/backgrounds/planet-row-d-surface-bg-v2-generated.png")) center / cover no-repeat;
    }

    .planet-map-surface.dragging {
      cursor: grabbing;
      transition: none;
    }

    .planet-zoom-chip {
      position: absolute;
      right: 18px;
      top: 14px;
      z-index: 4;
      padding: 4px 8px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(2, 7, 13, 0.68);
      color: #b7f7ff;
      font-size: 11px;
      pointer-events: none;
    }

    .planet-city-panel {
      position: absolute;
      right: 18px;
      top: auto;
      bottom: 24px;
      z-index: 4;
      width: 260px;
      max-height: calc(100% - 150px);
      overflow: auto;
      padding: 12px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background: linear-gradient(180deg, rgba(8, 22, 36, 0.92), rgba(2, 7, 13, 0.95));
      box-shadow: 0 0 24px rgba(32, 216, 255, 0.14), inset 0 0 18px rgba(183, 247, 255, 0.04);
      color: #effcff;
      clip-path: var(--cut);
    }

    .planet-city-panel-head {
      display: grid;
      grid-template-columns: 58px 1fr auto;
      gap: 8px;
      align-items: center;
      margin-bottom: 10px;
    }

    .planet-city-panel-head img {
      width: 58px;
      height: 50px;
      object-fit: contain;
      filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.42));
    }

    .planet-city-panel-head strong {
      display: block;
      color: #b7f7ff;
      font-size: 14px;
      line-height: 18px;
    }

    .planet-city-panel-head span {
      display: block;
      color: var(--muted);
      font-size: 11px;
      line-height: 15px;
    }

    .planet-panel-close {
      width: 24px;
      height: 24px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.36);
      color: #effcff;
      cursor: pointer;
    }

    .planet-city-stats,
    .planet-scout-section {
      display: grid;
      gap: 6px;
      margin-top: 8px;
    }

    .planet-city-stat,
    .planet-scout-row {
      display: grid;
      grid-template-columns: 72px 1fr;
      gap: 6px;
      align-items: center;
      min-height: 24px;
      padding: 5px 7px;
      border: 1px solid rgba(183, 247, 255, 0.12);
      background: rgba(0, 0, 0, 0.18);
      font-size: 12px;
    }

    .planet-city-stat span,
    .planet-scout-row span {
      color: var(--muted);
    }

    .planet-city-stat strong,
    .planet-scout-row strong {
      color: #effcff;
      font-weight: 700;
      text-align: right;
    }

    .planet-action-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 10px;
    }

    .planet-action-row button {
      height: 32px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: linear-gradient(180deg, rgba(22, 64, 92, 0.76), rgba(4, 13, 24, 0.88));
      color: #effcff;
      cursor: pointer;
      font-size: 12px;
    }

    .planet-action-row button.danger {
      border-color: rgba(255, 86, 86, 0.36);
      background: linear-gradient(180deg, rgba(112, 34, 34, 0.78), rgba(22, 5, 8, 0.9));
    }

    .planet-scout-title {
      margin-top: 10px;
      color: #b7f7ff;
      font-size: 12px;
      line-height: 16px;
    }

    .planet-scout-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      margin-top: 6px;
    }

    .planet-scout-resource,
    .planet-scout-army {
      min-height: 42px;
      padding: 6px;
      border: 1px solid rgba(183, 247, 255, 0.12);
      background: rgba(0, 0, 0, 0.2);
      font-size: 11px;
    }

    .planet-scout-resource img,
    .planet-scout-army img {
      width: 18px;
      height: 18px;
      object-fit: contain;
      vertical-align: middle;
      margin-right: 4px;
    }

    .planet-scout-resource strong,
    .planet-scout-army strong {
      display: block;
      margin-top: 4px;
      color: #effcff;
      font-size: 12px;
    }

    .planet-orbit {
      position: absolute;
      left: 50%;
      top: 50%;
      width: min(78vw, 920px);
      aspect-ratio: 1;
      translate: -50% -50%;
      border: 1px solid rgba(183, 247, 255, 0.07);
      border-radius: 50%;
      box-shadow: inset 0 0 70px rgba(47, 125, 255, 0.04);
    }

    .planet-orbit::before,
    .planet-orbit::after {
      content: "";
      position: absolute;
      inset: 18%;
      border: 1px solid rgba(183, 247, 255, 0.055);
      border-radius: 50%;
      transform: rotateX(62deg) rotateZ(-12deg);
    }

    .planet-orbit::after {
      inset: 34%;
      border-color: rgba(255, 212, 107, 0.08);
    }

    .planet-node {
      appearance: none;
      position: absolute;
      left: var(--x);
      top: var(--y);
      translate: -50% -50%;
      width: var(--node-w, 96px);
      min-height: var(--node-h, 68px);
      border: 1px solid rgba(183, 247, 255, 0.26);
      background: linear-gradient(180deg, rgba(15, 34, 54, 0.7), rgba(3, 8, 16, 0.8));
      color: #effcff;
      box-shadow: 0 0 18px rgba(32, 216, 255, 0.16), inset 0 0 14px rgba(255, 255, 255, 0.04);
      clip-path: var(--cut);
      cursor: pointer;
      display: grid;
      place-items: center;
      gap: 2px;
      padding: 8px;
      text-align: center;
    }

    .planet-node:focus {
      outline: none;
    }

    .planet-node:focus-visible {
      outline: 1px solid rgba(183, 247, 255, 0.34);
      outline-offset: 2px;
    }

    .planet-node strong,
    .planet-node span {
      display: block;
      max-width: 108px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .planet-node strong {
      color: #b7f7ff;
      font-size: 13px;
    }

    .planet-node span {
      color: var(--muted);
      font-size: 11px;
      line-height: 14px;
    }

    .planet-node.center {
      --node-w: min(36vw, 430px);
      --node-h: min(30vw, 360px);
      translate: -50% -66%;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
    }

    .planet-training-links {
      position: absolute;
      inset: 0;
      z-index: 69;
      width: 100%;
      height: 100%;
      overflow: visible;
      pointer-events: none;
    }

    .planet-training-links line {
      stroke-linecap: round;
    }

    .planet-training-links .link-bed {
      stroke: rgba(5, 12, 17, 0.68);
      stroke-width: 0.76;
      filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.52));
    }

    .planet-training-links .link-core {
      stroke: rgba(126, 223, 255, 0.56);
      stroke-width: 0.28;
      stroke-dasharray: 1.2 0.7;
      filter: drop-shadow(0 0 3px rgba(49, 205, 255, 0.52));
    }

    .planet-training-links .difficulty-easy {
      stroke: rgba(94, 231, 139, 0.72);
    }

    .planet-training-links .difficulty-normal {
      stroke: rgba(74, 208, 255, 0.74);
    }

    .planet-training-links .difficulty-hard {
      stroke: rgba(255, 188, 70, 0.78);
    }

    .planet-training-links .difficulty-live {
      stroke: rgba(255, 82, 74, 0.82);
    }

    .planet-node.center.training-hub {
      --node-w: min(23vw, 280px);
      --node-h: min(16vw, 190px);
      translate: -50% -62%;
    }

    .planet-node.training-facility {
      --training-color: #4ad0ff;
      --node-w: clamp(104px, 12vw, 170px);
      --node-h: clamp(82px, 8.5vw, 120px);
      height: var(--node-h);
      translate: -50% -62%;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
      isolation: isolate;
      transition: filter 0.14s ease-out, transform 0.14s ease-out;
    }

    .planet-node.training-facility::before {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 8px;
      z-index: -1;
      width: 78%;
      height: 20%;
      translate: -50% 0;
      border-radius: 50%;
      background: radial-gradient(ellipse, color-mix(in srgb, var(--training-color) 28%, rgba(0, 0, 0, 0.7)), transparent 72%);
      filter: blur(2px);
    }

    .planet-node.training-facility.difficulty-easy {
      --training-color: #5ee78b;
    }

    .planet-node.training-facility.difficulty-normal {
      --training-color: #4ad0ff;
    }

    .planet-node.training-facility.difficulty-hard {
      --training-color: #ffbc46;
    }

    .planet-node.training-facility.difficulty-live {
      --training-color: #ff524a;
    }

    .planet-node.training-facility:hover,
    .planet-node.training-facility.selected {
      z-index: 140 !important;
      filter: brightness(1.14);
      transform: scale(1.08);
    }

    .planet-node.city {
      --node-w: var(--plot-w, 148px);
      --node-h: var(--plot-h, 94px);
      translate: -50% -50%;
      transform: scale(var(--city-map-scale, 1));
      transform-origin: 50% 100%;
      padding: 0;
      border-color: transparent;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
    }

    .planet-node.city::before {
      content: none;
    }

    .planet-node.city .planet-node-caption {
      min-width: 92px;
      padding: 3px 7px 4px;
      transform: scale(calc(1 / var(--city-map-scale, 1)));
      transform-origin: 50% 0;
    }

    .planet-node.city strong,
    .planet-node.claimed-city strong {
      max-width: 144px;
      font-size: 16px;
      font-weight: 800;
      line-height: 19px;
    }

    .planet-node.city .planet-node-caption > span,
    .planet-node.claimed-city .planet-node-caption > span {
      display: block;
      max-width: 144px;
      color: #d7e8ef;
      font-size: 13px;
      font-weight: 700;
      line-height: 16px;
    }

    .planet-node.neutral-enemy {
      --node-w: clamp(106px, 10vw, 164px);
      --node-h: clamp(96px, 9.6vw, 152px);
      translate: -50% -100%;
      transform: scale(calc(var(--ground-scale, 1) * var(--planet-node-scale, 1)));
      transform-origin: 50% 100%;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
      isolation: isolate;
    }

    .planet-node.neutral-enemy:not(.resource-enemy) {
      --node-w: clamp(216px, 18vw, 312px);
      --node-h: clamp(168px, 15.6vw, 264px);
    }

    .planet-node.neutral-enemy::before,
    .planet-node.ancient-ruins::before,
    .planet-node.neutral-outpost::before,
    .planet-node.neutral-cave::before {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 0;
      width: calc(var(--node-w) * 0.62);
      height: calc(var(--node-h) * 0.14);
      translate: -50% 36%;
      border-radius: 50%;
      background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.28) 46%, transparent 74%),
        radial-gradient(ellipse at center, rgba(32, 216, 255, 0.16), transparent 68%);
      filter: blur(2px);
      pointer-events: none;
      z-index: 0;
    }

    .enemy-node-art {
      position: relative;
      z-index: 1;
      width: var(--node-w);
      height: var(--node-h);
      object-fit: contain;
      filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 12px rgba(32, 216, 255, 0.14));
    }

    .planet-enemy-squad {
      position: relative;
      z-index: 1;
      display: block;
      width: var(--node-w);
      height: var(--node-h);
      pointer-events: none;
      filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 12px rgba(32, 216, 255, 0.14));
    }

    .planet-enemy-sprite {
      position: absolute;
      left: 50%;
      bottom: -1px;
      width: 118px;
      height: 118px;
      translate: calc(-50% + var(--unit-offset, 0px)) 0;
      transform: scaleX(-1);
      transform-origin: 50% 100%;
      background-image: url("../game_design/art_reference/generated_ui/battle/unit_sprites/terran_infantry_action_spritesheet.png");
      background-size: 800% 200%;
      background-position: 0% var(--sprite-row-y, 0%);
      background-repeat: no-repeat;
      animation: planetEnemySpriteAction 0.92s steps(7, end) infinite;
      animation-delay: var(--sprite-delay, 0s);
      filter: sepia(0.14) saturate(1.08);
    }

    .planet-enemy-sprite-img {
      position: absolute;
      left: 50%;
      bottom: 2px;
      width: 94px;
      height: 94px;
      translate: calc(-50% + var(--unit-offset, 0px)) 0;
      transform-origin: 50% 100%;
      object-fit: contain;
      object-position: center bottom;
      animation: planetEnemyFloatStep 0.72s ease-in-out infinite;
      animation-delay: var(--sprite-delay, 0s);
      filter: drop-shadow(0 9px 7px rgba(0, 0, 0, 0.56));
    }

    .planet-enemy-sprite-img.unit-zerg-walker {
      width: 108px;
      height: 86px;
      bottom: 0;
      filter: drop-shadow(0 9px 6px rgba(0, 0, 0, 0.58)) saturate(1.08);
    }

    .planet-enemy-sprite-img.unit-protoss-walker {
      width: 96px;
      height: 96px;
      filter: drop-shadow(0 9px 7px rgba(0, 0, 0, 0.54)) drop-shadow(0 0 8px rgba(103, 216, 255, 0.24));
    }

    .planet-enemy-sprite.unit-faction-terran {
      filter: sepia(0.16) saturate(1.16) hue-rotate(-8deg) brightness(1.04);
    }

    .planet-enemy-sprite.unit-faction-zerg {
      filter: sepia(0.28) saturate(1.75) hue-rotate(78deg) brightness(0.92);
    }

    .planet-enemy-sprite.unit-faction-protoss {
      filter: sepia(0.16) saturate(1.6) hue-rotate(170deg) brightness(1.12);
    }

    .planet-node.enemy-faction-terran .planet-node-caption {
      border-color: rgba(255, 117, 82, 0.38);
    }

    .planet-node.enemy-faction-zerg .planet-node-caption {
      border-color: rgba(181, 108, 255, 0.42);
      color: #e7d5ff;
    }

    .planet-node.enemy-faction-protoss .planet-node-caption {
      border-color: rgba(103, 216, 255, 0.42);
      color: #d8f8ff;
    }

    .planet-enemy-squad.count-2 .planet-enemy-sprite {
      width: 104px;
      height: 104px;
    }

    .planet-enemy-squad.count-2 .planet-enemy-sprite-img {
      width: 84px;
      height: 84px;
    }

    .planet-enemy-squad.count-2 .planet-enemy-sprite-img.unit-zerg-walker {
      width: 96px;
      height: 76px;
    }

    .planet-enemy-squad.count-3 .planet-enemy-sprite {
      width: 94px;
      height: 94px;
    }

    .planet-enemy-squad.count-3 .planet-enemy-sprite-img {
      width: 76px;
      height: 76px;
    }

    .planet-enemy-squad.count-3 .planet-enemy-sprite-img.unit-zerg-walker {
      width: 86px;
      height: 68px;
    }

    .planet-enemy-squad.count-2 .planet-enemy-sprite:nth-child(2),
    .planet-enemy-squad.count-3 .planet-enemy-sprite:nth-child(2) {
      bottom: 5px;
    }

    .planet-enemy-squad.count-2 .planet-enemy-sprite-img:nth-child(2),
    .planet-enemy-squad.count-3 .planet-enemy-sprite-img:nth-child(2) {
      bottom: 6px;
    }

    .planet-enemy-squad.count-3 .planet-enemy-sprite:nth-child(3) {
      bottom: 1px;
    }

    .planet-enemy-squad.count-3 .planet-enemy-sprite-img:nth-child(3) {
      bottom: 2px;
    }

    @keyframes planetEnemyFloatStep {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-3px); }
    }

    .planet-node.ancient-ruins {
      --node-w: clamp(290px, 26vw, 450px);
      --node-h: clamp(290px, 26vw, 450px);
      translate: -50% -100%;
      transform: scale(calc(var(--ground-scale, 1) * var(--planet-node-scale, 1)));
      transform-origin: 50% 100%;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
      isolation: isolate;
    }

    .ancient-ruins-art {
      position: relative;
      z-index: 1;
      width: var(--node-w);
      height: var(--node-h);
      object-fit: contain;
      filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.64)) drop-shadow(0 0 26px rgba(32, 216, 255, 0.28));
    }

    .planet-map-surface.planet-row-i .ancient-ruins-art {
      translate: 0 18px;
      object-position: center bottom;
      filter:
        drop-shadow(0 4px 2px rgba(0, 0, 0, 0.5))
        drop-shadow(0 9px 7px rgba(0, 0, 0, 0.3))
        drop-shadow(0 0 8px rgba(32, 216, 255, 0.1));
    }

    .planet-node.ancient-ruins:hover:not(.selected) .ancient-ruins-art {
      filter: brightness(1.12) drop-shadow(0 24px 30px rgba(0, 0, 0, 0.66)) drop-shadow(0 0 34px rgba(74, 238, 255, 0.42));
    }

    .planet-node.neutral-outpost {
      --node-w: clamp(214px, 16.8vw, 302px);
      --node-h: clamp(178px, 14.8vw, 256px);
      translate: -50% -100%;
      transform: scale(calc(var(--ground-scale, 1) * var(--planet-node-scale, 1)));
      transform-origin: 50% 100%;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
      isolation: isolate;
    }

    .planet-node.neutral-cave {
      --node-w: clamp(164px, 12.5vw, 224px);
      --node-h: clamp(134px, 10.8vw, 190px);
      translate: -50% -100%;
      transform: scale(calc(var(--ground-scale, 1) * var(--planet-node-scale, 1)));
      transform-origin: 50% 100%;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      clip-path: none;
      overflow: visible;
      isolation: isolate;
    }

    .outpost-city-art {
      position: relative;
      z-index: 1;
      width: var(--node-w);
      height: var(--node-h);
      object-fit: contain;
      object-position: center bottom;
      translate: 0 0;
      filter:
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.5))
        drop-shadow(0 5px 4px rgba(0, 0, 0, 0.26))
        drop-shadow(0 0 8px rgba(62, 226, 255, 0.12));
    }

    .planet-node.neutral-outpost.claimed .outpost-city-art {
      filter:
        brightness(1.08)
        drop-shadow(0 16px 20px rgba(0, 0, 0, 0.62))
        drop-shadow(0 0 22px rgba(98, 255, 166, 0.32));
    }

    .planet-node.neutral-outpost.claimed .planet-node-caption {
      border-color: rgba(98, 255, 166, 0.5);
      background: rgba(4, 34, 24, 0.72);
    }

    .planet-node.neutral-outpost.claimed-city .claimed-outpost-city-art {
      bottom: 0;
      width: clamp(246px, 18vw, 326px);
      height: clamp(176px, 13.8vw, 238px);
      translate: -50% 0;
      filter:
        drop-shadow(0 4px 2px rgba(0, 0, 0, 0.54))
        drop-shadow(0 9px 7px rgba(0, 0, 0, 0.3))
        drop-shadow(0 0 8px color-mix(in srgb, var(--city-color, var(--faction)) 22%, transparent));
    }

    .planet-map-surface.planet-row-i .outpost-city-art {
      z-index: 2;
      translate: 0 0;
      filter:
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.48))
        drop-shadow(0 5px 4px rgba(0, 0, 0, 0.24))
        drop-shadow(0 0 5px rgba(62, 226, 255, 0.08));
    }

    .cave-art {
      position: relative;
      z-index: 1;
      width: var(--node-w);
      height: var(--node-h);
      object-fit: contain;
      filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 14px rgba(255, 211, 122, 0.2));
    }

    .planet-node.neutral-outpost::before,
    .planet-node.neutral-cave::before {
      width: calc(var(--node-w) * 0.82);
      height: calc(var(--node-h) * 0.2);
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-outpost::before,
    .planet-map-surface.planet-row-i .planet-node.ancient-ruins::before {
      width: calc(var(--node-w) * 0.74);
      height: calc(var(--node-h) * 0.11);
      background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.24) 42%, rgba(0, 0, 0, 0.08) 62%, transparent 78%);
      filter: blur(1px);
      translate: -50% 22%;
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-outpost::after {
      content: none;
    }

    .planet-node.resource-enemy {
      --node-w: clamp(104px, 9vw, 152px);
      --node-h: clamp(86px, 8.4vw, 134px);
    }

    .outpost-pad,
    .outpost-console-icon {
      display: block;
      position: relative;
      z-index: 1;
      width: 42px;
      height: 58px;
      border: 1px solid rgba(183, 247, 255, 0.36);
      clip-path: polygon(50% 0, 100% 24%, 82% 100%, 18% 100%, 0 24%);
      transform: none;
      transform-origin: 50% 100%;
      background:
        linear-gradient(180deg, rgba(79, 234, 255, 0.62), rgba(12, 44, 58, 0.82)),
        radial-gradient(circle at 50% 34%, rgba(255, 244, 175, 0.34), transparent 42%);
      box-shadow: 0 10px 16px rgba(0, 0, 0, 0.42), inset 0 0 14px rgba(32, 216, 255, 0.22);
    }

    .outpost-console-icon {
      width: 100%;
      max-width: 52px;
      height: 48px;
    }

    .planet-node.neutral-outpost:hover .outpost-pad,
    .planet-node.neutral-outpost.selected .outpost-pad {
      border-color: rgba(255, 211, 122, 0.72);
      filter: brightness(1.16) drop-shadow(0 0 16px rgba(255, 211, 122, 0.34));
    }

    .planet-map-surface.planet-row-i .outpost-pad {
      opacity: 0.92;
    }

    .planet-map-surface.planet-row-i .planet-node-caption {
      top: calc(100% + 4px);
      transform: scale(calc(1 / var(--ground-scale, 1)));
      transform-origin: 50% 0;
    }

    .planet-map-surface.planet-row-i .planet-node-caption {
      min-width: 0;
      width: max-content;
      max-width: 240px;
      padding: 4px 8px;
      border: 0;
      border-radius: 4px;
      background: rgba(0, 0, 0, 0.46);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.34);
      text-shadow:
        1px 0 0 #000,
        -1px 0 0 #000,
        0 1px 0 #000,
        0 -1px 0 #000,
        1px 1px 0 #000,
        -1px 1px 0 #000,
        1px -1px 0 #000,
        -1px -1px 0 #000,
        0 2px 2px rgba(0, 0, 0, 0.9);
      opacity: 1;
    }

    .planet-map-surface.planet-row-i .planet-node-caption strong,
    .planet-map-surface.planet-row-i .planet-node-caption span {
      max-width: none;
      overflow: visible;
      white-space: normal;
      text-overflow: clip;
    }

    .planet-map-surface.planet-row-i .planet-node-caption strong {
      color: #ffffff;
      font-size: 24px;
      line-height: 27px;
      font-weight: 900;
      -webkit-text-stroke: 0;
    }

    .planet-map-surface.planet-row-i .planet-node-caption span {
      color: #eefaff;
      font-size: 18px;
      line-height: 21px;
      font-weight: 800;
      -webkit-text-stroke: 0;
    }

    .planet-map-surface.planet-row-i .planet-node.city .planet-node-caption {
      transform: scale(calc(1 / var(--ground-scale, 1))) scale(calc(1 / var(--city-map-scale, 1)));
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-enemy .planet-node-caption {
      top: calc(100% + 7px);
      max-width: 280px;
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-enemy .planet-node-caption strong {
      font-size: 26px;
      line-height: 29px;
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-enemy .planet-node-caption span {
      display: none;
    }

    .planet-map-surface.planet-row-i .planet-node.ancient-ruins .planet-node-caption {
      top: calc(100% + 12px);
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-outpost .planet-node-caption {
      top: calc(100% + 18px);
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-cave.selected {
      filter: drop-shadow(0 0 18px rgba(74, 238, 255, 0.32));
    }

    .planet-map-surface.planet-row-i .planet-node.ancient-ruins.selected::before {
      background:
        radial-gradient(ellipse at center, rgba(74, 238, 255, 0.42), rgba(0, 0, 0, 0.28) 38%, rgba(0, 0, 0, 0.1) 60%, transparent 80%);
    }

    .planet-map-surface.planet-row-i .planet-node.ancient-ruins.selected .planet-node-caption {
      background: rgba(4, 27, 34, 0.72);
      box-shadow: 0 0 0 1px rgba(74, 238, 255, 0.42), 0 3px 8px rgba(0, 0, 0, 0.46);
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-outpost.selected::before {
      background:
        radial-gradient(ellipse at center, rgba(255, 211, 122, 0.52), rgba(0, 0, 0, 0.28) 36%, rgba(0, 0, 0, 0.12) 58%, transparent 80%);
    }

    .planet-map-surface.planet-row-i .planet-node.neutral-outpost.selected .planet-node-caption {
      background: rgba(34, 24, 4, 0.72);
      box-shadow: 0 0 0 1px rgba(255, 211, 122, 0.42), 0 3px 8px rgba(0, 0, 0, 0.46);
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .ancient-ruins-art {
      translate: 0 10px;
      object-position: center bottom;
      filter:
        drop-shadow(0 8px 5px rgba(0, 0, 0, 0.38))
        drop-shadow(0 20px 20px rgba(0, 0, 0, 0.44))
        drop-shadow(0 0 16px rgba(32, 216, 255, 0.18));
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .outpost-city-art {
      z-index: 2;
      translate: 0 0;
      filter:
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.48))
        drop-shadow(0 5px 4px rgba(0, 0, 0, 0.24))
        drop-shadow(0 0 6px rgba(62, 226, 255, 0.1));
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-outpost::before,
    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.ancient-ruins::before {
      width: calc(var(--node-w) * 0.72);
      height: calc(var(--node-h) * 0.11);
      background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.24) 42%, transparent 76%);
      filter: blur(1px);
      translate: -50% 22%;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-outpost::after {
      content: none;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node-caption {
      top: calc(100% + 4px);
      min-width: 0;
      width: max-content;
      max-width: 180px;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      transform: scale(calc(1 / var(--ground-scale, 1)));
      transform-origin: 50% 0;
      text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.94),
        1px 0 0 rgba(0, 0, 0, 0.9),
        -1px 0 0 rgba(0, 0, 0, 0.9),
        0 -1px 0 rgba(0, 0, 0, 0.88),
        0 0 6px rgba(0, 0, 0, 0.86);
      opacity: 1;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node-caption strong,
    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node-caption span {
      max-width: none;
      overflow: visible;
      white-space: normal;
      text-overflow: clip;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node-caption strong {
      color: #ffffff;
      font-size: 16px;
      line-height: 19px;
      font-weight: 900;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node-caption span {
      color: rgba(238, 250, 252, 0.96);
      font-size: 13px;
      line-height: 15px;
      font-weight: 800;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.city .planet-node-caption {
      transform: scale(calc(1 / var(--ground-scale, 1))) scale(calc(1 / var(--city-map-scale, 1)));
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.city .planet-node-caption strong {
      font-size: 21px;
      line-height: 24px;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.city .planet-node-caption > span {
      font-size: 15px;
      line-height: 18px;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-enemy .planet-node-caption {
      top: calc(100% + 7px);
      max-width: 210px;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-enemy .planet-node-caption strong {
      font-size: 18px;
      line-height: 21px;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-enemy .planet-node-caption span {
      display: none;
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.ancient-ruins .planet-node-caption {
      top: calc(100% + 12px);
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-outpost .planet-node-caption {
      top: calc(100% + 11px);
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-cave.selected {
      filter: drop-shadow(0 0 18px rgba(74, 238, 255, 0.32));
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.ancient-ruins.selected::before {
      background:
        radial-gradient(ellipse at center, rgba(74, 238, 255, 0.4), rgba(0, 0, 0, 0.28) 38%, rgba(0, 0, 0, 0.1) 60%, transparent 80%);
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.ancient-ruins.selected .planet-node-caption {
      text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.98),
        1px 0 0 rgba(0, 0, 0, 0.94),
        -1px 0 0 rgba(0, 0, 0, 0.94),
        0 -1px 0 rgba(0, 0, 0, 0.9),
        0 0 7px rgba(74, 238, 255, 0.52);
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-outpost.selected::before {
      background:
        radial-gradient(ellipse at center, rgba(255, 211, 122, 0.5), rgba(0, 0, 0, 0.28) 36%, rgba(0, 0, 0, 0.12) 58%, transparent 80%);
    }

    .planet-map-surface:is(.planet-row-d, .planet-row-e, .planet-row-f, .planet-row-g, .planet-row-h) .planet-node.neutral-outpost.selected .planet-node-caption {
      text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.98),
        1px 0 0 rgba(0, 0, 0, 0.94),
        -1px 0 0 rgba(0, 0, 0, 0.94),
        0 -1px 0 rgba(0, 0, 0, 0.9),
        0 0 7px rgba(255, 211, 122, 0.52);
    }

    .planet-node.neutral-cave:hover .cave-art,
    .planet-node.neutral-cave.selected .cave-art {
      filter: brightness(1.12) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.66)) drop-shadow(0 0 22px rgba(255, 211, 122, 0.34));
    }

    .planet-node.neutral-enemy:hover .enemy-node-art,
    .planet-node.neutral-enemy.selected .enemy-node-art,
    .planet-node.neutral-enemy:hover .planet-enemy-squad,
    .planet-node.neutral-enemy.selected .planet-enemy-squad {
      filter: brightness(1.16) drop-shadow(0 16px 20px rgba(0, 0, 0, 0.62)) drop-shadow(0 0 18px rgba(255, 80, 60, 0.32));
    }

    .planet-node.empty {
      --node-w: var(--plot-w, 148px);
      --node-h: var(--plot-h, 94px);
      translate: -50% -50%;
      padding: 0;
      border-color: transparent;
      background: transparent;
      box-shadow: none;
      opacity: 1;
      clip-path: none;
    }

    .planet-node.empty:hover,
    .planet-node.city:hover,
    .planet-node.center:hover,
    .planet-node.center.selected,
    .planet-node.city.selected {
      filter: brightness(1.12);
      z-index: 5;
    }

    .planet-node-art {
      display: block;
      pointer-events: none;
      user-select: none;
    }

    .training-camp-art {
      width: min(23vw, 280px);
      height: min(15vw, 180px);
      object-fit: contain;
      object-position: center bottom;
      filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.46)) drop-shadow(0 0 14px rgba(255, 212, 107, 0.28));
    }

    .training-facility-art {
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center bottom;
      filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 9px color-mix(in srgb, var(--training-color) 48%, transparent));
    }

    .city-base-art {
      position: absolute;
      left: 50%;
      bottom: -7px;
      z-index: 1;
      width: 236px;
      height: 200px;
      object-fit: contain;
      object-position: center bottom;
      translate: -50% 0;
      filter: none;
    }

    .city-foundation-art {
      position: absolute;
      left: 50%;
      bottom: -5px;
      z-index: 0;
      width: var(--city-foundation-w, 236px);
      height: var(--city-foundation-h, 100px);
      object-fit: contain;
      object-position: center bottom;
      translate: -50% 0;
      scale: var(--city-foundation-tier-scale, 1);
      transform-origin: 50% 100%;
      filter: none;
    }

    .planet-node.city.city-tier-1 {
      --city-foundation-tier-scale: 0.76;
    }

    .planet-node.city.city-tier-2 {
      --city-foundation-tier-scale: 0.9;
    }

    .planet-node.city.city-tier-3 {
      --city-foundation-tier-scale: 1;
    }

    .planet-node.city.terran-city {
      --city-foundation-w: 236px;
      --city-foundation-h: 100px;
    }

    .planet-node.city.zerg-city {
      --city-foundation-w: 270px;
      --city-foundation-h: 114px;
    }

    .planet-node.city.zerg-city .city-foundation-art {
      bottom: -8px;
      filter: brightness(1.16) saturate(1.12);
    }

    .planet-node.city.protoss-city {
      --city-foundation-w: 220px;
      --city-foundation-h: 94px;
    }

    .planet-node.city .planet-site-pad {
      display: none;
    }

    .city-level-badge {
      position: absolute;
      left: 50%;
      bottom: -25px;
      z-index: 2;
      translate: -50% 0;
      min-width: 44px;
      max-width: none !important;
      padding: 2px 6px;
      border: 1px solid color-mix(in srgb, var(--city-color, var(--faction)) 72%, white);
      background: rgba(3, 10, 15, 0.88);
      color: #ffffff !important;
      box-shadow: inset 3px 0 var(--city-color, var(--faction));
      font-size: 14px !important;
      font-weight: 900;
      line-height: 18px !important;
      white-space: nowrap;
      overflow: visible !important;
      pointer-events: none;
    }

    .planet-site-pad {
      width: 100%;
      height: 100%;
      border: 0;
      border-radius: 0;
      background: url("../game_design/art_reference/generated_ui/planet/plot_ring_v1.png") center / contain no-repeat;
      filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.34));
      pointer-events: none;
    }

    .planet-node.empty:hover .planet-site-pad {
      filter: brightness(1.12) drop-shadow(0 0 12px rgba(32, 216, 255, 0.24));
    }

    .planet-node-caption {
      position: absolute;
      left: 50%;
      top: calc(100% - 2px);
      translate: -50% 0;
      display: grid;
      gap: 1px;
      min-width: 72px;
      padding: 2px 5px 3px;
      border: 1px solid color-mix(in srgb, var(--city-color, rgba(183, 247, 255, 0.55)) 40%, rgba(183, 247, 255, 0.16));
      background: rgba(2, 7, 13, 0.74);
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.34);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.12s ease-out;
    }

    .planet-node:hover .planet-node-caption,
    .planet-node.selected .planet-node-caption,
    .planet-node.center .planet-node-caption,
    .planet-node.training-facility .planet-node-caption,
    .planet-node.neutral-enemy .planet-node-caption {
      opacity: 1;
    }

    .planet-node.training-facility .planet-node-caption {
      top: calc(100% - 8px);
      min-width: 82px;
      border-color: color-mix(in srgb, var(--training-color) 56%, rgba(183, 247, 255, 0.18));
      box-shadow: 0 0 12px color-mix(in srgb, var(--training-color) 20%, rgba(0, 0, 0, 0.46));
    }

    .planet-node.training-facility .planet-node-caption strong {
      color: color-mix(in srgb, var(--training-color) 76%, white);
    }

    .planet-training-zone {
      display: grid;
      gap: 7px;
      min-height: 116px;
      padding: 14px;
      border: 1px solid rgba(74, 208, 255, 0.46);
      background: rgba(5, 18, 28, 0.84);
      box-shadow: inset 0 0 22px rgba(74, 208, 255, 0.08);
    }

    .planet-training-zone strong {
      color: #eafcff;
      font-size: 16px;
    }

    .planet-training-zone span,
    .planet-training-zone em {
      color: #b8d2dc;
      font-size: 12px;
      font-style: normal;
    }

    .planet-training-zone.difficulty-0 {
      border-color: rgba(94, 231, 139, 0.6);
    }

    .planet-training-zone.difficulty-2 {
      border-color: rgba(255, 188, 70, 0.68);
    }

    .planet-training-zone.difficulty-3 {
      border-color: rgba(255, 82, 74, 0.74);
    }

    .planet-node-caption strong,
    .planet-node-caption span {
      max-width: 82px;
    }

    .planet-node.home {
      border-color: var(--faction);
      box-shadow: 0 0 24px color-mix(in srgb, var(--faction) 46%, transparent), inset 0 0 18px var(--faction-soft);
    }

    @keyframes planetEnemySpriteAction {
      from {
        background-position-x: 0%;
      }
      to {
        background-position-x: 100%;
      }
    }

    .planet-training-menu {
      position: absolute;
      left: 50%;
      top: calc(50% + 72px);
      translate: -50% 0;
      z-index: 3;
      display: grid;
      grid-template-columns: repeat(4, minmax(64px, 1fr));
      gap: 8px;
      padding: 10px;
      border: 1px solid rgba(255, 212, 107, 0.34);
      background: linear-gradient(180deg, rgba(11, 23, 36, 0.94), rgba(3, 8, 16, 0.96));
      box-shadow: 0 0 24px rgba(255, 212, 107, 0.16), inset 0 0 14px rgba(255, 212, 107, 0.05);
    }

    .planet-training-menu button {
      height: 34px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.34);
      color: #effcff;
      cursor: pointer;
      font-size: 12px;
    }

    .planet-training-dialog {
      position: fixed;
      left: 50%;
      top: calc((100dvh - var(--bottom-ui-safe-height) + 34px) / 2);
      z-index: 6;
      display: grid;
      grid-template-rows: 38px minmax(0, 1fr) auto;
      width: min(720px, calc(100vw - 56px));
      height: min(460px, calc(100dvh - var(--bottom-ui-safe-height) - 50px));
      translate: -50% -50%;
      border: 1px solid rgba(183, 247, 255, 0.5);
      background:
        linear-gradient(180deg, rgba(10, 28, 44, 0.96), rgba(1, 7, 15, 0.98)),
        radial-gradient(circle at 50% 0%, rgba(255, 212, 107, 0.1), transparent 54%);
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.54), inset 0 0 0 1px rgba(32, 216, 255, 0.12);
      color: #effcff;
      clip-path: var(--cut);
    }

    .planet-training-dialog-head {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      padding: 8px 12px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.34);
    }

    .planet-training-dialog-head strong {
      color: #b7f7ff;
      font-size: 14px;
    }

    .planet-training-dialog-head button,
    .planet-training-start {
      border: 1px solid rgba(183, 247, 255, 0.36);
      background: linear-gradient(180deg, rgba(22, 72, 104, 0.86), rgba(3, 12, 22, 0.92));
      color: #effcff;
      cursor: pointer;
    }

    .planet-training-dialog-head button {
      width: 28px;
      height: 24px;
    }

    .planet-training-dialog-body {
      display: grid;
      grid-template-columns: 160px 1fr 190px;
      gap: 10px;
      min-height: 0;
      padding: 10px;
    }

    .planet-training-column {
      min-height: 0;
      padding: 8px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.22);
      overflow: auto;
    }

    .planet-training-column h4 {
      margin: 0 0 8px;
      color: #ffd46b;
      font-size: 12px;
      font-weight: 700;
    }

    .planet-training-choice,
    .planet-training-hero,
    .planet-training-enemy {
      width: 100%;
      min-height: 38px;
      margin-bottom: 6px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(3, 13, 22, 0.72);
      color: #effcff;
      text-align: left;
      cursor: pointer;
    }

    .planet-training-choice.active,
    .planet-training-hero.active {
      border-color: rgba(255, 212, 107, 0.7);
      box-shadow: 0 0 12px rgba(255, 212, 107, 0.16), inset 0 0 0 1px rgba(255, 212, 107, 0.18);
    }

    .planet-training-choice {
      padding: 6px 8px;
    }

    .planet-training-choice strong,
    .planet-training-choice span,
    .planet-training-hero strong,
    .planet-training-hero span,
    .planet-training-enemy strong,
    .planet-training-enemy span {
      display: block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .planet-training-choice span,
    .planet-training-hero span,
    .planet-training-enemy span {
      color: var(--muted);
      font-size: 11px;
      line-height: 14px;
    }

    .planet-training-enemy,
    .planet-training-hero {
      display: grid;
      grid-template-columns: 34px 1fr;
      gap: 7px;
      align-items: center;
      padding: 5px 7px;
    }

    .planet-training-enemy img,
    .planet-training-hero img {
      width: 32px;
      height: 32px;
      object-fit: cover;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.3);
    }

    .planet-training-dialog-foot {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 8px 12px 10px;
      border-top: 1px solid rgba(183, 247, 255, 0.18);
      color: var(--muted);
      font-size: 12px;
    }

    .planet-training-start {
      min-width: 92px;
      height: 30px;
    }

    .planet-path {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      opacity: 0.72;
    }

    .planet-path line {
      stroke: rgba(183, 247, 255, 0.22);
      stroke-width: 1.4;
      stroke-dasharray: 5 7;
    }

    .planet-view-title {
      position: absolute;
      left: 18px;
      top: 14px;
      z-index: 2;
      display: grid;
      gap: 3px;
      color: #effcff;
    }

    .planet-view-title strong {
      color: #b7f7ff;
      font-size: 16px;
      line-height: 20px;
    }

    .planet-view-title span {
      color: var(--muted);
      font-size: 12px;
    }

    .leftbar,
    .rightbar {
      display: none;
    }

    .auth-modal {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: none;
      place-items: center;
      background: rgba(0, 0, 0, 0.72);
      backdrop-filter: blur(4px);
    }

    .auth-modal.open {
      display: grid;
    }

    .runtime-gate-modal {
      z-index: 2000;
      background: rgba(0, 3, 9, 0.92);
      backdrop-filter: blur(8px);
    }

    .runtime-gate-card {
      width: min(460px, calc(100vw - 28px));
      gap: 16px;
      border-color: rgba(255, 212, 107, 0.58);
      background:
        linear-gradient(135deg, rgba(255, 212, 107, 0.1), transparent 38%),
        linear-gradient(180deg, rgba(13, 24, 38, 0.98), rgba(2, 7, 14, 0.99));
    }

    .runtime-gate-eyebrow {
      color: #ffd46b;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0;
    }

    .auth-card .runtime-gate-versions {
      padding: 9px 10px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.24);
      color: #b7f7ff;
      font-family: Consolas, "Courier New", monospace;
      line-height: 18px;
    }

    .runtime-gate-actions {
      grid-template-columns: 1fr;
    }

    .auth-card {
      width: min(380px, calc(100vw - 28px));
      max-height: calc(100vh - 28px);
      overflow-y: auto;
      display: grid;
      gap: 12px;
      padding: 18px;
      border: 1px solid rgba(183, 247, 255, 0.28);
      background:
        linear-gradient(135deg, rgba(126, 232, 255, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(15, 25, 39, 0.96), rgba(2, 7, 14, 0.98));
      clip-path: var(--cut);
      box-shadow: 0 18px 54px rgba(0, 0, 0, 0.46), inset 0 0 24px rgba(126, 232, 255, 0.06);
    }

    .auth-card h2 {
      margin: 0;
      color: #effcff;
      font-size: 20px;
      line-height: 24px;
    }

    .auth-card p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .auth-card label {
      display: grid;
      gap: 5px;
      color: #b7f7ff;
      font-size: 11px;
    }

    .auth-card label[hidden] {
      display: none;
    }

    .auth-card input {
      height: 34px;
      border: 1px solid rgba(183, 247, 255, 0.32);
      background: rgba(0, 0, 0, 0.36);
      color: #effcff;
      padding: 0 10px;
      outline: none;
      clip-path: var(--cut);
    }

    .auth-card .auth-consent-checkbox {
      grid-template-columns: 18px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      color: var(--muted);
      line-height: 1.55;
    }

    .auth-card .auth-consent-checkbox input {
      width: 16px;
      height: 16px;
      margin: 1px 0 0;
      padding: 0;
      accent-color: #67cfdf;
      clip-path: none;
    }

    .registration-faction-modal {
      z-index: 100;
      padding: 18px;
      background: rgba(0, 3, 9, 0.92);
      backdrop-filter: blur(8px);
    }

    .registration-faction-card {
      width: min(900px, calc(100vw - 36px));
      gap: 16px;
      padding: 22px;
      overflow-x: hidden;
      overflow-y: auto;
    }

    .registration-faction-heading {
      display: grid;
      gap: 4px;
      text-align: center;
    }

    .registration-faction-heading > span {
      color: #7edff0;
      font-size: 10px;
      letter-spacing: 0;
    }

    .registration-faction-heading .registration-commander-name {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      color: #d5edf5;
    }

    .registration-commander-name input {
      box-sizing: border-box;
      width: min(210px, 100%);
      height: 30px;
      padding: 3px 8px;
      border: 1px solid #51647a;
      background: #080e17;
      color: #effcff;
      font: inherit;
    }

    .registration-commander-name input:focus-visible {
      outline: 1px solid #9bc8e3;
    }

    .registration-faction-options {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .registration-faction-option {
      position: relative;
      min-width: 0;
      min-height: 270px;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
      align-items: end;
      padding: 0;
      overflow: hidden;
      border: 1px solid rgba(183, 247, 255, 0.3);
      border-radius: 4px;
      background: rgba(2, 7, 14, 0.96);
      color: #effcff;
      cursor: pointer;
      box-shadow: inset 0 0 24px rgba(126, 232, 255, 0.05);
    }

    .registration-faction-option:hover,
    .registration-faction-option:focus-visible {
      border-color: var(--registration-faction-color);
      outline: none;
      box-shadow: 0 0 18px var(--registration-faction-soft), inset 0 0 24px var(--registration-faction-soft);
    }

    .registration-faction-option[aria-pressed="true"] {
      border-color: var(--registration-faction-color);
      box-shadow: 0 0 22px var(--registration-faction-soft), inset 0 0 0 1px var(--registration-faction-color);
    }

    .registration-faction-option.terran {
      --registration-faction-color: #ff5f55;
      --registration-faction-soft: rgba(255, 62, 54, 0.22);
    }

    .registration-faction-option.zerg {
      --registration-faction-color: #e56bff;
      --registration-faction-soft: rgba(196, 80, 224, 0.24);
    }

    .registration-faction-option.protoss {
      --registration-faction-color: #68dfff;
      --registration-faction-soft: rgba(55, 198, 255, 0.24);
    }

    .registration-faction-art {
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at center, var(--registration-faction-soft), #03060b);
      pointer-events: none;
    }

    .registration-faction-art img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: 50% 28%;
    }

    .registration-faction-art::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(transparent 54%, #03060bc0 78%, #03060b);
    }

    .registration-faction-name {
      grid-column: 1;
      grid-row: 2;
      z-index: 1;
      align-self: end;
      display: grid;
      gap: 2px;
      padding: 14px 72px 14px 16px;
      color: #ffffff;
      font-size: 18px;
      font-weight: 700;
      text-align: left;
    }

    .registration-faction-name strong {
      font: inherit;
    }

    .registration-faction-name small {
      overflow: hidden;
      color: #b9d9e3;
      font-size: 10px;
      font-weight: 400;
      line-height: 14px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .registration-faction-state {
      position: absolute;
      right: 10px;
      bottom: 14px;
      z-index: 2;
      min-width: 48px;
      padding: 4px 7px;
      border: 1px solid rgba(255, 255, 255, 0.24);
      background: rgba(0, 0, 0, 0.54);
      color: #b8d2da;
      font-size: 10px;
      text-align: center;
    }

    .registration-faction-option[aria-pressed="true"] .registration-faction-state {
      border-color: var(--registration-faction-color);
      background: var(--registration-faction-soft);
      color: #ffffff;
    }

    .registration-faction-actions {
      width: min(420px, 100%);
      justify-self: center;
    }

    .auth-actions button:disabled {
      cursor: not-allowed;
      opacity: 0.42;
      box-shadow: none;
    }

    .auth-consent-checkbox a,
    .legal-consent-links a {
      color: #8be5f1;
      text-decoration: none;
    }

    .auth-consent-checkbox a:hover,
    .legal-consent-links a:hover {
      text-decoration: underline;
    }

    .legal-consent-modal {
      z-index: 160;
      background: rgba(0, 3, 9, 0.9);
      backdrop-filter: blur(8px);
    }

    .legal-consent-card {
      width: min(520px, calc(100vw - 28px));
      border-color: rgba(119, 217, 232, 0.5);
    }

    .auth-card .legal-consent-version {
      padding: 9px 10px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.24);
      color: #b7f7ff;
      font-family: Consolas, "Courier New", monospace;
    }

    .legal-consent-links {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      font-size: 12px;
    }

    .legal-consent-confirm {
      padding: 10px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.18);
    }

    .legal-consent-actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .auth-actions button,
    .auth-userbar button {
      height: 30px;
      border: 1px solid rgba(183, 247, 255, 0.42);
      background: linear-gradient(180deg, rgba(29, 91, 126, 0.72), rgba(5, 18, 34, 0.9));
      color: #effcff;
      cursor: pointer;
      clip-path: var(--cut);
      font-size: 12px;
    }

    .auth-actions button.primary {
      border-color: rgba(255, 212, 107, 0.68);
      background: linear-gradient(180deg, rgba(106, 78, 22, 0.96), rgba(22, 12, 3, 0.96));
      color: #ffe8a3;
    }

    .auth-actions button.danger,
    .auth-userbar button.danger {
      border-color: rgba(255, 126, 126, 0.58);
      background: linear-gradient(180deg, rgba(111, 31, 37, 0.9), rgba(39, 8, 13, 0.96));
      color: #ffd4d4;
    }

    .auth-actions .auth-wide-action {
      grid-column: 1 / -1;
    }

    .recovery-code-output {
      font-family: Consolas, "Courier New", monospace;
      font-size: 15px;
      text-align: center;
      letter-spacing: 0;
    }

    .account-session-card {
      width: min(440px, calc(100vw - 28px));
    }

    .account-security-card {
      width: min(500px, calc(100vw - 28px));
    }

    .account-security-list {
      display: grid;
      max-height: min(320px, 44vh);
      overflow-y: auto;
      border-top: 1px solid rgba(183, 247, 255, 0.16);
    }

    .account-security-row {
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(112px, 0.65fr) minmax(0, 1fr);
      gap: 6px 12px;
      align-items: center;
      padding: 10px 2px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.14);
    }

    .account-security-row strong,
    .account-security-row span {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .account-security-row strong {
      color: #effcff;
      font-size: 11px;
    }

    .account-security-row span {
      color: var(--muted);
      font-size: 10px;
      line-height: 1.5;
    }

    .account-security-actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-session-list {
      display: grid;
      max-height: min(360px, 50vh);
      overflow-y: auto;
      border-top: 1px solid rgba(183, 247, 255, 0.16);
    }

    .account-session-row {
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 4px 10px;
      align-items: center;
      padding: 10px 2px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.14);
    }

    .account-session-row strong,
    .account-session-row span {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .account-session-row strong {
      color: #effcff;
      font-size: 12px;
    }

    .account-session-row span {
      grid-column: 1;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.5;
    }

    .account-session-row button {
      grid-column: 2;
      grid-row: 1 / 3;
      min-width: 54px;
      height: 28px;
      border: 1px solid rgba(255, 126, 126, 0.44);
      background: rgba(83, 19, 24, 0.72);
      color: #ffd4d4;
      cursor: pointer;
      clip-path: var(--cut);
    }

    .account-session-current {
      grid-column: 2;
      grid-row: 1 / 3;
      align-self: center;
      color: #8fffc1;
      font-size: 10px;
    }

    .account-session-empty {
      padding: 16px 2px;
      color: var(--muted);
      font-size: 11px;
      text-align: center;
    }

    .account-delete-card {
      width: min(420px, calc(100vw - 28px));
      border-color: rgba(255, 126, 126, 0.4);
    }

    .auth-card .account-delete-warning {
      color: #ffbcbc;
    }

    #accountDeleteUsernameHint {
      color: #ffffff;
      overflow-wrap: anywhere;
    }

    .auth-message {
      min-height: 16px;
      color: #ffd46b;
      font-size: 11px;
      line-height: 16px;
    }

    .auth-userbar {
      display: flex;
      gap: 6px;
      align-items: center;
      color: var(--muted);
      font-size: 11px;
      white-space: nowrap;
    }

    .auth-userbar strong {
      color: #ffe8a3;
      font-size: 12px;
    }

    .auth-userbar button {
      width: auto;
      min-width: 44px;
      height: 24px;
      padding: 0 8px;
      font-size: 11px;
    }

    .audio-control {
      display: flex;
      align-items: center;
      gap: 4px;
      flex: 0 0 auto;
    }

    .auth-userbar .audio-settings-button {
      width: 28px;
      min-width: 28px;
      padding: 0;
      border-color: rgba(183, 247, 255, 0.58);
      color: #b7f7ff;
      background: rgba(3, 12, 24, 0.92);
      font-size: 17px;
      line-height: 1;
    }

    .auth-userbar .audio-settings-button:hover,
    .auth-userbar .audio-settings-button:focus-visible {
      border-color: var(--faction);
      color: #ffffff;
      box-shadow: 0 0 10px var(--faction-soft);
      outline: 0;
    }

    .auth-userbar .audio-settings-button.muted {
      border-color: rgba(255, 116, 116, 0.7);
      color: #ff9c9c;
    }

    .auth-userbar .audio-options-button {
      font-size: 14px;
    }

    .audio-settings-popover {
      position: fixed;
      top: 38px;
      right: 8px;
      z-index: 120;
      display: grid;
      width: 238px;
      gap: 10px;
      padding: 11px 12px 12px;
      border: 1px solid rgba(183, 247, 255, 0.62);
      background: rgba(2, 9, 18, 0.97);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(32, 216, 255, 0.08);
      color: var(--muted);
      font-size: 11px;
    }

    .audio-settings-popover[hidden] {
      display: none;
    }

    .audio-settings-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-width: 0;
      padding-bottom: 7px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.16);
    }

    .audio-settings-head strong {
      color: #ffffff;
      font-size: 12px;
    }

    .audio-settings-popover > label {
      display: grid;
      grid-template-columns: 70px minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      min-width: 0;
    }

    .motion-settings { display: grid; gap: 5px; border-top: 1px solid #b7f7ff29; padding-top: 8px; }
    .motion-settings label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
    .motion-settings > label { font-weight: bold; color: #fff; }
    .motion-settings input { margin: 0; accent-color: var(--faction); }
    .motion-settings fieldset { display: grid; gap: 5px; margin: 0; border: 0; padding: 0 0 0 19px; }
    .motion-settings fieldset:disabled { opacity: .65; }
    .motion-settings fieldset:disabled label { cursor: default; }
    #stage img[data-city-still] { visibility: hidden; }
    #harvesterLayer[hidden] { display: none; }
    #stage .building, #stage .building *, #stage .building::before, #stage .building::after,
    #stage .building *::before, #stage .building *::after { animation: none !important; }

    .audio-settings-popover input[type="range"] {
      width: 100%;
      min-width: 0;
      height: 18px;
      margin: 0;
      accent-color: var(--faction);
      cursor: pointer;
    }

    .game-bookmark {
      border-top: 1px solid rgba(183, 247, 255, 0.16);
      padding-top: 8px;
    }

    .game-bookmark summary {
      color: #dcecff;
      cursor: pointer;
    }

    .game-bookmark p {
      margin: 6px 0;
      line-height: 1.6;
    }

    .game-bookmark a {
      color: #9fe1ff;
    }

    .audio-mute-control {
      display: flex;
      align-items: center;
      gap: 5px;
      color: #dcecff;
      cursor: pointer;
    }

    .audio-mute-control input {
      margin: 0;
      accent-color: var(--faction);
    }

    /* Final movement GIFs. Sizes match the approved battlefield tiers. */
    .battle-unit.movement-gif-unit {
      overflow: visible;
      isolation: isolate;
    }

    .battle-unit.movement-gif-unit.moving:not(.attacking) {
      animation: none;
    }

    .battle-unit.movement-gif-unit.moving:not(.attacking)::before {
      content: none;
    }

    .battle-unit.movement-gif-unit .battle-move-sprite {
      position: absolute;
      left: 50%;
      bottom: 0;
      z-index: 2;
      display: block;
      width: var(--battle-move-size, 82px);
      height: var(--battle-move-size, 82px);
      max-width: none;
      max-height: none;
      translate: -50% 0;
      transform: rotate(-5deg);
      transform-origin: 50% 100%;
      object-fit: contain;
      object-position: 50% 100%;
      pointer-events: none;
      user-select: none;
      image-rendering: auto;
      backface-visibility: hidden;
      filter: none;
    }

    .battle-unit.move-tier-small {
      --battle-move-size: 74px;
      --battle-flight-lift: 22px;
    }

    .battle-unit.move-tier-medium {
      --battle-move-size: 100px;
      --battle-flight-lift: 30px;
    }

    .battle-unit.move-tier-large {
      --battle-move-size: 120px;
      --battle-flight-lift: 38px;
    }

    .battle-unit.move-tier-giant {
      --battle-move-size: 140px;
      --battle-flight-lift: 46px;
    }

    .battle-unit.motion-atlas-unit.unit-high-spine-walker {
      --battle-move-size: 150px;
    }

    .battle-unit.move-anchor-center .battle-move-sprite {
      bottom: -2px;
    }

    .battle-unit.movement-gif-unit.branch-flight .battle-move-sprite {
      bottom: var(--battle-flight-lift, 30px);
      transform-origin: 50% 50%;
    }

    .battle-unit.movement-gif-unit.branch-flight:not(.destroyed) .battle-sprite,
    .battle-unit.movement-gif-unit.branch-flight:not(.destroyed) .battle-ground-token {
      bottom: var(--battle-flight-lift, 30px);
    }

    .battle-unit.movement-gif-unit.branch-flight.attacking::before {
      translate: 0 calc(-1 * var(--battle-flight-lift, 30px));
    }

    .battle-unit.enemy .battle-move-sprite {
      transform: rotate(5deg) scaleX(-1);
      filter:
        sepia(0.12)
        saturate(0.92)
        brightness(0.92);
    }

    /* Controllable battle motion atlases. Legacy GIFs remain available but are not used by live combat. */
    .battle-unit.motion-atlas-unit,
    .battle-unit.directional-atlas-unit,
    .battle-unit.horizontal-runtime-unit {
      overflow: visible;
      isolation: isolate;
      --battle-energy: #54ddff;
      --battle-energy-core: #f4ffff;
      --battle-energy-soft: rgba(84, 221, 255, 0.44);
    }

    .battle-unit.motion-atlas-unit.faction-protoss,
    .battle-unit.directional-atlas-unit.faction-protoss,
    .battle-unit.horizontal-runtime-unit.faction-protoss {
      --battle-energy: #ffd768;
      --battle-energy-core: #ffffff;
      --battle-energy-soft: rgba(94, 228, 255, 0.48);
    }

    .battle-unit.motion-atlas-unit.faction-zerg,
    .battle-unit.directional-atlas-unit.faction-zerg,
    .battle-unit.horizontal-runtime-unit.faction-zerg {
      --battle-energy: #f06cff;
      --battle-energy-core: #ffd6ff;
      --battle-energy-soft: rgba(121, 255, 138, 0.42);
    }

    .battle-motion-sprite {
      position: absolute;
      left: 50%;
      bottom: 0;
      z-index: 4;
      display: block;
      width: var(--battle-move-size, 82px);
      height: var(--battle-move-size, 82px);
      max-width: none;
      max-height: none;
      translate: -50% 0;
      transform: rotate(-4deg) scaleX(1);
      transform-origin: 50% 88%;
      background-image: var(--motion-atlas);
      background-size: 100% 100%;
      background-repeat: no-repeat;
      background-position: center center;
      pointer-events: none;
      user-select: none;
      image-rendering: auto;
      backface-visibility: hidden;
      filter: none;
      will-change: transform;
    }

    .battle-horizontal-clip {
      position: absolute;
      left: 50%;
      bottom: 0;
      z-index: 4;
      display: block;
      width: var(--horizontal-unit-size, var(--battle-move-size, 82px));
      height: var(--horizontal-unit-size, var(--battle-move-size, 82px));
      translate: -50% 0;
      overflow: hidden;
      pointer-events: none;
      user-select: none;
      image-rendering: auto;
      backface-visibility: hidden;
    }

    .battle-unit.horizontal-runtime-unit.motion-flight .battle-horizontal-clip,
    .battle-unit.horizontal-runtime-unit.motion-hover .battle-horizontal-clip {
      bottom: var(--battle-flight-lift, 30px);
    }

    .battle-unit .battle-horizontal-sprite {
      position: absolute;
      left: var(--horizontal-left, 0%);
      top: 0;
      display: block;
      width: var(--horizontal-atlas-width, 100%);
      height: 100%;
      max-width: none;
      max-height: none;
      object-fit: fill;
      pointer-events: none;
      user-select: none;
    }

    .battle-unit.horizontal-runtime-unit.moving,
    .battle-unit.horizontal-runtime-unit[data-horizontal-mode="turning"] {
      animation: none !important;
    }

    .battle-unit.horizontal-runtime-unit[data-horizontal-mode="turning"] .battle-horizontal-clip {
      filter: brightness(1.08);
    }

    .battle-directional-clip {
      position: absolute;
      left: 50%;
      bottom: 0;
      z-index: 4;
      display: block;
      width: var(--battle-move-size, 82px);
      height: var(--battle-move-size, 82px);
      translate: -50% var(--directional-offset-y, 0%);
      scale: calc(var(--directional-mirror, 1) * var(--directional-scale, 1)) var(--directional-scale, 1);
      transform-origin: 50% 88%;
      overflow: hidden;
      pointer-events: none;
      user-select: none;
      image-rendering: auto;
      backface-visibility: hidden;
      will-change: filter, translate;
    }

    .battle-unit .battle-directional-sprite {
      position: absolute;
      left: var(--directional-left, 0%);
      top: var(--directional-top, 0%);
      display: block;
      width: var(--directional-atlas-width, 100%);
      height: var(--directional-atlas-height, 100%);
      max-width: none;
      max-height: none;
      object-fit: fill;
      pointer-events: none;
      user-select: none;
    }

    .battle-procedural-ship-clip {
      position: absolute;
      left: 50%;
      bottom: var(--battle-flight-lift, 30px);
      z-index: 4;
      display: block;
      width: var(--battle-move-size, 100px);
      height: var(--battle-move-size, 100px);
      translate: -50% 0;
      scale: var(--ship-scale, 1);
      transform-origin: 50% 50%;
      animation: battleProceduralShipHover 1.35s ease-in-out var(--ship-phase, 0s) infinite alternate;
      overflow: visible;
      pointer-events: none;
      user-select: none;
      backface-visibility: hidden;
      will-change: translate, transform;
    }

    .battle-procedural-ship-sprite,
    .battle-procedural-ship-outgoing {
      position: absolute;
      inset: 0;
      z-index: 3;
      display: block;
      width: 100%;
      height: 100%;
      max-width: none;
      max-height: none;
      object-fit: contain;
      transform: scaleX(var(--ship-mirror, 1));
      transform-origin: 50% 50%;
      pointer-events: none;
      user-select: none;
      backface-visibility: hidden;
      filter: none;
    }

    .battle-procedural-ship-turning {
      animation: battleProceduralShipTurnIn 200ms linear both;
    }

    .battle-procedural-ship-outgoing {
      z-index: 4;
      animation: battleProceduralShipTurnOut 200ms linear both;
    }

    .battle-procedural-ship-engine,
    .battle-procedural-ship-charge {
      position: absolute;
      z-index: 2;
      display: block;
      width: 14%;
      height: 14%;
      translate: -50% -50%;
      border-radius: 50%;
      pointer-events: none;
    }

    .battle-procedural-ship-engine {
      left: var(--ship-thrust-x, 22%);
      top: var(--ship-thrust-y, 50%);
      background: radial-gradient(circle, var(--battle-energy-core) 0 10%, var(--battle-energy) 24%, transparent 72%);
      filter: blur(0.7px) drop-shadow(0 0 7px var(--battle-energy));
      opacity: 0.58;
      animation: battleProceduralShipEngine 0.86s ease-in-out var(--ship-phase, 0s) infinite alternate;
    }

    .battle-unit.procedural-ship-unit.moving .battle-procedural-ship-engine {
      width: 18%;
      height: 18%;
      opacity: 0.92;
      animation-duration: 0.44s;
    }

    .battle-unit.procedural-ship-unit .battle-unit-energy-ring {
      display: none;
    }

    .battle-procedural-ship-charge {
      left: var(--ship-muzzle-x, 78%);
      top: var(--ship-muzzle-y, 50%);
      z-index: 5;
      background: radial-gradient(circle, var(--battle-energy-core) 0 12%, var(--battle-energy) 28%, transparent 72%);
      filter: drop-shadow(0 0 7px var(--battle-energy));
      opacity: 0;
      scale: 0.3;
    }

    .battle-unit.procedural-ship-unit.attacking .battle-procedural-ship-clip {
      animation:
        battleProceduralShipRecoil 280ms cubic-bezier(.2,.72,.32,1) 1,
        battleProceduralShipHover 1.35s ease-in-out var(--ship-phase, 0s) infinite alternate;
    }

    .battle-unit.procedural-ship-unit.attacking .battle-procedural-ship-charge {
      animation: battleProceduralShipCharge 340ms ease-out 1;
    }

    .battle-unit.procedural-ship-unit.hit:not(.destroyed) .battle-procedural-ship-sprite:not(.battle-procedural-ship-outgoing) {
      animation: battleProceduralShipHitTint 240ms ease-out 1;
    }

    .battle-unit.procedural-ship-unit.destroyed .battle-procedural-ship-clip {
      animation: battleProceduralShipDestroyed 620ms ease-out both;
    }

    .battle-unit.procedural-ship-unit.destroyed .battle-unit-health,
    .battle-unit.procedural-ship-unit.destroyed .battle-unit-energy-ring {
      opacity: 0;
    }

    .battle-unit.directional-atlas-unit.motion-flight .battle-directional-clip,
    .battle-unit.directional-atlas-unit.motion-hover .battle-directional-clip {
      bottom: var(--battle-flight-lift, 30px);
      transform-origin: 50% 50%;
      animation: battleDirectionalFlight 1.1s ease-in-out infinite alternate;
    }

    .battle-unit.directional-atlas-unit.motion-flight.moving .battle-directional-clip,
    .battle-unit.directional-atlas-unit.motion-hover.moving .battle-directional-clip {
      animation-duration: 0.72s;
    }

    .battle-directional-clip[data-motion-active="false"] {
      animation-play-state: paused;
    }

    .battle-directional-turning {
      z-index: 4;
      animation: battleDirectionalTurnIn 200ms linear both !important;
    }

    .battle-directional-outgoing {
      z-index: 5;
      animation: battleDirectionalTurnOut 200ms linear both !important;
    }

    .battle-unit.directional-atlas-unit.moving,
    .battle-unit.directional-atlas-unit.attacking {
      animation: none !important;
    }

    .battle-unit.directional-atlas-unit.attacking .battle-directional-clip {
      filter: brightness(1.02) saturate(1.02);
    }

    .battle-unit.self-destruct-consumed {
      visibility: hidden !important;
      pointer-events: none !important;
    }

    .battle-unit.directional-atlas-unit.attacking .battle-directional-clip[data-attack-body-policy="reuse-run"] {
      animation: battleDirectionalAttackRecoil var(--directional-recoil-duration, 300ms) cubic-bezier(.2,.72,.32,1) var(--directional-recoil-delay, 0ms) 1;
    }

    .battle-unit.directional-atlas-unit.attacking::before {
      content: none !important;
    }

    .battle-unit.directional-atlas-unit.hit:not(.destroyed) .battle-directional-clip {
      animation: battleDirectionalHitTint 0.24s ease-out 1;
    }

    .battle-unit.directional-atlas-unit.destroyed .battle-directional-clip {
      filter: grayscale(0.5) brightness(0.62);
      opacity: 0.58;
    }

    .battle-unit.motion-atlas-unit.facing-left .battle-motion-sprite {
      transform: rotate(4deg) scaleX(-1);
    }

    .battle-unit.motion-atlas-unit.moving .battle-motion-sprite {
      animation: none;
    }

    .battle-unit.motion-atlas-unit.motion-biped.moving,
    .battle-unit.motion-atlas-unit.motion-organic.moving {
      animation: battleMotionGroundStride calc(var(--motion-duration, 0.8s) / 2) ease-in-out infinite alternate;
    }

    .battle-unit.motion-atlas-unit.motion-walker.moving {
      animation: battleMotionWalker 0.52s ease-in-out infinite alternate;
    }

    .battle-unit.motion-atlas-unit.motion-wheeled.moving,
    .battle-unit.motion-atlas-unit.motion-tracked.moving {
      animation: battleMotionVehicle 0.18s linear infinite alternate;
    }

    .battle-unit.motion-atlas-unit.motion-flight .battle-motion-sprite,
    .battle-unit.motion-atlas-unit.motion-hover .battle-motion-sprite {
      bottom: var(--battle-flight-lift, 30px);
      transform-origin: 50% 50%;
    }

    .battle-unit.motion-atlas-unit.motion-flight,
    .battle-unit.motion-atlas-unit.motion-hover {
      animation: battleMotionFlight 1.1s ease-in-out infinite alternate;
    }

    .battle-unit.motion-atlas-unit.motion-flight.moving,
    .battle-unit.motion-atlas-unit.motion-hover.moving {
      animation: battleMotionFlightTravel 0.72s ease-in-out infinite alternate;
    }

    /* Runtime cell sizes target the visible-width bands in the unit art matrix. */
    .battle-unit.directional-atlas-unit.unit-rifleman { --battle-move-size: 82px; }
    .battle-unit.directional-atlas-unit.unit-sentry-engineer {
      --battle-move-size: 84px;
      --battle-flight-lift: 16px;
    }
    .battle-unit.directional-atlas-unit.unit-night-hawk-bomber {
      --battle-move-size: 104px;
      --battle-flight-lift: 24px;
    }
    .battle-unit.directional-atlas-unit.unit-expedition-cruiser {
      --battle-move-size: 220px;
      --battle-flight-lift: 42px;
    }
    .battle-unit.directional-atlas-unit.unit-sentinel-transport {
      --battle-move-size: 200px;
      --battle-flight-lift: 46px;
    }
    .battle-unit.directional-atlas-unit.unit-swift-fire-car { --battle-move-size: 90px; }
    .battle-unit.directional-atlas-unit.unit-flame-engineer { --battle-move-size: 90px; }
    .battle-unit.directional-atlas-unit.unit-jump-scout { --battle-move-size: 120px; }
    .battle-unit.directional-atlas-unit.unit-shadow-agent { --battle-move-size: 116px; }
    .battle-unit.directional-atlas-unit.unit-radiant-guard { --battle-move-size: 90px; }
    .battle-unit.directional-atlas-unit.unit-phase-archer { --battle-move-size: 90px; }
    .battle-unit.directional-atlas-unit.unit-phase-interceptor { --battle-move-size: 92px; }
    .battle-unit.directional-atlas-unit.unit-void-judge { --battle-move-size: 112px; }
    .battle-unit.directional-atlas-unit.unit-psionic-archon { --battle-move-size: 132px; }
    .battle-unit.directional-atlas-unit.unit-high-spine-walker { --battle-move-size: 182px; }
    .battle-unit.directional-atlas-unit.unit-watcher-eye {
      --battle-move-size: 90px;
      --battle-flight-lift: 18px;
    }
    .battle-unit.directional-atlas-unit.unit-corrosion-bomber {
      --battle-move-size: 148px;
      --battle-flight-lift: 24px;
    }
    .battle-unit.directional-atlas-unit.unit-thorn-colossus {
      --battle-move-size: 246px;
    }
    .battle-unit.directional-atlas-unit.unit-bile-beast {
      --battle-move-size: 184px;
    }
    .battle-unit.directional-atlas-unit.unit-nav-sac {
      --battle-move-size: 160px;
      --battle-flight-lift: 34px;
    }
    .battle-unit.directional-atlas-unit.unit-observer-core {
      --battle-move-size: 108px;
      --battle-flight-lift: 18px;
    }
    .battle-unit.directional-atlas-unit.unit-star-sentinel {
      --battle-move-size: 88px;
      --battle-flight-lift: 13px;
      --battle-hit-base-brightness: 0.78;
      --battle-hit-base-saturation: 0.8;
      --battle-hit-base-contrast: 1.06;
    }
    .battle-unit.directional-atlas-unit.unit-dualform-fighter {
      --battle-move-size: 144px;
      --battle-flight-lift: 26px;
    }
    .battle-unit.directional-atlas-unit.unit-star-dome-mothership { --battle-move-size: 192px; }
    .battle-unit.directional-atlas-unit.unit-lumen-prism { --battle-move-size: 184px; }
    .battle-unit.directional-atlas-unit.unit-heavy-rail-siege { --battle-move-size: 204px; }
    .battle-unit.directional-atlas-unit.unit-mine-mech { --battle-move-size: 154px; }
    .battle-unit.directional-atlas-unit.unit-skyhammer-armor { --battle-move-size: 176px; }
    .battle-unit.directional-atlas-unit.unit-aegis-warden { --battle-move-size: 200px; }
    .battle-unit.directional-atlas-unit.unit-star-sentinel .battle-directional-clip {
      filter: brightness(0.78) saturate(0.8) contrast(1.06);
    }
    .battle-unit.directional-atlas-unit.unit-star-sentinel.attacking .battle-directional-clip {
      filter: brightness(0.82) saturate(0.84) contrast(1.06);
    }
    .battle-unit.directional-atlas-unit.unit-phoenix-fighter {
      --battle-move-size: 108px;
      --battle-flight-lift: 24px;
      --battle-hit-base-brightness: 0.84;
      --battle-hit-base-saturation: 0.9;
      --battle-hit-base-contrast: 1.04;
    }
    .battle-unit.directional-atlas-unit.unit-void-ship {
      --battle-move-size: 176px;
      --battle-flight-lift: 30px;
    }
    .battle-unit.directional-atlas-unit.unit-phoenix-fighter .battle-directional-clip {
      filter: brightness(0.84) saturate(0.9) contrast(1.04);
    }
    .battle-unit.directional-atlas-unit.unit-phoenix-fighter.attacking .battle-directional-clip {
      filter: brightness(0.88) saturate(0.94) contrast(1.04);
    }
    .battle-unit.directional-atlas-unit.unit-rift-claw { --battle-move-size: 74px; }
    .battle-unit.directional-atlas-unit.unit-burst-sac { --battle-move-size: 82px; }
    .battle-unit.directional-atlas-unit.unit-spore-barrage { --battle-move-size: 108px; }
    .battle-unit.directional-atlas-unit.unit-spine-hunter { --battle-move-size: 112px; }
    .battle-unit.directional-atlas-unit.unit-blade-wing {
      --battle-move-size: 112px;
      --battle-flight-lift: 22px;
    }
    .battle-unit.directional-atlas-unit.unit-corrupt-wing {
      --battle-move-size: 128px;
      --battle-flight-lift: 26px;
    }
    .battle-unit.directional-atlas-unit.unit-earth-spine { --battle-move-size: 150px; }

    /* Alpha-derived clearances keep the health bar above each unit's visible silhouette. */
    .battle-unit.unit-rifleman { --battle-health-top-ratio: 1.145; }
    .battle-unit.unit-flame-engineer { --battle-health-top-ratio: 1.001; }
    .battle-unit.unit-sentry-engineer { --battle-health-top-ratio: 0.883; }
    .battle-unit.unit-night-hawk-bomber { --battle-health-top-ratio: 0.891; }
    .battle-unit.unit-swift-fire-car { --battle-health-top-ratio: 0.926; }
    .battle-unit.unit-jump-scout { --battle-health-top-ratio: 0.982; }
    .battle-unit.unit-shadow-agent { --battle-health-top-ratio: 1.083; }
    .battle-unit.unit-dualform-fighter { --battle-health-top-ratio: 0.948; }
    .battle-unit.unit-heavy-rail-siege { --battle-health-top-ratio: 0.997; }
    .battle-unit.unit-mine-mech { --battle-health-top-ratio: 0.942; }
    .battle-unit.unit-skyhammer-armor { --battle-health-top-ratio: 0.946; }
    .battle-unit.unit-expedition-cruiser { --battle-health-top-ratio: 1.014; }
    .battle-unit.unit-sentinel-transport { --battle-health-top-ratio: 0.941; }
    .battle-unit.unit-radiant-guard { --battle-health-top-ratio: 0.926; }
    .battle-unit.unit-phase-archer { --battle-health-top-ratio: 1.129; }
    .battle-unit.unit-phase-interceptor { --battle-health-top-ratio: 1.067; }
    .battle-unit.unit-aegis-warden { --battle-health-top-ratio: 0.930; }
    .battle-unit.unit-high-spine-walker { --battle-health-top-ratio: 0.918; }
    .battle-unit.unit-observer-core { --battle-health-top-ratio: 0.922; }
    .battle-unit.unit-star-sentinel { --battle-health-top-ratio: 0.995; }
    .battle-unit.unit-void-judge { --battle-health-top-ratio: 0.918; }
    .battle-unit.unit-psionic-archon { --battle-health-top-ratio: 0.971; }
    .battle-unit.unit-phoenix-fighter { --battle-health-top-ratio: 0.966; }
    .battle-unit.unit-void-ship { --battle-health-top-ratio: 0.895; }
    .battle-unit.unit-star-dome-mothership { --battle-health-top-ratio: 1.045; }
    .battle-unit.unit-lumen-prism { --battle-health-top-ratio: 0.945; }
    .battle-unit.unit-rift-claw { --battle-health-top-ratio: 1.134; }
    .battle-unit.unit-burst-sac { --battle-health-top-ratio: 0.973; }
    .battle-unit.unit-rot-armor { --battle-health-top-ratio: 0.906; }
    .battle-unit.unit-watcher-eye { --battle-health-top-ratio: 0.990; }
    .battle-unit.unit-spore-barrage { --battle-health-top-ratio: 0.946; }
    .battle-unit.unit-spine-hunter { --battle-health-top-ratio: 0.906; }
    .battle-unit.unit-blade-wing { --battle-health-top-ratio: 0.910; }
    .battle-unit.unit-earth-spine { --battle-health-top-ratio: 0.949; }
    .battle-unit.unit-corrosion-bomber { --battle-health-top-ratio: 0.949; }
    .battle-unit.unit-corrupt-wing { --battle-health-top-ratio: 0.816; }
    .battle-unit.unit-thorn-colossus { --battle-health-top-ratio: 1.041; }
    .battle-unit.unit-bile-beast { --battle-health-top-ratio: 0.906; }
    .battle-unit.unit-nav-sac { --battle-health-top-ratio: 0.859; }

    .battle-unit.directional-atlas-unit.unit-earth-spine .battle-directional-clip {
      bottom: -9px;
      translate: -50% calc(var(--directional-offset-y, 0%) + var(--earth-spine-sink, 0px));
      opacity: var(--earth-spine-body-opacity, 1);
      transition: opacity 80ms linear, translate 80ms linear;
    }

    .battle-unit.horizontal-runtime-unit.unit-earth-spine .battle-horizontal-clip {
      bottom: -9px;
      translate: -50% var(--earth-spine-sink, 0px);
      opacity: var(--earth-spine-body-opacity, 1);
      transition: opacity 80ms linear, translate 80ms linear;
    }

    .battle-unit.directional-atlas-unit.unit-earth-spine .battle-unit-health {
      opacity: var(--earth-spine-hud-opacity, 1);
      transition: opacity 80ms linear;
    }

    .battle-unit.horizontal-runtime-unit.unit-earth-spine .battle-unit-health {
      opacity: var(--earth-spine-hud-opacity, 1);
      transition: opacity 80ms linear;
    }

    .battle-earth-spine-burrow-ring {
      position: absolute;
      left: 50%;
      bottom: -8px;
      z-index: 3;
      display: block;
      width: calc(var(--battle-move-size, 140px) * 0.72);
      height: calc(var(--battle-move-size, 140px) * 0.19);
      translate: -50% 0;
      scale: var(--earth-spine-ring-scale, 0.78);
      border: 2px solid rgba(240, 108, 255, calc(0.58 + var(--earth-spine-ring-pulse, 0) * 0.22));
      border-radius: 50%;
      background:
        radial-gradient(ellipse at center, rgba(18, 7, 21, 0.72) 0 42%, rgba(88, 30, 96, 0.52) 55%, rgba(36, 14, 43, 0.16) 68%, transparent 74%),
        conic-gradient(from 12deg, transparent 0 8%, rgba(125, 255, 146, 0.42) 9% 10%, transparent 11% 24%, rgba(240, 108, 255, 0.56) 25% 27%, transparent 28% 48%, rgba(125, 255, 146, 0.34) 49% 50%, transparent 51% 73%, rgba(240, 108, 255, 0.48) 74% 76%, transparent 77% 100%);
      box-shadow:
        0 2px 7px rgba(0, 0, 0, 0.68),
        0 0 calc(5px + var(--earth-spine-ring-pulse, 0) * 5px) rgba(240, 108, 255, 0.34),
        inset 0 0 7px rgba(125, 255, 146, 0.22);
      opacity: var(--earth-spine-ring-opacity, 0);
      transform-origin: 50% 50%;
      transition: opacity 80ms linear, scale 80ms linear;
      pointer-events: none;
    }

    .battle-earth-spine-burrow-ring::before,
    .battle-earth-spine-burrow-ring::after {
      content: "";
      position: absolute;
      inset: -5px -9px;
      border: 1px solid rgba(240, 108, 255, 0.28);
      border-radius: 50%;
      opacity: calc(0.2 + var(--earth-spine-ring-pulse, 0) * 0.5);
      scale: calc(0.88 + var(--earth-spine-ring-pulse, 0) * 0.24);
      pointer-events: none;
    }

    .battle-earth-spine-burrow-ring::after {
      inset: 3px 8px;
      border-color: rgba(125, 255, 146, 0.22);
      opacity: calc(0.18 + (1 - var(--earth-spine-ring-pulse, 0)) * 0.3);
      scale: calc(0.96 + (1 - var(--earth-spine-ring-pulse, 0)) * 0.12);
    }

    .battle-unit-energy-ring {
      position: absolute;
      left: 50%;
      bottom: -7px;
      z-index: 2;
      width: calc(var(--battle-move-size, 82px) * 0.48);
      height: calc(var(--battle-move-size, 82px) * 0.15);
      translate: -50% 0;
      border: 1px solid color-mix(in srgb, var(--battle-energy) 74%, transparent);
      border-radius: 50%;
      box-shadow: 0 0 8px var(--battle-energy-soft), inset 0 0 5px var(--battle-energy-soft);
      opacity: 0.72;
      pointer-events: none;
    }

    /* Animated unit art should sit in the battlefield, not read as a glowing board token. */
    .battle-unit.motion-atlas-unit .battle-unit-energy-ring {
      display: none;
    }

    .battle-unit.enemy .battle-unit-energy-ring {
      border-color: rgba(255, 96, 82, 0.82);
      box-shadow: 0 0 8px rgba(255, 79, 64, 0.38), inset 0 0 5px rgba(255, 79, 64, 0.26);
    }

    .battle-arena .battle-unit.sprite .battle-sprite {
      filter: none;
    }

    .battle-arena .battle-unit.enemy.sprite .battle-sprite {
      filter: sepia(0.2) saturate(1.08);
    }

    .battle-arena .battle-unit.enemy.sprite.action-sprite.unit-rifleman .battle-sprite {
      filter: sepia(0.26) saturate(0.68) brightness(0.76) contrast(0.9);
    }

    .battle-arena .battle-unit.sprite .battle-sprite::after,
    .battle-arena .battle-unit.sprite.action-sprite.unit-rifleman::before {
      content: none;
      display: none;
    }

    .battle-unit-health {
      /* HUD stays above the independent body and ground layers. */
      position: absolute;
      left: 50%;
      bottom: calc(100% + 6px);
      z-index: 8;
      width: 40px;
      height: 6px;
      translate: -50% 0;
      overflow: hidden;
      border: 1px solid rgba(1, 8, 12, 0.9);
      border-radius: 1px;
      background: linear-gradient(90deg, #42e681 0 var(--health, 100%), rgba(37, 43, 43, 0.94) var(--health, 100%) 100%);
      box-shadow: none;
      pointer-events: none;
    }

    /* Match sprite highlights to the warm grass light without flattening faction colors. */
    .battle-arena .battle-unit.motion-atlas-unit .battle-motion-sprite,
    .battle-arena .battle-unit.directional-atlas-unit .battle-directional-sprite,
    .battle-arena .battle-unit.horizontal-runtime-unit .battle-horizontal-sprite,
    .battle-arena .battle-unit.procedural-ship-unit .battle-procedural-ship-sprite {
      filter: saturate(0.86) brightness(0.94) contrast(0.96) drop-shadow(0 2px 2px rgba(24, 22, 10, 0.42));
    }

    .battle-arena .battle-unit.enemy.motion-atlas-unit .battle-motion-sprite,
    .battle-arena .battle-unit.enemy.directional-atlas-unit .battle-directional-sprite,
    .battle-arena .battle-unit.enemy.horizontal-runtime-unit .battle-horizontal-sprite,
    .battle-arena .battle-unit.enemy.procedural-ship-unit .battle-procedural-ship-sprite {
      filter: saturate(0.9) brightness(0.92) contrast(0.98) drop-shadow(0 2px 2px rgba(31, 18, 10, 0.46));
    }

    .battle-arena .battle-unit.motion-flight .battle-motion-sprite,
    .battle-arena .battle-unit.motion-hover .battle-motion-sprite {
      filter: saturate(0.82) brightness(0.96) contrast(0.94) drop-shadow(0 6px 4px rgba(24, 22, 10, 0.28));
    }

    .battle-unit.enemy .battle-unit-health {
      background: linear-gradient(90deg, #ff514a 0 var(--health, 100%), rgba(48, 36, 38, 0.94) var(--health, 100%) 100%);
    }

    .battle-unit.motion-atlas-unit.motion-flight,
    .battle-unit.motion-atlas-unit.motion-hover,
    .battle-unit.directional-atlas-unit.motion-flight,
    .battle-unit.directional-atlas-unit.motion-hover,
    .battle-unit.horizontal-runtime-unit.motion-flight,
    .battle-unit.horizontal-runtime-unit.motion-hover {
      --battle-health-lift: var(--battle-flight-lift, 30px);
    }

    .battle-unit.motion-atlas-unit .battle-unit-health,
    .battle-unit.directional-atlas-unit .battle-unit-health,
    .battle-unit.horizontal-runtime-unit .battle-unit-health {
      bottom: calc(
        var(--battle-health-lift, 0px)
        + var(--battle-move-size, 82px) * var(--battle-health-top-ratio, 0.94)
        + 5px
      );
    }

    .battle-unit.motion-atlas-unit.attacking {
      animation: battleMotionAttack 0.24s cubic-bezier(.2,.7,.3,1) 1;
    }

    .battle-unit.motion-atlas-unit.attacking .battle-motion-sprite {
      animation: none;
      filter: brightness(1.2) saturate(1.16);
    }

    .battle-unit.motion-atlas-unit.hit:not(.destroyed) .battle-motion-sprite {
      animation: battleMotionHit 0.24s ease-out 1;
      filter: brightness(1.65) saturate(0.72);
    }

    .battle-unit.motion-atlas-unit.destroyed {
      filter: none;
      box-shadow: none;
    }

    .battle-unit.motion-atlas-unit.destroyed .battle-unit-health,
    .battle-unit.motion-atlas-unit.destroyed .battle-unit-energy-ring {
      opacity: 0;
    }

    .battle-unit.motion-atlas-unit.death-fresh .battle-motion-sprite {
      animation: battleMotionDeathImpact 0.42s ease-out both;
    }

    .battle-unit.motion-atlas-unit.death-falling .battle-motion-sprite,
    .battle-unit.motion-atlas-unit.death-settled .battle-motion-sprite {
      background-position: 100% 0;
      transform: rotate(72deg) scaleX(0.98) scaleY(0.78);
      filter: grayscale(0.58) brightness(0.58) sepia(0.18);
      opacity: 0.58;
    }

    .battle-unit.motion-atlas-unit.facing-left.death-falling .battle-motion-sprite,
    .battle-unit.motion-atlas-unit.facing-left.death-settled .battle-motion-sprite {
      transform: rotate(-72deg) scaleX(-0.98) scaleY(0.78);
    }

    .battle-unit-death-burst {
      position: absolute;
      left: 50%;
      bottom: 10px;
      z-index: 7;
      width: calc(var(--battle-move-size, 82px) * 0.58);
      height: calc(var(--battle-move-size, 82px) * 0.58);
      translate: -50% 0;
      border-radius: 50%;
      background:
        radial-gradient(circle, var(--battle-energy-core) 0 4%, var(--battle-energy) 8%, transparent 42%),
        conic-gradient(from 12deg, transparent 0 8%, var(--battle-energy) 9% 12%, transparent 13% 32%, var(--battle-energy) 33% 36%, transparent 37% 100%);
      filter: drop-shadow(0 0 10px var(--battle-energy));
      animation: battleMotionDeathBurst 0.7s ease-out both;
      pointer-events: none;
    }

    .battle-unit.death-settled .battle-unit-death-burst {
      display: none;
    }

    @keyframes battleMotionGroundStride {
      from { transform: translateY(0) rotate(-0.7deg); }
      to { transform: translateY(1.5px) rotate(0.7deg); }
    }

    @keyframes battleProceduralShipHover {
      from { translate: -50% -1px; }
      to { translate: -50% 1.5px; }
    }

    @keyframes battleProceduralShipEngine {
      from { opacity: 0.42; scale: 0.74; }
      to { opacity: 0.9; scale: 1.08; }
    }

    @keyframes battleProceduralShipTurnIn {
      0%, 49.9% {
        visibility: hidden;
        opacity: 0;
        scale: 0.92 1;
        filter: brightness(1);
      }
      50% {
        visibility: visible;
        opacity: 1;
        scale: 0.92 1;
        filter: brightness(1.08);
      }
      100% {
        visibility: visible;
        opacity: 1;
        scale: 1 1;
        filter: brightness(1);
      }
    }

    @keyframes battleProceduralShipTurnOut {
      0% {
        visibility: visible;
        opacity: 1;
        scale: 1 1;
        filter: brightness(1);
      }
      49.9% {
        visibility: visible;
        opacity: 1;
        scale: 0.92 1;
        filter: brightness(1.08);
      }
      50%, 100% {
        visibility: hidden;
        opacity: 0;
        scale: 0.92 1;
        filter: brightness(1);
      }
    }

    @keyframes battleProceduralShipRecoil {
      0%, 100% { transform: translate(0, 0); }
      34% { transform: translate(var(--ship-recoil-x, -2px), var(--ship-recoil-y, 0)); }
    }

    @keyframes battleProceduralShipCharge {
      0% { opacity: 0; scale: 0.25; }
      44% { opacity: 1; scale: 1.15; }
      100% { opacity: 0; scale: 0.5; }
    }

    @keyframes battleProceduralShipHitTint {
      0%, 100% { filter: brightness(1) saturate(1); }
      38% {
        filter:
          brightness(1.42)
          saturate(1.18);
      }
    }

    @keyframes battleProceduralShipDestroyed {
      0% { opacity: 1; transform: translate(0, 0) scale(1); }
      100% { opacity: 0.48; transform: translate(0, 7px) scale(0.96); filter: grayscale(0.5) brightness(0.58); }
    }

    @keyframes battleMotionWalker {
      from { transform: translateY(0) rotate(-1deg); }
      to { transform: translateY(2px) rotate(1deg); }
    }

    @keyframes battleMotionVehicle {
      from { transform: translateY(-0.35px); }
      to { transform: translateY(0.35px); }
    }

    @keyframes battleMotionFlight {
      from { transform: translateY(-1px) rotate(-0.7deg); }
      to { transform: translateY(2px) rotate(0.7deg); }
    }

    @keyframes battleDirectionalFlight {
      from { translate: -50% calc(var(--directional-offset-y, 0%) - 1px); }
      to { translate: -50% calc(var(--directional-offset-y, 0%) + 2px); }
    }

    @keyframes battleDirectionalTurnIn {
      0%, 49.9% {
        visibility: hidden;
        opacity: 0;
        transform: scaleX(0.92);
        filter: brightness(1) saturate(1);
      }
      50% {
        visibility: visible;
        opacity: 1;
        transform: scaleX(0.92);
        filter: brightness(1.08) saturate(0.96);
      }
      100% {
        visibility: visible;
        opacity: 1;
        transform: scaleX(1);
        filter: brightness(1) saturate(1);
      }
    }

    @keyframes battleDirectionalTurnOut {
      0% {
        visibility: visible;
        opacity: 1;
        transform: scaleX(1);
        filter: brightness(1) saturate(1);
      }
      49.9% {
        visibility: visible;
        opacity: 1;
        transform: scaleX(0.92);
        filter: brightness(1.08) saturate(0.96);
      }
      50%, 100% {
        visibility: hidden;
        opacity: 0;
        transform: scaleX(0.92);
        filter: brightness(1) saturate(1);
      }
    }

    @keyframes battleMotionFlightTravel {
      from { transform: translateY(-2px) rotate(-1.5deg); }
      to { transform: translateY(2px) rotate(1.5deg); }
    }

    @keyframes battleMotionDust {
      from { opacity: 0.58; transform: scale(0.72); }
      to { opacity: 0; transform: scale(1.18); }
    }

    @keyframes battleMotionAttack {
      0%, 100% { transform: translateX(0) scale(1); }
      45% { transform: translateX(2px) scale(1.035); }
    }

    @keyframes battleMotionHit {
      0% { transform: rotate(-4deg) translateX(0); }
      40% { transform: rotate(-4deg) translateX(-4px); }
      100% { transform: rotate(-4deg) translateX(0); }
    }

    @keyframes battleDirectionalAttackRecoil {
      0%, 100% {
        translate: -50% var(--directional-offset-y, 0%);
      }
      34% {
        translate:
          calc(-50% + var(--directional-recoil-x, 0px))
          calc(var(--directional-offset-y, 0%) + var(--directional-recoil-y, 0px));
      }
    }

    @keyframes battleDirectionalHitTint {
      0%, 100% {
        filter:
          brightness(var(--battle-hit-base-brightness, 1))
          saturate(var(--battle-hit-base-saturation, 1))
          contrast(var(--battle-hit-base-contrast, 1));
      }
      38% {
        filter:
          brightness(calc(var(--battle-hit-base-brightness, 1) + 0.38))
          saturate(calc(var(--battle-hit-base-saturation, 1) + 0.16))
          contrast(var(--battle-hit-base-contrast, 1))
          drop-shadow(0 0 8px var(--battle-energy));
      }
    }

    @keyframes battleMotionDeathImpact {
      0% { opacity: 1; transform: rotate(-4deg) scale(1); }
      38% { opacity: 1; transform: rotate(18deg) scale(1.06); }
      100% { opacity: 0.62; transform: rotate(72deg) scaleX(0.98) scaleY(0.78); }
    }

    @keyframes battleMotionDeathBurst {
      0% { opacity: 0; transform: scale(0.25); }
      28% { opacity: 1; transform: scale(1); }
      100% { opacity: 0; transform: scale(1.7); }
    }

    .battle-screen.movement-showcase .battle-map-world {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      transform: none;
      transform-origin: center;
      will-change: auto;
    }

    .battle-screen.movement-showcase .battle-camera-controls {
      display: none;
    }

    .battle-screen.horizontal-movement-showcase {
      grid-template-rows: minmax(0, 1fr) 132px;
    }

    .battle-screen.horizontal-movement-showcase .battle-arena {
      overflow-x: hidden;
      overflow-y: auto;
      background: #10150f;
      cursor: default;
      touch-action: pan-y;
    }

    .battle-screen.horizontal-movement-showcase .battle-top-hud {
      position: sticky;
      top: 10px;
      height: 0;
    }

    .battle-screen.horizontal-movement-showcase .battle-map-world {
      position: relative;
      left: auto;
      top: auto;
      width: 100%;
      height: 6000px;
      transform: none;
      contain: layout paint style;
    }

    .battle-screen.attack-showcase {
      grid-template-rows: minmax(0, 1fr) 132px;
    }

    .battle-screen.attack-showcase .battle-arena {
      overflow-x: hidden;
      overflow-y: auto;
      background: #10150f;
      cursor: default;
      touch-action: pan-y;
    }

    .battle-screen.attack-showcase .battle-top-hud {
      position: sticky;
      top: 10px;
      height: 0;
    }

    .battle-screen.attack-showcase .battle-map-world {
      position: relative;
      left: auto;
      top: auto;
      width: 100%;
      height: 3400px;
      transform: none;
      contain: layout paint style;
    }

    .battle-screen.attack-showcase .battle-terrain-grid {
      background-size: 100% 1250px;
      background-repeat: repeat-y;
    }

    .battle-screen.attack-showcase .battle-terrain-grid::after {
      background-size: 768px 768px, 100% 1250px, 100% 100%, 100% 100%;
    }

    .battle-screen.attack-showcase .battle-midline {
      display: block;
      background: rgba(255, 212, 107, 0.22);
      box-shadow: 0 0 14px rgba(255, 212, 107, 0.18);
    }

    .battle-screen.attack-showcase .battle-unit {
      z-index: 6;
      cursor: default;
    }

    .battle-screen.attack-showcase .battle-unit .battle-unit-energy-ring,
    .battle-screen.attack-showcase .battle-unit .battle-unit-health,
    .battle-screen.attack-showcase .battle-unit em {
      display: none;
    }

    .attack-showcase-labels {
      position: absolute;
      inset: 0;
      z-index: 5;
      pointer-events: none;
    }

    .attack-showcase-row-label {
      position: absolute;
      left: 8px;
      top: var(--label-y);
      display: grid;
      grid-template-columns: 22px minmax(0, auto);
      gap: 1px 6px;
      width: min(185px, 17vw);
      translate: 0 -50%;
      padding: 5px 7px;
      border-left: 2px solid #54ddff;
      background: rgba(3, 10, 15, 0.78);
      color: #dff8ff;
      font-size: 10px;
      line-height: 13px;
      letter-spacing: 0;
    }

    .attack-showcase-row-label b {
      grid-row: 1 / span 2;
      align-self: center;
      color: #ffffff;
      font-family: Consolas, monospace;
      font-size: 11px;
    }

    .attack-showcase-row-label strong,
    .attack-showcase-row-label em {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .attack-showcase-row-label em {
      color: #8fb5c6;
      font-style: normal;
    }

    .attack-showcase-row-label.faction-protoss {
      border-left-color: #39c8ff;
    }

    .attack-showcase-row-label.faction-zerg {
      border-left-color: #8dff63;
    }

    .battle-screen.horizontal-movement-showcase .battle-terrain-grid {
      background-size: 100% 1250px;
      background-repeat: repeat-y;
    }

    .battle-screen.horizontal-movement-showcase .battle-terrain-grid::after {
      background-size: 768px 768px, 100% 1250px, 100% 100%, 100% 100%;
    }

    .battle-screen.horizontal-movement-showcase .battle-midline {
      position: absolute;
      left: 50%;
      top: 0;
      bottom: 0;
      z-index: 3;
      display: block;
      width: 1px;
      background: rgba(255, 212, 107, 0.28);
      box-shadow: 0 0 12px rgba(255, 212, 107, 0.22);
    }

    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit {
      z-index: 6;
      cursor: default;
      transition: none;
    }

    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit:not(.enemy)::after,
    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit.enemy::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: -9px;
      width: 18px;
      height: 2px;
      translate: -50% 0;
      background: #54ddff;
      box-shadow: 0 0 6px rgba(84, 221, 255, 0.8);
    }

    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit.enemy::after {
      background: #ff6256;
      box-shadow: 0 0 6px rgba(255, 98, 86, 0.8);
    }

    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit .battle-unit-energy-ring,
    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit .battle-unit-health,
    .battle-screen.horizontal-movement-showcase .horizontal-showcase-unit em {
      display: none;
    }

    .horizontal-showcase-labels {
      position: absolute;
      inset: 0;
      z-index: 5;
      pointer-events: none;
    }

    .horizontal-showcase-row-label {
      position: absolute;
      left: 8px;
      top: var(--label-y);
      max-width: 120px;
      translate: 0 -50%;
      overflow: hidden;
      padding: 3px 6px;
      border-left: 2px solid #54ddff;
      color: #dff8ff;
      background: rgba(3, 10, 15, 0.72);
      font-size: 10px;
      letter-spacing: 0;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .horizontal-showcase-row-label.faction-protoss {
      border-left-color: #ffd768;
      color: #fff3b8;
    }

    .horizontal-showcase-row-label.faction-zerg {
      border-left-color: #f06cff;
      color: #ffd9ff;
    }

    html.horizontal-showcase-active .auth-modal {
      display: none !important;
    }

    .feature-body.dungeon-feature-view {
      display: block;
      padding: 0;
      min-width: 0;
      overflow: hidden;
    }

    .dungeon-shell {
      display: grid;
      grid-template-rows: 42px minmax(0, 1fr);
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      color: #effcff;
      background:
        linear-gradient(180deg, rgba(9, 20, 31, 0.94), rgba(3, 8, 15, 0.98)),
        radial-gradient(circle at 70% 0%, rgba(255, 177, 56, 0.1), transparent 44%);
    }

    .dungeon-tabs {
      display: grid;
      grid-template-columns: 112px 112px minmax(0, 1fr);
      align-items: stretch;
      min-width: 0;
      border-bottom: 1px solid rgba(183, 247, 255, 0.22);
      background: rgba(0, 0, 0, 0.24);
    }

    .dungeon-tabs button {
      border: 0;
      border-right: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(255, 255, 255, 0.025);
      color: #91a7b8;
      font-size: 13px;
      cursor: pointer;
    }

    .dungeon-tabs button.active {
      color: #ffffff;
      background: linear-gradient(180deg, rgba(45, 123, 156, 0.52), rgba(10, 34, 51, 0.72));
      box-shadow: inset 0 -2px #45dbff;
    }

    .dungeon-tabs > span {
      align-self: center;
      justify-self: end;
      min-width: 0;
      padding: 0 14px;
      overflow: hidden;
      color: #ffd46b;
      font-size: 11px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-content {
      min-width: 0;
      min-height: 0;
      overflow: hidden;
    }

    .dungeon-selection-layout,
    .dungeon-operation-layout,
    .dungeon-rest-layout {
      display: grid;
      grid-template-columns: minmax(260px, 0.78fr) minmax(440px, 1.45fr);
      gap: 10px;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      padding: 10px;
    }

    .dungeon-stage-panel,
    .dungeon-deploy-panel,
    .dungeon-operation-main,
    .dungeon-operation-side,
    .dungeon-rest-main,
    .dungeon-rest-side {
      min-width: 0;
      min-height: 0;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(6, 13, 23, 0.72);
    }

    .dungeon-stage-panel,
    .dungeon-deploy-panel,
    .dungeon-operation-main,
    .dungeon-rest-main {
      display: grid;
      align-content: start;
      gap: 9px;
      padding: 10px;
      overflow: auto;
    }

    .dungeon-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }

    .dungeon-section-head strong,
    .dungeon-section-head span {
      display: block;
    }

    .dungeon-section-head strong {
      color: #ffffff;
      font-size: 13px;
      line-height: 18px;
    }

    .dungeon-section-head span {
      color: #7f9aac;
      font-size: 10px;
      line-height: 14px;
    }

    .dungeon-section-head > b {
      color: #ffd46b;
      font-size: 13px;
    }

    .dungeon-stage-list,
    .dungeon-hero-list,
    .dungeon-run-roster,
    .dungeon-transfer-list {
      display: grid;
      align-content: start;
      gap: 6px;
      min-width: 0;
      min-height: 0;
    }

    .dungeon-stage-list,
    .dungeon-hero-list,
    .dungeon-transfer-list {
      overflow: auto;
      padding-right: 3px;
    }

    .dungeon-stage-row {
      display: grid;
      grid-template-columns: 76px minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      width: 100%;
      min-height: 66px;
      padding: 5px 8px 5px 5px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(255, 255, 255, 0.035);
      color: #dbeeff;
      text-align: left;
      cursor: pointer;
    }

    .dungeon-stage-row > img {
      width: 76px;
      height: 54px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      object-fit: cover;
    }

    .dungeon-stage-row.active {
      border-color: rgba(255, 212, 107, 0.62);
      background: linear-gradient(90deg, rgba(122, 78, 10, 0.42), rgba(21, 47, 59, 0.38));
      box-shadow: inset 3px 0 #ffd46b;
    }

    .dungeon-stage-row span,
    .dungeon-stage-row b,
    .dungeon-stage-row strong,
    .dungeon-stage-row em,
    .dungeon-stage-row small {
      display: block;
      min-width: 0;
    }

    .dungeon-stage-row b {
      color: #45dbff;
      font-size: 10px;
      line-height: 13px;
    }

    .dungeon-stage-row strong {
      overflow: hidden;
      color: #ffffff;
      font-size: 13px;
      line-height: 18px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-stage-row em,
    .dungeon-stage-row small {
      overflow: hidden;
      color: #839cac;
      font-size: 10px;
      font-style: normal;
      line-height: 14px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-stage-row > span:last-child {
      text-align: right;
    }

    .dungeon-stage-brief {
      display: grid;
      grid-template-columns: 148px minmax(0, 1fr);
      gap: 8px 12px;
      padding: 8px;
      border-left: 3px solid #ffd46b;
      background: linear-gradient(90deg, rgba(102, 68, 13, 0.38), rgba(255, 255, 255, 0.025));
    }

    .dungeon-stage-art {
      width: 148px;
      height: 104px;
      border: 1px solid rgba(255, 212, 107, 0.34);
      object-fit: cover;
    }

    .dungeon-stage-summary {
      display: grid;
      align-content: start;
      gap: 3px;
      min-width: 0;
    }

    .dungeon-stage-brief span,
    .dungeon-stage-brief strong,
    .dungeon-stage-brief p,
    .dungeon-stage-brief small {
      display: block;
      margin: 0;
    }

    .dungeon-stage-brief span {
      color: #ffd46b;
      font-size: 10px;
    }

    .dungeon-stage-brief strong {
      margin-top: 2px;
      color: #ffffff;
      font-size: 17px;
    }

    .dungeon-stage-brief p,
    .dungeon-stage-brief small {
      color: #9db2c0;
      font-size: 10px;
      line-height: 15px;
    }

    .dungeon-stage-brief > small,
    .dungeon-encounter-preview {
      grid-column: 1 / -1;
    }

    .dungeon-stage-brief > small {
      color: #cde7bd;
    }

    .dungeon-power-check {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 2px 8px;
      margin-top: 3px;
      padding: 5px 7px;
      border: 1px solid rgba(255, 194, 87, 0.28);
      background: rgba(45, 28, 5, 0.56);
    }

    .dungeon-power-check.ready {
      border-color: rgba(111, 218, 118, 0.38);
      background: rgba(10, 49, 27, 0.48);
    }

    .dungeon-power-check span,
    .dungeon-power-check em,
    .dungeon-power-check b {
      min-width: 0;
      color: #b8cbd7;
      font-size: 11px;
      font-style: normal;
      line-height: 15px;
    }

    .dungeon-power-check b {
      color: #ffffff;
    }

    .dungeon-power-check em {
      grid-column: 1 / -1;
      color: #ffcf72;
    }

    .dungeon-power-check.ready em {
      color: #9cf6a2;
    }

    .dungeon-deploy-panel .dungeon-hero-list {
      min-height: 100px;
    }

    .dungeon-encounter-preview {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 4px;
      min-width: 0;
    }

    .dungeon-encounter-preview > span {
      display: grid;
      grid-template-columns: 20px minmax(0, 1fr);
      gap: 0 5px;
      min-width: 0;
      padding: 4px 5px;
      border: 1px solid rgba(183, 247, 255, 0.15);
      background: rgba(3, 12, 22, 0.62);
    }

    .dungeon-encounter-preview b {
      grid-row: 1 / 3;
      display: grid;
      place-items: center;
      width: 20px;
      color: #ffd46b;
      font-size: 10px;
    }

    .dungeon-encounter-preview em,
    .dungeon-encounter-preview small {
      overflow: hidden;
      min-width: 0;
      font-size: 9px;
      font-style: normal;
      line-height: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-encounter-preview em {
      color: #dceeff;
    }

    .dungeon-encounter-preview small {
      color: #7f9aac;
    }

    .dungeon-hero-row {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) 24px;
      align-items: center;
      gap: 8px;
      width: 100%;
      min-height: 54px;
      padding: 5px 7px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(255, 255, 255, 0.035);
      color: #effcff;
      text-align: left;
      cursor: pointer;
    }

    .dungeon-hero-row img {
      width: 42px;
      height: 42px;
      border: 1px solid rgba(183, 247, 255, 0.22);
      object-fit: cover;
    }

    .dungeon-hero-row span,
    .dungeon-hero-row strong,
    .dungeon-hero-row em,
    .dungeon-hero-row small {
      display: block;
      min-width: 0;
    }

    .dungeon-hero-row strong {
      overflow: hidden;
      color: #ffffff;
      font-size: 12px;
      line-height: 16px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-hero-row em,
    .dungeon-hero-row small {
      overflow: hidden;
      color: #91a9b8;
      font-size: 10px;
      font-style: normal;
      line-height: 13px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-hero-row > b {
      display: grid;
      place-items: center;
      width: 22px;
      height: 22px;
      border: 1px solid rgba(255, 212, 107, 0.34);
      color: #ffd46b;
      font-size: 11px;
    }

    .dungeon-hero-row.selected,
    .dungeon-hero-row.active {
      border-color: rgba(69, 219, 255, 0.62);
      background: linear-gradient(90deg, rgba(22, 95, 125, 0.45), rgba(255, 255, 255, 0.025));
      box-shadow: inset 3px 0 #45dbff;
    }

    .dungeon-hero-row.locked,
    .dungeon-run-hero.empty .dungeon-hero-row {
      opacity: 0.42;
      filter: grayscale(0.65);
    }

    .dungeon-warning,
    .dungeon-loss-summary {
      padding: 7px 9px;
      border: 1px solid rgba(255, 116, 92, 0.34);
      background: rgba(82, 24, 20, 0.28);
      color: #ffc0b5;
      font-size: 10px;
      line-height: 15px;
    }

    .dungeon-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: auto;
      padding-top: 8px;
      border-top: 1px solid rgba(183, 247, 255, 0.14);
    }

    .dungeon-actions.vertical {
      display: grid;
    }

    .dungeon-report-links {
      justify-content: center;
      flex-wrap: wrap;
      gap: 6px;
      max-width: 100%;
    }

    .dungeon-actions span {
      color: #8199a8;
      font-size: 10px;
    }

    .dungeon-actions button,
    .dungeon-operation-side > button,
    .dungeon-battlefield-head button,
    .dungeon-order-tools button,
    .dungeon-transfer-row button,
    .dungeon-end-view > button,
    .dungeon-activity-row button {
      min-height: 28px;
      padding: 0 12px;
      border: 1px solid rgba(69, 219, 255, 0.48);
      background: linear-gradient(180deg, rgba(31, 105, 137, 0.76), rgba(5, 25, 39, 0.94));
      color: #effcff;
      font-size: 10px;
      cursor: pointer;
    }

    .dungeon-actions button:disabled,
    .dungeon-order-tools button:disabled {
      opacity: 0.38;
      cursor: default;
    }

    .dungeon-actions button.danger,
    .dungeon-operation-side > button.danger {
      border-color: rgba(255, 116, 92, 0.5);
      background: linear-gradient(180deg, rgba(118, 42, 34, 0.76), rgba(39, 10, 9, 0.94));
    }

    .dungeon-operation-layout,
    .dungeon-rest-layout {
      grid-template-columns: minmax(470px, 1.45fr) minmax(250px, 0.72fr);
    }

    .dungeon-operation-side,
    .dungeon-rest-side {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr) auto;
      gap: 8px;
      padding: 10px;
      overflow: hidden;
    }

    .dungeon-operation-side > strong {
      color: #ffd46b;
      font-size: 12px;
    }

    .dungeon-operation-title {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.16);
    }

    .dungeon-operation-title span,
    .dungeon-operation-title em {
      color: #ffd46b;
      font-size: 10px;
      font-style: normal;
      white-space: nowrap;
    }

    .dungeon-operation-title strong {
      overflow: hidden;
      color: #ffffff;
      font-size: 16px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-encounter-track {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 5px;
      min-width: 0;
    }

    .dungeon-encounter-track > span {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr);
      align-items: center;
      gap: 5px;
      min-width: 0;
      height: 32px;
      padding: 3px 5px;
      border: 1px solid rgba(183, 247, 255, 0.13);
      background: rgba(255, 255, 255, 0.025);
    }

    .dungeon-encounter-track b {
      display: grid;
      place-items: center;
      width: 22px;
      height: 22px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      color: #8da7b8;
      font-size: 10px;
    }

    .dungeon-encounter-track em {
      overflow: hidden;
      color: #77909f;
      font-size: 9px;
      font-style: normal;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-encounter-track > span.done {
      border-color: rgba(111, 218, 118, 0.36);
    }

    .dungeon-encounter-track > span.done b {
      color: #9cf6a2;
      border-color: rgba(111, 218, 118, 0.46);
    }

    .dungeon-encounter-track > span.current {
      border-color: rgba(255, 212, 107, 0.54);
      background: rgba(91, 61, 13, 0.28);
    }

    .dungeon-encounter-track > span.current b,
    .dungeon-encounter-track > span.current em {
      color: #ffd46b;
    }

    .dungeon-travel-clock {
      display: grid;
      place-items: center;
      gap: 3px;
      min-height: 120px;
      border: 1px solid rgba(255, 212, 107, 0.26);
      background: linear-gradient(180deg, rgba(68, 48, 15, 0.28), rgba(4, 12, 19, 0.64));
      text-align: center;
    }

    .dungeon-travel-clock span,
    .dungeon-travel-clock em {
      color: #91a9b8;
      font-size: 10px;
      font-style: normal;
    }

    .dungeon-travel-clock strong {
      color: #ffd46b;
      font-family: Consolas, monospace;
      font-size: 42px;
      line-height: 48px;
    }

    .dungeon-run-roster {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dungeon-run-hero {
      min-width: 0;
    }

    .dungeon-run-hero .dungeon-hero-row {
      grid-template-columns: 38px minmax(0, 1fr) 22px;
      min-height: 50px;
    }

    .dungeon-run-hero .dungeon-hero-row img {
      width: 36px;
      height: 36px;
    }

    .dungeon-order-tools {
      display: grid;
      grid-template-columns: 28px 28px minmax(0, 1fr);
      gap: 3px;
      margin-top: 3px;
    }

    .dungeon-order-tools button {
      min-width: 0;
      padding: 0 4px;
    }

    .dungeon-broadcast {
      min-height: 0;
      overflow: auto;
      padding: 7px;
      border: 1px solid rgba(183, 247, 255, 0.13);
      background: rgba(0, 0, 0, 0.28);
    }

    .dungeon-broadcast p {
      margin: 0 0 6px;
      color: #9eb6c5;
      font-family: Consolas, "Microsoft YaHei", monospace;
      font-size: 10px;
      line-height: 15px;
    }

    .dungeon-progress-panel {
      display: grid;
      gap: 7px;
      min-height: 94px;
      padding: 11px;
      border: 1px solid rgba(69, 219, 255, 0.24);
      background: rgba(11, 39, 53, 0.34);
    }

    .dungeon-progress-panel > div:first-child {
      display: flex;
      justify-content: space-between;
      color: #cfe9f6;
      font-size: 11px;
    }

    .dungeon-progress-panel > div:first-child strong {
      color: #45dbff;
    }

    .dungeon-progress-panel small {
      color: #809aa9;
      font-size: 10px;
    }

    .dungeon-progress-bar {
      height: 12px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.5);
      overflow: hidden;
    }

    .dungeon-progress-bar i {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, #2aa8d5, #6fe27a, #ffd46b);
      transition: width 0.35s linear;
    }

    .dungeon-battlefield-view {
      display: grid;
      grid-template-rows: auto minmax(150px, 1fr) auto minmax(80px, 0.55fr);
      gap: 9px;
      height: 100%;
      padding: 10px;
    }

    .dungeon-battlefield-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(183, 247, 255, 0.18);
    }

    .dungeon-battlefield-head span,
    .dungeon-battlefield-head strong {
      display: block;
    }

    .dungeon-battlefield-head span {
      color: #ffd46b;
      font-size: 10px;
    }

    .dungeon-battlefield-head strong {
      color: #ffffff;
      font-size: 15px;
    }

    .dungeon-battlefield-arena {
      display: grid;
      grid-template-columns: minmax(130px, 1fr) minmax(220px, 2fr) minmax(130px, 1fr);
      align-items: center;
      gap: 18px;
      min-height: 0;
      padding: 18px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background:
        linear-gradient(90deg, rgba(20, 86, 112, 0.28), transparent 42%, rgba(116, 40, 30, 0.24)),
        repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(183, 247, 255, 0.035) 29px),
        rgba(2, 8, 14, 0.84);
    }

    .dungeon-force {
      display: grid;
      gap: 5px;
      padding: 12px;
      border: 1px solid rgba(183, 247, 255, 0.2);
      background: rgba(0, 0, 0, 0.38);
    }

    .dungeon-force b {
      color: #ffffff;
      font-size: 13px;
    }

    .dungeon-force span {
      color: #8fa7b5;
      font-size: 10px;
    }

    .dungeon-force.own {
      border-left: 3px solid #45dbff;
    }

    .dungeon-force.enemy {
      border-right: 3px solid #ff745c;
      text-align: right;
    }

    .dungeon-frontline {
      position: relative;
      height: 30px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: linear-gradient(90deg, rgba(69, 219, 255, 0.34) var(--battle-progress), rgba(255, 116, 92, 0.22) var(--battle-progress));
    }

    .dungeon-frontline i {
      position: absolute;
      left: var(--battle-progress);
      top: -8px;
      width: 3px;
      height: 44px;
      background: #ffd46b;
      box-shadow: 0 0 12px rgba(255, 212, 107, 0.72);
    }

    .dungeon-frontline em {
      position: absolute;
      left: 50%;
      top: 50%;
      translate: -50% -50%;
      color: #ffffff;
      font-size: 11px;
      font-style: normal;
    }

    .dungeon-live-strip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      border: 1px solid rgba(255, 212, 107, 0.22);
      background: rgba(69, 46, 10, 0.24);
      color: #aebfca;
      font-size: 10px;
    }

    .dungeon-live-strip strong {
      color: #ffd46b;
    }

    .dungeon-loss-summary {
      display: grid;
      gap: 3px;
    }

    .dungeon-loss-summary strong {
      color: #ffb0a2;
      font-size: 11px;
    }

    .dungeon-transfer-list {
      overflow: auto;
    }

    .dungeon-transfer-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 56px auto;
      align-items: center;
      gap: 5px;
      padding: 6px;
      border: 1px solid rgba(183, 247, 255, 0.14);
      background: rgba(255, 255, 255, 0.03);
    }

    .dungeon-transfer-row span,
    .dungeon-transfer-row strong,
    .dungeon-transfer-row em {
      display: block;
      min-width: 0;
    }

    .dungeon-transfer-row strong,
    .dungeon-transfer-row em {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dungeon-transfer-row strong {
      color: #dcefff;
      font-size: 10px;
    }

    .dungeon-transfer-row em {
      color: #90a9b8;
      font-size: 9px;
      font-style: normal;
    }

    .dungeon-transfer-row input {
      width: 56px;
      height: 26px;
      border: 1px solid rgba(183, 247, 255, 0.24);
      background: rgba(0, 0, 0, 0.42);
      color: #ffffff;
      text-align: center;
    }

    .dungeon-empty {
      padding: 16px 10px;
      border: 1px dashed rgba(183, 247, 255, 0.18);
      color: #8199a8;
      font-size: 10px;
      text-align: center;
    }

    .dungeon-end-view {
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 9px;
      width: 100%;
      height: 100%;
      padding: 20px;
      text-align: center;
    }

    .dungeon-end-view > span {
      color: #6fe27a;
      font-size: 11px;
      text-transform: uppercase;
    }

    .dungeon-end-view.failed > span {
      color: #ff745c;
    }

    .dungeon-end-view > strong {
      color: #ffffff;
      font-size: 24px;
    }

    .dungeon-end-view > p {
      margin: 0;
      color: #94aab8;
      font-size: 11px;
    }

    .dungeon-end-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 7px;
      width: min(680px, 100%);
    }

    .dungeon-end-stats span {
      display: grid;
      gap: 5px;
      min-width: 0;
      padding: 10px;
      border: 1px solid rgba(183, 247, 255, 0.16);
      background: rgba(255, 255, 255, 0.03);
    }

    .dungeon-end-stats em {
      color: #849dac;
      font-size: 10px;
      font-style: normal;
    }

    .dungeon-end-stats b {
      overflow-wrap: anywhere;
      color: #ffd46b;
      font-size: 12px;
    }

    .dungeon-end-stats b > .dungeon-skill-drop,
    .activity-result-stats b > .dungeon-skill-drop {
      display: inline-grid !important;
      grid-template-columns: 28px minmax(0, 1fr);
      align-items: center;
      gap: 6px;
      max-width: 100% !important;
      padding: 0;
      border: 0;
      background: transparent;
    }

    .dungeon-skill-drop img {
      width: 28px;
      height: 28px;
      border: 1px solid rgba(116, 190, 255, 0.52);
      object-fit: cover;
    }

    .dungeon-skill-drop i {
      overflow-wrap: anywhere;
      color: #dff4ff;
      font-style: normal;
    }

    .dungeon-end-view .dungeon-broadcast {
      width: min(680px, 100%);
      max-height: 120px;
      text-align: left;
    }

    .dungeon-activity-layout {
      display: grid;
      align-content: start;
      gap: 10px;
      height: 100%;
      padding: 10px;
      overflow: auto;
    }

    .dungeon-activity-list {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .dungeon-activity-row {
      --activity-accent: #45dbff;
      display: grid;
      grid-template-columns: 148px minmax(0, 1fr);
      grid-template-rows: auto minmax(0, 1fr) auto;
      grid-template-areas:
        "art kicker"
        "art copy"
        "art action";
      gap: 8px;
      min-width: 0;
      min-height: 164px;
      padding: 7px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      border-top-color: color-mix(in srgb, var(--activity-accent) 70%, transparent);
      background: linear-gradient(145deg, color-mix(in srgb, var(--activity-accent) 10%, rgba(8, 17, 26, 0.92)), rgba(3, 9, 16, 0.94) 58%);
    }

    .dungeon-activity-row.activity-daily-boss { --activity-accent: #ff6f61; }
    .dungeon-activity-row.activity-capture-general { --activity-accent: #f1b35b; }
    .dungeon-activity-row.activity-race-construction { --activity-accent: #56c7ed; }
    .dungeon-activity-row.activity-swarm-invasion { --activity-accent: #79d47b; }

    .dungeon-activity-art {
      grid-area: art;
      min-width: 0;
      overflow: hidden;
      border: 1px solid color-mix(in srgb, var(--activity-accent) 45%, transparent);
      background: #030811;
    }

    .dungeon-activity-art img {
      display: block;
      width: 100%;
      height: 100%;
      min-height: 148px;
      object-fit: cover;
    }

    .dungeon-activity-row > span {
      grid-area: kicker;
      align-self: end;
      color: var(--activity-accent);
      font-size: 10px;
    }

    .dungeon-activity-copy {
      grid-area: copy;
      min-width: 0;
    }

    .dungeon-activity-row strong {
      color: #ffffff;
      font-size: 14px;
    }

    .dungeon-activity-row p {
      margin: 6px 0;
      color: #9aafbc;
      font-size: 10px;
      line-height: 15px;
    }

    .dungeon-activity-row small {
      display: block;
      color: #ffd46b;
      font-size: 9px;
      line-height: 14px;
    }

    .dungeon-activity-row > button {
      grid-area: action;
      justify-self: end;
      border-color: color-mix(in srgb, var(--activity-accent) 60%, transparent);
      background: linear-gradient(180deg, color-mix(in srgb, var(--activity-accent) 24%, rgba(10, 32, 45, 0.88)), rgba(5, 17, 27, 0.96));
    }

    .activity-detail-layout {
      display: grid;
      align-content: start;
      gap: 10px;
      height: 100%;
      padding: 10px;
      overflow: auto;
    }

    .activity-detail-head,
    .activity-detail-actions {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 10px;
      align-items: center;
    }

    .activity-detail-head > div,
    .activity-detail-summary,
    .activity-boss-brief,
    .activity-result-panel {
      display: grid;
      gap: 7px;
    }

    .activity-detail-hero {
      position: relative;
      isolation: isolate;
      min-height: 148px;
      overflow: hidden;
      border: 1px solid rgba(255, 116, 92, 0.34);
      background: #030811;
    }

    .activity-detail-hero > img {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 48%;
    }

    .world-boss-detail-layout .activity-detail-hero > img {
      object-fit: contain;
      object-position: right center;
    }

    .world-boss-detail-layout .activity-detail-hero {
      background: #081321 url("generated_assets/activity_scenes_v1/capture-general.webp") center 45% / cover;
    }

    .world-boss-detail-layout .activity-detail-hero::after {
      background: linear-gradient(90deg, rgba(2, 7, 13, .88), rgba(2, 7, 13, .35) 55%, transparent 88%);
    }

    [data-pirate-panel] .shop-buy {
      justify-self: start;
      min-width: 78px;
    }

    .pirate-defense-actions {
      display: flex;
      gap: 8px;
    }

    [data-pirate-panel] .activity-detail-summary h3 {
      margin: 5px 0 0;
      padding-bottom: 4px;
      border-bottom: 1px solid var(--panel-border);
      color: #f0d882;
      font-size: 13px;
    }

    [data-pirate-panel] summary { cursor: pointer; color: #e6d598; }

    :is(.dungeon-activity-row, .activity-detail-head, .activity-detail-actions,
        .pirate-defense-actions, [data-pirate-panel] .activity-detail-summary,
        .race-construction-head, .swarm-invasion-head, .swarm-garrison-actions,
        .swarm-command-band, .swarm-support-control) > button,
    .race-construction-donation button[type="submit"] {
      border: 1px solid var(--panel-button-border);
      background: var(--panel-button-surface);
      color: var(--panel-button-text);
      border-radius: 1px;
    }

    .activity-detail-hero::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      background: linear-gradient(90deg, rgba(2, 7, 13, 0.92), rgba(2, 8, 14, 0.44) 62%, rgba(2, 7, 13, 0.76));
      pointer-events: none;
    }

    .activity-detail-hero .activity-detail-head {
      position: relative;
      z-index: 2;
      min-height: 148px;
      padding: 14px;
      align-content: end;
    }

    .activity-detail-head span,
    .activity-detail-head small,
    .activity-detail-summary span,
    .activity-boss-brief span,
    .activity-detail-actions span {
      color: #91a9b8;
      font-size: 10px;
    }

    .activity-detail-head strong {
      color: #ffffff;
      font-size: 16px;
    }

    .activity-detail-head button,
    .activity-detail-actions button {
      min-height: 30px;
      border: 1px solid rgba(111, 226, 122, 0.46);
      background: rgba(12, 48, 26, 0.72);
      color: #eaffed;
      cursor: pointer;
    }

    .activity-detail-summary,
    .activity-boss-brief,
    .activity-result-panel {
      padding: 10px;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(3, 12, 20, 0.62);
    }

    .activity-detail-summary p {
      margin: 0;
      color: #c5d8e3;
      font-size: 11px;
      line-height: 16px;
    }

    .activity-detail-summary strong,
    .activity-boss-brief strong {
      color: #ffd46b;
      font-size: 11px;
    }

    .activity-boss-brief {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      border-left: 3px solid #ff6f61;
    }

    .activity-boss-brief.ready {
      border-left-color: #6fe27a;
    }

    .activity-boss-brief > div {
      display: grid;
      gap: 3px;
      min-width: 0;
      padding: 6px 8px;
      background: rgba(0, 0, 0, 0.22);
    }

    .activity-boss-brief > div span,
    .activity-boss-brief > small {
      color: #91a9b8;
      font-size: 9px;
      line-height: 14px;
    }

    .activity-boss-brief > div strong {
      overflow-wrap: anywhere;
      color: #ffffff;
      font-size: 12px;
    }

    .activity-boss-brief.ready > div:last-of-type strong {
      color: #8ff29a;
    }

    .activity-boss-brief.danger > div:last-of-type strong {
      color: #ff9388;
    }

    .activity-power-bar {
      grid-column: 1 / -1;
      height: 7px;
      padding: 0 !important;
      overflow: hidden;
      border: 1px solid rgba(183, 247, 255, 0.18);
      background: rgba(0, 0, 0, 0.62) !important;
    }

    .activity-power-bar i {
      display: block;
      height: 100%;
      max-width: 100%;
      background: #ff6f61;
    }

    .activity-boss-brief.ready .activity-power-bar i {
      background: #6fe27a;
    }

    .activity-boss-brief > small {
      grid-column: 1 / -1;
    }

    .activity-hero-list {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      max-height: 240px;
    }

    .activity-detail-layout .activity-hero-list {
      min-height: 72px;
    }

    .activity-detail-actions {
      grid-template-columns: minmax(0, 1fr) auto;
      padding-top: 4px;
    }

    .activity-detail-actions button {
      min-width: 120px;
      padding: 0 14px;
    }

    .activity-detail-actions button:disabled {
      opacity: 0.4;
      cursor: default;
    }

    .faction-season-panel p {
      margin: 0;
      color: #c5d8e3;
      font-size: 12px;
      line-height: 18px;
    }

    .activity-result-panel > div:first-child {
      display: flex;
      justify-content: space-between;
      gap: 10px;
    }

    .activity-result-panel > div:first-child span {
      color: #91a9b8;
      font-size: 10px;
    }

    .activity-result-panel > div:first-child strong {
      color: #6fe27a;
      font-size: 12px;
    }

    .activity-result-panel.failed {
      border-color: rgba(255, 111, 97, 0.32);
    }

    .activity-result-panel.failed > div:first-child strong {
      color: #ff9388;
    }

    .activity-result-stats {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .activity-result-stats span {
      display: grid;
      gap: 3px;
      padding: 7px;
      background: rgba(0, 0, 0, 0.24);
    }

    .activity-result-stats em {
      color: #91a9b8;
      font-size: 9px;
      font-style: normal;
    }

    .activity-result-stats b {
      overflow-wrap: anywhere;
      color: #ffffff;
      font-size: 10px;
    }

    @media (max-width: 900px) {
      html,
      body {
        width: 100%;
        min-width: 0;
        overflow: hidden;
      }

      .auth-modal {
        width: 100vw;
        max-width: 100%;
        padding: 14px;
      }

      .auth-card {
        width: min(380px, 100%);
        max-width: 100%;
      }

      .shop-dialog {
        width: calc(100% - 16px);
      }

      .shop-body {
        grid-template-columns: 156px minmax(0, 1fr);
      }

      .payment-products {
        grid-template-columns: 1fr;
      }

      .payment-order-row {
        grid-template-columns: minmax(110px, 1fr) 64px 56px;
      }

      .payment-order-row button {
        grid-column: 1 / -1;
        justify-self: end;
      }

      .feature-modal {
        inset: 58px 10px calc(var(--bottom-ui-safe-height) + 8px);
      }

      .topbar,
      .bottombar {
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
      }

      .topbar::-webkit-scrollbar,
      .bottombar::-webkit-scrollbar {
        display: none;
      }

      .bottombar {
        grid-template-columns: 220px 70px 420px 180px 340px;
      }

      .social-inline-form {
        grid-template-columns: 1fr;
      }

      .feature-body.admin-moderation-view {
        grid-template-columns: 1fr;
        overflow: auto;
      }

      .feature-body.equipment-enhance-view {
        display: block;
        overflow-x: hidden;
        overflow-y: auto;
      }

      .equipment-enhance-equipment-panel,
      .equipment-enhance-bag-panel,
      .equipment-enhance-main {
        min-width: 0;
      }

      .equipment-enhance-equipment-panel,
      .equipment-enhance-bag-panel {
        overflow: visible;
      }

      .equipment-enhance-equipment-panel {
        height: 130px;
      }

      .equipment-enhance-main,
      .equipment-enhance-bag-panel {
        margin-top: 10px;
      }

      .equipment-enhance-bag-panel {
        height: 224px;
      }

      .equipment-enhance-equipment-list {
        grid-auto-flow: column;
        grid-auto-columns: minmax(150px, 0.8fr);
        grid-template-columns: none;
        overflow-x: auto;
        overflow-y: hidden;
      }

      .equipment-enhance-equipment-row {
        min-height: 54px;
      }

      .equipment-enhance-main {
        grid-template-rows: minmax(330px, auto) auto 6px auto auto;
        overflow: visible;
      }

      .equipment-enhance-ritual {
        min-height: 330px;
        grid-template-rows: 76px 22px 24px 82px auto auto 30px;
        padding: 12px 8px 10px;
      }

      .equipment-enhance-gem-node {
        width: 76px;
        height: 76px;
      }

      .equipment-enhance-gem-shape {
        font-size: 56px;
      }

      .equipment-enhance-gem-shape.has-image {
        width: 68px;
        height: 68px;
      }

      .equipment-enhance-ritual .equipment-enhance-icon,
      .equipment-enhance-ritual .equipment-enhance-skill-icon {
        width: 76px;
        height: 76px;
      }

      .equipment-enhance-circuit {
        inset: 10px 5%;
      }

      .equipment-enhance-investment {
        padding: 9px 8px;
      }

      .equipment-enhance-selected-card {
        grid-template-columns: 66px minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 80px;
        padding: 6px 8px;
      }

      .equipment-enhance-selected-card .equipment-enhance-icon {
        width: 66px;
        height: 66px;
      }

      .equipment-enhance-progress {
        grid-template-columns: minmax(62px, 1fr) 30px minmax(62px, 1fr);
        min-height: 66px;
        gap: 6px;
      }

      .equipment-enhance-progress strong {
        font-size: 22px;
      }

      .equipment-enhance-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .equipment-enhance-bag-grid {
        grid-template-columns: repeat(4, minmax(54px, 1fr));
        max-height: 214px;
      }

      .equipment-enhance-main .feature-footer {
        flex-wrap: wrap;
      }

      .equipment-enhance-main .feature-footer button {
        flex: 1 1 132px;
        min-width: 0;
      }

      .admin-report-list {
        overflow: visible;
      }

      .admin-sanction-controls {
        grid-template-columns: 1fr;
      }

      .admin-player-row header {
        grid-template-columns: 1fr;
      }

      .admin-player-row header em {
        justify-self: start;
      }

      .admin-player-operation-buttons,
      .admin-resource-operation-row header {
        grid-template-columns: 1fr;
      }

      .admin-resource-operation-row header em {
        justify-self: start;
      }

      .admin-mail-target-grid,
      .admin-mail-item-grid,
      .admin-mail-grant-grid {
        grid-template-columns: 1fr;
      }

      .city-transfer-fields {
        grid-template-columns: 1fr 80px;
      }

      .city-transfer-submit {
        grid-column: 1 / -1;
      }

      .dungeon-selection-layout,
      .dungeon-operation-layout,
      .dungeon-rest-layout {
        grid-template-columns: 1fr;
        overflow: auto;
      }

      .dungeon-stage-panel,
      .dungeon-deploy-panel,
      .dungeon-operation-main,
      .dungeon-operation-side,
      .dungeon-rest-main,
      .dungeon-rest-side {
        overflow: visible;
      }

      .dungeon-stage-brief {
        grid-template-columns: 112px minmax(0, 1fr);
      }

      .dungeon-stage-art {
        width: 112px;
        height: 86px;
      }

      .dungeon-encounter-preview {
        grid-template-columns: repeat(5, minmax(78px, 1fr));
        overflow-x: auto;
      }

      .dungeon-run-roster,
      .dungeon-activity-list,
      .activity-hero-list,
      .activity-result-stats {
        grid-template-columns: 1fr;
      }

      .dungeon-activity-row {
        grid-template-columns: 1fr;
        grid-template-rows: 116px auto minmax(0, 1fr) auto;
        grid-template-areas:
          "art"
          "kicker"
          "copy"
          "action";
      }

      .dungeon-activity-art img {
        min-height: 116px;
      }

      .dungeon-activity-row > button {
        width: 100%;
        justify-self: stretch;
      }

      .activity-boss-brief {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .dungeon-encounter-track {
        grid-template-columns: repeat(5, minmax(34px, 1fr));
        overflow-x: auto;
      }

      .dungeon-encounter-track em {
        display: none;
      }

      .dungeon-battlefield-arena {
        grid-template-columns: 1fr;
      }

      .dungeon-force.enemy {
        text-align: left;
      }

      .dungeon-end-stats {
        grid-template-columns: 1fr;
      }
    }

    /* Compact shell for phones and short landscape screens. */
    @media (max-width: 760px), (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
      :root {
        --bottom-ui-safe-height: 112px;
      }

      .battle-unit.directional-atlas-unit.unit-expedition-cruiser {
        --battle-move-size: 176px;
        --battle-flight-lift: 32px;
      }

      .battle-unit.directional-atlas-unit.unit-sentinel-transport {
        --battle-move-size: 160px;
      }

      .battle-unit.directional-atlas-unit.unit-shadow-agent {
        --battle-move-size: 93px;
      }

      .battle-unit.directional-atlas-unit.unit-dualform-fighter {
        --battle-move-size: 115px;
      }

      .battle-unit.directional-atlas-unit.unit-observer-core {
        --battle-move-size: 86px;
      }

      .battle-unit.directional-atlas-unit.unit-psionic-archon {
        --battle-move-size: 106px;
      }

      .battle-unit.directional-atlas-unit.unit-void-ship {
        --battle-move-size: 141px;
        --battle-flight-lift: 24px;
      }

      .battle-unit.directional-atlas-unit.unit-star-dome-mothership {
        --battle-move-size: 154px;
      }

      .battle-unit.directional-atlas-unit.unit-lumen-prism {
        --battle-move-size: 147px;
      }

      .battle-unit.directional-atlas-unit.unit-radiant-guard {
        --battle-move-size: 72px;
      }

      .battle-unit.directional-atlas-unit.unit-phase-archer {
        --battle-move-size: 72px;
      }

      .battle-unit.directional-atlas-unit.unit-watcher-eye {
        --battle-move-size: 72px;
        --battle-flight-lift: 14px;
      }

      .battle-unit.directional-atlas-unit.unit-corrosion-bomber {
        --battle-move-size: 118px;
        --battle-flight-lift: 19px;
      }

      .battle-unit.directional-atlas-unit.unit-thorn-colossus {
        --battle-move-size: 197px;
      }

      .battle-unit.directional-atlas-unit.unit-bile-beast {
        --battle-move-size: 147px;
      }

      .battle-unit.directional-atlas-unit.unit-skyhammer-armor {
        --battle-move-size: 150px;
      }

      .battle-unit.directional-atlas-unit.unit-nav-sac {
        --battle-move-size: 128px;
        --battle-flight-lift: 27px;
      }

      html,
      body {
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        overscroll-behavior: none;
      }

      body {
        touch-action: manipulation;
      }

      .app {
        grid-template-rows: 88px minmax(0, 1fr);
        width: 100%;
        height: 100%;
      }

      .topbar {
        height: 88px;
        grid-template-columns: 94px minmax(0, 1fr) auto;
        grid-template-rows: 30px 28px 30px;
        align-items: stretch;
        overflow: hidden;
      }

      .audio-settings-popover {
        top: 94px;
        right: 5px;
        width: min(238px, calc(100vw - 10px));
      }

      .brand {
        grid-column: 1 / 3;
        grid-row: 1;
        gap: 5px;
        min-width: 0;
        padding: 0 7px;
        border-right: 1px solid var(--line);
        font-size: 12px;
        white-space: nowrap;
      }

      .registration-faction-card {
        width: min(720px, 100%);
        max-height: 100%;
        padding: 16px;
        overflow-y: auto;
      }

      .registration-faction-options {
        gap: 8px;
      }

      .registration-faction-option {
        min-height: 220px;
      }


      .registration-faction-name {
        padding: 12px 10px;
        font-size: 15px;
      }

      .registration-faction-state {
        right: 8px;
        bottom: 11px;
      }

      .brand-mark {
        width: 18px;
        height: 18px;
      }

      .faction-tabs {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        padding: 0 3px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        scrollbar-width: none;
      }

      .faction-tabs::-webkit-scrollbar,
      .resources::-webkit-scrollbar,
      .system-nav::-webkit-scrollbar,
      .city-function-rail::-webkit-scrollbar,
      .mission-tabs::-webkit-scrollbar,
      .shop-tabs::-webkit-scrollbar,
      .console-build-list::-webkit-scrollbar,
      .console-selected-panel .console-grid::-webkit-scrollbar {
        display: none;
      }

      .faction-tabs .tab {
        flex: 1 0 42px;
        min-width: 42px;
        height: 26px;
        padding: 0 4px;
        font-size: 11px;
      }

      .auth-userbar {
        grid-column: 3;
        grid-row: 1;
        gap: 2px;
        min-width: 0;
        padding-right: 4px;
        overflow: hidden;
      }

      .auth-userbar > span,
      .auth-userbar #authSaveBtn {
        display: none !important;
      }

      .auth-userbar button {
        width: auto;
        min-width: 36px;
        height: 24px;
        padding: 0 5px;
        font-size: 10px;
      }

      .resources {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(8, max-content);
        justify-content: space-between;
        gap: 2px;
        min-width: 0;
        padding: 0 3px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
      }

      .resource {
        width: auto;
        min-width: 64px;
        height: 27px;
        justify-content: center;
        gap: 2px;
        padding: 0 2px;
        font-size: 10px;
      }

      .topbar .resource span {
        display: none;
      }

      .resource i {
        width: 18px;
        height: 18px;
      }

      .resource i img {
        width: 18px;
        height: 18px;
      }

      .resource strong {
        max-width: none;
        overflow: visible;
      }

      .system-nav {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: repeat(7, minmax(44px, 1fr));
        gap: 3px;
        min-width: 0;
        padding: 2px 4px;
        overflow-x: auto;
        overflow-y: hidden;
        border-top: 1px solid rgba(183, 247, 255, 0.12);
        border-left: 0;
        scrollbar-width: none;
      }

      .system-button {
        width: auto;
        min-width: 46px;
        height: 25px;
        padding: 0 3px;
        font-size: 10px;
      }

      .stage-wrap {
        grid-row: 2;
        min-width: 0;
        min-height: 0;
      }

      .universe-view {
        top: 88px;
        bottom: var(--bottom-ui-safe-height);
      }

      .universe-title,
      .universe-three-hover-card {
        display: none;
      }

      .universe-zoom-chip {
        top: 8px;
        right: 8px;
        padding: 4px 7px;
        font-size: 10px;
      }

      .universe-three-selected-panel {
        top: 36%;
        width: min(52vw, 220px);
        height: min(52vw, 220px);
      }

      .universe-three-selected-panel .universe-info-card {
        left: 50%;
        top: calc(100% + 10px);
        width: min(410px, calc(100vw - 20px));
        max-height: min(30vh, 220px);
        transform: translateX(-50%);
        padding: 8px 10px;
      }

      .universe-info-card strong {
        margin-bottom: 3px;
        font-size: 12px;
        line-height: 16px;
      }

      .universe-info-card span {
        font-size: 10px;
        line-height: 14px;
      }

      .universe-legend {
        left: 8px;
        right: 8px;
        bottom: 8px;
        max-width: none;
        gap: 4px 7px;
        padding: 5px 7px;
      }

      .universe-legend span {
        gap: 3px;
        font-size: 9px;
        line-height: 12px;
      }

      .mission-panel {
        left: 8px;
        top: 8px;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 6px;
        width: min(230px, calc(100% - 16px));
        min-width: 0;
      }

      .newbie-guide {
        left: 8px;
        top: 52px;
        width: min(260px, calc(100% - 16px));
      }

      .mission-avatar {
        width: 36px;
        height: 36px;
      }

      .mission-text {
        min-width: 0;
      }

      .mission-text strong,
      .mission-text span {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 11px;
        line-height: 15px;
      }

      .resource-callout,
      .city-jump-rail {
        display: none;
      }

      .city-function-rail {
        left: 6px;
        right: 6px;
        top: auto;
        bottom: calc(var(--bottom-ui-safe-height) + 6px);
        gap: 3px;
        padding: 3px;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;
      }

      .city-function-rail > .hud-button {
        flex: 0 0 36px;
        width: 36px;
        min-width: 36px;
        height: 34px;
        padding: 3px;
      }

      .city-function-panel,
      .city-function-panel.military-mode {
        position: fixed;
        left: 6px;
        right: 6px;
        top: auto;
        bottom: calc(var(--bottom-ui-safe-height) + 48px);
        width: auto;
        max-height: min(54vh, 430px);
        overflow: hidden;
      }

      .city-function-panel-body {
        min-height: 0;
        overflow-y: auto;
      }

      .bottombar {
        height: var(--bottom-ui-safe-height);
        grid-template-columns: 42px 46px minmax(0, 1fr) 46px;
        grid-template-areas: "chat nav console commander";
        gap: 3px;
        padding: 4px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
        overflow: hidden;
      }

      .bottom-panel {
        border-width: 1px;
      }

      .minimap {
        grid-area: chat;
        display: grid;
        place-items: center;
        min-width: 0;
        overflow: visible;
        border: 0;
        background: transparent !important;
        box-shadow: none;
      }

      .minimap::after,
      .minimap > * {
        display: none;
      }

      .chat-button {
        left: 5px;
        width: 38px;
        height: 38px;
        font-size: 18px;
      }

      .nav-dock {
        grid-area: nav;
        gap: 2px;
        padding: 3px;
      }

      .nav-icon {
        min-height: 0;
      }

      .queue {
        display: none;
      }

      .tool-dock {
        grid-area: console;
        grid-template-rows: 16px minmax(0, 1fr);
        gap: 2px;
        min-width: 0;
        padding: 3px 4px;
        overflow: hidden;
      }

      .tool-dock:has(.universe-console) {
        grid-template-rows: minmax(0, 1fr);
        padding: 3px;
      }

      .universe-console {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 2px;
        width: 100%;
        height: 100%;
        padding: 2px;
        overflow: hidden;
      }

      .universe-console-side {
        width: 42px;
        height: 42px;
      }

      .universe-console-center {
        grid-template-columns: repeat(3, 34px);
        grid-template-rows: repeat(3, 28px);
        gap: 1px 3px;
      }

      .universe-console .universe-console-icon img {
        width: 42px;
        height: 42px;
      }

      .universe-console-center .universe-console-icon img {
        width: 36px;
        height: 36px;
      }

      .console-head {
        gap: 4px;
        font-size: 10px;
        line-height: 14px;
      }

      .console-head span {
        display: none;
      }

      .console-grid,
      .console-selected-panel .console-grid {
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
      }

      .console-selected-panel .console-grid {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: 36px;
        grid-template-rows: 36px;
        gap: 3px;
      }

      .console-selected-panel .console-grid .console-button {
        width: 36px;
        height: 36px;
      }

      .console-build-panel {
        grid-template-rows: minmax(0, 1fr) 34px;
      }

      .console-build-list {
        grid-template-columns: repeat(5, 44px);
        grid-auto-rows: 44px;
        gap: 3px;
        overflow: auto;
        scrollbar-width: none;
      }

      .console-build-button {
        width: 44px;
        height: 44px;
      }

      .console-build-footer {
        min-height: 22px;
      }

      .console-back-button {
        width: 32px;
        height: 32px;
        transform: translateY(-10px);
      }

      .commander-card {
        grid-area: commander;
        display: grid;
        grid-template-columns: 1fr;
        padding: 3px;
      }

      .commander-avatar {
        width: 100%;
        height: 100%;
        min-height: 0;
      }

      .action-meter {
        position: absolute;
        right: 2px;
        bottom: 2px;
        display: block;
      }

      .action-bar {
        display: none;
      }

      .action-meter b {
        position: static;
        display: block;
        padding: 1px 3px;
        opacity: 1;
        transform: none;
        font-size: 8px;
        line-height: 10px;
      }

      .commander-popover {
        left: auto;
        right: 0;
        bottom: calc(100% + 6px);
        width: min(210px, calc(100vw - 12px));
      }

      .quick-actions {
        left: 6px;
        right: 6px;
        bottom: calc(var(--bottom-ui-safe-height) + 6px);
        width: auto;
        max-height: min(48vh, 360px);
        grid-template-columns: 1fr;
        padding: 8px;
        overflow-y: auto;
      }

      .battle-view {
        inset: 94px 0 0;
      }

      .battle-view .battle-screen {
        grid-template-rows: minmax(0, 1fr) 94px;
      }

      .stage-wrap:has(.battle-view.open) :is(.chat-dialog, .chat-button) {
        bottom: 99px;
      }

      .battle-top-hud {
        left: 4px;
        right: 4px;
        top: 4px;
        grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
        gap: 4px;
      }

      .battle-roster-card,
      .battle-roster-card.enemy {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 4px;
        min-height: 52px;
        padding: 4px;
        text-align: left;
      }

      .battle-roster-card.enemy {
        grid-template-columns: minmax(0, 1fr) 34px;
        text-align: right;
      }

      .battle-roster-card img {
        width: 34px;
        height: 34px;
      }

      .battle-roster-body {
        gap: 1px;
        font-size: 9px;
        line-height: 1.2;
      }

      .battle-roster-body strong {
        font-size: 11px;
      }

      .battle-roster-body > span:last-child {
        display: none;
      }

      .battle-countdown {
        min-width: 0;
        padding: 4px 3px;
      }

      .battle-countdown span {
        font-size: 8px;
        line-height: 10px;
      }

      .battle-countdown strong {
        font-size: 18px;
        line-height: 22px;
      }

      .battle-hud {
        grid-template-columns: 72px minmax(0, 1fr) 58px;
        gap: 3px;
        padding: 3px;
      }

      .battle-hud-icons,
      .battle-hud > [data-battle-selected-panel] {
        display: none;
      }

      .battle-camera-controls {
        display: none;
      }

      .battle-hud-main {
        grid-template-rows: 18px minmax(0, 1fr);
        gap: 2px;
        padding: 2px;
      }

      .battle-hud-title {
        height: 18px;
        font-size: 10px;
        line-height: 16px;
      }

      .battle-hud-grid {
        gap: 2px;
      }

      .battle-hud-field {
        height: 20px;
        padding: 0 3px;
        font-size: 9px;
        line-height: 18px;
      }

      .battle-hud-field:nth-child(n + 5) {
        display: none;
      }

      .battle-exit-panel {
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 3px;
        padding: 3px;
      }

      .battle-exit-panel .battle-hud-title,
      .battle-exit-panel p {
        display: none;
      }

      .battle-exit-panel button {
        min-width: 0;
        min-height: 0;
        padding: 1px;
        font-size: 9px;
      }

      .feature-modal,
      .feature-modal:has(> .feature-body.battle-report-view) {
        left: 5px !important;
        right: 5px;
        top: 94px !important;
        bottom: calc(var(--bottom-ui-safe-height) + 5px);
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        transform: none !important;
        grid-template-rows: 40px minmax(0, 1fr);
      }

      .feature-head {
        padding: 6px 8px;
        cursor: default;
      }

      .feature-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        min-width: 0;
        min-height: 0;
        padding: 8px;
        overflow-x: hidden;
        overflow-y: auto;
      }

      .feature-body > *,
      .feature-side,
      .feature-main {
        min-width: 0;
        max-width: 100%;
      }

      .feature-side,
      .feature-main {
        overflow: visible;
      }

      .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        overflow: visible;
      }

      .mission-dialog,
      .shop-dialog,
      .hero-recruit-dialog,
      .hero-detail-dialog {
        position: fixed;
        left: 5px !important;
        right: 5px;
        top: 94px !important;
        bottom: calc(var(--bottom-ui-safe-height) + 5px);
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        transform: none !important;
      }

      body:has(.feature-modal.open, .mission-dialog.open, .shop-dialog.open, .hero-recruit-dialog.open, .hero-detail-dialog.open, .battle-view.open, .planet-training-dialog) .mission-panel,
      body:has(.feature-modal.open, .mission-dialog.open, .shop-dialog.open, .hero-recruit-dialog.open, .hero-detail-dialog.open, .battle-view.open, .planet-training-dialog) .newbie-guide {
        display: none;
      }

      .planet-training-dialog {
        position: fixed;
        left: 5px;
        right: 5px;
        top: 94px;
        bottom: calc(var(--bottom-ui-safe-height) + 5px);
        width: auto;
        height: auto;
        translate: none;
        grid-template-rows: 38px minmax(0, 1fr) auto;
      }

      .planet-training-dialog-body {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
        gap: 6px;
        padding: 6px;
        overflow-y: auto;
      }

      .planet-training-column {
        min-height: auto;
        overflow: visible;
      }

      .planet-training-dialog-foot {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        padding: 6px 8px 8px;
        font-size: 10px;
      }

      .planet-training-start {
        min-width: 82px;
      }

      .mission-dialog-head,
      .shop-head,
      .hero-recruit-head,
      .hero-detail-head {
        cursor: default;
      }

      .mission-dialog-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
      }

      .mission-tabs,
      .shop-tabs {
        display: flex;
        gap: 6px;
        min-width: 0;
        padding: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
      }

      .shop-tabs {
        flex: 0 0 44px;
        height: 44px;
        min-height: 44px;
        align-items: center;
      }

      .shop-tabs > .feature-kicker,
      .shop-tabs > .feature-summary,
      .shop-tabs > .feature-stats {
        display: none;
      }

      .mission-tab,
      .shop-tab {
        flex: 0 0 auto;
        min-width: 92px;
        height: 30px;
        padding: 0 8px;
        text-align: center;
      }

      .mission-list {
        overflow-y: auto;
      }

      .shop-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 6px;
        padding: 6px;
      }

      .shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 138px;
        gap: 6px;
        padding: 6px;
      }

      .chat-dialog {
        position: fixed;
        left: 5px;
        right: 5px;
        bottom: calc(var(--bottom-ui-safe-height) + 5px);
        width: auto;
        height: min(55vh, 420px);
      }

      .chat-head {
        grid-row: 1;
      }

      .chat-tabs {
        grid-row: 2;
      }

      .chat-recipient {
        grid-row: 3;
      }

      .chat-log {
        grid-row: 4;
      }

      .chat-input-row {
        grid-row: 5;
      }

      .hero-recruit-body,
      .hero-detail-body {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
      }

      .hero-config-panel,
      .hero-recruit-dialog .hero-detail-card {
        min-width: 0;
        overflow: visible;
      }

      .auth-modal {
        padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
      }

      .auth-card {
        width: min(380px, 100%);
        max-height: 100%;
        padding: 16px;
      }

      .toast {
        top: 8px;
        width: calc(100% - 16px);
        min-width: 0;
        padding: 7px 10px;
        font-size: 11px;
      }
    }

    @media (max-width: 560px) {
      .registration-faction-options {
        grid-template-columns: 1fr;
      }

      .registration-faction-option {
        min-height: 170px;
      }

    }

    @media (max-width: 380px) {
      .topbar {
        grid-template-columns: 42px minmax(0, 1fr) auto;
      }

      .brand {
        justify-content: center;
        padding: 0 4px;
      }

      .brand > span:last-child {
        display: none;
      }

      .auth-userbar button {
        min-width: 33px;
        padding: 0 3px;
      }

      .resource {
        min-width: 40px;
      }

      .bottombar {
        grid-template-columns: 38px 42px minmax(0, 1fr) 42px;
      }

      .shop-grid,
      .feature-grid,
      .activity-boss-brief,
      .activity-result-stats {
        grid-template-columns: 1fr;
      }

      .mission-card {
        grid-template-columns: minmax(0, 1fr);
      }

      .mission-submit {
        width: 100%;
      }

      .mission-actions {
        width: 100%;
      }

      .auth-actions,
      .legal-consent-actions,
      .account-security-actions {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
      :root {
        --bottom-ui-safe-height: 84px;
      }

      .app {
        grid-template-rows: 62px minmax(0, 1fr);
      }

      .topbar {
        height: 62px;
        grid-template-columns: 94px minmax(0, 1fr) auto;
        grid-template-rows: 31px 31px;
      }

      .audio-settings-popover {
        top: 66px;
      }

      .resources {
        grid-column: 1 / 3;
        grid-row: 2;
      }

      .system-nav {
        grid-column: 3;
        grid-row: 2;
        grid-template-columns: repeat(7, 42px);
        border-top: 0;
      }

      .system-button {
        min-width: 42px;
      }

      .stage-wrap {
        grid-row: 2;
      }

      .universe-view {
        top: 62px;
      }

      .universe-three-selected-panel {
        left: 34%;
        top: 44%;
        width: min(38vh, 170px);
        height: min(38vh, 170px);
      }

      .universe-three-selected-panel .universe-info-card {
        left: calc(100% + 10px);
        top: 50%;
        width: min(42vw, 310px);
        max-height: calc(100vh - 160px);
        transform: translateY(-50%);
      }

      .universe-legend {
        display: none;
      }

      .feature-modal,
      .feature-modal:has(> .feature-body.battle-report-view),
      .mission-dialog,
      .shop-dialog,
      .hero-recruit-dialog,
      .hero-detail-dialog {
        top: 68px !important;
      }

      .chat-dialog {
        height: min(68vh, 320px);
      }

      .bottombar {
        grid-template-columns: 38px 42px minmax(0, 1fr) 42px;
        padding-top: 3px;
      }

      .console-build-list {
        grid-template-columns: repeat(5, 38px);
        grid-auto-rows: 38px;
      }

      .console-build-button {
        width: 38px;
        height: 38px;
      }

      .planet-console-operation {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 5px;
      }

      .planet-console-operation > img {
        width: 40px;
        height: 38px;
      }

      .planet-console-hint {
        display: none;
      }

      .planet-console-actions {
        grid-template-columns: repeat(2, 38px);
        gap: 3px;
      }

      .planet-console-actions button {
        height: 28px;
        font-size: 10px;
      }

      .universe-console {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 2px;
        padding: 2px;
      }

      .universe-console-side {
        width: 40px;
        height: 40px;
      }

      .universe-console-center {
        grid-template-columns: repeat(3, 34px);
        grid-template-rows: repeat(3, 25px);
        gap: 1px 3px;
      }

      .universe-console .universe-console-icon img,
      .universe-console-center .universe-console-icon img {
        width: 38px;
        height: 38px;
      }
    }

    /* Original-client frames own their poses, colors and death effects. */
    .battle-unit.battle-original-unit {
      animation: none !important;
      filter: none !important;
    }

    .battle-unit.battle-original-unit.destroyed {
      opacity: 1 !important;
      transform: scale(var(--depth-scale, 1));
    }

    .battle-unit.battle-original-unit::before {
      display: none !important;
    }

    .battle-unit.battle-original-unit:not(.selected)::after {
      display: none !important;
    }

    .battle-unit.battle-original-unit .battle-contact-shadow {
      left: calc(50% + var(--original-shadow-x, 0px));
      width: var(--original-shadow-width, 36px);
      height: var(--original-shadow-height, 7px);
      bottom: var(--original-shadow-bottom, -3px);
      background: radial-gradient(ellipse, rgba(17, 22, 7, .6), rgba(17, 22, 7, .28) 52%, transparent 78%);
      filter: blur(.65px);
      opacity: 1;
    }

    .battle-unit.battle-original-unit .battle-cast-shadow {
      position: absolute;
      z-index: 0;
      left: 50%;
      bottom: 0;
      width: var(--cast-canvas);
      height: var(--cast-canvas);
      translate: -50% var(--cast-offset);
      transform-origin: 50% var(--cast-anchor);
      transform: matrix(1, 0, -.23, .28, 0, 0);
      background: #191912;
      mask: var(--cast-atlas) left top / var(--cast-atlas-size) no-repeat;
      opacity: .42;
      pointer-events: none;
    }

    .battle-unit.battle-original-unit:is(.motion-flight,.motion-hover) .battle-cast-shadow {
      transform: matrix(.93, 0, -.13, .56, 4, 2);
      opacity: .48;
    }

    .battle-unit.battle-original-unit:is(.motion-flight,.motion-hover) .battle-contact-shadow {
      opacity: .18;
    }

    .battle-unit.battle-original-unit .battle-original-clip {
      width: var(--original-canvas-size) !important;
      height: var(--original-canvas-size) !important;
      bottom: var(--original-flight-lift, 0px) !important;
      translate: -50% var(--original-offset-y, 0px) !important;
      scale: 1 !important;
      transform: none !important;
      opacity: 1 !important;
      filter: none !important;
      animation: none !important;
      transition: none !important;
    }

    .battle-unit.battle-original-unit .battle-original-clip .battle-directional-sprite {
      filter: none !important;
      transform: none !important;
      image-rendering: auto;
    }

    .battle-unit.stealth-active:not(.destroyed) :is(.battle-directional-clip, .battle-horizontal-clip,
      .battle-procedural-ship-clip, .battle-motion-sprite, .battle-move-sprite, .battle-sprite, .battle-ground-token,
      .battle-earth-spine-burrow-ring) {
      filter: brightness(1.28) saturate(.58) blur(1.35px) opacity(.5) !important;
    }

    .battle-unit.stealth-active:not(.destroyed) :is(.battle-contact-shadow, .battle-cast-shadow) {
      opacity: .13 !important;
    }

    .battle-unit.battle-original-unit .battle-original-hit {
      position: absolute;
      z-index: 5;
      pointer-events: auto;
    }

    .battle-member-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; }
    .battle-member-minimap { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
    .ai-raid-indicator { color: #fff0c6; border-color: #de9155; background: #622b22; }
    .ai-raid-indicator[hidden] { display: none; }
    #outpostMarchIndicator { width: auto; min-width: 76px; flex: 0 0 auto; }
    @media (min-width: 901px) {
      #outpostMarchIndicator { position: fixed; top: 44px; right: 12px; min-width: 100px; }
    }
    .ai-raid-dialog { width: min(460px, calc(100% - 32px)); max-width: 100%; padding: 20px; color: #e5f1f4; background: #0b1820; border: 1px solid #c07a45; }
    .ai-raid-dialog::backdrop { background: rgba(0, 0, 0, .62); }
    .ai-raid-dialog h2 { margin: 0 0 12px; font-size: 18px; }
    .ai-raid-dialog p { line-height: 1.5; overflow-wrap: anywhere; }
    .ai-raid-dialog [role="status"] { color: #ffb7a6; }
    .ai-raid-actions { display: flex; justify-content: flex-end; gap: 8px; }
    .ai-raid-actions button { padding: 7px 14px; color: #e5f1f4; border: 1px solid #65a0ad; background: #142b35; cursor: pointer; }
    .ai-raid-actions button:disabled { opacity: .55; cursor: default; }

    .battle-unit.battle-original-unit .battle-unit-death-burst,
    .battle-unit.battle-original-unit .battle-unit-energy-ring,
    .battle-unit.battle-original-unit.destroyed .battle-unit-health,
    .battle-unit.battle-original-unit.destroyed .battle-contact-shadow,
    .battle-unit.battle-original-unit.destroyed .battle-cast-shadow {
      display: none !important;
    }



.fleet-route-preview { grid-column: 1 / -1; display: block; color: #b9d6dc; font-size: 12px; line-height: 1.5; padding: 7px 9px; border: 1px solid #315763; overflow-wrap: anywhere; }

/* City targets stay readable in screen space while the map pans beneath them. */
.building-label[hidden] { display: none; }
.building-label {
  box-sizing: border-box; min-height: 26px; max-width: 260px;
  padding: 3px 7px; font-size: 12px; line-height: 18px;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer; pointer-events: auto;
}
.building-label.selected { color: #d7fcff; border-color: #8ce4f0; background: #0c2a36; }
.building-label:hover { border-color: #b1f2ff; background: #163542; }
.building:focus-visible, .building-label:focus-visible, .city-building-dot:focus-visible {
  outline: 2px solid #bdedff; outline-offset: 3px;
}
.city-building-dot {
  width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0;
  border: 0; cursor: pointer; z-index: 2; background: transparent; box-shadow: none;
}
.city-building-dot::before { content: ''; position: absolute; inset: 4px; background: var(--faction); box-shadow: 0 0 4px var(--faction); }
.city-building-dot.selected { z-index: 3; }
.city-building-dot.selected::before { inset: 2px; border: 1px solid #f3fbff; box-shadow: 0 0 6px #e4f9ff; }
.city-minimap-viewport {
  position: absolute; box-sizing: border-box; pointer-events: none; z-index: 1;
  border: 1px solid #d1edf4; background: rgba(177, 222, 242, .07);
}

/* Delay game artwork until the server has restored an authenticated session. */
html[data-assets-locked] .app { display: none !important; }

/* Keep inventory art legible at shop, equipment, loot and inline reward sizes. */
img:is([src*="skill_icons_v1/"], [src*="/template_icons/"], [src*="/icons/unit_equipment/"], [src*="/icons/equipment/"]) {
  box-sizing: border-box;
  border: 3px solid #406285;
  border-image: url("generated_assets/item_icons_v1/optimized/shop/inventory-frame.png") 4 stretch;
  background: #0d1522;
}
img.energy-tier-icon, .battle-report-skill-icon img { border-width: 1px; }
.original-shop-icon {
  display: block;
  width: 54px;
  height: 54px;
  background: url("generated_assets/item_icons_v1/optimized/original-shop-tiles.png") no-repeat;
  background-size: 700% 300%;
}
body:has(#shopDialog.open) :is(.newbie-guide, .newbie-guide-pointer) { visibility: hidden; }

/* Interface chrome shared by the shop, game panels and confirmations. */
:root {
  --panel-border: #536784;
  --panel-surface: linear-gradient(130deg, #111925, #050913 45%, #0a1022);
  --panel-shadow: inset 0 0 0 2px #111925, 0 12px 34px #000b;
  --panel-title-surface: linear-gradient(#191f28, #8b9092 12%, #181b22 20%, #444953 31%, #070b10 37%, #0b1119);
  --panel-button-border: #406c42;
  --panel-button-surface: linear-gradient(#234729, #102a1d 52%, #0b1b14);
  --panel-button-text: #caddbf;
  --panel-button-hover: linear-gradient(#4f883e, #19441e 56%, #2b551d);
}
:is(.feature-modal, .game-dialog, .planet-training-dialog, .city-feature-panel, .hero-detail-dialog, .hero-recruit-dialog, .mission-dialog, .outpost-scout-dialog, .chat-dialog, .plan-task-dialog) {
  border-color: var(--panel-border);
  background: var(--panel-surface);
  box-shadow: var(--panel-shadow);
}
:is(.feature-modal > .feature-head, .game-dialog:not(.compact) h2, .planet-training-dialog-head, .chat-head, .plan-task-head) {
  background: var(--panel-title-surface);
  border-bottom-color: #24354c;
}
:is(.game-dialog footer button, .system-feature-row-actions button, .planet-console-actions button,
    .planet-action-row button, .planet-training-dialog-foot button, .feature-head button, .battle-exit-panel button,
    .universe-flight-card button, .city-transfer-console button, .city-feature-card button,
    .feature-main button:not(.bag-cell, .bag-item, .auction-item-cell), .plan-task-dialog :is(footer button, .plan-task-close, .plan-task-row-action button, .plan-task-error button)) {
  border: 1px solid var(--panel-button-border);
  background: var(--panel-button-surface);
  color: var(--panel-button-text);
}
:is(.game-dialog footer button, .system-feature-row-actions button, .planet-console-actions button,
    .planet-action-row button, .planet-training-dialog-foot button, .feature-head button, .battle-exit-panel button,
    .universe-flight-card button, .city-transfer-console button, .city-feature-card button,
    .feature-main button:not(.bag-cell, .bag-item, .auction-item-cell), .plan-task-dialog :is(footer button, .plan-task-close, .plan-task-row-action button, .plan-task-error button)):enabled:is(:hover, :focus-visible) {
  border-color: #86ae4c;
  background: var(--panel-button-hover);
  color: #f2ffd7;
}
.game-dialog [data-game-dialog-confirm], .plan-task-dialog footer [data-plan-task-submit]:enabled { border-color: #86ae4c; }
.game-dialog [data-game-dialog-cancel] { border-color: var(--panel-border); background: #131d2a; color: #d3deec; }

body :is(.console-recruit-popover, .game-dialog, .outpost-scout-dialog, .planet-atlas-gallery) {
  border: 1px solid var(--classic-frame);
  border-radius: 2px;
  background: var(--classic-body);
  box-shadow: var(--classic-rim);
  color: #dce3ed;
}

body :is(.console-recruit-head, .audio-settings-head, .game-dialog:not(.compact) h2, .outpost-scout-dialog > header, .planet-atlas-gallery > header) {
  border-bottom: 1px solid #3a4863;
  background: var(--classic-metal);
  color: #e7eaf2;
  text-shadow: 1px 1px #000;
}

body :is(.console-recruit-head, .audio-settings-head) { padding: 5px 7px; }

body :is(.console-recruit-close, .city-function-panel-close, .planet-training-dialog-head button, .outpost-scout-dialog > header button, .planet-atlas-gallery button) {
  border: 1px solid #567846;
  border-radius: 1px;
  background: var(--classic-green);
  color: #dbead2;
}

body :is(.game-dialog footer, .planet-training-dialog-foot) { flex-wrap: wrap; }

body .planet-atlas-gallery > header {
  margin: -18px -22px 0;
  padding: 8px 12px;
}

body .planet-atlas-gallery button[aria-pressed="true"] {
  border-color: #abd263;
  background: var(--classic-lit);
  color: #f6ffe3;
}

@media (761px <= width <= 1099px) and (height > 520px), (961px <= width <= 1099px) {
  .app .topbar { grid-template-columns: 102px minmax(0, 1fr) auto auto; }
  .app .brand { padding-inline: 6px; gap: 5px; white-space: nowrap; }
  .app .brand-mark { width: 20px; height: 20px; }
  .app .system-nav { gap: 2px; padding-inline: 3px; }
  .app .system-nav .system-button { min-width: 34px; padding-inline: 4px; }
  .bottombar {
    grid-template-columns: 132px 52px minmax(195px, 1fr) 118px minmax(215px, 1fr);
    overflow: visible;
  }
  .bottombar .commander-card { grid-template-columns: minmax(0, 1fr) 18px; gap: 3px; }
  .bottombar .commander-avatar { width: 100%; min-width: 0; }
  .feature-modal { inset-inline: 16px; }
}

/* Desktop shop counter layout. */
#shopDialog {
  width: min(784px, calc(100% - 28px)); height: min(565px, calc(100% - 58px));
  grid-template-rows: 43px minmax(0, 1fr) 34px;
  border: 1px solid var(--panel-border);
  background: var(--panel-surface);
  box-shadow: var(--panel-shadow);
}
#shopDialog .shop-head {
  position: relative; display: flex; justify-content: center; align-items: center; padding: 0;
  background: var(--panel-title-surface);
  border-bottom: 1px solid #24354c;
}
#shopDialog .shop-title {
  display: grid; width: 306px; height: 43px; place-items: center;
  background: url("generated_assets/item_icons_v1/optimized/shop/shop-header.png") center/contain no-repeat;
}
#shopDialog .shop-title strong { font-size: 20px; line-height: 28px; letter-spacing: .12em; text-shadow: 0 2px 1px #000; }
#shopDialog .shop-close, .shop-footer button, #shopDialog .shop-tab {
  border: 1px solid var(--panel-button-border); background: var(--panel-button-surface);
  color: var(--panel-button-text); text-align: center; font-size: 13px; cursor: pointer;
}
#shopDialog .shop-close { position: absolute; right: 9px; width: 64px; height: 22px; }
#shopDialog .shop-body { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); min-height: 0; padding: 8px 12px 0; gap: 0; }
#shopDialog .shop-tabs { display: flex; align-items: end; gap: 3px; height: auto; min-height: 0; padding: 0 4px; border: none; background: none; overflow-x: auto; }
#shopDialog .shop-tab { flex: 1 0 auto; min-width: 0; height: 26px; padding: 0 8px; border-radius: 3px 6px 0 0; }
#shopDialog .shop-tab.active, #shopDialog .shop-tab:hover, .shop-footer button:hover, #shopDialog .shop-close:hover { color: #f2ffd7; background: linear-gradient(#4f883e, #19441e 56%, #2b551d); border-color: #86ae4c; }
#shopDialog .shop-grid { border: 1px solid #344870; background: linear-gradient(140deg, #0b111e, #040812 60%, #091121); scrollbar-color: #345d85 #0d1624; }
#shopDialog .shop-grid:not(.payment-center) {
  display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); grid-auto-rows: 132px; gap: 5px 0;
  padding: 10px 6px; align-content: start; scrollbar-gutter: stable;
}
#shopDialog .shop-card {
  display: grid; grid-template-rows: 78px 20px 20px; justify-items: center; align-content: center;
  gap: 1px; padding: 2px; border: 1px solid transparent; box-shadow: none; background: none;
}
#shopDialog .shop-card:hover, #shopDialog .shop-card:focus-within { border-color: #354e69; background: #122034; }
#shopDialog .shop-card:focus-visible { outline: 1px solid #c2eaff; outline-offset: -2px; }
#shopDialog .shop-icon, #shopDialog .original-shop-icon { width: 78px; height: 78px; max-width: 100%; }
#shopDialog .shop-card strong { max-width: 100%; color: #ffe56a; font-size: 12px; text-shadow: 1px 1px #000; }
#shopDialog .shop-buy, #shopDialog .shop-list-price {
  box-sizing: border-box; width: 78px; height: 21px; min-width: 0; max-width: 100%;
  display: flex; justify-content: space-between; align-items: center; padding: 0 4px;
  border: 1px solid transparent; background: transparent; box-shadow: none;
}
#shopDialog .shop-buy small, .shop-list-price small { font-size: 11px; color: #adbfce; }
#shopDialog .shop-buy b, .shop-list-price b, .shop-footer strong { color: #93ef64; font-variant-numeric: tabular-nums; font-size: 13px; }
#shopDialog .shop-buy:enabled:hover, #shopDialog .shop-buy:focus-visible { background: #193522; border-color: #55733e; }
.shop-footer { display: flex; align-items: center; gap: 7px; padding: 3px 13px; }
.shop-footer .shop-currency { margin-right: auto; color: #c7d4e4; font-size: 12px; }
.shop-footer [data-shop-gift-recipient] { width: 104px; color: #e1eff5; background: #132435; border: 1px solid #42627b; padding: 3px 6px; }
.shop-footer [hidden] { display: none; }
.shop-footer strong { margin-left: 5px; }
.shop-footer button { min-width: 70px; height: 23px; }
img[src*="item_icons_v1/optimized/shop/"] { border: 0; background: transparent; }

img:is(
  [src$="/shop/resource-card-crystal.png"],
  [src$="/shop/resource-card-gas.png"],
  [src$="/shop/resource-card-alloy.png"],
  [src$="/shop/resource-card-rare.png"],
  [src$="/shop/resource-card-shard.png"]
) {
  box-sizing: border-box;
  padding: 4px;
  border-radius: 4px;
  object-fit: contain;
  background:
    url("generated_assets/item_icons_v1/optimized/shop/inventory-frame.png") center / 100% 100% no-repeat,
    radial-gradient(ellipse at 50% 65%, #182d43, #080f19 78%);
}


#item-detail-tooltip {
  position: fixed; z-index: 2147483600; pointer-events: none; box-sizing: border-box;
  inset: auto; overflow: visible;
  width: max-content; max-width: min(244px, calc(100vw - 12px));
  margin: 0; padding: 5px 8px; overflow-wrap: anywhere;
  background: linear-gradient(125deg, #19283b, #090f1c 75%); color: #d9e1e9;
  border: 1px solid #7593b5; box-shadow: inset 0 0 0 2px #263a50, 2px 5px 14px #000a;
  font: 12px/1.4 "Microsoft YaHei", sans-serif;
}
#item-detail-tooltip[hidden], #item-detail-tooltip [hidden] { display: none; }
#item-detail-tooltip .detail-head { display: flex; align-items: center; gap: 6px; }
#item-detail-tooltip .detail-head i:not([hidden]), #item-detail-tooltip .detail-head img {
  display: block; width: 36px; height: 36px; flex: none; object-fit: contain;
}
#item-detail-tooltip strong, #item-detail-tooltip small { display: block; }
#item-detail-tooltip strong { color: #ffe577; font-size: 13px; }
#item-detail-tooltip small { color: #a9bed3; font-size: 11px; }
#item-detail-tooltip p { margin: 4px 0 0; }
#item-detail-tooltip footer { margin-top: 4px; padding-top: 4px; border-top: 1px solid #344b61; white-space: pre-line; color: #c3e0b3; }
.equipment-hover-head:has(.equipment-detail-image) { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; }
.equipment-detail-image { width: 34px; height: 34px; object-fit: contain; grid-column: 1; grid-row: 1 / 3; }
.equipment-hover-head:has(.equipment-detail-image) small { grid-column: 2 / -1; }
.equipment-hover-head:has(.equipment-detail-image) strong { color: #ffe577; }

#shopDialog .exchange-header { grid-column: 1 / -1; padding: 6px 8px; color: #bfd0dd; align-self:start; }
#shopDialog .exchange-header nav, #shopDialog .exchange-gift { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
#shopDialog .shop-grid:has(> .announcement-panel) { grid-template-rows:auto; }
#shopDialog .shop-grid:has(> [data-naga-campaign]) { grid-template-rows: auto auto; }
#shopDialog .announcement-panel button { border:1px solid #5a7851; color:#e5f7d8; background:#233c29; padding:3px 10px; }
#shopDialog .announcement-panel button:disabled { color:#93a4ac; background:#17242c; border-color:#374954; }
#shopDialog .announcement-panel h3 { margin:4px 0; color:#def3ff; }
#shopDialog .announcement-panel output { margin-left:10px; color:#b3e7c0; }
.forge-gem-operation .smelt-slots { display:flex; gap:6px; flex-wrap:wrap; margin:10px 0; }
.forge-gem-operation .smelt-slots label { display:grid; gap:3px; }
.forge-gem-operation .smelt-slots select { color:#e5edf5; background:#152938; border:1px solid #4c6684; padding:4px; }
#shopDialog .calendar-reward { display:flex; justify-content:space-between; align-items:center; padding:5px 0; gap:12px; border-bottom:1px solid #344865; }
#shopDialog .exchange-header p { margin:8px 0 3px; }
#shopDialog .exchange-header [aria-pressed="true"] { color:#9de79a; border-color:#619369; }
#shopDialog .exchange-gift input { max-width:145px; background:#101a29; border:1px solid #64738a; color:#e5edf7; }
#shopDialog .exchange-card .shop-buy { white-space:normal; font-size:11px; }
#shopDialog .exchange-mission { grid-column:1/-1; justify-self:start; margin:8px; }
    .prison-panel { padding: 8px 12px; }
    .prison-panel p { margin: 6px 0; }
    .prison-roster, .prison-controls { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
    .prison-roster button[aria-pressed="true"] { outline: 1px solid #9de5cc; color: #c5ffe9; }
    .prison-grid { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 440px); background: linear-gradient(#07151ba8,#0d1e24c9), url("generated_assets/dungeon_scenes_v1/silent-station.webp") center/cover; }
    .prison-grid button { min-width: 0; min-height: 28px; padding: 1px; border: 1px solid #415967; border-radius: 1px; font-size: 11px; }
    .prison-grid .wall { background: repeating-linear-gradient(135deg,#28343d 0 4px,#1d2830 4px 8px); }
    .prison-grid .floor { background: #172d357c; }
    .prison-grid .reachable { background: #235f605c; border-color: #66ae9c; }
    .prison-grid .guard { color: #ffe2b5; background: #77382e; }
    .prison-grid .ally { color: #cceaff; background: #225170; }
    .prison-grid .destination { color: #d6faff; background: #22696c; }
    .prison-grid button:disabled { opacity: 1; cursor: default; }

    #featureModal .battle-report-unit-grid {
      justify-content: center;
      scrollbar-gutter: stable both-edges;
      grid-template-columns: repeat(5, minmax(0, 70px));
    }

    @media (max-width: 900px) {
      #featureModal .battle-report-classic:not(.battle-analysis) {
        grid-template-rows: none;
        grid-auto-rows: auto;
      }
      #featureModal .battle-report-meta { grid-auto-rows: minmax(16px, auto); }
    }

    @media (max-width: 760px), (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
      #featureModal:has(> .battle-report-view) {
        inset: 0 !important;
        margin: auto;
        width: calc(100% - 12px);
        height: min(590px, calc(100dvh - 16px));
        transform: none !important;
      }
      #featureModal > .battle-report-view {
        max-height: none;
        overflow: auto;
      }
    }

/* Compact battle summary. Analysis and replay use their own layouts. */
#featureModal:has(> .report-summary) {
  --report-frame: #66c366;
  --report-panel-edge: #4da856;
  --report-inset-edge: #234830;
  --report-edge-glow: #61e66244;
  --report-socket: url("../game_design/art_reference/generated_ui/battle/report-socket-20261126.webp");
  position: fixed;
  width: min(720px, calc(100vw - 24px));
  height: max-content;
  max-height: calc(100dvh - 20px);
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--report-frame);
  border-radius: 6px;
  padding: 6px;
  background: linear-gradient(180deg, #141e23, #0b1421 64%, #111c2b);
  clip-path: none;
  box-shadow: 0 0 0 2px #253b35, 0 0 15px var(--report-edge-glow), 0 12px 30px #0009;
}
#featureModal:has(> .report-summary)::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border: 10px solid transparent;
  border-image: url("../game_design/art_reference/generated_ui/battle/report-window-20261126.webp") 55 / 12px stretch;
  pointer-events: none;
}
body #featureModal:has(> .report-summary) > .feature-head::before {
  background: none;
}
body #featureModal:has(> .report-summary) > .feature-head {
  background: linear-gradient(180deg, #263539, #151f30 26%, #070f1d 83%, #152330);
  border-bottom: 1px solid #52705e;
  border-radius: 5px 5px 0 0;
  box-shadow: inset 0 1px #a3b9b666;
}
#featureModal:has(> .report-summary) .feature-title {
  justify-self: center;
  text-align: center;
  min-width: 0;
  width: min(154px, calc(100% - 174px));
  min-height: 49px;
  align-content: center;
  padding: 4px 10px 5px;
  background: url("../game_design/art_reference/generated_ui/battle/report-title-20261126.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 2px #03060b);
  gap: 0;
}
#featureModal:has(> .report-summary) .feature-title strong {
  color: #f5f9ff;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 22px;
  letter-spacing: .18em;
  text-indent: .18em;
  text-shadow: 0 1px #7b91ac, 0 2px #080e25, 0 0 6px #8fb9f0ad;
}
#featureModal:has(> .report-summary) .feature-title span { color: #bdcddf; font-size: 10px; line-height: 12px; }
#featureModal > .report-summary {
  padding: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
#featureModal .report-summary .battle-report-classic {
  display: flex;
  flex-direction: column;
  height: auto;
  border: 0;
  background: #0d1521;
  box-shadow: none;
  overflow: visible;
}
.report-summary :is(.battle-report-shared-scope, .battle-report-loot-pending, .battle-report-classic > p) {
  padding: 4px 12px;
  margin: 0;
  color: #c6d3e4;
  font-size: 12px;
}
#featureModal .report-summary .battle-report-meta {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto auto;
  grid-auto-rows: auto;
  gap: 5px 12px;
  padding: 7px 12px;
  color: #e0ebf7;
  background: #0e1826;
  border-color: #304c47;
  font-size: 12px;
  line-height: 17px;
}
.report-summary .battle-report-meta b { color: #93abc5; font-weight: 500; }
#featureModal .report-summary .battle-report-meta > * {
  white-space: normal;
  overflow-wrap: anywhere;
}
#featureModal .report-summary .battle-report-meta time { color: #a6b8ce; }
#featureModal .report-summary .battle-report-multipliers {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
#featureModal .report-summary .battle-report-multipliers > span {
  padding: 1px 5px;
  border: 1px solid #45665b;
  border-radius: 2px;
  color: #c5dcd2;
  background: #102520;
  white-space: nowrap;
}
#featureModal .report-summary .battle-report-multipliers strong {
  color: #e1f1e5;
  font-variant-numeric: tabular-nums;
}
#featureModal .report-summary .battle-report-multipliers .boosted {
  border-color: #74be69;
  box-shadow: inset 0 0 5px #59b45b36;
}
#featureModal .report-summary .battle-report-multipliers .boosted strong {
  color: #aef98d;
  text-shadow: 0 0 5px #60db6499;
}
#featureModal .report-summary .battle-report-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 6px;
  padding: 8px 12px 10px;
}
#featureModal .report-summary .battle-report-force {
  --report-accent: #6aaacb;
  grid-template-rows: auto auto 1fr;
  border: 1px solid var(--report-panel-edge);
  border-top-width: 2px;
  border-radius: 3px;
  padding: 4px;
  background: url("../game_design/art_reference/generated_ui/battle/report-panel-20261126.webp") center / 100% 100% no-repeat, #101c1d;
  box-shadow: inset 0 0 0 1px var(--report-inset-edge), inset 0 0 12px #60da6125, 0 0 6px var(--report-edge-glow);
}
#featureModal .report-summary .battle-report-force.enemy { --report-accent: #c99b64; }
#featureModal .report-summary .battle-report-commander {
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 78px;
  gap: 9px;
  padding: 7px 9px;
}
#featureModal .report-summary .battle-report-force:last-child .battle-report-commander {
  grid-template-columns: minmax(0, 1fr) 62px;
}
#featureModal .report-summary .battle-report-force:last-child .battle-report-commander > img {
  grid-column: 2;
  grid-row: 1;
}
#featureModal .report-summary .battle-report-force:last-child .battle-report-commander > div {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}
#featureModal .report-summary .battle-report-commander > img {
  width: 62px;
  height: 62px;
  border: 1px solid var(--report-frame);
  border-radius: 3px;
  background: #0b131e;
  box-shadow: 0 0 0 1px var(--report-inset-edge), 0 0 6px var(--report-edge-glow);
}
.report-summary .battle-report-commander strong {
  color: #f2f6fc;
  font-size: 14px;
  line-height: 17px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.report-summary .battle-report-commander span {
  color: #b6c7d7;
  font-size: 11px;
  line-height: 14px;
}
.report-summary .battle-report-commander span:first-child { color: var(--report-accent); }
#featureModal .report-summary .battle-report-force-stats {
  padding: 5px 9px;
  border-top: 1px solid #315247;
  align-items: center;
  font-size: 11px;
  color: #c9d9e5;
  background: #0a191f99;
  font-variant-numeric: tabular-nums;
}
#featureModal .report-summary .battle-report-force-stats span {
  white-space: normal;
  overflow-wrap: anywhere;
}
#featureModal .report-summary .battle-report-unit-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 5px;
  justify-content: stretch;
  overflow: visible;
  scrollbar-gutter: auto;
  padding: 5px 7px 9px;
}
#featureModal .report-summary .battle-report-unit-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
#featureModal .report-summary .battle-report-unit-slot.empty { opacity: 1; }
#featureModal .report-summary .battle-report-unit-art,
#featureModal .report-summary .battle-report-unit-slot.empty i {
  width: min(100%, 43px);
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  border: 1px solid var(--report-frame);
  border-radius: 3px;
  background: var(--report-socket) center / cover no-repeat, #0a131f;
  box-shadow: inset 0 0 0 1px var(--report-inset-edge), inset 0 0 6px #58d05a3b, 0 0 4px #46b95140;
}
#featureModal .report-summary .battle-report-unit-art img {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  margin: 3px auto 0;
}
#featureModal .report-summary .battle-report-unit-slot.empty i {
  border-color: var(--report-panel-edge);
}
#featureModal .report-summary .battle-report-unit-art b { font-size: 10px; }
#featureModal .report-summary .battle-report-unit-counts { display: flex; gap: 2px; color: #d4e2ee; font-size: 10px; }
.report-summary .battle-report-unit-counts b { color: #ffab9d; }
.report-summary .battle-report-unit-counts i { font-style: normal; color: #8ca1b7; }
#featureModal .report-summary .battle-report-versus-mark {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding-top: 8px;
}
#featureModal .report-summary .battle-report-versus-mark::before { display: none; }
#featureModal .report-summary .battle-report-versus-mark span {
  width: auto;
  height: auto;
  border: 0;
  background: none;
  box-shadow: none;
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.075em;
  padding-right: .075em;
  white-space: nowrap;
  color: #b9ffa8;
  -webkit-text-stroke: 1px #246a26;
  text-shadow: 0 2px #082312, 0 0 7px #73ff68, 0 0 17px #31c544ce;
}
#featureModal .report-summary .battle-report-versus-mark strong {
  padding: 0 3px 2px;
  border: 0;
  background: none;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}
#featureModal .report-summary .battle-report-versus-mark .report-outcome.win {
  color: #ffd468;
  -webkit-text-stroke: 1px #fa7518;
  text-shadow: 0 2px #8e2311, 0 0 6px #ffa22b, 0 0 15px #f16828;
}
#featureModal .report-summary .battle-report-versus-mark .report-outcome.lose {
  text-shadow: 0 1px #520a10, 0 0 8px #ed594077;
}
#featureModal .report-summary .battle-report-versus-mark .full-result {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
#featureModal .report-summary .battle-report-loot {
  display: block;
  margin: 0 12px;
  border: 1px solid var(--report-panel-edge);
  border-radius: 3px;
  background: linear-gradient(180deg, #183e4a, #122735 22%, #08141f 80%, #142e3d);
  box-shadow: inset 0 1px 0 #528795, inset 0 0 8px #4cc0db2c, 0 0 6px var(--report-edge-glow);
}
#featureModal .report-summary .battle-report-loot > header {
  min-height: 0;
  padding: 5px 8px;
  background: #172539;
}
#featureModal .report-summary .battle-report-loot-row {
  grid-template-columns: 66px minmax(0, 1fr);
  border-color: #2c3d50;
}
#featureModal .report-summary .battle-report-loot-row-title {
  border-color: #2c3d50;
  background: none;
  color: #b3c5d8;
  font-size: 11px;
}
#featureModal .report-summary .battle-report-loot-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px 6px;
}
#featureModal .report-summary .battle-report-loot-row.secondary .battle-report-loot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#featureModal .report-summary .battle-report-loot-row.items .battle-report-loot-grid { grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); }
#featureModal .report-summary .battle-report-loot-slot {
  grid-template-columns: 21px minmax(0, 1fr);
  min-height: 25px;
  padding: 0 2px;
  border: 0;
  background: none;
}
#featureModal .report-summary .battle-report-loot-slot > :is(img, i) {
  width: 20px;
  height: 20px;
}
#featureModal .report-summary .battle-report-loot-slot > span { font-size: 10px; }
#featureModal .report-summary .battle-report-loot-slot.zero { opacity: .85; }
#featureModal .report-summary .battle-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px 10px;
  margin-top: 4px;
  background: linear-gradient(180deg, #111c26, #081018);
}
#featureModal .report-summary .battle-report-actions button {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 26px;
  padding: 3px 9px;
  font-size: 12px;
}
#featureModal:has(> .battle-report-view) :is(.feature-head-actions, .battle-report-actions) button {
  border: 1px solid #548a36;
  border-radius: 2px;
  color: #eef7e8;
  background: linear-gradient(180deg, #30572a 0%, #1b351b 52%, #0d200f 100%);
  box-shadow: inset 0 0 0 1px #152b13, inset 0 1px 0 #82a962;
}
#featureModal:has(> .battle-report-view) :is(.feature-head-actions, .battle-report-actions) button:is(:hover, [aria-pressed="true"]):enabled {
  border-color: #a9d96a;
  color: #f6ffe9;
  background: linear-gradient(180deg, #477738 0%, #294b21 52%, #152c15 100%);
}
#featureModal:has(> .battle-report-view) :is(.feature-head-actions, .battle-report-actions) button:focus-visible {
  outline: 2px solid #b7e58b;
  outline-offset: 2px;
}
#featureModal:has(> .battle-report-view) :is(.feature-head-actions, .battle-report-actions) button:active:enabled {
  background: linear-gradient(180deg, #152f17 0%, #31552a 100%);
}
#featureModal .report-summary .battle-report-actions [data-report-back] { margin-right: auto; }
/* Compact attack, defense and scout inbox. */
#featureModal:has(> .intel-inbox) {
  inset: 50% auto auto 50%;
  width: min(548px, calc(100vw - 20px));
  height: min(334px, calc(100dvh - 42px));
  transform: translate(-50%, -50%);
  z-index: 60;
  grid-template-rows: 28px minmax(0, 1fr);
  border: 1px solid #152b40;
  border-top: 0;
  border-radius: 2px;
  background: #02070e;
  box-shadow: 0 6px 21px #000c, inset 0 0 0 1px #01040a;
  clip-path: none;
}
#featureModal:has(> .intel-inbox) .feature-head {
  position: relative;
  display: flex;
  justify-content: center;
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, #000, #050c14);
}
#featureModal:has(> .intel-inbox) .feature-head::before { content: none; }
#featureModal:has(> .intel-inbox) .feature-title {
  position: relative;
  align-self: flex-start;
  display: grid;
  place-items: center;
  width: min(230px, 51%);
  max-width: none;
  height: 20px;
  background: var(--classic-title) center / 100% 100% no-repeat;
}
#featureModal:has(> .intel-inbox) .feature-title strong {
  position: relative;
  color: #e3eeff;
  font-size: 12px;
  line-height: 18px;
  text-shadow: 0 1px 2px #090c16;
}
#featureModal:has(> .intel-inbox) :is(.feature-title span, .feature-help-button) { display: none; }
#featureModal:has(> .intel-inbox) .feature-head-actions { position: absolute; top: 5px; right: 2px; }
#featureModal:has(> .intel-inbox) .feature-close {
  min-width: 46px;
  height: 16px;
  padding: 0 4px 0 7px;
  border: 1px solid #274663;
  background: linear-gradient(#071f3b, #0e5282 61%, #08233f);
  color: #beddf5;
  box-shadow: inset 0 1px #0e2c48;
  clip-path: polygon(17% 0, 100% 0, 100% 100%, 0 100%, 0 72%);
  font-size: 10px;
  line-height: 13px;
}
#featureModal > .intel-inbox { display: block; padding: 0 3px 4px; overflow: hidden; }
.intel-inbox > section { display: grid; grid-template-rows: 19px minmax(0, 1fr); height: 100%; }
.intel-tabs { display: flex; align-items: start; gap: 2px; }
.intel-tabs button {
  width: 72px;
  height: 19px;
  padding: 0 5px;
  border: 1px solid #25475c;
  background: linear-gradient(#0b2236, #0b1828);
  color: #7091aa;
  box-shadow: inset 0 0 0 2px #112c3c;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
  font-size: 10px;
  line-height: 16px;
  cursor: pointer;
}
.intel-tabs button:first-child { width: 69px; }
.intel-tabs button:nth-child(2) { width: 74px; }
.intel-tabs button[aria-pressed="true"] {
  color: #b8e3b1;
  border-color: #4a9557;
  background: linear-gradient(#104828, #175a35);
  box-shadow: inset 0 0 0 2px #2a7547;
}
.intel-tabs button:hover, .intel-tabs button:focus-visible { color: #e6f2ff; }
.intel-frame {
  min-height: 0;
  padding: 4px;
  border: 1px solid #28728e;
  background: #020b1b;
  box-shadow: inset 0 0 0 1px #081824;
}
.intel-scroll {
  height: 100%;
  overflow: auto;
  border: 1px solid #18385b;
  background: repeating-linear-gradient(#02081a 0 22px, #04112a 22px 44px);
  background-position: 0 22px;
  scrollbar-width: thin;
  scrollbar-color: #246292 #041124;
}
.intel-table { width: 100%; table-layout: fixed; border-spacing: 0; color: #c4d7ec; font-size: 10px; }
.intel-date-col { width: 72px; }
.intel-action-col { width: 28px; }
.intel-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  height: 22px;
  padding: 0;
  border-bottom: 1px solid #1e4c84;
  background: linear-gradient(#123467, #071b44 78%, #081632);
  color: #d0e6ff;
  font-size: 11px;
  font-weight: 600;
}
.intel-table th:first-child { padding-left: 39px; }
.intel-table td { height: 22px; padding: 0; }
.intel-table tbody tr:nth-child(odd) { background: #02081a; }
.intel-table tbody tr:nth-child(even) { background: #04112a; }
.intel-table tbody tr:hover { background: #0b2444; }
.intel-row-title { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 0 4px 0 9px; }
.intel-message { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.intel-unread { flex: 0 0 9px; height: 9px; border-radius: 2px; }
.intel-unread.is-unread { background: #478fdb; box-shadow: inset 0 0 0 1px #2764a6; }
.intel-envelope {
  position: relative;
  margin-left: 6px;
  flex: 0 0 11px;
  height: 10px;
  clip-path: polygon(0 44%, 45% 0, 100% 32%, 100% 100%, 0 100%);
  background: linear-gradient(#759ce5 0 44%, #ffe1a1 45% 66%, #b98c39 67%);
}
.intel-envelope::before {
  content: "";
  position: absolute;
  inset: 0 1px 3px;
  background: #e0efff;
  clip-path: polygon(0 0, 100% 0, 100% 51%, 50% 88%, 0 58%);
}
.intel-date { text-align: center; white-space: nowrap; color: #abbcd6; font-variant-numeric: tabular-nums; }
.intel-favorite { color: #edc279; }
.intel-actions { display: flex; justify-content: center; gap: 1px; }
.intel-actions button {
  min-width: 0;
  border: 0;
  padding: 0 1px;
  background: transparent;
  color: #beddf5;
  font-size: 9px;
  cursor: pointer;
}
.intel-actions button:not(.intel-open) { width: 11px; }
.intel-open { display: grid; width: 20px; height: 20px; place-items: center; }
.intel-open i {
  position: relative;
  width: 10px;
  height: 10px;
  border: 1px solid #2d6fb6;
  border-radius: 50%;
  background: radial-gradient(at 34% 30%, #ffe489, #d89b32 48%, #985818 74%);
  box-shadow: 0 0 2px #325d9c;
}
.intel-open i::after {
  content: "";
  position: absolute;
  top: 6px;
  left: -3px;
  width: 5px;
  height: 2px;
  transform: rotate(-48deg);
  border-radius: 1px;
  background: #dda751;
}
.intel-open:hover i, .intel-open:focus-visible i { filter: brightness(1.35); }
@media (max-width: 720px) {
  #featureModal:has(> .intel-inbox) { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; }
}

@media (max-width: 620px) {
  #featureModal .report-summary .battle-report-versus { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); }
  #featureModal .report-summary .battle-report-commander,
  #featureModal .report-summary .battle-report-force:last-child .battle-report-commander {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 60px;
    gap: 6px;
  }
  #featureModal .report-summary .battle-report-force:last-child .battle-report-commander {
    grid-template-columns: minmax(0, 1fr) 42px;
  }
  #featureModal .report-summary .battle-report-commander > img { width: 42px; height: 42px; }
  #featureModal .report-summary .battle-report-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #featureModal .report-summary .battle-report-meta time { text-align: left; }
  #featureModal .report-summary .battle-report-versus-mark span { font-size: 33px; }
  #featureModal .report-summary .battle-report-versus-mark strong:not(.full-result) { font-size: 27px; }
}
@media (max-width: 480px) {
  #featureModal .report-summary .battle-report-versus { grid-template-columns: minmax(0, 1fr); }
  #featureModal .report-summary .battle-report-versus-mark { display: flex; align-items: center; justify-content: center; padding-top: 0; }
  #featureModal .report-summary .battle-report-loot-row.resource-rewards .battle-report-loot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Command controls share a metal panel and the bright green key artwork. */
#controlConsole:has(> :is(.console-selected-panel, .console-build-panel, .build-mode-grid, .universe-console), > .console-head [data-map-find]) {
  --command-key: url("../game_design/art_reference/generated_ui/icons/command-key-20261126.webp");
  border-color: #3e5651;
  border-radius: 4px;
  padding-inline: 10px;
  background:
    url("../game_design/art_reference/generated_ui/icons/command-panel-20261126.webp") center / 100% 100% no-repeat,
    #101c20;
  box-shadow: inset 0 0 0 1px #02060b, 0 1px 4px #0008;
}

#controlConsole:has(> :is(.console-selected-panel, .console-build-panel, .build-mode-grid), > .console-head [data-map-find]) .console-head {
  padding: 1px 5px;
  border-bottom: 1px solid #3b5860;
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find]) {
  border: 1px solid #78eb9c;
  border-image: var(--command-key) 25 fill / 6px stretch;
  border-radius: 4px;
  background: #102820;
  color: #e6fff8;
  box-shadow: 0 0 0 1px #69ed9166, 0 0 7px #58ec8b70;
  filter: brightness(1.16) saturate(1.25);
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find]):enabled:is(:hover, [aria-pressed="true"]) {
  border-color: #bdffd1;
  box-shadow: 0 0 0 1px #9bffbba3, 0 0 8px #74ffa29b;
  filter: brightness(1.28) saturate(1.3);
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find]):active:enabled {
  filter: brightness(1.34) saturate(1.32);
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find], .universe-console-icon):focus-visible {
  outline: 2px solid #d3fbe1;
  outline-offset: 1px;
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .universe-console-icon):disabled {
  box-shadow: none;
  filter: grayscale(1);
  opacity: .65;
}

#controlConsole .universe-console {
  background: transparent;
}

#controlConsole .planet-console-operation:has(> .planet-console-info:first-child) {
  grid-template-columns: minmax(0, 1fr) auto;
}

#controlConsole .planet-console-info > .planet-console-lore {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

#controlConsole .planet-console-actions button {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.console-command-icon {
  display: block;
  width: 23px;
  height: 23px;
  background-image: url("../game_design/art_reference/generated_ui/icons/command-symbols-20261126.webp");
  background-size: 500% 400%;
  background-position: var(--symbol-x) var(--symbol-y);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 2px #9bffc58c);
}

.build-mode-grid .console-command-icon { width: 18px; height: 18px; }

#controlConsole .console-common-actions {
  display: flex;
  gap: 4px;
  min-width: 0;
}

#controlConsole .console-common-actions .console-back-button {
  flex: 0 0 32px;
  margin-left: auto;
  transform: none;
}

#controlConsole .console-build-footer .console-back-button {
  width: 30px;
  height: 30px;
}

/* Playback keys share the artwork from the city and map command panels. */
#battleView .battle-exit-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-color: #3e5651;
  background: url("../game_design/art_reference/generated_ui/icons/command-panel-20261126.webp") center / 100% 100% no-repeat, #101c20;
}

#battleView .battle-exit-panel p {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#battleView .battle-exit-panel button {
  flex-shrink: 0;
  min-height: 24px;
  border: 1px solid #78eb9c;
  border-image: url("../game_design/art_reference/generated_ui/icons/command-key-20261126.webp") 25 fill / 5px stretch;
  background: #102820;
  box-shadow: 0 0 0 1px #69ed9166, 0 0 6px #58ec8b70;
  clip-path: none;
  color: #e6fff8;
  filter: brightness(1.16) saturate(1.25);
}

#battleView .battle-exit-panel button:hover:enabled { filter: brightness(1.28) saturate(1.3); }
#battleView .battle-exit-panel button:focus-visible { outline: 2px solid #d3fbe1; outline-offset: 1px; }
#battleView .battle-exit-panel button:disabled { box-shadow: none; filter: grayscale(1); }

@media (min-width: 761px) and (max-width: 1179px) {
  #battleView .battle-hud {
    grid-template-columns: minmax(116px, 1fr) 48px minmax(0, 1.65fr) minmax(126px, .85fr) minmax(142px, .7fr);
  }
}

@media (max-width: 760px) {
  #battleView .battle-hud {
    grid-template-columns: 72px minmax(0, 1fr) minmax(112px, 25%);
  }
}
/* End playback controls. */


/* Fit restored sprites to their ground footprints in both camera views. */
.stage { --city-terrain: url("generated_assets/classic_city/terran/ground.webp"); --city-marker: #f5c876; }
.stage.zerg { --city-terrain: url("generated_assets/classic_city/zerg/ground.webp"); --city-marker: #e8a4c3; }
.stage.protoss { --city-terrain: url("generated_assets/classic_city/protoss/ground.webp"); --city-marker: #83dfef; }
.stage .building.classic-building { pointer-events: none; }
.stage .classic-building::before, .stage .classic-building::after { display: none; }
.classic-building .classic-building-body {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: max-content;
  transform: translateX(-50%);
  transform-origin: center bottom;
  pointer-events: auto;
}
.stage .building.classic-building .building-art {
  display: block;
  position: static;
  width: auto;
  height: auto;
  max-width: calc(var(--cell-x) * var(--cols) * .92);
  max-height: calc(var(--cell-y) * var(--rows) * 1.18);
  transform: none;
  image-rendering: auto;
  filter: drop-shadow(1px 2px 1px #0b080b6b);
}
.stage .classic-building.selected .classic-building-body::after {
  content: "";
  position: absolute;
  inset: -3px -4px -1px;
  pointer-events: none;
  --mark: linear-gradient(var(--city-marker), var(--city-marker));
  background: var(--mark) left top, var(--mark) right top, var(--mark) left bottom, var(--mark) right bottom,
    var(--mark) left top, var(--mark) right top, var(--mark) left bottom, var(--mark) right bottom;
  background-size: 8px 2px, 8px 2px, 8px 2px, 8px 2px, 2px 8px, 2px 8px, 2px 8px, 2px 8px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 1px #12171c);
}

/* The terrain fills the window, with the playable grid centered on it. */
.stage {
  isolation: isolate;
  background: none;
  box-shadow: none;
}
.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--city-terrain-extent, 100%);
  height: var(--city-terrain-extent, 100%);
  background: var(--city-terrain) center / 100% 100% no-repeat;
}
#minimap:has([data-city-minimap-viewport]) {
  background-position: center;
  background-size: 100% 100%, var(--city-terrain-extent, 100%) var(--city-terrain-extent, 100%);
}
.city-zoom-button {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 4;
  padding: 2px 7px;
  border: 1px solid #7392a0;
  color: #e5f8ff;
  background: linear-gradient(#203a46, #0b161c);
  font: bold 12px/16px "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

/* Bright edge lighting for the generated command keys. */
:is(#controlConsole, #battleView) {
  --command-key-rim: #92f7aacc;
  --command-key-halo: #61ff90a0;
  --command-key-filter: brightness(1.27) saturate(1.3);
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find]):enabled,
#battleView .battle-exit-panel button:enabled {
  border-color: #92f7aa;
  box-shadow: 0 0 0 1px var(--command-key-rim), 0 0 6px var(--command-key-halo);
  filter: var(--command-key-filter);
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find]):enabled:is(:hover, [aria-pressed="true"]),
#battleView .battle-exit-panel button:enabled:is(:hover, [aria-pressed="true"]) {
  --command-key-rim: #c2ffd3f2;
  --command-key-halo: #71ffa6cb;
  --command-key-filter: brightness(1.4) saturate(1.32);
  border-color: #c2ffd3;
  box-shadow: 0 0 0 1px var(--command-key-rim), 0 0 7px var(--command-key-halo);
  filter: var(--command-key-filter);
}

#controlConsole :is(.console-button[data-console-action], .planet-console-actions button, .console-head [data-map-find], .map-find-slot [data-map-find]):active:enabled,
#battleView .battle-exit-panel button:active:enabled {
  --command-key-filter: brightness(1.48) saturate(1.32);
  filter: var(--command-key-filter);
}

#controlConsole .universe-console .universe-console-icon:enabled {
  filter: brightness(1.15) drop-shadow(0 0 2px #6cff9d77);
}

#controlConsole .universe-console .universe-console-icon:enabled:hover {
  filter: brightness(1.28) drop-shadow(0 0 5px #7affa3b3);
}

/* Rankings */
.system-rank-view { grid-template-columns: minmax(0, 1fr); }
.system-rank-view .feature-main { grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 8px; min-width: 0; }
.rank-filter, .rank-page {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rank-filter label { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rank-filter :is(input, select) {
  min-width: 0;
  min-height: 24px;
  border: 1px solid #4a6683;
  background: #091626;
  padding: 2px 7px;
  color: #e1efff;
  font: inherit;
}
.rank-filter input { width: min(19vw, 172px); }
.rank-table-scroll { min-width: 0; overflow: auto; border: 1px solid #405b73; }
.rank-table { width: 100%; min-width: max-content; border-collapse: separate; border-spacing: 0; text-align: left; }
.rank-table thead { position: sticky; top: 0; z-index: 1; background: #192d46; }
.rank-table tr:nth-child(even) { background: #111d2d; }
.rank-table tr.rank-own-row { background: #203b32; }
.rank-table :is(td, th) { padding: 4px 8px; border-bottom: 1px solid #263f54; white-space: nowrap; }
.rank-table .rank-empty { padding: 15px 8px; text-align: center; color: #a4bdd1; }
.rank-page { justify-content: flex-end; }
.rank-page > [role="status"] { margin-inline-end: auto; }
.rank-table button:disabled, .rank-page button:disabled { opacity: .6; }
.rank-table-scroll:focus-visible { outline: 2px solid #a2e8a6; outline-offset: -2px; }

#item-detail-tooltip:is(.command-tooltip, .game-hint-tooltip, .equipment-tooltip),
body .equipment-hover-card {
  border-color: #79c691;
  background: linear-gradient(150deg, #15342b, #0b181a 64%, #080e15);
  box-shadow: inset 0 0 0 1px #233f3c, 0 0 8px #5bf48b32, 0 5px 15px #000b;
  color: #deefe7;
  overflow-wrap: anywhere;
}
#item-detail-tooltip:is(.command-tooltip, .game-hint-tooltip) strong { color: #bfffd1; }
#item-detail-tooltip.game-hint-tooltip strong { white-space: pre-line; }
#item-detail-tooltip.equipment-tooltip .detail-head small { margin-top: 2px; }
body .equipment-hover-card {
  width: min(230px, calc(100vw - 12px));
  padding: 6px 8px;
  gap: 4px;
}
.equipment-hover-card .equipment-hover-head { padding-bottom: 4px; }
.equipment-hover-card .equipment-hover-head strong { white-space: normal; overflow-wrap: anywhere; }
#item-detail-tooltip.equipment-tooltip strong { white-space: normal; }
.equipment-stat-list {
  display: grid;
  gap: 2px;
  padding-top: 4px;
  margin-top: 3px;
  border-top: 1px solid #385b4a;
}
.equipment-stat-list > b { color: #bfffd1; }
.equipment-stat-list [role="list"] { display: grid; gap: 2px; color: #d9e9df; }
#item-detail-tooltip.command-tooltip p { white-space: pre-line; }
#item-detail-tooltip.command-tooltip footer { border-color: #385b4a; color: #cce6d3; }

#featureBody.field-scout-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.field-scout-body .field-scout-report {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.field-scout-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 18px;
  padding: 7px 10px;
  border-bottom: 1px solid #335349;
  color: #b2c9c8;
}
.field-scout-layout {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 2fr);
  gap: 10px;
  padding: 10px;
  align-items: start;
  align-content: start;
}
.field-scout-resources { grid-column: 1 / -1; }
.field-scout-resources .field-scout-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr));
  column-gap: 14px;
}
.field-scout-section {
  min-width: 0;
  border: 1px solid #3a535c;
  background: #0b1820;
  overflow-wrap: anywhere;
}
.field-scout-section h3 {
  margin: 0;
  padding: 6px 9px;
  background: linear-gradient(105deg, #234035, #10242c);
  color: #d5f2da;
  font-size: 13px;
}
.field-scout-section h4 {
  margin: 8px 10px 2px;
  color: #b9cbd5;
  font-size: 12px;
}
.field-scout-fields { margin: 0; padding: 5px 9px; }
.field-scout-fields div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 4px 0;
}
.field-scout-fields dt { display: flex; align-items: center; gap: 6px; color: #adbecb; }
.field-scout-fields dt img { width: 18px; height: 18px; object-fit: contain; }
.field-scout-fields dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.field-scout-units {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 5px;
  margin: 0;
  padding: 8px;
  list-style: none;
}
.field-scout-units li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid #29434f;
  background: #101f2a;
}
.field-scout-units img { width: 36px; height: 32px; object-fit: contain; }
.field-scout-units strong { color: #d8f5d7; font-variant-numeric: tabular-nums; }
.field-scout-empty { margin: 4px 10px 8px; color: #aebfc9; }
.field-scout-footer { flex: none; display: flex; justify-content: flex-end; padding-inline: 4px; }
.field-scout-footer button {
  padding: 5px 12px;
  color: #e1f4d7;
  background: linear-gradient(#31482c, #16251c);
  border: 1px solid #617e52;
  cursor: pointer;
}
.field-scout-footer button:hover { border-color: #addd90; }
@media (max-width: 640px) {
  .field-scout-layout { grid-template-columns: 1fr; }
}

.auth-loading.open { z-index: 84; background: radial-gradient(ellipse at 50% 45%, #1b3741, #08121c 65%, #060b12); }
.auth-loading-card {
  box-sizing: border-box;
  width: min(416px, calc(100% - 40px));
  padding: 30px 28px 25px;
  text-align: center;
  color: #d9f3ea;
  background: linear-gradient(180deg, #1c2d3a, #101a26 65%, #0b1420);
  border: 1px solid #547784;
  box-shadow: inset 0 0 0 2px #132635, 0 12px 30px #0008;
}
.auth-loading-card h2 { margin: 0 0 23px; color: #e6f6ff; font-size: clamp(24px, 4vw, 34px); letter-spacing: .14em; }
.auth-loading-card progress { display: block; width: 100%; height: 7px; accent-color: #7ae2a7; }
.auth-loading-card p { min-height: 1.4em; margin: 12px 0 0; font-size: 13px; color: #b5d7de; }

.avatar-editor {
  box-sizing: border-box;
  width: min(448px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid #597582;
  background: #101b28;
  color: #deebf3;
  box-shadow: 0 12px 30px #000b, inset 0 0 0 2px #182b39;
}
.avatar-editor::backdrop { background: #060c13b8; }
.avatar-editor header { padding: 12px 16px; border-bottom: 1px solid #405667; background: #203144; }
.avatar-editor h2 { margin: 0; font-size: 17px; }
.avatar-editor-content { display: grid; grid-template-columns: minmax(0, 192px) minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; }
.avatar-editor-preview { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border: 1px solid #3d6570; background: #09131f; }
.avatar-editor-preview canvas { display: block; width: 100%; height: auto; }
.avatar-editor-preview [hidden] { display: none; }
.avatar-editor-preview p { margin: 12px; text-align: center; color: #a0bbcb; }
.avatar-editor-controls { display: grid; gap: 12px; align-content: center; min-width: 0; }
.avatar-editor-controls label { display: grid; gap: 4px; }
.avatar-editor input[type="range"] { width: 100%; min-width: 0; accent-color: #86d9a7; }
.avatar-editor [role="status"] { min-height: 1.2em; margin: 0; color: #d6e3bd; }
.avatar-editor footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 14px; }
.avatar-editor button { min-height: 30px; padding: 4px 14px; border: 1px solid #597582; background: #203244; color: #e0f2fb; cursor: pointer; }
.avatar-editor #avatarEditorSave { border-color: #6da682; background: #244735; }
.avatar-editor button:disabled { opacity: .55; cursor: default; }
.avatar-editor button:focus-visible { outline: 2px solid #9fe8b8; outline-offset: 2px; }

/* Classic right-hand command panel. The existing metal frame sits under the grid and indicator lights. */
:is(#controlConsole, #battleView .battle-exit-panel) {
  --classic-command-size: 38px;
  --classic-command-grid: #6a918c16;
  --classic-command-metal: url("../game_design/art_reference/generated_ui/icons/command-panel-20261126.webp");
  --classic-command-socket: #07100e;
  --classic-command-key-edge: #71c7af;
  --classic-command-key-fill: linear-gradient(152deg, #2b6358 0%, #101f1d 46%, #0c1514 78%, #254f45 100%);
  --classic-command-key-shadow: inset 0 0 0 1px #030909, inset 0 0 0 2px #4ca58b86, inset 0 0 7px #4df1be59, 0 0 2px #5febbb96;
}
#controlConsole.bottom-panel,
#battleView .battle-hud-panel.battle-exit-panel {
  position: relative;
  border: 1px solid #687571;
  border-radius: 5px 3px 2px 3px;
  padding: 5px 12px 6px 10px;
  background:
    var(--classic-command-metal) center / 100% 100% no-repeat,
    #0c1515;
  box-shadow: inset 0 1px #e2f0e170, inset 2px 0 #8b979280, 0 1px 3px #000b;
}
#controlConsole.bottom-panel::before,
#battleView .battle-exit-panel::before {
  content: "";
  position: absolute;
  inset: 7px 8px 5px 7px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid #a5b8aa32;
  border-radius: 2px;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, var(--classic-command-grid) 4px 5px),
    repeating-linear-gradient(90deg, transparent 0 8px, var(--classic-command-grid) 8px 9px),
    linear-gradient(174deg, #14201e, #070b0b 48%, #101817);
  box-shadow: inset 0 0 10px #000, 0 0 0 1px #020504;
}
#controlConsole.bottom-panel::after,
#battleView .battle-exit-panel::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 17px;
  bottom: 8px;
  width: 3px;
  pointer-events: none;
  background:
    radial-gradient(circle closest-side, #ffd3b2 0 38%, #f26b44 60%, transparent 100%) 0 0 / 3px 5px no-repeat,
    repeating-linear-gradient(0deg, #651f16 0 4px, #e9784f 4px 5px, #140a08 5px 8px) 0 100% / 2px 65% no-repeat;
  filter: drop-shadow(0 0 2px #c94026a0);
}
#controlConsole.bottom-panel:has(.universe-console)::after,
#controlConsole.bottom-panel:has(.planet-console-operation)::after {
  background: repeating-linear-gradient(0deg, #17332c 0 4px, #90f3c5 4px 6px, #05110e 6px 8px) 0 36% / 2px 36% no-repeat;
  filter: drop-shadow(0 0 2px #6aefb69c);
}
#controlConsole.bottom-panel > *,
#battleView .battle-exit-panel > * { position: relative; }
#controlConsole.bottom-panel .console-head {
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid #2b3f39;
  background: linear-gradient(90deg, #121d1b, #101b19a0);
  min-width: 0;
}
#controlConsole.bottom-panel .console-head strong { color: #dbe9df; font-size: 12px; white-space: nowrap; }
#controlConsole.bottom-panel .console-head span { color: #a8bab0; }
#controlConsole.bottom-panel .console-head span:last-of-type { margin-left: auto; }

#controlConsole.bottom-panel :is(.console-button, .console-build-button, .planet-console-actions button, [data-map-find]),
#battleView .battle-exit-panel button {
  flex: 0 0 auto;
  width: var(--classic-command-size);
  height: var(--classic-command-size);
  min-width: 0;
  min-height: 0;
  padding: 3px;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  border: 1px solid var(--classic-command-key-edge);
  border-image: none;
  border-radius: 3px;
  outline-offset: 2px;
  background: var(--classic-command-key-fill);
  color: #f3fff9;
  box-shadow: var(--classic-command-key-shadow);
  filter: none;
  clip-path: none;
  transform: none;
  font-size: 0;
  line-height: 1;
}
#controlConsole.bottom-panel :is(.console-button, .console-build-button, .planet-console-actions button, [data-map-find]):is(:hover, .active, [aria-pressed="true"]),
#battleView .battle-exit-panel button:is(:hover, [aria-pressed="true"]) {
  border-color: #b3ffdd;
  box-shadow: inset 0 0 0 1px #122922, inset 0 0 8px #9fffceaa, 0 0 6px #55efb794;
  background-color: #254f45;
  filter: brightness(1.18);
}
#controlConsole.bottom-panel :is(.console-button, .console-build-button, .planet-console-actions button, [data-map-find]):active:enabled,
#battleView .battle-exit-panel button:active:enabled {
  box-shadow: inset 0 0 9px #040907, 0 0 3px #69d4af;
  filter: brightness(1.07);
}
#controlConsole.bottom-panel :is(.console-button, .console-build-button, .planet-console-actions button, .universe-console-icon):is(:disabled, .disabled),
#battleView .battle-exit-panel button:disabled {
  border-color: #7b817e;
  background: linear-gradient(155deg,#343938,#1e2221 55%,#323735);
  box-shadow: inset 0 0 0 1px #0b0e0e, inset 0 0 5px #a6aba358;
  opacity: .76;
  filter: grayscale(1);
}
#controlConsole.bottom-panel :is(.console-button, .console-build-button, .planet-console-actions button, .universe-console-icon, [data-map-find]):focus-visible,
#battleView .battle-exit-panel button:focus-visible { outline: 2px solid #c2ffdf; }
#controlConsole.bottom-panel .console-button > span { display: none; }
#controlConsole.bottom-panel .console-icon { width: 100%; height: 100%; object-fit: contain; overflow: hidden; }
#controlConsole.bottom-panel .console-icon img { width: 100%; height: 100%; object-fit: contain; }

#controlConsole.bottom-panel .build-mode-grid {
  grid-template-columns: repeat(2, var(--classic-command-size));
  grid-auto-rows: var(--classic-command-size);
  gap: 3px;
  padding: 1px 0 0;
  margin: 0;
}
#controlConsole.bottom-panel .console-build-panel {
  grid-template-rows: minmax(0, 1fr) calc(var(--classic-command-size) + 3px);
}
#controlConsole.bottom-panel .console-build-list {
  grid-template-columns: repeat(5, var(--classic-command-size));
  grid-auto-rows: var(--classic-command-size);
  gap: 3px;
  padding: 3px 1px 1px;
}
#controlConsole.bottom-panel .console-build-button {
  background: linear-gradient(140deg,#253435,#0f1717 65%,#242c2c);
  border-color: #596662;
  box-shadow: inset 0 0 0 1px #0e1717, inset 0 0 5px #b3c4b840;
}
#controlConsole.bottom-panel .console-build-button:not(.disabled):is(:hover, .active) { border-color: #acffd5; box-shadow: var(--classic-command-key-shadow); }
#controlConsole.bottom-panel .console-build-button img { width: 100%; height: 100%; object-fit: contain; }
#controlConsole.bottom-panel .console-selected-panel .console-grid {
  grid-template-columns: repeat(auto-fill, var(--classic-command-size));
  grid-auto-rows: var(--classic-command-size);
  gap: 3px;
  padding: 2px 0 1px;
}
#controlConsole.bottom-panel .console-selected-panel { grid-template-rows: minmax(0,1fr) calc(var(--classic-command-size) + 3px); }
#controlConsole.bottom-panel .console-selected-panel.busy-state {
  grid-template-rows: auto minmax(0,1fr) calc(var(--classic-command-size) + 3px);
}
#controlConsole.bottom-panel .console-common-actions .console-back-button { margin-left: auto; flex: 0 0 var(--classic-command-size); }
#controlConsole.bottom-panel .console-common-actions [data-console-action="remove"] { order: 1; }
#controlConsole.bottom-panel .console-common-actions [data-console-action="upgrade"] { order: 2; }
#controlConsole.bottom-panel .console-common-actions .console-back-button { order: 3; }
#controlConsole.bottom-panel .console-command-icon { width: 23px; height: 23px; filter: drop-shadow(0 0 2px #a1fbd3a8); }
#controlConsole.bottom-panel [data-console-action^="build-"]:not([data-console-action="build-back"]) .console-command-icon,
#controlConsole.bottom-panel [data-console-action="assign"] .console-command-icon,
#controlConsole.bottom-panel [data-console-action="upgrade"] .console-command-icon {
  background: #f3fff8;
}
#controlConsole.bottom-panel [data-console-action="build-basic"] .console-command-icon {
  clip-path: polygon(20% 15%,80% 15%,87% 47%,94% 47%,99% 83%,58% 83%,58% 68%,42% 68%,42% 83%,1% 83%,6% 47%,13% 47%,20% 15%,30% 42%,30% 53%,70% 53%,70% 42%,30% 42%);
}
#controlConsole.bottom-panel [data-console-action="build-advanced"] .console-command-icon {
  clip-path: polygon(30% 8%,70% 8%,87% 24%,96% 52%,99% 84%,59% 84%,59% 68%,41% 68%,41% 84%,1% 84%,4% 52%,13% 24%,30% 8%,30% 24%,19% 38%,14% 54%,26% 54%,31% 40%,40% 33%,60% 33%,69% 40%,74% 54%,86% 54%,81% 38%,70% 24%,30% 24%);
}
#controlConsole.bottom-panel [data-console-action="assign"] .console-command-icon {
  clip-path: polygon(4% 3%,28% 3%,28% 26%,21% 26%,21% 72%,28% 72%,28% 97%,4% 97%,4% 72%,11% 72%,11% 26%,4% 26%,4% 3%,38% 3%,62% 3%,62% 26%,55% 26%,55% 72%,62% 72%,62% 97%,38% 97%,38% 72%,45% 72%,45% 26%,38% 26%,38% 3%,72% 3%,96% 3%,96% 26%,89% 26%,89% 72%,96% 72%,96% 97%,72% 97%,72% 72%,79% 72%,79% 26%,72% 26%,72% 3%);
}
#controlConsole.bottom-panel [data-console-action="upgrade"] .console-command-icon {
  clip-path: polygon(50% 8%,96% 55%,69% 55%,69% 94%,31% 94%,31% 55%,4% 55%);
}

#controlConsole.bottom-panel .universe-console {
  grid-column: 1;
  grid-row: 1 / -1;
  gap: 5px;
  grid-template-columns: var(--classic-command-size) max-content var(--classic-command-size);
  justify-content: end;
  padding: 0 4px;
}
#controlConsole.bottom-panel .universe-console-center {
  grid-template: repeat(3, var(--classic-command-size)) / repeat(3, var(--classic-command-size));
  gap: 2px;
}
#controlConsole.bottom-panel .universe-console-icon { width: var(--classic-command-size); height: var(--classic-command-size); }
#controlConsole.bottom-panel .universe-console-icon img { width: 100%; height: 100%; }
#controlConsole.bottom-panel [data-map-find] img { width: 100%; height: 100%; object-fit: contain; }
#controlConsole.bottom-panel .console-head [data-map-find] { width: 25px; height: 19px; padding: 0; }
#controlConsole.bottom-panel .planet-console-actions,
#battleView .battle-replay-controls {
  grid-template-columns: repeat(2,var(--classic-command-size));
  gap: 3px;
  align-content: end;
  justify-content: end;
}
#controlConsole.bottom-panel .planet-console-actions :is([data-planet-action="outpost-claim"], [data-planet-action="neutral-start"], [data-planet-action="relic-start"], [data-planet-action="raid"]) { align-self: end; }
#controlConsole.bottom-panel .planet-console-actions button > img { display: none; }

#controlConsole.bottom-panel .planet-console-actions button::before,
#battleView .battle-exit-panel button::before {
  content: var(--classic-glyph);
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: #f5fff9;
  font: bold 21px/1 "Segoe UI Symbol", sans-serif;
  text-shadow: 0 0 4px #8de7c4;
}
#controlConsole.bottom-panel .planet-console-actions button { --classic-glyph: "✥"; }
#controlConsole.bottom-panel .planet-console-actions button[data-planet-action$="scout"] { --classic-glyph: "⊙"; }
#controlConsole.bottom-panel .planet-console-actions button:is(.danger,[data-planet-action$="start"],[data-planet-action$="claim"]) { --classic-glyph: "⦿"; }
#controlConsole.bottom-panel .planet-console-actions [data-planet-action="neutral-roster"] { --classic-glyph: "▦"; }
#controlConsole.bottom-panel .planet-console-actions [data-planet-action="neutral-fleet"] { --classic-glyph: "✦"; }
#controlConsole.bottom-panel .planet-console-actions [data-planet-action="outpost-defend"] { --classic-glyph: "⛨"; }
#controlConsole.bottom-panel .planet-console-actions [data-planet-action="outpost-retry"] { --classic-glyph: "↻"; }
#controlConsole.bottom-panel .planet-console-actions [data-planet-action="outpost-cities"] { --classic-glyph: "▤"; }
#controlConsole.bottom-panel .planet-console-actions [data-planet-action="outpost-abandon"] { --classic-glyph: "⊘"; }
#battleView .battle-hud-panel.battle-exit-panel { --classic-command-size: 31px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 20px minmax(0,1fr) auto; align-items: start; gap: 3px; }
#battleView .battle-exit-panel :is(.battle-hud-title,p) { grid-column: 1 / -1; }
#battleView .battle-exit-panel .battle-hud-title { width: 100%; }
#battleView .battle-exit-panel p { align-self: stretch; }
#battleView .battle-exit-panel .battle-replay-controls { display: flex; flex-wrap: wrap; justify-content: end; grid-column: 1; }
#battleView .battle-exit-panel [data-battle-report-id] { --classic-glyph: "▤"; justify-self: end; }
#battleView .battle-exit-panel [data-battle-close] { --classic-glyph: "↶"; grid-column: 2; justify-self: end; align-self: end; }
#battleView .battle-exit-panel [data-report-playback="pause"] { --classic-glyph: "Ⅱ"; }
#battleView .battle-exit-panel [data-report-playback="pause"][aria-pressed="true"] { --classic-glyph: "▶"; }
#battleView .battle-exit-panel [data-report-playback="speed"] { --classic-glyph: "»"; }
#battleView .battle-exit-panel [data-report-playback="finish"] { --classic-glyph: "⇥"; }

@media (max-width: 1190px), (max-height: 730px) {
  #controlConsole.bottom-panel { --classic-command-size: 29px; }
  #controlConsole.bottom-panel .console-command-icon,
  #controlConsole.bottom-panel .planet-console-actions button::before { width: 20px; height: 20px; font-size: 17px; }
  #battleView .battle-hud-panel.battle-exit-panel { --classic-command-size: 25px; }
  #battleView .battle-exit-panel button::before { width: 18px; height: 18px; font-size: 16px; }
}


/* Research tiles reuse the unit portraits and use distinct symbols for numeric technology branches. */
.tech-node .research-icon {
  color: #f2fff8;
  border: 1px solid #71c7af;
  border-radius: 3px;
  background: linear-gradient(148deg,#24574b,#101e1a 45%,#07130f 75%,#1c4b3c);
  box-shadow: inset 0 0 0 1px #050b08, inset 0 0 6px #5ef4bb69;
}
.tech-node .research-icon::before {
  content: var(--research-glyph, "╬");
  font: bold 21px/1 "Segoe UI Symbol", sans-serif;
  text-shadow: 0 0 4px #93ffc9;
}
.research-icon[data-research-icon="unit"]::before { content: none; }
.research-icon[data-research-icon="gather"] { --research-glyph: "◈"; }
.research-icon[data-research-icon="load"] { --research-glyph: "⬒"; }
.research-icon[data-research-icon="carry"] { --research-glyph: "♟"; }
.research-icon[data-research-icon="queue"] { --research-glyph: "▤"; }
.research-icon:is([data-research-icon="attack"],[data-research-icon="weapon"]) { --research-glyph: "⚔"; }
.research-icon:is([data-research-icon="defense"],[data-research-icon="armor"]) { --research-glyph: "⛨"; }
.research-icon[data-research-icon="time"] { --research-glyph: "◷"; }
.tech-node.locked .research-icon { filter: grayscale(1); opacity: .8; }
.tech-node:is(.selected, :hover) .research-icon { border-color: #b3ffdd; }


#controlConsole.bottom-panel .planet-console-actions {
  align-self: end;
  grid-auto-rows: var(--classic-command-size);
}
#controlConsole.bottom-panel .planet-console-actions button:is(.danger,[data-planet-action$="start"],[data-planet-action$="claim"])::before {
  content: "";
  width: 56%;
  height: 56%;
  border: 2px solid #f3fff9;
  border-radius: 50%;
  background: radial-gradient(circle, #f3fff9 0 17%, transparent 25%);
  box-shadow: 0 0 4px #d6fff2, inset 0 0 4px #d6fff2;
}
#battleView .battle-exit-panel [data-battle-close] { position: relative; }
/* Keep the command panel inside the compact desktop dock. */
@media (min-width: 761px) and (max-width: 1180px) {
  .bottombar {
    grid-template-columns: 132px 52px minmax(180px, 1fr) 118px minmax(190px, 1fr);
    overflow: visible;
  }
  .bottombar .commander-card { grid-template-columns: minmax(0, 1fr) 18px; gap: 3px; }
  .bottombar .commander-avatar { width: 100%; min-width: 0; }
}

/* Placement and research controls follow the right-hand command grid. */
#controlConsole.bottom-panel .build-mode-grid:has([data-console-action="cancel-placement"]) {
  grid-template-columns: repeat(2, var(--classic-command-size)) minmax(0, 1fr) var(--classic-command-size);
  width: 100%;
}
#controlConsole.bottom-panel [data-console-action="cancel-placement"] { grid-column: 4; }
#controlConsole.bottom-panel [data-console-action="cancel-placement"] .console-command-icon {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 2px solid #f6fff9;
  border-radius: 50%;
  background: none;
}
#controlConsole.bottom-panel [data-console-action="cancel-placement"] .console-command-icon::after {
  content: "";
  width: 15px;
  height: 2px;
  transform: rotate(-45deg);
  background: #f6fff9;
}
.console-technology {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: #52867a transparent;
}
.console-tech-actions,
.console-tech-units,
.console-tech-keys {
  display: grid;
  grid-template-columns: repeat(8, var(--classic-command-size));
  grid-auto-rows: var(--classic-command-size);
  gap: 3px;
  width: max-content;
}
.console-tech-keys { grid-template-columns: repeat(6, var(--classic-command-size)); }
#controlConsole.bottom-panel .console-technology .console-button {
  position: relative;
  padding: 3px;
  overflow: hidden;
}
.console-technology .console-button img { display: block; width: 100%; height: 100%; object-fit: contain; }
.console-technology .console-research-key i {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #f3fff9;
}
.console-technology .console-research-key i::before {
  content: var(--research-glyph, "╬");
  font: bold 19px/1 "Segoe UI Symbol", sans-serif;
  text-shadow: 0 0 4px #d9fff1;
}
.console-technology .console-research-key i[data-research-icon="unit"]::before { content: none; }
#controlConsole.bottom-panel .console-research-key.unavailable {
  border-color: #7e8582;
  background: linear-gradient(145deg,#333939,#161a19 65%,#292e2d);
  box-shadow: inset 0 0 0 1px #111616, inset 0 0 4px #b2bcaf48;
  filter: grayscale(1);
}
.console-research-key small {
  position: absolute;
  right: 1px;
  bottom: 1px;
  padding: 0 2px;
  color: #fff;
  background: #060b0be6;
  font: 9px/1.2 Arial, sans-serif;
}
#featureModal:has(.console-tech-detail) {
  inset: auto 8px calc(var(--bottom-ui-safe-height) + 7px) auto;
  width: min(370px, calc(100vw - 16px));
  height: auto;
  max-height: calc(100vh - var(--bottom-ui-safe-height) - 52px);
}
#featureModal:has(.console-tech-detail) .feature-body {
  display: block;
  padding: 8px;
  overflow: auto;
}
.console-tech-detail .tech-selected-card { margin: 0; }

/* Faction technology uses nine protected raster tiles per faction. */
[data-research-faction="terran"] {
  --faction-research-art: url("../game_design/art_reference/generated_ui/icons/dock-technology-terran-20261129.webp");
}
[data-research-faction="zerg"] {
  --faction-research-art: url("../game_design/art_reference/generated_ui/icons/dock-technology-zerg-20261129.webp");
}
[data-research-faction="protoss"] {
  --faction-research-art: url("../game_design/art_reference/generated_ui/icons/dock-technology-protoss-20261129.webp");
}
.research-icon[data-research-icon="gather"] { --research-sprite-x: 0%; --research-sprite-y: 0%; }
.research-icon[data-research-icon="load"] { --research-sprite-x: 50%; --research-sprite-y: 0%; }
.research-icon[data-research-icon="carry"] { --research-sprite-x: 100%; --research-sprite-y: 0%; }
.research-icon[data-research-icon="queue"] { --research-sprite-x: 0%; --research-sprite-y: 50%; }
.research-icon[data-research-icon="weapon"] { --research-sprite-x: 50%; --research-sprite-y: 50%; }
.research-icon[data-research-icon="armor"] { --research-sprite-x: 100%; --research-sprite-y: 50%; }
.research-icon[data-research-icon="attack"] { --research-sprite-x: 0%; --research-sprite-y: 100%; }
.research-icon[data-research-icon="defense"] { --research-sprite-x: 50%; --research-sprite-y: 100%; }
.research-icon[data-research-icon="time"] { --research-sprite-x: 100%; --research-sprite-y: 100%; }
:is(.console-technology[data-research-faction] .research-icon, .tech-node .research-icon[data-research-faction], .console-button .research-icon[data-research-faction]):not([data-research-icon="unit"])::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background-image: var(--faction-research-art);
  background-position: var(--research-sprite-x, 50%) var(--research-sprite-y, 50%);
  background-size: 300% 300%;
  background-repeat: no-repeat;
}

/* Faction artwork for standalone upgrades and the three military branches. */
[data-research-faction="terran"] { --facility-research-art: url("../game_design/art_reference/generated_ui/icons/dock-technology-terran-facility-20261129.webp"); }
[data-research-faction="zerg"] { --facility-research-art: url("../game_design/art_reference/generated_ui/icons/dock-technology-zerg-facility-20261129.webp"); }
[data-research-faction="protoss"] { --facility-research-art: url("../game_design/art_reference/generated_ui/icons/dock-technology-protoss-facility-20261129.webp"); }
.research-icon[data-research-icon="drill"] { --research-sprite-x: 0%; --research-sprite-y: 0%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="storage"] { --research-sprite-x: 50%; --research-sprite-y: 0%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="housing"] { --research-sprite-x: 100%; --research-sprite-y: 0%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="infantry-weapon"] { --research-sprite-x: 0%; --research-sprite-y: 50%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="infantry-armor"] { --research-sprite-x: 50%; --research-sprite-y: 50%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="vehicle-weapon"] { --research-sprite-x: 100%; --research-sprite-y: 50%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="vehicle-armor"] { --research-sprite-x: 0%; --research-sprite-y: 100%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="flight-weapon"] { --research-sprite-x: 50%; --research-sprite-y: 100%; --faction-research-art: var(--facility-research-art); }
.research-icon[data-research-icon="flight-armor"] { --research-sprite-x: 100%; --research-sprite-y: 100%; --faction-research-art: var(--facility-research-art); }

#controlConsole.bottom-panel .console-button > .research-icon[data-research-faction] {
  display: block;
  width: 100%;
  height: 100%;
}
#controlConsole .console-recruit-popover {
  position: fixed;
  inset: auto 8px calc(var(--bottom-ui-safe-height) + 8px) auto;
  width: min(360px, calc(100vw - 20px));
  max-height: min(720px, calc(100dvh - var(--bottom-ui-safe-height) - 52px));
}
#controlConsole .console-recruit-popover::after { display: none; }

/* Inventory tabs, slots and item actions share the game's dark frame and green controls. */
.feature-body.bag-only {
  min-height: 0;
  overflow: hidden;
}

.bag-only .bag-main {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 8px;
}

.bag-only .bag-tabs {
  gap: 4px;
  padding: 0 4px;
  border-bottom: 1px solid #37605e;
}

.bag-only .bag-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 70px;
  height: 27px;
  margin-bottom: -1px;
  padding: 0 11px;
  clip-path: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  border-color: #345160;
  background: linear-gradient(#182e3a, #101a25 53%, #080e16);
  color: #aec4d2;
  box-shadow: inset 0 1px #355565;
}

.bag-only .bag-tabs button.active {
  border-color: #78af64;
  border-bottom-color: #294a35;
  background: linear-gradient(#346846, #1a452d 51%, #132b20);
  color: #edffce;
  box-shadow: inset 0 1px #6b9b64;
}


.bag-tabs button span {
  color: #9eb5c3;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bag-tabs button.active span { color: #bce192; }

.bag-main .bag-section { min-height: 0; overflow: hidden; }

.bag-only .bag-grid,
.bag-only .energy-bag-grid {
  gap: 5px;
  padding: 6px;
  border: 1px solid #29434b;
  border-top: 0;
  background: #070d15;
  scrollbar-color: #3b6471 #080f19;
}

.bag-only .bag-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }

.bag-only .bag-cell {
  height: 69px;
  padding: 4px 4px 3px;
  gap: 1px;
  grid-template-rows: minmax(0, 1fr) 16px;
}

.bag-only .bag-cell.empty {
  opacity: 1;
  border-color: #233746;
  background: #090f19;
  box-shadow: inset 0 0 0 1px #0b1521;
}
.bag-only .bag-cell.empty::before { content: none; }

.bag-only .bag-count {
  top: 3px;
  right: 3px;
  bottom: auto;
  min-width: 0;
  padding: 0 3px;
  border-color: #5b4d2a;
  font-variant-numeric: tabular-nums;
}
.bag-only .energy-bag-grid { max-height: 100%; }
.bag-only .energy-bag-tier {
  border-color: #294650;
  background: linear-gradient(#142632, #0b1520);
}
.bag-only .energy-bag-tier strong { color: #c0e6d4; }

.bag-action-popover {
  width: min(216px, calc(100% - 16px));
  padding: 6px;
  gap: 7px;
  border: 1px solid #619373;
  background: linear-gradient(155deg, #132b26, #101c23 48%, #090f17 95%);
  box-shadow: inset 0 0 0 1px #29413e, 0 5px 18px #000d;
  color: #d8ebe2;
  overflow: auto;
  scrollbar-color: #4b6e60 #0e1719;
}
.bag-action-popover[data-bag-menu-mode="actions"] { width: min(192px, calc(100% - 16px)); }
.bag-action-popover[data-bag-menu-mode="detail"] { width: min(274px, calc(100% - 16px)); }
.bag-menu-heading {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 21px;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #3a594d;
}
.bag-menu-art {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid #48675c;
  background: #0b151c;
}
.bag-menu-art .bag-icon {
  transform: scale(.68);
  transform-origin: left top;
}
.bag-menu-heading strong,
.bag-menu-heading div span { display: block; overflow-wrap: anywhere; }
.bag-menu-heading strong { color: #e4f8d5; font-size: 12px; line-height: 1.25; }
.bag-menu-heading div span { margin-top: 2px; color: #a8c3b5; font-size: 10px; line-height: 1.2; }
.bag-menu-actions,
.bag-menu-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.bag-menu-footer > :only-child { grid-column: 2; }
.bag-menu-controls { display: grid; gap: 5px; }
.bag-use-targets { display: grid; gap: 3px; max-height: 150px; overflow-y: auto; }
.bag-use-targets label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bag-action-popover .bag-use-targets input { width: 15px; min-height: 15px; }
[data-bag-use-status]:empty { display: none; }
.bag-action-popover :is(button, input, select) {
  height: 26px;
  min-width: 0;
  width: 100%;
  padding: 0 4px;
  border: 1px solid #3c5755;
  border-radius: 0;
  background: #0c1920;
  color: #dfebe4;
  font: inherit;
  font-size: 11px;
}
.bag-action-popover button {
  background: linear-gradient(#233a39, #142726 54%, #101e21);
  box-shadow: inset 0 1px #324e48;
}
.bag-action-popover button.primary {
  border-color: #6c925b;
  background: linear-gradient(#386446, #254e32 54%, #173423);
  color: #eeffd6;
}
.bag-action-popover button.danger {
  border-color: #714447;
  background: linear-gradient(#422b2d, #24171d);
  color: #f2b5ac;
}
.bag-action-popover button:hover:not(:disabled) {
  border-color: #87c981;
  color: #f6ffdc;
  filter: brightness(1.18);
}
.bag-action-popover button.danger:hover:not(:disabled) { border-color: #cb776d; }
.bag-action-popover :is(input, select, button):focus-visible,
.bag-only .bag-tabs button:focus-visible { outline: 1px solid #c5ec9a; outline-offset: -2px; }
.bag-action-popover .bag-menu-close {
  align-self: start;
  height: 20px;
  box-shadow: none;
  font-size: 15px;
  line-height: 1;
}
.bag-action-popover p { margin: 0; font-size: 11px; }
.bag-menu-quantity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 36px;
  gap: 5px;
  align-items: center;
  font-size: 11px;
}
.bag-menu-stepper { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; }
.bag-menu-stepper button { font-size: 14px; }
.bag-menu-stepper input {
  border-inline: 0;
  appearance: textfield;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.bag-menu-stepper input::-webkit-inner-spin-button { appearance: none; }
.bag-action-popover .bag-action-detail { padding: 0; }
.bag-action-popover .bag-action-detail span { color: #bdcfd0; }
.bag-action-popover .bag-action-warning { padding: 0; }
body:has(.bag-cell.menu-open:hover) #item-detail-tooltip { visibility: hidden; }

/* The two commander cards flank the compact battlefield clock. */
.battle-top-hud {
  grid-template-columns: minmax(0, 310px) 118px minmax(0, 310px);
  justify-content: center;
  gap: 5px;
}
.battle-roster-card {
  grid-template: "portrait data" auto "skills skills" auto / 45px minmax(0, 1fr);
  gap: 4px 7px;
  min-height: 0;
  padding: 5px 7px;
}
.battle-roster-card.enemy {
  grid-template: "data portrait" auto "skills skills" auto / minmax(0, 1fr) 45px;
}
.battle-roster-card .battle-commander-portrait { grid-area: portrait; width: 45px; height: 45px; }
.battle-roster-card .battle-roster-body { grid-area: data; gap: 1px; }
.battle-roster-body .battle-commander-title { color: #cdeea3; }
.battle-commander-skills {
  grid-area: skills;
  display: flex;
  gap: 4px;
  border-top: 1px solid #325052;
  padding-top: 4px;
}
.enemy .battle-commander-skills { justify-content: flex-end; }
.battle-skill-slot {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid #3f5e55;
  background: #07131a;
}
.battle-skill-slot.equipped { border-color: #87ad66; pointer-events: auto; cursor: help; }
.battle-skill-slot.equipped:focus-visible { outline: 1px solid #d9ffac; }
.battle-roster-card .battle-skill-slot img { width: 100%; height: 100%; border: 0; }
.battle-top-hud .battle-countdown { min-width: 0; padding: 5px 4px; }
.battle-top-hud .battle-countdown strong {
  color: #d5edff;
  text-shadow: 0 0 7px #399bde;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .battle-top-hud { grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); }
  .battle-roster-card, .battle-roster-card.enemy { grid-template-columns: 32px minmax(0, 1fr); }
  .battle-roster-card.enemy { grid-template-columns: minmax(0, 1fr) 32px; }
  .battle-roster-card .battle-commander-portrait { width: 32px; height: 32px; }
  .battle-skill-slot { width: 18px; height: 18px; }
}

/* Barracks use the city window frame and the HUD's resource icons. */
#controlConsole .recruit-sheet {
  --recruit-line: #34454b;
  box-sizing: border-box;
  width: min(560px, calc(100vw - 20px));
  max-height: calc(100dvh - var(--bottom-ui-safe-height) - 54px);
  display: flex;
  flex-direction: column;
  padding: 3px;
  overflow: hidden;
  background: #101922;
  border: 1px solid #66777b;
  box-shadow: inset 0 0 0 2px #233139, 0 8px 22px #000b;
  color: #d7e3e7;
  text-align: left;
}
.recruit-sheet .recruit-sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border-bottom: 1px solid #51655e;
  background: linear-gradient(#35413e, #1c2929 46%, #172222);
}
.recruit-sheet-head > div { display: flex; flex: 1; gap: 11px; align-items: baseline; }
.recruit-sheet-head > div > span { color: #b3c4ae; font-size: 12px; }
.recruit-sheet-head h2 { margin: 0; color: #f3e9c6; font-size: 19px; line-height: 1.25; }
.recruit-tier { color: #d4dcbc; font-size: 13px; font-variant-numeric: tabular-nums; }
.recruit-sheet-head .console-recruit-close { width: 26px; height: 26px; font-size: 18px; line-height: 1; padding: 0; }
.recruit-sheet-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.recruit-profile { display: grid; grid-template-columns: 162px minmax(0, 1fr); gap: 16px; padding: 14px; }
.recruit-art {
  position: relative; display: grid; place-items: center; align-self: stretch; min-height: 152px;
  border: 1px solid #435353;
  background: radial-gradient(ellipse at 50% 63%, #34413d, #162025 65%, #0b1117);
  box-shadow: inset 0 0 0 2px #0c1519;
}
.recruit-portrait { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; padding: 5px; box-sizing: border-box; }
.recruit-profile-data { align-self: center; min-width: 0; }
.recruit-profile-data .unit-trait-row { margin: 0; gap: 4px; }
.recruit-profile-data .unit-trait-chip { background: #2a302b; color: #d6daba; border-color: #495043; font-size: 12px; line-height: 16px; }
.recruit-profile-data p { margin: 7px 0; color: #c0cbd0; font-size: 13px; line-height: 1.5; }
.recruit-stats, .recruit-materials { display: grid; margin: 0; font-variant-numeric: tabular-nums; }
.recruit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.recruit-stats > div, .recruit-materials > div { display: flex; justify-content: space-between; gap: 5px; align-items: center; }
.recruit-stats > div { border-bottom: 1px solid #28353d; padding: 3px 0; }
.recruit-stats dt { color: #a3b7bf; font-size: 12px; }
.recruit-stats dd, .recruit-materials dd { margin: 0; color: #edf0e9; font-size: 13px; font-weight: 650; }
.recruit-routes, .recruit-price { padding: 9px 14px 11px; border-top: 1px solid var(--recruit-line); }
.recruit-sheet h3 { margin: 0; font-size: 14px; line-height: 1.45; color: #e0dfc8; }
.recruit-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.recruit-section-title > span { color: #a1b3bc; font-size: 12px; }
.recruit-section-title b { color: #d1dddf; font-weight: 600; }
.recruit-materials { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; }
.recruit-materials > div { min-width: 0; padding: 4px 7px; background: #151f29; border: 1px solid #293a41; }
.recruit-materials dt { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #c2d0d5; }
.recruit-materials dt img { width: 19px; height: 19px; object-fit: contain; }
.recruit-materials dd { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; column-gap: 3px; }
.recruit-materials .short dd { color: #ffb79b; }
.recruit-materials small { font-weight: normal; font-size: 10px; }
.recruit-sheet .recruit-sheet-foot { flex: none; display: flex; gap: 14px; align-items: center; padding: 10px 14px; background: #172320; border-top: 1px solid #45584e; }
.recruit-sheet-foot > h3 { white-space: nowrap; }
.recruit-sheet-foot .console-recruit-options { flex: 1; gap: 6px; }
.recruit-sheet .console-recruit-options button {
  height: 31px; padding: 0 4px; border: 1px solid #627f52; background: var(--classic-green);
  color: #e5efdb; font-weight: 600; font-size: 13px;
}
.recruit-sheet .console-recruit-options button:not([aria-disabled="true"]):enabled:hover { border-color: #c2d697; color: #fff4d2; }
.recruit-sheet button:focus-visible { outline: 2px solid #ffe3a3; outline-offset: -2px; }
.recruit-sheet .console-recruit-options button[aria-disabled="true"] { opacity: 1; filter: none; background: #242a2b; border-color: #40494a; color: #99a4a5; }
.recruit-sheet .route-options button[aria-current="true"] { opacity: 1; filter: none; border-color: #a3a46c; color: #edddaa; }
@media (max-height: 670px) {
  #controlConsole .recruit-sheet { max-height: calc(100dvh - var(--bottom-ui-safe-height) - 54px); }
  .recruit-profile { padding: 9px 12px; grid-template-columns: 140px minmax(0, 1fr); }
  .recruit-art { min-height: 132px; }
}
@media (max-width: 540px) {
  .recruit-profile { grid-template-columns: 28% minmax(0, 1fr); gap: 8px; padding: 8px; }
  .recruit-materials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recruit-sheet .recruit-sheet-foot { gap: 6px; padding: 8px; }
  .recruit-sheet-foot .console-recruit-options { gap: 3px; }
}

.bottombar:has(#controlConsole .planet-field-operation) {
  overflow: visible;
}

#controlConsole.tool-dock:has(.planet-field-operation) {
  align-self: end;
  grid-template-rows: 20px auto;
  overflow: visible;
}

#controlConsole .planet-field-operation {
  grid-template-columns: minmax(0, 1fr) auto;
  height: auto;
  gap: 6px 8px;
}

#controlConsole .planet-field-info {
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.planet-field-operation .planet-console-title {
  display: flex;
  gap: 5px;
}

.planet-field-operation .planet-battle-unit-portrait {
  width: 30px;
  height: 30px;
  flex: none;
}

.planet-field-identity {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1px 6px;
  min-width: 0;
}

.planet-field-operation :is(.planet-field-identity > *, .planet-console-line > *) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.planet-field-operation .planet-console-lines {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
}

.planet-field-operation .planet-console-line {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
}

.planet-field-operation .planet-field-roster {
  grid-column: auto;
}

.planet-field-operation :is(.planet-field-wide, .planet-field-notes) {
  grid-column: 1 / -1;
}

.planet-field-notes {
  display: grid;
  gap: 3px;
  padding-top: 4px;
  border-top: 1px solid #36534a;
  color: #b7d5d8;
  font-size: 11px;
  line-height: 14px;
  overflow-wrap: anywhere;
}

.planet-field-notes .planet-console-lore {
  margin: 0;
}

#controlConsole .planet-field-notes .planet-console-hint { display: block; }

@media (max-width: 600px) {
  .planet-field-operation .planet-console-lines { grid-template-columns: minmax(0, 1fr); }
}

/* Keep planet commands visible while long target details scroll within the panel. */
#controlConsole.tool-dock:has(> .planet-console-operation) {
  min-height: 0;
  align-self: stretch;
  grid-template-rows: 20px minmax(0, 1fr);
}

#controlConsole .planet-console-operation {
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
}

#controlConsole .planet-console-operation > .planet-console-info {
  min-height: 0;
  max-height: 100%;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#controlConsole .planet-console-operation:not(.planet-field-operation) .planet-field-hero {
  grid-row: 2;
}

@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
  #controlConsole.bottom-panel .planet-console-operation > .planet-console-actions:has(> button:nth-child(3)) {
    grid-template-columns: none;
    grid-auto-columns: var(--classic-command-size);
    grid-auto-flow: column;
  }
}

.scout-inbox-tools {
  display: flex;
  justify-content: flex-end;
}
.intel-tabs .scout-inbox-tools { margin-left: auto; }
#featureModal .scout-inbox-tools button {
  min-width: 64px;
  height: 19px;
  padding: 0 7px;
  border: 1px solid #406641;
  background: var(--classic-green, linear-gradient(#234c2a, #0d2919));
  color: #e3f3d4;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
}
#featureModal .scout-inbox-tools button:enabled:is(:hover, :focus-visible) {
  color: #f1ffe9;
  border-color: #9cce83;
}
#featureModal .scout-inbox-tools button:disabled { opacity: .45; cursor: default; }

/* 情报分类 */
[data-intel-summary].feature-stat {
  min-width: 0;
  align-items: center;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
[data-intel-summary]:hover, [data-intel-summary]:focus-visible {
  border-color: #7db6cd;
  color: #effbff;
}
[data-intel-summary][aria-pressed="true"] {
  border-color: #59976c;
  background: linear-gradient(#204735, #163325);
  color: #ddf4dd;
}
.feature-main:has([data-intel-list]) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.system-feature-list[data-intel-list] { min-height: 0; overflow-y: auto; }
.feature-side:has([data-intel-summary]) { overflow-y: auto; }
.intel-inbox > section:has(.intel-summary-bar) { grid-template-rows: 19px auto minmax(0, 1fr); }
.intel-summary-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin: 3px 0;
}
.intel-summary-bar .feature-stat {
  grid-template-columns: auto auto;
  justify-content: center;
  gap: 3px;
  padding: 3px 1px;
  font-size: 11px;
  background-color: #0c1f32;
}
.intel-summary-bar strong { font-size: inherit; }
.intel-summary-empty { padding: 1em; text-align: center; color: #bad2e3; }
