html.corefront-session,
body.corefront-session {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.corefront-session {
  width: 100%;
}

.corefront-shell {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #02050a;
  color: #f3f7ff;
  isolation: isolate;
}

.corefront-menu-screen,
.corefront-playfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.corefront-menu-screen {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding:
    max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 34%, rgba(65, 221, 168, 0.20), transparent 25%),
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.18), transparent 30%),
    linear-gradient(160deg, #06111b 0%, #03070d 52%, #010308 100%);
}

.corefront-menu-screen::before {
  position: absolute;
  inset: -35%;
  content: "";
  background:
    linear-gradient(rgba(91, 214, 174, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 214, 174, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  transform:
    perspective(720px)
    rotateX(62deg)
    translateY(24%);
  transform-origin: center bottom;
  animation: corefront-grid-drift 18s linear infinite;
  pointer-events: none;
}

.corefront-menu-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      transparent 14%,
      transparent 86%,
      rgba(0, 0, 0, 0.38)
    );
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.corefront-menu-panel {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(620px, 100%);
  padding: clamp(32px, 6vw, 68px);
  border: 1px solid rgba(127, 255, 212, 0.20);
  border-radius: 28px;
  background:
    linear-gradient(
      145deg,
      rgba(11, 24, 37, 0.91),
      rgba(3, 9, 16, 0.94)
    );
  box-shadow:
    0 38px 120px rgba(0, 0, 0, 0.52),
    0 0 80px rgba(48, 204, 153, 0.08);
  backdrop-filter: blur(18px);
  text-align: center;
}

.corefront-menu-eyebrow {
  margin: 0 0 15px;
  color: #70edbd;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.corefront-menu-logo {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 950;
  letter-spacing: -0.065em;
  line-height: 0.92;
  text-shadow:
    0 0 42px rgba(80, 228, 174, 0.23),
    0 18px 48px rgba(0, 0, 0, 0.52);
}

.corefront-menu-subtitle {
  margin: 20px 0 32px;
  color: #9db0c5;
  font-size: clamp(16px, 2.2vw, 20px);
}

.corefront-menu-actions {
  display: grid;
  gap: 13px;
  width: min(360px, 100%);
}

.corefront-menu-button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 58px;
  padding: 12px 20px;
  border: 1px solid rgba(151, 174, 202, 0.25);
  border-radius: 14px;
  background: rgba(19, 34, 52, 0.84);
  color: #eef6ff;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.01em;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.corefront-menu-button:hover:not(:disabled),
.corefront-menu-button:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(112, 237, 189, 0.75);
  background: rgba(31, 67, 72, 0.92);
  box-shadow: 0 14px 42px rgba(22, 163, 115, 0.16);
  outline: none;
}

.corefront-menu-button.primary {
  border-color: rgba(112, 237, 189, 0.55);
  background:
    linear-gradient(135deg, #65efbc, #24b982);
  color: #03120c;
  box-shadow: 0 14px 42px rgba(36, 185, 130, 0.16);
}

.corefront-menu-button.secondary {
  background: rgba(15, 27, 43, 0.78);
}

.corefront-menu-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.corefront-menu-button small {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.78;
  text-transform: uppercase;
}

.corefront-playfield {
  overflow: hidden;
  background: #02050a;
}

.corefront-game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  background: #02050a;
}

.core-node strong {
  font-size: 34px;
  letter-spacing: -0.04em;
}

@keyframes corefront-grid-drift {
  from {
    transform:
      perspective(720px)
      rotateX(62deg)
      translate3d(0, 24%, 0);
  }

  to {
    transform:
      perspective(720px)
      rotateX(62deg)
      translate3d(72px, calc(24% + 72px), 0);
  }
}

