/* === FactionPanel === */

.sectionIcon {
  display: flex;
  align-items: center;
  color: var(--hull-grey);
}

.sectionToggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0.25rem 0;
  cursor: pointer;
  color: var(--chrome-silver);
  transition: color 0.15s ease;
}

.sectionToggle:hover,
.sectionToggle:focus-visible {
  color: var(--star-white);
}

.sectionToggle:focus-visible {
  outline: 1px solid var(--plasma-cyan);
  outline-offset: 2px;
}

.divider {
  height: 1px;
  background: var(--dim-grey);
  margin: 0.25rem 0;
}

/* Faction info card */
.factionCard {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

.factionHeader {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.factionName {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--star-white);
}

.factionTag {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--plasma-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  display: inline-block;
  width: fit-content;
}

.factionDescription {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--chrome-silver);
  line-height: 1.4;
}

.factionMeta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.metaTag {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metaValue {
  color: var(--plasma-cyan);
}

/* Relations (allies & enemies) */
.relationsRow {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.relationGroup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.relationLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hull-grey);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 0.25rem;
}

.allyBadge {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
}

.enemyBadge {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
}

/* War list */
.warList {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.warItem {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.6rem;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.15);
  border-radius: 4px;
}

.warHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.warTarget {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f87171;
}

.warStats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.warKills {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
}

.warLosses {
  color: #f87171;
}

.warReason {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  font-style: italic;
}

/* Peace proposals */
.proposalList {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.proposalItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.15);
  border-radius: 4px;
}

.proposalInfo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.proposalFrom {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--star-white);
}

.proposalTerms {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  font-style: italic;
}

/* Member list */
.memberList {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.memberItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  background: rgba(61, 90, 108, 0.1);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.memberItem:hover {
  background: rgba(61, 90, 108, 0.2);
}

.memberLeft {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.memberRight {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.onlineDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hull-grey);
  flex-shrink: 0;
}

.onlineDot.online {
  background: #4ade80;
  box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
}

.memberName {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--star-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memberRole {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  text-transform: uppercase;
  flex-shrink: 0;
}

.kickBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--hull-grey);
  transition: all 0.15s ease;
}

.kickBtn:hover,
.kickBtn:focus-visible {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  outline: none;
}

.kickBtn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Create faction form */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.label {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--chrome-silver);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--star-white);
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  padding: 0.4rem 0.55rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: var(--hull-grey);
}

.input:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.formActions {
  display: flex;
  gap: 0.35rem;
}

/* Invite row */
.inviteRow {
  display: flex;
  gap: 0.35rem;
}

.inviteInput {
  flex: 1;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--star-white);
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.inviteInput::placeholder {
  color: var(--hull-grey);
}

.inviteInput:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

/* Pending invites list */
.inviteList {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.inviteItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

.inviteItemInfo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.inviteItemName {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--star-white);
}

.inviteItemMeta {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
}

.inviteItemActions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Diplomacy */
.diplomacySection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.diplomacyRow {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Faction browser list */
.factionList {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.factionListItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  background: rgba(61, 90, 108, 0.1);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s ease;
  gap: 0.5rem;
}

.factionListItem:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.15);
}

.factionListInfo {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.factionListRight {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.factionListName {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--star-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.factionListTag {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--plasma-cyan);
  flex-shrink: 0;
}

.factionListMembers {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  flex-shrink: 0;
}

.diplomacyTargetBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 3px;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--plasma-cyan);
  transition: all 0.15s ease;
}

.diplomacyTargetBtn:hover,
.diplomacyTargetBtn:focus-visible {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.4);
  outline: none;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
}

/* === Intel Section === */
.intelSection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.intelQueryRow {
  display: flex;
  gap: 0.35rem;
}

.intelList {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 160px;
  overflow-y: auto;
}

.intelItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  background: rgba(61, 90, 108, 0.1);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.intelItem:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.15);
}

.intelSystemName {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--star-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intelMeta {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  flex-shrink: 0;
}

.intelStats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.5rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

.intelStatItem {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.25rem 0.4rem;
}

.intelStatLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hull-grey);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.intelStatValue {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--plasma-cyan);
}

/* === Room Section === */
.roomSection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roomList {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.roomItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  background: rgba(61, 90, 108, 0.1);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s ease;
  gap: 0.5rem;
}

.roomItem:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.15);
}

.roomItemInfo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.roomItemName {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--star-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roomItemMeta {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
}

.roomItemActions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.roomContent {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

.roomContentHeader {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.roomContentTitle {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--star-white);
}

.roomContentMeta {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
}

.roomContentBody {
  font-family: var(--font-space-grotesk), 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--chrome-silver);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.roomContentFooter {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--hull-grey);
  border-top: 1px solid var(--dim-grey);
  padding-top: 0.35rem;
  margin-top: 0.15rem;
}

.roomForm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(61, 90, 108, 0.06);
  border: 1px solid var(--dim-grey);
  border-radius: 4px;
}

.roomFormTitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--chrome-silver);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.roomFormCount {
  font-size: 0.75rem;
  color: var(--hull-grey);
  margin-left: auto;
}

.textarea {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--star-white);
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  padding: 0.4rem 0.55rem;
  outline: none;
  resize: vertical;
  min-height: 3rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea::placeholder {
  color: var(--hull-grey);
}

.textarea:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.select {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--star-white);
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  padding: 0.4rem 0.55rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

/* Mobile */
@media (max-width: 768px) {
  .input { font-size: 16px; min-height: 44px; }
  .inviteInput { font-size: 16px; min-height: 44px; }
  .textarea { font-size: 16px; min-height: 44px; }
  .select { font-size: 16px; min-height: 44px; }
  .metaTag { font-size: 0.68rem; }
  .memberRole { font-size: 0.68rem; }
  .factionListTag { font-size: 0.68rem; }
  .factionListMembers { font-size: 0.68rem; }
  .intelMeta { font-size: 0.68rem; }
  .intelStatLabel { font-size: 0.68rem; }
  .roomItemMeta { font-size: 0.68rem; }
  .roomContentMeta { font-size: 0.68rem; }
  .roomContentFooter { font-size: 0.68rem; }
  .roomFormCount { font-size: 0.68rem; }
}
