/* Visually dimmed button for disabled state */
.btn-disabled,
button:disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(40%);
  cursor: not-allowed;
}
/* King icon for color picker */
.color-choice-piece img {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  display: inline-block;
}
/* Extra padding for rules panel on game page only */
.game-container > .rules-panel {
  padding: 20px 24px 20px 24px;
}
/* Capture-pen consistency warning */
.capture-inconsistency-warning {
  background: #e74c3c;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  grid-column: 1 / -1;
  z-index: 10;
}
/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure the HTML `hidden` attribute always wins over display rules in class selectors */
[hidden] {
  display: none !important;
}

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --text: #e0e0e0;
  --text-muted: #8899aa;
  --accent: #4a9eff;
  --accent-hover: #6ab4ff;
  --danger: #e74c3c;
  --success: #2ecc71;

  --board-light: #f0d9b5;
  --board-dark: #b58863;
  --board-selected: #ffff44;
  --board-legal: rgba(0, 0, 0, 0.15);
  --board-capture: rgba(220, 50, 50, 0.5);
  --board-last-move: rgba(255, 255, 100, 0.35);
  --board-check: rgba(255, 0, 0, 0.6);
  --board-checkmate: rgba(180, 0, 255, 0.7);
  --board-stalemate: rgba(90, 90, 90, 0.75);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* ===== Common ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  text-decoration: none;
  color: white;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #444;
}

.btn-secondary:hover {
  background: #555;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-back {
  background: transparent;
  border: 1px solid #555;
  color: var(--text-muted);
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.error-message {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  text-align: center;
}

/* ===== Lobby (index.html) ===== */
.container {
  max-width: 920px;
  width: 100%;
  text-align: center;
}

.container h1 {
  font-size: 2.5em;
  margin-bottom: 32px;
  color: white;
}

.lobby-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  text-align: left;
}

.lobby-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lobby-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lobby-left .card {
  text-align: left;
  margin-bottom: 0;
}

.lobby-left .card h2 {
  font-size: 1.2em;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.lobby-left .btn {
  width: 100%;
  margin-bottom: 8px;
}

#variant-picker,
#bot-variant-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#variant-picker .btn,
#bot-variant-picker .btn {
  margin-bottom: 0;
}

.join-form {
  display: flex;
  gap: 8px;
}

.join-form input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #0d1117;
  color: white;
  font-size: 16px;
  outline: none;
  text-transform: lowercase;
}

.join-form input:focus {
  border-color: var(--accent);
}

.join-form .btn {
  width: auto;
  margin-bottom: 0;
}

/* ===== Color picker (lobby) ===== */
.color-picker-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.color-picker-label {
  color: var(--text-muted);
  font-size: 0.85em;
  margin-bottom: 12px;
}

.color-picker-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-color-choice {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition:
    border-color 0.15s,
    transform 0.1s;
}

.btn-color-choice:active {
  transform: scale(0.97);
}

.btn-color-choice:hover {
  border-color: #d4a870;
}

.color-choice-piece {
  font-size: 2.5em;
  line-height: 1;
}

.btn-color-white-choice {
  background: #b58863;
  color: #e8dcc8;
}

.btn-color-white-choice .color-choice-piece {
  color: #f5f0e8;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-color-random-choice {
  background: #444;
  color: white;
}

.btn-color-random-choice:hover {
  border-color: #888;
}

.btn-color-black-choice {
  background: #f0d9b5;
  color: #2c2415;
  border-color: #d4b890;
}

.btn-color-black-choice .color-choice-piece {
  color: #1a1a1a;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.15);
}

.share-link-container {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.share-link-container input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #0d1117;
  color: var(--accent);
  font-size: 13px;
  outline: none;
}

.game-code {
  color: var(--text-muted);
  font-size: 14px;
}

.game-code strong {
  color: white;
  font-family: monospace;
  font-size: 18px;
  letter-spacing: 2px;
}