@media (max-width: 560px) {
  .corefront-menu-screen {
    padding: 16px;
  }

  .corefront-menu-panel {
    padding: 32px 22px;
    border-radius: 22px;
  }

  .corefront-menu-actions {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .corefront-menu-screen::before {
    animation: none;
  }

  .corefront-menu-button {
    transition: none;
  }
}

/* ==========================================================
   COREFRONT STAGE 2 – GAME HUD
   ========================================================== */

.corefront-playfield {
  --corefront-command-width: clamp(270px, 16.6667vw, 360px);
  --corefront-topbar-height: 68px;

  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    var(--corefront-command-width);
  grid-template-rows:
    var(--corefront-topbar-height)
    minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #02050a;
}

.corefront-topbar {
  position: relative;
  z-index: 5;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid rgba(115, 241, 194, 0.16);
  background:
    linear-gradient(
      180deg,
      rgba(10, 24, 37, 0.98),
      rgba(5, 14, 23, 0.97)
    );
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.corefront-economy {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.corefront-economy-item {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  min-width: 176px;
  padding: 8px 24px;
  border-right: 1px solid rgba(140, 171, 198, 0.13);
}

.corefront-economy-icon {
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(104, 237, 188, 0.32);
  border-radius: 10px;
  background: rgba(35, 130, 100, 0.15);
  color: #7cf1c4;
  font-size: 1.05rem;
  font-weight: 950;
  box-shadow: inset 0 0 18px rgba(71, 232, 175, 0.05);
}

.corefront-economy-label {
  align-self: end;
  color: #8da2b7;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
}

.corefront-economy-value {
  align-self: start;
  color: #f5fbff;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.08rem, 1.35vw, 1.34rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.corefront-economy-value.income {
  color: #78edbd;
}

.corefront-map-viewport {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #02050a;
}

.corefront-game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  background: #02050a;
  touch-action: none;
}

.corefront-command-panel {
  position: relative;
  z-index: 6;
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid rgba(115, 241, 194, 0.18);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(57, 189, 144, 0.10),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(9, 22, 34, 0.99),
      rgba(3, 10, 17, 0.99)
    );
  box-shadow:
    -18px 0 46px rgba(0, 0, 0, 0.32),
    inset 1px 0 0 rgba(255, 255, 255, 0.02);
}

.corefront-command-header {
  display: flex;
  align-items: center;
  min-height: var(--corefront-topbar-height);
  padding: 0 20px;
  border-bottom: 1px solid rgba(132, 168, 195, 0.13);
}

.corefront-command-title {
  margin: 0;
  color: #edf7ff;
  font-size: clamp(0.94rem, 1vw, 1.08rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.corefront-command-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 12px;
  border-bottom: 1px solid rgba(132, 168, 195, 0.12);
  background: rgba(0, 0, 0, 0.11);
}

.corefront-command-tab {
  appearance: none;
  min-width: 0;
  min-height: 42px;
  padding: 8px 7px;
  border: 1px solid rgba(133, 162, 189, 0.18);
  border-radius: 9px;
  background: rgba(15, 30, 45, 0.78);
  color: #9fb1c3;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.corefront-command-tab:hover,
.corefront-command-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(108, 233, 185, 0.48);
  color: #eafaf4;
  outline: none;
}

.corefront-command-tab[aria-selected="true"] {
  border-color: rgba(112, 237, 189, 0.56);
  background:
    linear-gradient(
      145deg,
      rgba(49, 168, 126, 0.29),
      rgba(24, 88, 76, 0.22)
    );
  color: #86f1c7;
  box-shadow: inset 0 0 20px rgba(65, 213, 161, 0.06);
}

.corefront-command-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(105, 222, 179, 0.40) rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
}

.corefront-command-pane {
  min-height: 100%;
  padding: 18px;
}

.corefront-command-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 100%;
  padding: 30px 12px;
  color: #8297aa;
  text-align: center;
}

.corefront-command-empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  border: 1px solid rgba(107, 222, 181, 0.23);
  border-radius: 16px;
  background: rgba(45, 147, 113, 0.08);
  color: rgba(119, 235, 192, 0.70);
  font-size: 1.24rem;
  font-weight: 950;
  box-shadow: inset 0 0 26px rgba(79, 222, 169, 0.04);
}

.corefront-command-empty h3 {
  margin: 0 0 8px;
  color: #d9e5ee;
  font-size: 1rem;
  font-weight: 850;
}

.corefront-command-empty p {
  max-width: 240px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .corefront-playfield {
    --corefront-command-width: clamp(248px, 24vw, 300px);
  }

  .corefront-economy-item {
    min-width: 158px;
    padding-inline: 17px;
  }
}

@media (max-width: 760px) {
  .corefront-playfield {
    --corefront-command-width: clamp(220px, 38vw, 270px);
    --corefront-topbar-height: 62px;
  }

  .corefront-economy-item {
    min-width: 0;
    padding-inline: 11px;
  }

  .corefront-economy-icon {
    display: none;
  }

  .corefront-command-header {
    padding-inline: 14px;
  }

  .corefront-command-tabs {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 560px) {
  .corefront-playfield {
    --corefront-topbar-height: 56px;
  }

  .corefront-command-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .corefront-command-tab {
    min-height: 36px;
  }
}

/* ==========================================================
   COREFRONT STAGE 3 – PROCEDURAL WORLD, CAMERA, PAUSE, SAVES
   ========================================================== */

.corefront-world-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
  padding: 0 22px;
  border-left: 1px solid rgba(140, 171, 198, 0.13);
  color: #8195a9;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.corefront-world-meta strong {
  color: #c9d8e5;
  font-variant-numeric: tabular-nums;
}

