﻿

/* Chess Information Styling */
.chess-info {
    margin: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 5px solid #4CAF50;
    border-radius: 5px;
    text-align: center;
    width: 100%; /* Ensures full width within flex container */
}

/* Table Styles for Chessboard */
table {
    border-collapse: collapse;
    margin: 10px auto;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

td {
    width: 2rem;
    height: 2rem;
    text-align: center;
    vertical-align: middle;
    background-color: #8B4513; /* Wooden background color */
}

.white {
    background-color: #F0D9B5;
}

.black {
    background-color: #B58863;
}

/* Coordinate Styles */
.coordinate {
    background-color: #693a2d;
    color: white;
    font-weight: bold;
    border-width: 0.5px;
    border-style: solid;
    border-color: #693a2d;
    width: 1rem; /* Maintain the specific size for coordinates */
    height: 1rem;
}

/* Image Styles */
img {
    max-width: 100%;
    height: auto;
}


/* --- Chessboard visual polish (keep coordinates, remove outer border) --- */
.chessboard table {
  border-collapse: collapse !important;
  border: none !important;
  margin: auto;
  table-layout: fixed;
}

.chessboard td {
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  text-align: center;
  vertical-align: middle;
  border: none;
}


/* --- Perfect vertical centering for piece images --- */
.chessboard td img {
  display: block;
  margin: auto;
  width: 100%;
  height: auto;
  vertical-align: middle;
  transform: translateY(1px); /* tweak: pushes images down slightly */
}

/* Optional refinement: prevent any text-baseline influence */
.chessboard td {
  line-height: 0;
  padding: 0;
  vertical-align: middle;
}










.chessboard .white {
  background-color: #F0D9B5;
}
.chessboard .black {
  background-color: #B58863;
}

/* Coordinate styling */
.chessboard td.coordinate {
  background-color: #693a2d;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  border: none;
  width: 24px !important;
  height: 24px !important;
  text-align: center;
  vertical-align: middle;
}

/* Make outermost edges flush (no fat border look) */
.chessboard {
  display: inline-block;
  border: 2px solid #693a2d;
  border-radius: 4px;
  padding: 3px;
  box-shadow: 0 0 4px rgba(0,0,0,0.25);
  background-color: #693a2d;
}

/* Reduce coordinate contrast slightly on corners */
.chessboard tr:first-child td.coordinate:first-child,
.chessboard tr:first-child td.coordinate:last-child,
.chessboard tr:last-child td.coordinate:first-child,
.chessboard tr:last-child td.coordinate:last-child {
  background-color: transparent;
  color: transparent;
  border: none;
}


/* --- Coordinate Cell Refinement --- */
.chessboard td.coordinate {
  background-color: #693a2d;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  border: none;
  padding: 0;               /* remove inner spacing */
  margin: 0;                /* ensure no outer spacing */
  text-align: center;
  vertical-align: middle;
  width: 18px;              /* tighter horizontal fit */
  height: 18px;             /* tighter vertical fit */
  line-height: 18px;        /* centers the text vertically */
}

/* So corners don't add extra visual noise */
.chessboard tr:first-child td.coordinate:first-child,
.chessboard tr:first-child td.coordinate:last-child,
.chessboard tr:last-child td.coordinate:first-child,
.chessboard tr:last-child td.coordinate:last-child {
  background-color: transparent;
  color: transparent;
}