/* ===== Game Page ===== */
.game-container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}

.game-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}

.game-main-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.game-main-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.move-history-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-top: 44px;
}

/* Make rules-panel span both columns */
.game-container .rules-panel {
  grid-column: 1 / -1;
  margin: 24px auto;
}

@media (max-width: 900px) {
  .game-main {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .game-main-left,
  .game-main-right {
    gap: 0;
  }
  .game-container .rules-panel {
    margin-top: 16px;
    max-width: 480px;
  }
}

.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.game-status {
  font-size: 14px;
  color: var(--text-muted);
}

.game-status.your-turn {
  color: var(--success);
  font-weight: 600;
}

.variant-label {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.variant-label.variant-iceskate {
  background: rgba(74, 158, 255, 0.15);
  color: var(--accent);
}

.variant-label.variant-angry {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

/* ===== Player Bars ===== */
.player-bar {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  min-height: 52px; /* reserves space so captured pieces don't shift the board */
}

.player-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.captured-pieces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  font-size: 24px;
  line-height: 1;
}

.captured-group {
  display: flex;
  align-items: center;
}

.captured-group .captured-piece {
  opacity: 0.9;
  margin-left: -12px;
  width: 24px !important;
  height: 24px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 24px !important;
  max-height: 24px !important;
  object-fit: contain;
  z-index: 1;
}

.captured-group .captured-piece:first-child {
  margin-left: 0;
}

.captured-group .captured-piece--preview {
  opacity: 0.4;
}

.captured-advantage--preview {
  opacity: 0.5;
}

/* Single pill background behind all captured pieces */
.captured-pieces[data-piece-color="black"]:not(:empty) {
  background: rgba(240, 235, 225, 0.88);
  padding: 3px 8px;
  border-radius: 7px;
}

/* Ensure captured white pieces are visible on dark background */
.captured-pieces[data-piece-color="black"] .captured-piece.piece-white {
  filter: drop-shadow(0 0 2px #222) drop-shadow(0 0 1px #000) drop-shadow(1px 1px 0 #000);
}

/* Ensure captured black pieces are visible on light background */
.captured-pieces[data-piece-color="white"] .captured-piece.piece-black {
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #eee) drop-shadow(1px 1px 0 #fff);
}

.captured-pieces[data-piece-color="white"]:not(:empty) {
  background: rgba(0, 0, 0, 0.8);
  padding: 3px 8px;
  border-radius: 7px;
}

.captured-advantage {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
  color: var(--text-muted);
  line-height: 1;
}

/* ===== Chess Board ===== */
.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-select: none;
}

.square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s;
  /* Force perfectly square cells regardless of content */
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
}

.square.light {
  background: var(--board-light);
}

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

.square.selected {
  background: var(--board-selected) !important;
}

.square.last-move {
  background: var(--board-last-move) !important;
}

.square.in-check {
  background: var(--board-check) !important;
}

.square.in-checkmate {
  background: var(--board-checkmate) !important;
}

.square.in-stalemate {
  background: var(--board-stalemate) !important;
}

.chess-board.board-stalemated {
  filter: grayscale(0.65) brightness(0.58);
  transition: filter 0.4s;
}

/* Legal move dot */
.square.legal-move::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  background: var(--board-legal);
  border-radius: 50%;
  pointer-events: none;
}

/* Legal capture ring */
.square.legal-capture::after {
  content: "";
  position: absolute;
  width: 90%;
  height: 90%;
  border: 3px solid var(--board-capture);
  border-radius: 50%;
  pointer-events: none;
}