.corefront-map-viewport {
  position: relative;
  background: #172018;
}

.corefront-game-canvas {
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.corefront-game-canvas.is-dragging {
  cursor: grabbing;
}

.corefront-map-controls {
  position: absolute;
  z-index: 6;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
  max-width: min(620px, calc(100% - 32px));
  padding: 9px 12px;
  border: 1px solid rgba(155, 191, 171, 0.16);
  border-radius: 10px;
  background: rgba(5, 12, 9, 0.72);
  color: rgba(227, 239, 232, 0.72);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.corefront-map-controls kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid rgba(149, 186, 166, 0.26);
  border-bottom-color: rgba(149, 186, 166, 0.46);
  border-radius: 5px;
  background: rgba(14, 29, 21, 0.88);
  color: #d8eee2;
  font: inherit;
  font-weight: 850;
}

.corefront-pause-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 4, 6, 0.64);
  backdrop-filter: blur(8px) saturate(0.82);
}

.corefront-pause-overlay[hidden],
.corefront-pause-panel[hidden],
.corefront-save-browser[hidden],
.corefront-quit-confirm[hidden] {
  display: none !important;
}

.corefront-pause-panel,
.corefront-save-browser,
.corefront-quit-confirm {
  width: min(520px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(105, 235, 183, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(12, 28, 38, 0.98), rgba(3, 10, 15, 0.99));
  box-shadow:
    0 36px 110px rgba(0, 0, 0, 0.58),
    0 0 70px rgba(50, 197, 145, 0.08);
  color: #edf8f2;
  text-align: center;
}

.corefront-pause-kicker {
  margin: 0 0 9px;
  color: #6ee9b8;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.corefront-pause-title {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.corefront-pause-description {
  margin: 0 0 26px;
  color: #99adbd;
  line-height: 1.55;
}

.corefront-pause-actions {
  display: grid;
  gap: 11px;
}

.corefront-pause-button {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 11px 16px;
  border: 1px solid rgba(148, 177, 197, 0.24);
  border-radius: 12px;
  background: rgba(17, 34, 48, 0.88);
  color: #edf8f3;
  cursor: pointer;
  font: inherit;
  font-weight: 820;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.corefront-pause-button:hover:not(:disabled),
.corefront-pause-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(105, 235, 183, 0.70);
  background: rgba(27, 65, 59, 0.94);
  outline: none;
}

.corefront-pause-button.primary {
  border-color: rgba(105, 235, 183, 0.52);
  background: linear-gradient(135deg, #64ebb8, #27b984);
  color: #03120c;
}

.corefront-pause-button.danger {
  border-color: rgba(244, 112, 112, 0.34);
  background: rgba(74, 25, 29, 0.78);
  color: #ffdada;
}

.corefront-pause-button:disabled {
  cursor: not-allowed;
  opacity: 0.43;
}

.corefront-save-list {
  display: grid;
  gap: 10px;
  margin: 24px 0 18px;
}

.corefront-save-slot {
  appearance: none;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 66px;
  padding: 12px 15px;
  border: 1px solid rgba(139, 172, 193, 0.22);
  border-radius: 12px;
  background: rgba(13, 29, 41, 0.88);
  color: #e8f5ee;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.corefront-save-slot:hover:not(:disabled),
.corefront-save-slot:focus-visible:not(:disabled) {
  border-color: rgba(101, 232, 181, 0.64);
  background: rgba(23, 55, 51, 0.92);
  outline: none;
}

.corefront-save-slot strong {
  font-size: 0.94rem;
}

.corefront-save-slot span {
  color: #8fa5b6;
  font-size: 0.78rem;
}

.corefront-save-slot:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.corefront-quit-warning {
  margin: 20px 0 26px;
  padding: 14px 16px;
  border: 1px solid rgba(241, 124, 124, 0.22);
  border-radius: 12px;
  background: rgba(82, 31, 34, 0.34);
  color: #ffd3d3;
  line-height: 1.55;
}

.corefront-status-toast {
  position: fixed;
  z-index: 2147483000;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-width: min(360px, calc(100vw - 32px));
  max-width: min(620px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(126, 176, 151, 0.28);
  border-radius: 12px;
  background: rgba(5, 17, 13, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.44);
  color: #e7f5ed;
  font-size: 0.86rem;
  font-weight: 750;
  text-align: center;
  pointer-events: none;
}

.corefront-status-toast[data-kind="success"] {
  border-color: rgba(83, 229, 162, 0.55);
}

.corefront-status-toast[data-kind="error"] {
  border-color: rgba(245, 113, 113, 0.55);
  background: rgba(48, 13, 17, 0.96);
  color: #ffd7d7;
}

@media (max-width: 920px) {
  .corefront-world-meta {
    display: none;
  }

  .corefront-map-controls {
    display: none;
  }
}

@media (max-width: 700px) {
  .corefront-pause-overlay {
    padding: 14px;
  }

  .corefront-pause-panel,
  .corefront-save-browser,
  .corefront-quit-confirm {
    padding: 24px 18px;
    border-radius: 17px;
  }
}


/* ==========================================================
   COREFRONT STAGE 4 – LARGE WORLD, FOG OF WAR, MINIMAP
   ========================================================== */

.corefront-command-panel {
  grid-template-rows:
    minmax(150px, 20dvh)
    auto
    auto
    minmax(0, 1fr);
}

.corefront-minimap-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(132, 168, 195, 0.14);
  background:
    linear-gradient(
      180deg,
      rgba(7, 17, 27, 0.99),
      rgba(3, 10, 16, 0.99)
    );
}

.corefront-minimap-header,
.corefront-minimap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px;
}

.corefront-minimap-header {
  border-bottom: 1px solid rgba(132, 168, 195, 0.10);
}

.corefront-minimap-title {
  margin: 0;
  color: #dfeef6;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.corefront-minimap-explored {
  color: #7fecc1;
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.corefront-minimap-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 8px 10px 5px;
  overflow: hidden;
  border: 1px solid rgba(116, 224, 184, 0.22);
  border-radius: 7px;
  background: #020605;
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.45),
    0 4px 16px rgba(0, 0, 0, 0.24);
}

.corefront-minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 80px;
  cursor: crosshair;
  touch-action: none;
  image-rendering: auto;
}

