body {
  background-color: #FFF1E5;
  margin: 0;
  padding: 20px;
  font-family: Arial, sans-serif;
}

/* Overall layout using flex */
.container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 10px; /* Reduced from default to close gap */
}

/* Board container: relative for canvas overlay positioning */
#board-container {
  position: relative;
  width: 500px;
  height: 500px;
}

#myBoard {
  width: 500px;
  height: 500px;
}

/* Canvas overlay for arrows */
#arrows-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  pointer-events: none;
}

/* Evaluation bar – its background will be dynamically updated */
.evaluation-bar {
  width: 30px;
  height: 500px;
  background: linear-gradient(to top, white 50%, black 50%);
  margin-right: 20px;
  border: 1px solid #888;
  position: relative;
}

/* Stockfish analysis output container */
#analysis-container {
  margin-left: 20px;
  font-family: monospace;
  width: 400px;
  height: 500px;
  background-color: white;
  border: 1px solid #ccc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Engine control section */
#engine-control {
  padding: 10px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.engine-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#engine-select {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: white;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

/* Toggle switch styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #2196F3;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Eval graph in analysis container */
#analysis-eval-graph {
  width: 100%;
  height: 150px;
  border-bottom: 1px solid #ccc;
  background-color: #f8f8f8;
}

/* Scrollable content area */
#analysis-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  white-space: pre-wrap;
}

/* PGN Controls */
#pgn-controls {
  margin-top: 10px; /* Reduced from 20px to close gap */
  text-align: center;
  margin-left: 50px; /* Align with eval bar + margin */
}

#pgn-controls textarea {
  width: 400px;
  font-family: monospace;
  font-size: 12px;
  padding: 8px;
  border: 1px solid #ccc;
  resize: vertical;
}

.pgn-hint {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

body, html {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/*css for interactive notation*/
/* Interactive notation styles for Option 2 */
.move-pair {
  display: inline-block;
  margin: 0 8px 5px 0;
  white-space: nowrap;
}

.move-number {
  font-weight: bold;
  color: #666;
  margin-right: 4px;
}

.move-link {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s;
  margin: 0 2px;
  display: inline-block;
}

.move-link:hover {
  background-color: #e3f2fd;
  transform: translateY(-1px);
}

.move-link.current {
  background-color: #2196F3;
  color: white;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.white-move {
  border-bottom: 1px solid #eee;
}

.black-move {
  border-bottom: 1px solid #ddd;
}

.move-link.deviation {
  color: #d32f2f; /* SUBJECT TO CHANGE */
  font-weight: bold;
}

/* Interactive evaluation graph styles */
#analysis-eval-graph {
  cursor: crosshair;
}

#analysis-eval-graph:hover {
  cursor: crosshair; /* crosshair? */
}