html {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: #000000;
  background-image:
    linear-gradient(45deg, #222222 25%, transparent 25%, transparent 75%, #222222 75%),
    linear-gradient(45deg, #222222 25%, transparent 25%, transparent 75%, #222222 75%);
  background-size: 200px 200px;
  background-position: 0 0, 100px 100px;
}

body {
  min-height: 100%;
  margin: 20px;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: none;
}

.navbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
  margin-bottom: 10px;
}

.logout-btn {
  padding: 8px 16px;
  border: 2px solid #000000;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #333333;
}

.game-controls {
  display: flex;
  gap: 12px;
}

.game-controls button {
  padding: 8px 16px;
  border: 2px solid white;
  border-radius: 4px;
  background: black;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-transform: lowercase;
  shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #333333;
}

#game-status {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#game-status:empty {
  display: none;
}

.player-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  font-weight: bold;
  font-size: 16px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.turn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4CAF50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.turn-dot.active {
  opacity: 1;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-top: 0;
  overflow: visible;
}


div.layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  gap: 40px;
  position: relative;
  overflow: visible;
}

/* Apply image styles but exclude chessboard pieces */
img:not(.piece-417db):not(#myBoard img):not(#board-container img) {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure dragged pieces stay on top */
.piece-417db {
  z-index: 9999 !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 300px;
  gap: 20px;
  position: relative;
  z-index: 1;
  background: #01f10122;
  border:1px solid rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 8px;
}

.comment-section {
  position: relative;
  width: 600px;
  min-height: 500px;
  padding: 20px;
  box-sizing: border-box;
  background-color: rgba(40, 40, 40, 0.75);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 1;
}

.comment-section:hover {
  z-index: 100;
}

#comments-display {
  width: 100%;
  height: 440px;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-timestamp {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.comment-text {
  color: #ffffff;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#comment-input {
  flex: 1;
  min-height: 60px;
  max-height: 120px;
  padding: 10px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #ffffff;
  background-color: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  resize: vertical;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#comment-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#comment-input:focus {
  outline: 2px solid rgba(76, 175, 80, 0.4);
  background-color: rgba(20, 20, 20, 0.95);
}

#submit-comment {
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: rgba(76, 175, 80, 0.3);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

#submit-comment:hover {
  background-color: rgba(76, 175, 80, 0.5);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(76, 175, 80, 0.6);
}

#board-container {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  width: 80vw;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  overflow: visible;
  background: #01f10122;
  border:1px solid rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 8px;
}

.board-btn {
  position: absolute;
  top: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.board-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.4);
}

#fullscreen-btn {
  right: 8px;
}

#flip-btn {
  left: 8px;
}

#board-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

#board-container.fullscreen #myBoard {
  max-width: 90vh;
  max-height: 90vh;
  width: 90vmin;
  height: auto;
}

#board-container.fullscreen .player-name,
#board-container.fullscreen #turn-indicator,
#board-container.fullscreen #opening-info {
  display: none;
}

#board-container.fullscreen #flip-btn {
  display: none;
}

#myBoard {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.move-list {
  color: white;
  padding: 10px;
  max-height: 600px;
  overflow-y: auto;
  background: #808080;
  border-radius: 8px;
}

.move-list #pgn {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.8;
  color: white;
}

/* Chessboard square colors - shades of grey */
.white-1e1d7 {
  background-color: #d0d0d0 !important;
  color: #808080;
}

.black-3c85d {
  background-color: #808080 !important;
  color: #d0d0d0;
}
