body {
  padding: 0;
  margin: 0;
}

div {
  box-sizing: border-box;
}

.content-container {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.border {
  border: 1px solid;
}

.border-gray {
  border-color: gray;
}

.border-main {
  border-color: #002439;
}

.bg-panel-main {
  background-color: #005066;
}

.bg-main-page {
  background-color: #4e7988;
}

.bg-light {
  background-color: #71a6ab;
}

.bg-red {
  background-color: #e14848;
}

.border-red {
  border-color: #b03737;
}

.bg-green {
  background-color: #4de148;
}

.border-green {
  border-color: #37b041;
}

.head-block {
  width: 100%;
  height: 32px;
  display: flex;
  justify-content: space-between;
}

.jc-center {
  justify-content: center;
}

.jc-end {
  justify-content: end;
}

.aic {
  align-items: center;
}

.tac {
  text-align: center;
}

.body-block {
  width: 100%;
  flex: auto;
  display: flex;
  flex-direction: column; /* make main axis vertical */
}

.logo-block {
  display: flex;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.footer-block {
  width: 100%;
  height: 32px;
  display: flex;
}

.server-status {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 8px solid #21ff37;
  margin-left: 5px;
  margin-right: 5px;
}

.online-block {
  display: flex;
}

.select-lang {
  display: flex;
}

.login-box {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: 300px;
}

.notify-block {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: 300px;
}

.register-box {
  display: flex;
  flex-direction: column;
  margin: auto;
  /*height: 400px;*/
  width: 300px;
}

.win-head {
  display: flex;
  height: 32px;
  user-select: none;
}

.win-body {
  display: flex;
  flex: auto;
  flex-flow: column;
}

.win-footer {
  display: flex;
  height: 32px;
}

.fs-large {
  font-size: large;
}

.fs-larger {
  font-size: larger;
}

.fs-x-large {
  font-size: x-large;
}

.fs-xx-large {
  font-size: xx-large;
}

.p1 {
  padding: 5px;
}

.p2 {
  padding: 10px;
}

.pl2 {
  padding-left: 10px;
}

.pr2 {
  padding-right: 10px;
}

.p3 {
  padding: 15px;
}

.p4 {
  padding: 20px;
}

.p5 {
  padding: 25px;
}

.m1 {
  margin: 5px;
}

.m2 {
  margin: 10px;
}

.m3 {
  margin: 15px;
}

.m4 {
  margin: 20px;
}

.m5 {
  margin: 25px;
}

.d-flex {
  display: flex;
}

.w-100 {
  width: 100%;
}

.d-none {
  display: none !important;
}

.window {
  backdrop-filter: blur(12px);
  position: absolute;
  justify-content: space-between;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .window {
    width: 100% !important;
    height: calc(100% - 64px) !important;
    position: absolute !important;
    flex-direction: column !important;
    display: flex !important;
    left: 0px !important;
    top: 32px !important;
  }

  .btn-helper {
    display: none;
    user-select: none;
    visibility: hidden;
    pointer-events: none;
  }
}

.space-between {
  justify-content: space-between;
}

/* Window Planet */
.win-width-800 {
  width: 800px;
}

.win-height-600 {
  height: 600px;
}

.hide {
  display: none !important;
  user-select: none;
  visibility: hidden;
  pointer-events: none;
}

.btn {
  align-content: center;
  border-radius: 5px;
  border: 1px solid #002439;
  box-sizing: border-box;
  background-color: #013644;
  color: white;
  position: relative;
}

.btn-helper {
  position: absolute;
  top: -1px;
  right: -1px;
  text-shadow: 1px 1px 2px pink;
  font-size: 10px;
}

.btn-notify span {
  position: absolute;
  font-size: 10px;
  color: white;
  left: -3px;
  top: -6px;
  text-shadow: 1px 1px 2px pink;
}

.btn-notify-yellow {
  position: absolute;
  bottom: -1px;
  right: -1px;
  border: 5px solid yellow;
  border-radius: 50%;
  content: "&nbsp;";
}

.btn-notify-red {
  position: absolute;
  bottom: -1px;
  right: -1px;
  border: 5px solid red;
  border-radius: 50%;
  content: "&nbsp;";
}

.btn-notify-green {
  position: absolute;
  bottom: -1px;
  right: -1px;
  border: 5px solid green;
  border-radius: 50%;
  content: "&nbsp;";
}

.btn:hover {
  background-color: #01485d;
}

.btn:active {
  background-color: #01485d;
  border: 1px solid #001a26;
}

.footer-btn {
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.btn-24 {
  width: 24px;
  height: 24px;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-grab {
  cursor: grab;
}

.cursor-grabbing {
  cursor: grabbing;
}

.block-game-header {
  height: 25px;
  border-radius: 5px;
  border: 1px dashed rgba(0, 26, 38, 0.33);
  background: rgba(0, 36, 57, 0.38);
  min-width: 30px;
}

.cr-text {
  color: greenyellow;
}
.gl-text {
  color: gold;
}

.color-white {
  color: white;
}

/* --- Прелоадер страницы /game --- */
.game-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a1628;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}
.game-preloader.game-preloader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.game-preloader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 80, 102, 0.3);
  border-top-color: #71a6ab;
  border-radius: 50%;
  animation: game-preloader-spin 0.9s linear infinite;
}
.game-preloader-text {
  margin-top: 16px;
  color: #71a6ab;
  font-size: 14px;
}
@keyframes game-preloader-spin {
  to {
    transform: rotate(360deg);
  }
}
.game-content-hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- Прелоадер окна карты звёзд --- */
.galaxy-view-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}
.win-body.pos-rel {
  position: relative;
}
.galaxy-preloader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a1628;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}
.galaxy-preloader.galaxy-preloader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.galaxy-preloader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 80, 102, 0.3);
  border-top-color: #71a6ab;
  border-radius: 50%;
  animation: game-preloader-spin 0.9s linear infinite;
}
.galaxy-preloader-text {
  margin-top: 12px;
  color: #71a6ab;
  font-size: 13px;
}

