:root {
  --game-width: 1220px;
}

.chessVariantApp {
  width: var(--game-width);
  max-width: var(--game-width);
  margin: 2rem auto;
  padding: 1rem;
}

.gameIntro {
  text-align: center;
  margin-bottom: 1rem;
}

.gamePanel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;

  width: fit-content;
  max-width: none;
}

.boardArea {
  flex: 0 0 auto;
  width: fit-content;
}

body {
  background-color: rgb(8, 42, 114);
  color: white;
  overflow-x: auto;
}

#moveLogTable {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: sans-serif;
  font-size: 0.9rem;
}

#moveLogTable th,
#moveLogTable td {
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

#moveLogTable th {
  background: rgba(255, 255, 255, 0.15);
}

#moveLogTable tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.06);
}

#moveLogTable th:nth-child(1),
#moveLogTable td:nth-child(1) {
  width: 48px;
}

#moveLogTable th:nth-child(2),
#moveLogTable td:nth-child(2),
#moveLogTable th:nth-child(3),
#moveLogTable td:nth-child(3) {
  width: 220px;
}

#moveLogTable th:nth-child(4),
#moveLogTable td:nth-child(4) {
  width: auto;
}

#rulesBoxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: var(--game-width);
  max-width: var(--game-width);
  margin: 0 auto 1rem auto;
  align-items: start;
}

#pieceMoveRules,
#distortionRules {
  background: rgba(51, 7, 102, 0.9);
  border: 2px solid #55248d;
  border-radius: 8px;
  color: white;
  padding: 0.75rem 1rem;
}

#pieceMoveRules summary,
#distortionRules summary {
  cursor: pointer;
  font-weight: bold;
  user-select: none;
}

.rulesContent {
  margin-top: 0.75rem;
  line-height: 1.4;
}

@media (max-width: 900px) {
  #rulesBoxes {
    grid-template-columns: 1fr;
  }
}

#pieceMoveRules:not([open]),
#distortionRules:not([open]) {
  width: fit-content;
}

#networkBar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 1rem auto;
  color: white;
}

#networkBar input {
  text-transform: uppercase;
  width: 7rem;
  padding: 0.35rem;
}

#networkBar button {
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

#networkStatus {
  min-width: 18rem;
  text-align: left;
}
