.tb-rote-phase-deck {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.tb-phase-deck-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.tb-phase-deck-head h3 {
  margin: 2px 0 4px;
}

.tb-phase-deck-head p {
  margin: 0;
  max-width: 780px;
  color: #8295b4;
  font-size: .76rem;
  line-height: 1.45;
}

.tb-phase-deck-legend {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tb-phase-deck-legend span {
  border: 1px solid #2a3c59;
  border-radius: 999px;
  padding: 5px 8px;
  color: #9bacbf;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tb-phase-deck-legend .dark { border-color: rgba(230, 89, 112, .44); color: #ff9cac; }
.tb-phase-deck-legend .mixed { border-color: rgba(229, 190, 91, .44); color: #f6da88; }
.tb-phase-deck-legend .light { border-color: rgba(95, 213, 243, .44); color: #a9efff; }
.tb-phase-deck-legend .bonus { border-color: rgba(166, 126, 241, .44); color: #cfbaff; }

.tb-phase-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.tb-phase-tab {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  text-align: left;
  border: 1px solid #20324e;
  border-radius: 10px;
  background: #091423;
  color: #dbe8f9;
}

.tb-phase-tab:hover,
.tb-phase-tab.active {
  border-color: #62d8ee;
  background: linear-gradient(180deg, rgba(41, 111, 138, .26), rgba(9, 20, 35, .96));
}

.tb-phase-tab span {
  font-size: .62rem;
  color: #6edfee;
  font-weight: 900;
  letter-spacing: .08em;
}

.tb-phase-tab strong {
  font-size: .82rem;
}

.tb-phase-tab small {
  color: #7186a5;
  font-size: .56rem;
  line-height: 1.25;
}

.tb-phase-territory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tb-phase-territory-grid.bonus {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tb-phase-territory-card {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  min-width: 0;
  text-align: left;
  border: 1px solid #20334f;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(10, 23, 40, .98), rgba(6, 15, 29, .98));
  color: #dce9fa;
  overflow: hidden;
}

.tb-phase-territory-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  opacity: .92;
}

.tb-phase-territory-card.lane-dark-side::before { background: #e65a73; }
.tb-phase-territory-card.lane-mixed::before { background: #e3bd5a; }
.tb-phase-territory-card.lane-light-side::before { background: #62d8ef; }
.tb-phase-territory-card.lane-bonus::before { background: #a67ef1; }

.tb-phase-territory-card:hover,
.tb-phase-territory-card.selected {
  transform: translateY(-1px);
  border-color: #6edfee;
  box-shadow: 0 0 0 2px rgba(110, 223, 238, .08), 0 12px 28px rgba(0, 0, 0, .28);
}

.tb-phase-territory-art {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 202, 242, .12), transparent 68%);
}

.tb-phase-territory-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .6));
}

.tb-phase-territory-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tb-phase-territory-copy > span:first-child {
  color: #6f86a7;
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tb-phase-territory-copy > strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .84rem;
}

.tb-phase-territory-copy > small {
  color: #8194b1;
  font-size: .59rem;
}

.tb-phase-territory-readiness {
  min-width: 66px;
  display: grid;
  justify-items: end;
  gap: 1px;
}

.tb-phase-territory-readiness b {
  border: 1px solid #2a3d5a;
  border-radius: 999px;
  padding: 3px 5px;
  font-size: .5rem;
  color: #9eb0c8;
  letter-spacing: .05em;
}

.tb-phase-territory-card.status-deep .tb-phase-territory-readiness b,
.tb-phase-territory-card.status-ready .tb-phase-territory-readiness b {
  color: #a4f8d2;
  border-color: rgba(101, 239, 182, .38);
}

.tb-phase-territory-card.status-thin .tb-phase-territory-readiness b {
  color: #ffe09a;
  border-color: rgba(243, 196, 91, .38);
}

.tb-phase-territory-card.status-blocked .tb-phase-territory-readiness b {
  color: #ffaaa8;
  border-color: rgba(223, 102, 112, .38);
}

.tb-phase-territory-readiness strong {
  font-size: 1rem;
}

.tb-phase-territory-readiness small {
  color: #6e82a0;
  font-size: .52rem;
}

.tb-phase-mission-icons {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 18px;
  margin-top: 3px;
}

.tb-phase-mission-icons > span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid #253851;
  border-radius: 50%;
  background: #0b1728;
}

.tb-phase-mission-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.tb-phase-mission-icons > b {
  color: #8296b2;
  font-size: .56rem;
}

/* The ROTE source map is 750x500. Match that canvas so planet pins stay aligned. */
.tb-rote-fan-map {
  min-height: 0 !important;
  aspect-ratio: 3 / 2;
}

.tb-rote-fan-map .rote-galaxy-lines,
.tb-rote-fan-map .rote-map-phase-label {
  display: none;
}

.tb-rote-fan-map .tb-rote-map-core-hidden {
  display: none;
}

.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin {
  width: 50px;
  min-height: 50px;
  padding: 0;
  border-radius: 50%;
  background: rgba(4, 11, 23, .56);
  border: 1px solid rgba(92, 124, 157, .44);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .42);
  backdrop-filter: blur(2px);
}

.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin .rote-planet-orb {
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin .rote-planet-copy {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 120px;
  padding: 3px 6px;
  border: 1px solid rgba(41, 60, 88, .88);
  border-radius: 7px;
  background: rgba(4, 10, 21, .92);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin:hover .rote-planet-copy,
.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin.selected .rote-planet-copy {
  opacity: 1;
}

.tb-rote-fan-map .rote-planet-copy strong {
  font-size: .62rem;
}

.tb-rote-fan-map .rote-planet-copy small {
  display: none;
}

.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin.selected {
  transform: translate(-50%, -50%) scale(1.14);
  z-index: 6;
}

.tb-rote-fan-map .rote-planet-node.tb-rote-map-pin[data-tb-map-lane="bonus"] {
  border-style: dashed;
  border-color: rgba(166, 126, 241, .64);
}

/* Legacy Geo/Hoth: move phase information out of the map pins and into a readable strip. */
.tb-information-layout {
  display: grid;
  gap: 10px;
}

.tb-legacy-phase-deck {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid #1d2e48;
  border-radius: 12px;
  background: rgba(7, 16, 29, .92);
}

.tb-legacy-phase-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.tb-legacy-phase-tabs button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #243754;
  border-radius: 8px;
  background: #0a1525;
  color: #b9c8dc;
}

.tb-legacy-phase-tabs button.active {
  color: #e7fbff;
  border-color: #64d9ef;
  background: rgba(51, 128, 154, .18);
}

.tb-legacy-phase-tabs span {
  color: #72dff0;
  font-size: .62rem;
  font-weight: 900;
}

.tb-legacy-phase-tabs small {
  color: #7084a2;
  font-size: .54rem;
}

.tb-legacy-territory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.tb-legacy-territory-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  min-width: 0;
  text-align: left;
  border: 1px solid #223653;
  border-radius: 9px;
  background: #0a1525;
  color: #dce8f8;
}

.tb-legacy-territory-card:hover,
.tb-legacy-territory-card.selected {
  border-color: #62d8ed;
  background: rgba(31, 82, 105, .2);
}

.tb-legacy-territory-card > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tb-legacy-territory-card small,
.tb-legacy-territory-card em {
  color: #7185a4;
  font-size: .55rem;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-legacy-territory-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .72rem;
}

.tb-legacy-territory-card > b {
  border: 1px solid #2b405f;
  border-radius: 999px;
  padding: 4px 6px;
  color: #9eb0c7;
  font-size: .52rem;
  white-space: nowrap;
}

.tb-legacy-territory-card.status-ready > b { color: #a4f8d2; border-color: rgba(101, 239, 182, .38); }
.tb-legacy-territory-card.status-close > b { color: #b8f6ff; border-color: rgba(105, 223, 242, .38); }
.tb-legacy-territory-card.status-building > b { color: #ffe09a; border-color: rgba(243, 196, 91, .38); }
.tb-legacy-territory-card.status-blocked > b { color: #ffaaa8; border-color: rgba(223, 102, 112, .38); }

.tb-information-layout .dsgeo-map .dsgeo-territory {
  width: 120px;
  min-height: 54px;
  padding: 7px 8px;
}

.tb-information-layout .dsgeo-map .dsgeo-territory small {
  display: none;
}

.tb-information-layout .dsgeo-map .dsgeo-territory b {
  margin-top: 3px;
  font-size: .52rem;
}

@media (max-width: 1100px) {
  .tb-phase-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tb-phase-territory-grid,
  .tb-phase-territory-grid.bonus,
  .tb-legacy-territory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tb-phase-deck-head {
    display: grid;
  }

  .tb-phase-tabs {
    display: flex;
    overflow-x: auto;
  }

  .tb-phase-tab {
    flex: 0 0 110px;
  }

  .tb-phase-territory-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .tb-phase-territory-art,
  .tb-phase-territory-image {
    width: 48px;
    height: 48px;
  }

  .tb-rote-fan-map {
    min-height: 470px !important;
    aspect-ratio: auto;
  }

  .tb-rote-fan-map .rote-planet-node.tb-rote-map-pin {
    width: 44px;
    min-height: 44px;
  }

  .tb-rote-fan-map .rote-planet-node.tb-rote-map-pin .rote-planet-orb {
    width: 38px;
    height: 38px;
  }
}