.corefront-minimap-footer {
  padding-top: 2px;
  color: #73889b;
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.2;
}

@media (max-height: 720px) {
  .corefront-command-panel {
    grid-template-rows:
      minmax(120px, 20dvh)
      auto
      auto
      minmax(0, 1fr);
  }

  .corefront-minimap-footer {
    display: none;
  }
}


/* ============================================================
   Corefront Stage 5 – building production and placement
   ============================================================ */

.corefront-command-building-list {
  display: grid;
  gap: 12px;
}

.corefront-build-card {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 148px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid rgba(142, 174, 199, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      rgba(16, 31, 46, 0.96),
      rgba(7, 15, 24, 0.96)
    );
  color: #eff7ff;
  cursor: pointer;
  text-align: left;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.corefront-build-card:hover:not(:disabled),
.corefront-build-card:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(112, 237, 189, 0.66);
  box-shadow: 0 12px 30px rgba(20, 157, 113, 0.12);
  outline: none;
}

.corefront-build-card:disabled {
  cursor: not-allowed;
}

.corefront-build-card.is-preparing {
  border-color: rgba(255, 205, 90, 0.46);
  cursor: progress;
}

.corefront-build-card.is-ready,
.corefront-build-card.is-placing {
  border-color: rgba(112, 237, 189, 0.88);
  background:
    linear-gradient(
      145deg,
      rgba(18, 69, 55, 0.98),
      rgba(7, 30, 28, 0.98)
    );
  box-shadow:
    0 0 0 1px rgba(112, 237, 189, 0.16),
    0 13px 34px rgba(21, 183, 126, 0.14);
}

.corefront-build-card.is-insufficient {
  opacity: 0.52;
  filter: saturate(0.55);
}

.corefront-build-card-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(112, 237, 189, 0.30);
  border-radius: 12px;
  background:
    linear-gradient(
      145deg,
      rgba(47, 110, 92, 0.80),
      rgba(14, 41, 40, 0.92)
    );
  color: #bcffe4;
  font-size: 1.55rem;
  font-weight: 950;
}

.corefront-build-card-content {
  min-width: 0;
}

.corefront-build-card-title {
  margin: 0;
  color: #f7fbff;
  font-size: 1rem;
  font-weight: 900;
}

.corefront-build-card-description {
  margin: 4px 0 9px;
  color: #98aabd;
  font-size: 0.76rem;
  line-height: 1.35;
}

