:root {
  --ct-space: #020817;
  --ct-navy: #061a43;
  --ct-panel: #0a2759;
  --ct-blue: #1677ff;
  --ct-cyan: #50ddff;
  --ct-gold: #ffc52f;
  --ct-orange: #ff7a18;
  --ct-purple: #9d4dff;
  --ct-red: #ef3d51;
  --ct-green: #65e36f;
  --ct-ink: #f8fbff;
  --ct-copy: #d9eaff;
  --ct-border: rgba(255, 197, 47, .7);
}

.commander-page {
  color: var(--ct-ink);
  background: var(--ct-space);
}

.commander-page .site-header {
  border-bottom-color: var(--ct-gold);
  background: #030b1d;
}

.commander-page main {
  overflow: hidden;
}

.ct-shell {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.ct-kicker {
  margin: 0 0 .75rem;
  color: var(--ct-cyan);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ct-title {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.045em;
}

.ct-lede {
  max-width: 62ch;
  color: var(--ct-copy);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
}

.ct-hero {
  position: relative;
  min-height: min(820px, 88svh);
  display: grid;
  align-items: end;
  isolation: isolate;
  background: #030918;
}

.ct-hero-art {
  position: absolute;
  z-index: -2;
  inset: 0;
}

.ct-hero-art,
.ct-hero-art img {
  width: 100%;
  height: 100%;
}

.ct-hero-art img {
  object-fit: cover;
  object-position: center;
}

.ct-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 8, 23, .98) 0%, rgba(2, 8, 23, .88) 38%, rgba(2, 8, 23, .14) 72%),
    linear-gradient(0deg, rgba(2, 8, 23, .98), transparent 48%);
  content: "";
}

.ct-hero-copy {
  max-width: 670px;
  padding-block: clamp(5rem, 11vw, 9rem) clamp(3rem, 7vw, 6rem);
}

.ct-hero-logo {
  width: min(620px, 88vw);
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .5));
}

.ct-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3.7rem);
  line-height: .98;
  text-transform: uppercase;
}

.ct-hero-message {
  max-width: 22ch;
  margin: 1rem 0 1.5rem;
  color: #fff;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 900;
  line-height: 1.18;
  text-transform: uppercase;
}

.ct-hero-message strong {
  display: block;
  color: var(--ct-gold);
}

.ct-status {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .55rem .9rem;
  border: 2px solid var(--ct-gold);
  border-radius: 999px;
  color: var(--ct-space);
  background: var(--ct-gold);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ct-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.15rem;
  border: 2px solid var(--ct-gold);
  border-radius: 9px;
  color: #071a3b;
  background: var(--ct-gold);
  box-shadow: 0 6px 0 #9d5900;
  font-weight: 950;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ct-button:hover {
  color: #071a3b;
  background: #ffe07a;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #9d5900;
}

.ct-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #9d5900;
}

.ct-button:focus-visible {
  outline: 4px solid var(--ct-cyan);
  outline-offset: 4px;
}

.ct-section {
  padding-block: clamp(4rem, 8vw, 8rem);
}