/* Legal castling ring (castling target — blue) */
.square.legal-friendly::after {
  content: "";
  position: absolute;
  width: 90%;
  height: 90%;
  border: 3px solid rgba(30, 144, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
}

/* Pieces */

.piece {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-size: min(7vw, 65px);
  line-height: 1;
  align-self: end;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
  transition:
    transform 0.16s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.16s,
    top 0.16s;
}

.piece img,
img.piece {
  width: min(12vw, 60px);
  height: min(12vw, 60px);
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
  transition:
    transform 0.16s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.16s,
    top 0.16s;
}

.piece-white {
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.piece-black {
  color: #222;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Coordinate labels */
.coord {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

.light .coord {
  color: var(--board-dark);
}

.dark .coord {
  color: var(--board-light);
}

.coord-rank {
  top: 2px;
  left: 3px;
}

.coord-file {
  bottom: 2px;
  right: 3px;
}

/* ===== Promotion Dialog ===== */
.promotion-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 4px;
}

.promotion-dialog {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.promotion-choice {
  font-size: 48px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #444;
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  background: #f0d9b5;
  color: #1a1a2e;
  border-color: #b58863;
}

.promotion-choice:hover {
  background: #e8cfa0;
  border-color: var(--accent);
}

/* ===== Castling Disambiguation Dialog ===== */
.castling-disambiguation-dialog {
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.castling-disambiguation-label {
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.castling-choice {
  width: 140px;
  height: auto;
  padding: 10px 24px;
  font-size: clamp(13px, 3.5vw, 16px);
  font-family: inherit;
  font-weight: 600;
}

/* ===== Rules Panel ===== */

.rules-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.rules-panel details {
  padding: 0 16px 12px 16px;
  border: none;
}

.rules-panel details[open] {
  padding-bottom: 16px;
}

.rules-panel summary {
  cursor: pointer;
  outline: none;
  padding: 16px 0 8px 0;
  margin: 0 -16px 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  background: none;
  list-style: none;
  font-size: 1em;
  transition: background 0.15s;
  border-radius: 12px 12px 0 0;
}

.rules-panel h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  display: inline;
}

.rules-panel h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.rules-panel p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.rules-panel p + p {
  margin-top: 10px;
}

.variant-screenshot {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 14px auto 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.rules-panel-angry h3 {
  color: var(--danger);
}

.rules-panel-960 h3 {
  color: #a8d8a8;
}

/* ===== Move History ===== */
.move-history-panel {
  width: 100%;
  max-width: 480px;
  margin-top: 24px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
}

.move-history-panel h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.move-list {
  overflow-y: auto;
  font-family: monospace;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-height: 150px;
}

.move-row {
  display: grid;
  grid-template-columns: 32px 64px 64px;
  gap: 8px;
  padding: 2px 0;
}

.move-number {
  color: var(--text-muted);
  width: 32px;
  text-align: right;
}

.move-notation {
  width: 64px;
  color: var(--text);
}

/* ===== Game Controls ===== */
.game-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
  align-self: center;
}

/* ===== Draw Offer Banner ===== */
.draw-offer-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  z-index: 200;
  font-size: 14px;
}

/* ===== Game Over Overlay ===== */
.game-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.game-over-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.game-over-content h2 {
  font-size: 2em;
  margin-bottom: 12px;
}

.game-over-content p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.game-over-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ===== Scrollbar ===== */
.move-list::-webkit-scrollbar {
  width: 6px;
}

.move-list::-webkit-scrollbar-track {
  background: transparent;
}

.move-list::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

/* ===== Pending Move Confirmation ===== */
.square.pending-from {
  background: rgba(50, 210, 70, 0.55) !important;
}

.square.pending-to {
  background: rgba(30, 210, 60, 0.8) !important;
}

.square.preview-check {
  background: var(--board-check) !important;
}

.square.preview-checkmate {
  background: var(--board-checkmate) !important;
}

.square.preview-stalemate {
  background: var(--board-stalemate) !important;
}

/* Floating confirm button */
.confirm-move-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  pointer-events: all;
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 32px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.7);
  transition:
    transform 0.12s,
    background 0.18s,
    box-shadow 0.18s;
  padding: 0;
}

.btn-confirm:hover {
  background: #27ae60;
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(46, 204, 113, 0.9);
}

.btn-confirm:active {
  transform: scale(0.9);
}

.btn-cancel-move {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #555;
  color: white;
  font-size: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.12s,
    background 0.18s;
  padding: 0;
}

.btn-cancel-move:hover {
  background: var(--danger);
  transform: scale(1.08);
}

.btn-cancel-move:active {
  transform: scale(0.9);
}

/* ===== Move Review Navigation ===== */
.move-history-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.move-history-header h3 {
  margin-bottom: 0;
}

.review-nav {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.review-btn {
  padding: 10px 16px !important;
  font-size: 18px !important;
  min-width: 48px;
  min-height: 48px;
  line-height: 1.4;
}

.review-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.move-notation {
  cursor: pointer;
}

.move-notation:hover {
  color: var(--accent-hover);
}

.move-notation.current-move {
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  padding: 0 4px;
}

.move-notation--pending {
  opacity: 0.4;
  font-style: italic;
  cursor: default;
}

.move-notation--pending:hover {
  color: var(--text);
}

.game-status.review-mode {
  color: var(--accent);
  font-style: italic;
}

/* ===== Ice Skate Chess ===== */
.btn-iceskate {
  background: #0a2540 !important;
  border: 1px solid #7dd4fc;
}

.btn-iceskate:hover {
  background: #0f3358 !important;
}

/* ===== Angry Chess ===== */
.btn-angry {
  background: #3e0f0f !important;
  border: 1px solid #8e2a2a;
}

.btn-angry:hover {
  background: #551515 !important;
}

/* ===== Dark Chess ===== */
.btn-dark {
  background: #2a1a3e !important;
  border: 1px solid #5a3a8e;
}

.btn-dark:hover {
  background: #3a2a55 !important;
}

.variant-label.variant-dark {
  background: rgba(180, 142, 255, 0.15);
  color: #b48eff;
}

.rules-panel-dark h3 {
  color: #b48eff;
}

.dark-shrouded {
  background: #0a0a12 !important;
  overflow: visible !important;
  z-index: 2;
}

/* Faint square-colour tint + grid lines rendered above the fog so bishops can be lined up */
.dark-shrouded.light::before,
.dark-shrouded.dark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.dark-shrouded.light::before {
  background: rgba(240, 217, 181, 0.07);
}
.dark-shrouded.dark::before {
  background: rgba(181, 136, 99, 0.05);
}

/* Blurry dark-fog overlay — sits above pieces, bleeds softly into adjacent revealed squares */
.dark-shrouded::after {
  content: "";
  position: absolute;
  inset: -5px;
  background: rgba(5, 5, 15, 0.96);
  filter: blur(5px);
  z-index: 5;
  pointer-events: none;
}

.dark-shrouded .coord {
  opacity: 0.12;
  color: #222 !important;
}

.dark-illuminated {
  box-shadow: inset 0 0 18px 4px rgba(255, 170, 50, 0.25);
}

.move-notation--dark-hidden {
  color: transparent !important;
  text-shadow: 0 0 8px rgba(224, 224, 224, 0.5);
  user-select: none;
  pointer-events: none;
}

/* ===== Superchess ===== */
.btn-superchess {
  background: #163f29 !important;
  border: 1px solid #2aa75f;
}

.btn-superchess:hover {
  background: #299c5c !important;
}

.variant-label.variant-superchess {
  background: rgba(46, 204, 113, 0.15);
  color: #2aa75f;
}

.rules-panel-superchess h3 {
  color: #2aa75f;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .lobby-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    padding: 8px;
  }

  .container h1 {
    font-size: 2em;
  }

  .piece {
    font-size: 10vw;
  }

  .promotion-choice {
    width: 50px;
    height: 50px;
    font-size: 48px;
  }

  .castling-choice {
    width: min(120px, 35vw);
    padding: 8px 12px;
    font-size: clamp(13px, 3.5vw, 16px);
  }
}