.corefront-build-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #d8e6f4;
  font-size: 0.74rem;
  font-weight: 760;
}

.corefront-build-progress {
  position: absolute;
  right: 0;
  bottom: 31px;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.075);
}

.corefront-build-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, #e5b84d, #65efbc);
  transform: scaleX(0);
  transform-origin: left center;
}

.corefront-build-status {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  min-height: 31px;
  padding: 4px 9px;
  background: rgba(3, 10, 16, 0.76);
  color: #c9d8e8;
  font-size: 0.71rem;
  font-weight: 860;
  letter-spacing: 0.035em;
  text-align: center;
  text-transform: uppercase;
}

.corefront-build-card.is-ready .corefront-build-status,
.corefront-build-card.is-placing .corefront-build-status {
  background: rgba(38, 177, 127, 0.88);
  color: #02140d;
}

.corefront-build-card.is-preparing .corefront-build-status {
  color: #ffe5a0;
}

.corefront-game-canvas {
  touch-action: none;
}

@media (max-width: 980px) {
  .corefront-build-card {
    grid-template-columns: 50px minmax(0, 1fr);
    min-height: 152px;
    padding: 10px;
  }

  .corefront-build-card-icon {
    width: 50px;
    height: 50px;
  }
}


/* ============================================================
   Corefront Stage 6 – infantry production, queue and rally point
   ============================================================ */

.corefront-unit-list {
  display: grid;
  gap: 12px;
}

.corefront-unit-card {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  min-height: 218px;
  overflow: hidden;
  padding: 13px 13px 42px;
  border: 1px solid rgba(132, 167, 196, 0.24);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(16, 31, 46, 0.97), rgba(7, 15, 24, 0.98));
  color: #eff7ff;
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.corefront-unit-card:hover:not(:disabled),
.corefront-unit-card:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(112, 237, 189, 0.70);
  box-shadow: 0 12px 30px rgba(20, 157, 113, 0.13);
  outline: none;
}

.corefront-unit-card.is-training {
  border-color: rgba(255, 205, 90, 0.54);
}

.corefront-unit-card.is-insufficient {
  opacity: 0.52;
  filter: saturate(0.55);
  cursor: not-allowed;
}

.corefront-unit-card-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(112, 237, 189, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 34%, #8ff3cc, #257c62 48%, #102f2b 100%);
  color: #03150e;
  font-size: 1.28rem;
  font-weight: 950;
}

.corefront-unit-card-title {
  display: block;
  color: #f7fbff;
  font-size: 1rem;
  font-weight: 900;
}

.corefront-unit-card-description {
  display: block;
  margin-top: 4px;
  color: #98aabd;
  font-size: 0.75rem;
  line-height: 1.36;
}

.corefront-unit-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.corefront-unit-stat {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(139, 172, 199, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.17);
}

.corefront-unit-stat span {
  color: #7f94a9;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.corefront-unit-stat strong {
  color: #e9f7ff;
  font-size: 0.83rem;
}

.corefront-unit-ability {
  display: block;
  grid-column: 1 / -1;
  margin-top: 8px;
  color: #b8c9d8;
  font-size: 0.72rem;
  line-height: 1.4;
}

.corefront-unit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 9px;
  color: #d7e5f2;
  font-size: 0.72rem;
  font-weight: 760;
}

.corefront-unit-progress {
  position: absolute;
  right: 0;
  bottom: 31px;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.075);
}

.corefront-unit-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e5b84d, #65efbc);
  transform: scaleX(0);
  transform-origin: left center;
}

.corefront-unit-status {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  min-height: 31px;
  padding: 4px 9px;
  background: rgba(3, 10, 16, 0.78);
  color: #c9d8e8;
  font-size: 0.70rem;
  font-weight: 860;
  letter-spacing: 0.035em;
  text-align: center;
  text-transform: uppercase;
}

.corefront-unit-card.is-training .corefront-unit-status {
  color: #ffe5a0;
}

.corefront-unit-rally-hint {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(112, 237, 189, 0.16);
  border-radius: 10px;
  background: rgba(37, 109, 87, 0.08);
  color: #8fa6b9;
  font-size: 0.72rem;
  line-height: 1.42;
}


/* ============================================================
   Corefront Stage 7 – unit selection, formations and health HUD
   ============================================================ */

.corefront-game-canvas.has-unit-selection {
  cursor: crosshair;
}

.corefront-game-canvas.is-dragging {
  cursor: grabbing;
}
