* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/*  темы  */
:root {
  /* Чуть уменьшенный максимум, лучше встаёт с сайдбаром */
  --board-size: min(72vmin, 960px);
  --square-light: rgb(231, 241, 253);
  --square-dark: rgb(212, 227, 250);
  --move-hint: rgba(60, 90, 160, 0.55);
  --capture-hint: rgba(255, 120, 150, 0.95);
  --check-hint: rgba(255, 60, 60, 0.9);
}

body.theme-basic {
  --square-light: rgb(231, 241, 253);
  --square-dark: rgb(212, 227, 250);
  --move-hint: rgba(60, 90, 160, 0.55);
  --capture-hint: rgba(255, 120, 150, 0.95);
  --check-hint: rgba(255, 60, 60, 0.9);
}

body.theme-classic {
  --square-light: rgb(231, 241, 253);
  --square-dark: rgb(212, 227, 250);
  --move-hint: rgba(60, 90, 160, 0.55);
  --capture-hint: rgba(255, 120, 150, 0.95);
  --check-hint: rgba(255, 60, 60, 0.9);
}

body.theme-universal {
  --square-light: rgb(231, 241, 253);
  --square-dark: rgb(212, 227, 250);
  --move-hint: rgba(60, 90, 160, 0.55);
  --capture-hint: rgba(255, 120, 150, 0.95);
  --check-hint: rgba(255, 60, 60, 0.9);
}

/*  задний фон  */
body {
  background: radial-gradient(circle at top, #2b1b4b 0, #060818 55%, #020308 100%);
  color: #f5f5ff;
  font-family: "Courier New", monospace;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px 12px 32px;
  position: relative;
  overflow-x: hidden;
}

/* неоновые пятна как на About */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
  z-index: 0;
}

body::before {
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(255, 121, 198, 0.5), transparent 60%);
}

body::after {
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(80, 200, 255, 0.5), transparent 60%);
}

.page {
  width: 100%;
  max-width: 1400px;
  position: relative;
  z-index: 1;
}

/* шляпа */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.logo {
  line-height: 1;
  text-transform: uppercase;
  font-family: "Courier New", monospace;
  letter-spacing: 2px;

  font-size: clamp(20px, calc(var(--board-size) / 22), 32px);
  font-weight: 900;
  background: linear-gradient(120deg, #6df2ff, #ff9cf5, #c69bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(255, 121, 198, 0.7);
}

/* общий неоновый стиль текста */
.neon-text,
.coords-row,
.coords-col,
.sidebar h2,
.sidebar h3,
.sidebar p,
#current-turn,
#moves-log {
  background: linear-gradient(120deg, #6df2ff, #ff9cf5, #c69bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 8px rgba(255, 121, 198, 0.6);
}
/*  общий неоновый стиль текста */
.neon-text {
  font-weight: 900;
  font-family: "Courier New", monospace;
  text-transform: uppercase;

  /* градиент как в образце  */
  background: linear-gradient(90deg, #a8e0ff, #f3b2ff, #f5a8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* мягкое цветное свечение */
  text-shadow:
    0 0 8px rgba(168, 224, 255, 0.6),
    0 0 18px rgba(243, 178, 255, 0.5),
    0 0 26px rgba(245, 168, 255, 0.4);
}
/*  основной стиль текста  */
.neon-rounded-text {
  font-family: "Courier New", monospace;
  font-weight: 900;

  /* красивый мягкий градиент, как на твоей картинке */
  background: linear-gradient(90deg, #b7e3ff, #e9b8ff, #f2a4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* мягкое сияние вокруг букв */
  text-shadow:
    0 0 12px rgba(240, 183, 255, 0.4),
    0 0 20px rgba(200, 140, 255, 0.3),
    0 0 28px rgba(160, 120, 255, 0.25);
}

.top-bar .controls button,
.top-bar .controls a {
  background: rgba(10, 16, 44, 0.9);
  color: #f5f5ff;
  border: 1px solid rgba(171, 216, 255, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: "Courier New", monospace;
  box-shadow: 0 0 14px rgba(104, 200, 255, 0.45);
  backdrop-filter: blur(8px);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.top-bar .controls button:hover,
.top-bar .controls a:hover {
  background: rgba(16, 22, 60, 0.95);
  box-shadow: 0 0 18px rgba(104, 200, 255, 0.75);
  transform: translateY(-1px);
}

/*  основной макет  */

.main-layout {
  display: grid;
  grid-template-columns: auto minmax(260px, 340px);
  column-gap: 28px;
  align-items: flex-start;
  justify-content: center;
}

/*  доска  */

#board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* баннер победы */
#winner-banner {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 38px;
  font-weight: 800;
  font-family: "Courier New", monospace;
  color: #ffffff;
  text-shadow: 0 0 10px #000, 0 0 20px #000;
  padding: 16px 28px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.65);
  display: none; /* показывается из JS при мате */
  z-index: 10;
}

/* верх/низ (A–H) */
.coords-row {
  width: var(--board-size);
  height: clamp(30px, calc(var(--board-size) / 12), 56px);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  justify-items: center;
  align-items: center;
  font-size: clamp(20px, calc(var(--board-size) / 11), 48px);
  font-family: "Courier New", monospace;
  color: rgb(150, 180, 230);
  user-select: none;
}

/* центр: колонка слева, доска, колонка справа */
#board-middle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* лево/право (1–8) */
.coords-col {
  width: 32px;
  height: var(--board-size);
  display: grid;
  grid-template-rows: repeat(8, 1fr);
  justify-items: center;
  align-items: center;
  font-size: clamp(20px, calc(var(--board-size) / 11), 48px);
  font-family: "Courier New", monospace;
  color: rgb(150, 180, 230);
  user-select: none;
}

/* внутренняя 8×8 доска */
#board-grid {
  width: var(--board-size);
  height: var(--board-size);

  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);

  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(119, 185, 255, 0.35);
}

/* клетки */
.square {
  position: relative;
}

/* цвета клеток */
.square.light {
  background-color: var(--square-light);
}

.square.dark {
  background-color: var(--square-dark);
}

/* подсказка доступного хода – точка */
.square.move-hint::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  background-color: var(--move-hint);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* кружок на клетке, где можно взять фигуру соперника */
.square.capture-hint::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  background-color: var(--capture-hint);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

/* королём под шахом клетка*/
.square.in-check::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 60, 60, 0.38), rgba(255, 60, 60, 0.2));
  pointer-events: none;
  z-index: 3;
}