/* --- Утилиты --- */
.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1;
}
.min-h-0 {
  min-height: 0;
}
.min-w-0 {
  min-width: 0;
}
.overflow-auto {
  overflow: auto;
}
.border-r {
  border-right: 1px solid;
}
.gap2 {
  gap: 10px;
}
.mb1 {
  margin-bottom: 6px;
}
.mb2 {
  margin-bottom: 10px;
}
.flex-wrap {
  flex-wrap: wrap;
}
.storage-used-volume {
  font-size: 0.9em;
  color: #002439;
}

/* --- Окна: растягивание за угол --- */
.window-resizable {
  min-width: 320px;
  min-height: 280px;
  max-width: 100vw;
  max-height: 100vh;
}
.win-footer {
  position: relative;
  min-height: 12px;
}
.win-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 50%,
    rgba(0, 36, 57, 0.4) 50%
  );
}
.win-resize-handle::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(0, 36, 57, 0.6);
  border-bottom: 2px solid rgba(0, 36, 57, 0.6);
}

/* --- Окно планеты --- */
.win-body-planet {
  overflow: hidden;
  display: flex;
  flex-direction: row;
}
.planet-info-panel {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  flex-shrink: 0;
  background: rgba(0, 80, 102, 0.25);
}
.planet-info-title {
  font-weight: bold;
  color: #002439;
}
.planet-info-row {
  margin-bottom: 8px;
}
.planet-info-label {
  display: block;
  font-size: 0.9em;
  color: #002439;
}
.planet-info-value {
  display: block;
  margin-top: 2px;
}
.planet-info-ore .planet-ore-list {
  font-size: 0.85em;
}
.planet-tabs-panel {
  overflow: hidden;
}
.planet-tabs-head {
  flex-shrink: 0;
  background: rgba(0, 80, 102, 0.2);
}
.planet-tab-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: #002439;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.planet-tab-btn:hover {
  background: rgba(0, 80, 102, 0.2);
}
.planet-tab-btn.active {
  background: rgba(113, 166, 171, 0.5);
  border-bottom-color: #002439;
}
.planet-tab-content {
  display: none;
  height: 100%;
}
.planet-tab-content.active {
  display: flex;
  flex-direction: column;
}
.storage-split {
  min-height: 0;
}
.storage-block {
  min-width: 0;
  overflow: auto;
}
.storage-block-title {
  font-weight: bold;
  color: #002439;
}
.storage-class-hint {
  font-size: 0.85em;
  color: #004d66;
}
.storage-table-wrap {
  overflow: auto;
}
.storage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.storage-table th,
.storage-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 36, 57, 0.2);
}
.storage-table th {
  background: rgba(0, 80, 102, 0.2);
  color: #002439;
}
.storage-table .col-check {
  width: 28px;
}
.storage-table .col-actions {
  width: 60px;
}

/* --- Окно списка планет --- */
.planets-toolbar {
  flex-shrink: 0;
  background: rgba(0, 80, 102, 0.2);
}
.planets-search-input {
  padding: 6px 10px;
  border: 1px solid #002439;
  border-radius: 4px;
  min-width: 160px;
}
.planets-filter-select {
  padding: 4px 8px;
  border: 1px solid #002439;
  border-radius: 4px;
}
.planets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.planets-system-group {
  border: 1px solid rgba(0, 36, 57, 0.3);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}
.planets-system-name {
  padding: 8px 12px;
  background: rgba(0, 80, 102, 0.4);
  font-weight: bold;
  color: #002439;
  cursor: default;
}
.planets-system-planets {
  padding: 4px 0;
}
.planet-list-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 36, 57, 0.1);
}
.planet-list-item:hover {
  background: rgba(0, 80, 102, 0.2);
}
.planet-list-item:last-child {
  border-bottom: none;
}
.planet-list-item-name {
  font-weight: 500;
}
.planet-list-item-meta {
  font-size: 0.85em;
  color: #004d66;
}

/* --- Окно галактики (PixiJS контейнер) --- */
.galaxy-view-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0a1628;
}
.galaxy-view-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .window-resizable {
    min-width: 100%;
    min-height: 50vh;
  }
  .win-resize-handle {
    display: none;
  }
  .planet-info-panel {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid #002439;
  }
  .win-body-planet {
    flex-direction: column;
  }
  .storage-split {
    flex-direction: column;
  }
  .planet-tabs-head {
    overflow-x: auto;
  }
  .planet-tab-btn {
    white-space: nowrap;
  }
}