.ct-section-header {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(280px, 1.25fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.ct-story {
  background:
    radial-gradient(circle at 15% 30%, rgba(80, 221, 255, .16), transparent 24rem),
    linear-gradient(150deg, #061a43, #030918 62%);
}

.ct-story-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.ct-story-grid p {
  color: var(--ct-copy);
  line-height: 1.75;
}

.ct-system-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.ct-system-map {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  border: 2px solid var(--ct-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(80, 221, 255, .12), transparent 34%),
    radial-gradient(circle, rgba(255, 255, 255, .85) 1px, transparent 1.5px) 0 0/38px 38px,
    #030b23;
  box-shadow: inset 0 0 90px rgba(22, 119, 255, .18);
}

.ct-map-disclaimer {
  position: absolute;
  z-index: 4;
  top: 1rem;
  left: 1rem;
  max-width: 29ch;
  color: #bcd9ff;
  font-size: .72rem;
}

.ct-star {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #201000;
  background: radial-gradient(circle at 35% 30%, #fffbd1, #ffc52f 42%, #ff7417 74%);
  box-shadow: 0 0 28px #ffcf48, 0 0 90px rgba(255, 122, 24, .55);
  font-weight: 950;
  transform: translate(-50%, -50%);
}

.ct-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(113, 211, 255, .4);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-9deg);
}

.ct-orbit-a { width: 38%; aspect-ratio: 1; }
.ct-orbit-b { width: 63%; aspect-ratio: 1; }
.ct-orbit-c { width: 88%; aspect-ratio: 1; }

.ct-planet {
  position: absolute;
  z-index: 3;
  width: clamp(82px, 11vw, 132px);
  aspect-ratio: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: .5rem;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  text-align: center;
}

.ct-planet b { font-size: 1.05rem; }
.ct-planet small { max-width: 10ch; font-size: .63rem; line-height: 1.1; }
.ct-planet-a { top: 19%; left: 48%; background: radial-gradient(circle at 30% 25%, #ff9a34, #a1122f 62%, #27000d); }
.ct-planet-b { right: 10%; bottom: 22%; background: radial-gradient(circle at 30% 25%, #80f0ff, #126fdc 58%, #061a43); }
.ct-planet-c { bottom: 10%; left: 13%; background: radial-gradient(circle at 30% 25%, #9dffbc, #6243c8 58%, #19113e); }

.ct-attack,
.ct-observe {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: .2rem;
  color: var(--ct-gold);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ct-attack { top: 36%; right: 17%; transform: rotate(29deg); }
.ct-attack::after { content: "➜"; font-size: 2.8rem; }
.ct-observe { bottom: 20%; left: 32%; color: #aefcc1; }
.ct-observe::after { content: "◉"; font-size: 2rem; }

.ct-map-key {
  display: grid;
  gap: 1rem;
}

.ct-map-key article,
.ct-civilization,
.ct-feature,
.ct-boss-card,
.ct-mission-card {
  border: 1px solid var(--ct-border);
  border-radius: 16px;
  background: #0a2759;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .24);
}

.ct-map-key article {
  padding: 1.1rem;
}

.ct-map-key h3,
.ct-map-key p {
  margin: 0;
}

.ct-map-key p {
  margin-top: .35rem;
  color: var(--ct-copy);
}

.ct-map-key .a { border-color: #ef3d51; }
.ct-map-key .b { border-color: #50ddff; }
.ct-map-key .c { border-color: #9d4dff; }

.ct-civilizations {
  background: linear-gradient(180deg, #04112c, #061d46);
}

.ct-civ-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ct-civilization {
  overflow: hidden;
}

.ct-civilization figure {
  min-height: 260px;
  display: grid;
  place-items: end center;
  margin: 0;
}

.ct-civilization img {
  width: min(80%, 250px);
  height: auto;
  filter: drop-shadow(0 20px 24px rgba(0, 0, 0, .4));
}

.ct-civilization > div { padding: 1.35rem; }
.ct-civilization p { color: var(--ct-copy); line-height: 1.65; }
.ct-civilization.thum-a figure { background: radial-gradient(circle at 50% 70%, #df512d, #521026 62%, #140610); }
.ct-civilization.thum-b figure { background: radial-gradient(circle at 50% 70%, #50ddff, #135eb4 62%, #061a43); }
.ct-civilization.thum-c figure { background: radial-gradient(circle at 50% 70%, #73eaae, #6544c5 62%, #19113e); }
.ct-civilization.thum-a img { filter: hue-rotate(285deg) saturate(1.6) drop-shadow(0 20px 24px rgba(0, 0, 0, .4)); }
.ct-civilization.thum-c img { filter: hue-rotate(50deg) saturate(.9) drop-shadow(0 20px 24px rgba(0, 0, 0, .4)); }

.ct-commander {
  background:
    radial-gradient(circle at 70% 50%, rgba(80, 221, 255, .18), transparent 30rem),
    #020817;
}

.ct-commander-stage {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.ct-character-lockup {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ct-border);
  border-radius: 26px;
  background: radial-gradient(circle, #1557b1, #061a43 60%, #020817);
}

.ct-character-lockup .character { width: min(52%, 290px); }
.ct-character-lockup .ship { position: absolute; right: 5%; bottom: 8%; width: 42%; filter: drop-shadow(0 0 22px rgba(80, 221, 255, .5)); }
.ct-character-lockup .base { position: absolute; bottom: 3%; left: 5%; width: 42%; opacity: .72; }

.ct-mission-callout {
  margin-top: 2rem;
  padding: 1.4rem;
  border-left: 5px solid var(--ct-gold);
  color: #fff;
  background: #0a2759;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 950;
  line-height: 1.16;
  text-transform: uppercase;
}

.ct-wing-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 2rem;
}

.ct-wing-row figure {
  margin: 0;
  padding: .8rem;
  border: 1px solid rgba(80, 221, 255, .35);
  border-radius: 12px;
  background: #061a43;
  text-align: center;
}

.ct-wing-row img { width: 100%; height: auto; }
.ct-wing-row figcaption { color: var(--ct-copy); font-size: .7rem; font-weight: 800; }

.ct-conflict {
  background: linear-gradient(90deg, #310815, #092a61 52%, #24144f);
}

.ct-conflict-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}

.ct-conflict-flow article {
  min-height: 190px;
  display: grid;
  place-content: center;
  padding: 1rem;
  border: 2px solid currentColor;
  border-radius: 18px;
  text-align: center;
}

.ct-conflict-flow b { font-size: clamp(2rem, 4vw, 4rem); }
.ct-conflict-flow span { font-weight: 900; letter-spacing: .12em; }
.ct-conflict-flow .a { color: #ff7685; }
.ct-conflict-flow .b { color: #70e5ff; }
.ct-conflict-flow .c { color: #bd93ff; }
.ct-flow-arrow { color: var(--ct-gold); font-size: 2.5rem; }
.ct-question { margin: 2.5rem auto 0; color: #fff; font-size: clamp(1.45rem, 3vw, 2.6rem); text-align: center; }

.ct-gameplay {
  background:
    linear-gradient(180deg, rgba(3, 11, 29, .42), #020817),
    url("commander-thumb-hero-1600.webp") center/cover fixed;
}

.ct-gameplay-panel {
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--ct-border);
  border-radius: 26px;
  background: rgba(3, 13, 35, .96);
}

.ct-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.ct-feature {
  min-height: 190px;
  padding: 1.1rem;
}

.ct-feature b {
  display: block;
  color: var(--ct-gold);
  font-size: 1.8rem;
}

.ct-feature h3 { margin: .65rem 0 .4rem; }
.ct-feature p { margin: 0; color: var(--ct-copy); line-height: 1.5; }

.ct-bosses {
  background: linear-gradient(180deg, #040c22, #0c1a45);
}

.ct-boss-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .8rem;
}

.ct-boss-card {
  overflow: hidden;
}

.ct-boss-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: .5rem;
  background: radial-gradient(circle, rgba(157, 77, 255, .25), transparent 65%);
}

.ct-boss-card div { padding: .9rem; }
.ct-boss-card b { color: var(--ct-gold); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.ct-boss-card h3 { margin: .3rem 0 0; font-size: 1rem; line-height: 1.2; }

.ct-mystery {
  position: relative;
  min-height: 580px;
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at 75% 50%, rgba(101, 227, 111, .22), transparent 22rem),
    radial-gradient(circle at 64% 45%, rgba(157, 77, 255, .3), transparent 34rem),
    #080c2b;
}

.ct-mystery::after {
  position: absolute;
  right: 6%;
  color: rgba(255, 255, 255, .05);
  font-size: min(46vw, 540px);
  font-weight: 950;
  content: "?";
}

.ct-mystery-copy { position: relative; z-index: 1; max-width: 720px; }

.commander-tile {
  border-color: #22caff !important;
  background: linear-gradient(145deg, #03102f, #0c2d72) !important;
}

.commander-tile img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.commander-tile .alpha-badge {
  color: #071a3b;
  border-color: var(--ct-gold);
  background: var(--ct-gold);
}

.commander-tile h2,
.commander-tile h3,
.commander-tile p { color: #fff; }

.commander-tile .text-link { color: #83eaff; }

/* Palace readability repair: solid surfaces, explicit contrast, and clear states. */
.palace-play-page .section.navy {
  background: #071a3b;
}

.palace-play-page .tutorial-stage {
  border-color: #ffc534;
  background: #09275a;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .38);
}

.palace-play-page .mini-match-chrome {
  background: #071a3b;
}

.palace-play-page .palace-app-table {
  background:
    radial-gradient(ellipse 70% 53% at 50% 53%, #287ddd 0 42%, #0e4eac 68%, #082b63 100%),
    #0e4eac;
}

.palace-play-page .v3-feedback,
.palace-play-page .mini-match-chrome > footer {
  color: #10254d;
  background: #fff8e7;
  border-color: #ffc534;
}

.palace-play-page .v3-feedback.good {
  color: #0a4e22;
  background: #eaffef;
}

.palace-play-page .seat label,
.palace-play-page .central-pile label,
.palace-play-page .zone-label {
  color: #e8f8ff;
  text-shadow: 0 2px 3px #051329;
}

.palace-play-page button:not(.menu-toggle):not(.header-settings):disabled {
  color: #cfdded;
  border-color: #6d7d92;
  background: #34445b;
  opacity: 1;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .ct-section-header,
  .ct-story-grid,
  .ct-system-wrap,
  .ct-commander-stage {
    grid-template-columns: 1fr;
  }

  .ct-civ-grid { grid-template-columns: 1fr; }
  .ct-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-boss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-system-map { min-height: 580px; }
  .ct-gameplay { background-attachment: scroll; }
}

@media (max-width: 620px) {
  .ct-shell { width: min(100% - 1rem, 1180px); }
  .ct-hero { min-height: 790px; align-items: end; }
  .ct-hero-art { height: 48%; }
  .ct-hero-art img { object-position: 66% center; }
  .ct-hero::after {
    background:
      linear-gradient(0deg, #020817 0%, #020817 55%, rgba(2, 8, 23, .32) 84%, rgba(2, 8, 23, .08));
  }
  .ct-hero-copy { padding-top: 20rem; padding-bottom: 3rem; }
  .ct-hero-logo { width: min(100%, 460px); }
  .ct-hero h1 { font-size: clamp(1.7rem, 9vw, 2.65rem); }
  .ct-system-map { min-height: 510px; }
  .ct-star { width: 82px; }
  .ct-orbit-a { width: 42%; }
  .ct-orbit-b { width: 68%; }
  .ct-orbit-c { width: 94%; }
  .ct-planet { width: 78px; }
  .ct-planet-a { top: 21%; left: 45%; }
  .ct-planet-b { right: 4%; bottom: 21%; }
  .ct-planet-c { bottom: 7%; left: 6%; }
  .ct-attack { top: 38%; right: 9%; }
  .ct-observe { bottom: 18%; left: 27%; }
  .ct-character-lockup { min-height: 420px; }
  .ct-conflict-flow { grid-template-columns: 1fr; }
  .ct-flow-arrow { transform: rotate(90deg); text-align: center; }
  .ct-feature-grid,
  .ct-boss-grid { grid-template-columns: 1fr; }
  .ct-feature { min-height: 0; }
  .ct-wing-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-button {
    transition: none;
  }

  .ct-gameplay {
    background-attachment: scroll;
  }
}

.game-shelf,
.game-grid:has(.commander-tile) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 821px) {
  .site-nav a {
    padding-inline: .62rem;
    font-size: .68rem;
  }
}

@media (max-width: 900px) {
  .game-shelf,
  .game-grid:has(.commander-tile) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .game-shelf,
  .game-grid:has(.commander-tile) {
    grid-template-columns: 1fr;
  }

  .site-nav[data-open="true"] + .header-tools {
    inset-block-start: calc(100% + 366px);
  }
}
.ct-home-feature {
  background: #061330;
  color: #fff;
}

.ct-home-feature picture img {
  width: 100%;
  border: 1px solid var(--ct-gold);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