/* фигуры */
.piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 88%;
  height: 88%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 1;
}

/* выбранная фигура */
.piece.selected {
  animation: pieceWiggle 0.8s ease-in-out infinite;
  filter:
    drop-shadow(0 0 6px rgba(241, 196, 15, 0.9))
    drop-shadow(0 0 14px rgba(241, 196, 15, 0.6));
}

.piece.selected-static {
  filter:
    drop-shadow(0 0 6px rgba(241, 196, 15, 0.9))
    drop-shadow(0 0 14px rgba(241, 196, 15, 0.6));
}

/* аним "взял фигуру в руку" */
@keyframes pieceWiggle {
  0%   { transform: translate(-50%, calc(-50% - 6px)) rotate(0deg)   scale(1.05); }
  25%  { transform: translate(-50%, calc(-50% - 6px)) rotate(-3deg)  scale(1.05); }
  50%  { transform: translate(-50%, calc(-50% - 6px)) rotate(0deg)   scale(1.05); }
  75%  { transform: translate(-50%, calc(-50% - 6px)) rotate(3deg)   scale(1.05); }
  100% { transform: translate(-50%, calc(-50% - 6px)) rotate(0deg)   scale(1.05); }
}

/* туда сюда */

.sidebar {
  background: radial-gradient(circle at top left, rgba(255, 121, 198, 0.18), rgba(11, 16, 43, 0.96));
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow:
    0 0 18px rgba(0, 0, 0, 0.75),
    0 0 22px rgba(119, 185, 255, 0.35);
  border: 1px solid rgba(182, 210, 255, 0.45);
  backdrop-filter: blur(10px);
  font-family: "Courier New", monospace;
}

.sidebar h2 {
  font-size: 18px;
  margin-bottom: 6px;
  color: #fdf3ff;
  font-family: "Courier New", monospace;
}

.sidebar h3 {
  font-size: 15px;
  margin-top: 14px;
  margin-bottom: 6px;
  color: #f4e9ff;
  font-family: "Courier New", monospace;
}

.sidebar p {
  font-size: 14px;
  color: #dde7ff;
  font-family: "Courier New", monospace;
}

#current-turn {
  font-weight: 700;
  color: #ffd2ff;
}

/* лог ходов */
#moves-log {
  padding-left: 18px;
  max-height: 50vh;
  overflow-y: auto;
  font-size: 13px;
  color: #c8d6ff;
}

/* чуть-чуть прокрутка */
#moves-log::-webkit-scrollbar {
  width: 6px;
}
#moves-log::-webkit-scrollbar-track {
  background: rgba(5, 8, 25, 0.7);
}
#moves-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff79c6, #8be9fd);
  border-radius: 999px;
}

/* report bug page */
.bug-report-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 32px;
  border-radius: 18px;
  background: rgba(10, 12, 40, 0.8);
  box-shadow: 0 0 24px rgba(255, 0, 200, 0.25);
}

.bug-report-section h1 {
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-row label {
  margin-bottom: 4px;
}

.form-row input,
.form-row textarea {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 10px;
  background: rgba(15, 18, 60, 0.9);
  color: #fff;
}

.primary-btn {
  border-radius: 999px;
  padding: 8px 18px;
  border: 1px solid #ff66ff;
  background: linear-gradient(90deg, #ff66ff, #66ccff);
  color: #fff;
  cursor: pointer;
}

.primary-btn:hover {
  opacity: 0.9;
}

/*  пешка в другую фигуру  */
.promotion-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 25, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.promotion-modal.hidden {
  display: none;
}

.promotion-dialog {
  background: linear-gradient(145deg, rgba(25, 20, 60, 0.95), rgba(15, 10, 40, 0.98));
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 0 25px rgba(255, 100, 255, 0.5);
  border: 1px solid rgba(255, 150, 255, 0.85);
  min-width: 260px;
  text-align: center;
}

.promotion-title {
  font-family: "Courier New", monospace;
  font-size: 18px;
  margin-bottom: 14px;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 120, 255, 0.8),
               0 0 12px rgba(100, 200, 255, 0.7);
}

.promotion-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.promotion-buttons button {
  font-family: "Courier New", monospace;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #ff78ff;
  background: linear-gradient(120deg, #ff55ff, #66ccff);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 0 10px rgba(255, 120, 255, 0.5);
}

.promotion-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(255, 160, 255, 0.8);
}

.promotion-buttons button:active {
  transform: translateY(0);
  box-shadow: 0 0 6px rgba(255, 120, 255, 0.6);
}

.hidden {
  display: none !important;
}
