/* Foundation 0.9B.3 — Commander panel polish.
   Presentation only. Seat identity comes from the rendered authoritative view;
   Indigo and Legless remain visual War Table portraits, not gameplay leaders. */

.commander-shell {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 9px;
}

.commander-shell::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(214,182,110,.055);
  border-radius: 10px;
  pointer-events: none;
}

.commander-shell--p2::after {
  border-color: rgba(168,83,89,.075);
}

.commander-identity {
  min-height: 242px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  border-bottom: 0;
}

.commander-seatline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.commander-seatline .commander-kicker {
  margin: 0;
}

.seat-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(214,182,110,.25);
  border-radius: 999px;
  color: #d8c18a;
  background: rgba(5,7,11,.66);
  font-size: .5rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

.seat-role-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.commander-shell--p2 .seat-role-badge {
  border-color: rgba(168,83,89,.32);
  color: #d7a0aa;
}

.commander-portrait-copy {
  position: relative;
  z-index: 2;
  align-self: stretch;
  margin-top: auto;
  padding: 12px 12px 10px;
  border: 1px solid rgba(214,182,110,.16);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(5,7,11,.25), rgba(5,7,11,.78));
  backdrop-filter: blur(4px);
}

.commander-shell--p2 .commander-portrait-copy {
  border-color: rgba(168,83,89,.2);
}

.portrait-kind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #8b96a5;
  font-size: .49rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.portrait-kind span:last-child {
  color: #6f7a89;
  font-weight: 700;
  letter-spacing: .08em;
}

.commander-portrait-copy h2 {
  margin: 4px 0 0;
  display: block;
  padding: 0;
  color: #f0eadf;
  background: transparent;
  font: 800 1.55rem/1 Georgia, serif;
  letter-spacing: -.02em;
}

.commander-portrait-copy p {
  width: auto;
  max-width: none;
  margin: 5px 0 0;
  padding: 0;
  color: #aab3bf;
  background: transparent;
  font: italic .66rem/1.4 Georgia, serif;
}

.commander-profile-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: -2px;
}

.commander-profile-chip {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #303946;
  border-radius: 7px;
  background: rgba(6,9,14,.8);
}

.commander-profile-chip span {
  display: block;
  color: #657283;
  font-size: .44rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.commander-profile-chip strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #dce1e7;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commander-shell--p1 .commander-profile-chip:first-child {
  border-color: rgba(214,182,110,.32);
}

.commander-shell--p2 .commander-profile-chip:first-child {
  border-color: rgba(168,83,89,.36);
}

.command-resources.player-zone {
  margin-top: 0;
  border: 1px solid rgba(255,255,255,.045);
  box-shadow: inset 0 1px rgba(255,255,255,.018);
}

.commander-shell--p1 .command-resources.player-zone {
  border-color: rgba(214,182,110,.14);
}

.commander-shell--p2 .command-resources.player-zone {
  border-color: rgba(168,83,89,.17);
}

.commander-shell .command-resources .player-head h2 {
  color: #f0eadf;
  font: 800 1.12rem/1 Georgia, serif;
}

.commander-shell .command-resources .player-head .eyebrow {
  color: #7f8b9a;
}

.commander-shell--p1 .resource-priority--command {
  border-color: rgba(214,182,110,.54);
  background: linear-gradient(180deg, rgba(43,36,20,.34), rgba(5,8,12,.88));
}

.commander-shell--p2 .resource-priority--command {
  border-color: rgba(168,83,89,.46);
  background: linear-gradient(180deg, rgba(47,23,29,.34), rgba(5,8,12,.88));
}

.command-oaths,
.enemy-doctrine {
  margin-top: 0;
  flex: 1 0 auto;
  border-color: rgba(255,255,255,.06);
}

.command-oaths header,
.enemy-doctrine header {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.command-oaths h2,
.enemy-doctrine h2 {
  font-family: Georgia, serif;
}

.enemy-doctrine {
  display: flex;
  flex-direction: column;
}

.enemy-doctrine p {
  margin: 8px 0 0;
}

.commander-motto {
  margin: auto 3px 0;
  border-top-color: rgba(214,182,110,.15);
}

.commander-shell--p2 .commander-motto {
  border-top-color: rgba(168,83,89,.18);
}

.commander-identity .commander-sigil {
  position: absolute;
  right: 10px;
  bottom: 89px;
  width: 42px;
  height: 42px;
  margin: 0;
  opacity: .78;
  font-size: 1.15rem;
}

.commander-shell[data-seat-role="ai"] .seat-role-badge {
  color: #d69aa7;
}

.commander-shell[data-seat-role="human"] .seat-role-badge {
  color: #d9c38b;
}

.commander-shell[data-seat-id="P2"].commander-shell--p1 .commander-profile-chip:first-child,
.commander-shell[data-seat-id="P1"].commander-shell--p2 .commander-profile-chip:first-child {
  border-color: rgba(131,185,232,.34);
}

@media (max-width: 1080px) {
  .commander-identity {
    min-height: 210px;
  }

  .commander-portrait-copy h2 {
    font-size: 1.35rem;
  }
}

@media (max-width: 760px) {
  .commander-profile-strip {
    grid-template-columns: 1fr 1fr;
  }

  .commander-identity {
    min-height: 198px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .seat-role-badge,
  .commander-portrait-copy {
    backdrop-filter: none;
    background: rgba(5,7,11,.9);
  }
}
