/* ========================================
   UNIFIED STYLES FOR SIEGE CHESS
   All styles for index.html and game.html
   ======================================== */

/* CSS VARIABLES - Shared by both pages */
:root {
  --primary-bg: #636363;
  --secondary-bg: #5a5a5a;
  --border-color: #000000;
  --text-color: white;
  --accent-color: #FFD700;
  --disabled-color: #cccccc;
  --hover-bg: #707070;
  --button-bg: #30851c;
  --button-active: #3a9d23;
  --modal-overlay: rgba(0, 0, 0, 0.5);
  --modal-bg: #4a4a4a;
  --modal-border: #777;
  --modal-header-bg: #5a5a5a;
  --modal-close-hover: #666;
  --cancel-bg: #c11b1b;
  --cancel-hover: #a01717;
  --chat-bg: #4a4a4a;
  --chat-input-bg: #4a4a4a;
  --chat-placeholder: #cccccc;
  --chat-send-bg: #30851c;
  --chat-send-hover: #3a9d23;
  --text-modal-bg: #4a4a4a;
  --text-modal-header-bg: #5a5a5a;
  --text-modal-border: #888;
  --text-modal-close-hover: #666;
  --find-game-active: #FFD700;
  --find-game-inactive: #30851c;
  --chat-self: #FFD700;
  --chat-other: #ADD8E6;
  --timestamp-color: #cccccc;
  --black: black;
}
body {
  background-color: var(--primary-bg);
  font-family: Arial, sans-serif;
  color: var(--text-color);
  margin: 0;
  padding: 20px;
}

/* ========================================
   INDEX.HTML STYLES
   ======================================== */

body.index-page {
  display: flex;
  justify-content: center;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.separator {
  text-align: center;
  margin: 10px 0;
}

#container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
}

/* Layout */

#main-content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  margin-bottom: 20px;
}

#left-section {
  width: 250px;
  margin-right: 20px;
}

#right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Player List */

#player-list {
  width: 230px;
  padding: 10px 20px 10px 10px;
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  display: none;
  height: 95.7%;
  overflow-y: auto;
}

#player-list h3 {
  margin-top: 0;
  color: var(--text-color);
}

#player-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  height: calc(100% - 50px);
  overflow-y: auto;
}

#player-list li {
   padding: 12px;
   margin: 5px 0;
   background-color: #5e5e5e;
   cursor: pointer;
   border-radius: 3px;
   transition: background-color 0.2s;
   color: var(--text-color);
   font-size: 14px;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

#player-list li:hover {
   background-color: var(--hover-bg);
}

#player-list li.selected {
   background-color: var(--accent-color);
   color: var(--black);
}

#player-list li.current-user {
  font-weight: bold;
  color: var(--accent-color);
}

/* Auth Menu */

#auth-menu {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  text-align: center;
}

#auth-menu button {
  display: block;
  width: 100%;
  margin: 10px 0;
}

#signup-menu {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  text-align: center;
  display: none;
}

/* Game Menu */

#game-menu {
  display: none;
  width: 950px;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}

.button-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.button-container button {
  flex: 1;
}

/* Buttons */

button {
  padding: 10px 20px;
  margin: 5px;
  background-color: var(--button-bg);
  border: none;
  border-radius: 3px;
  color: var(--text-color);
  cursor: pointer;
}

button:disabled {
  background-color: var(--disabled-color);
  cursor: not-allowed;
}

button.active {
  background-color: var(--button-active);
}

/* Inputs */

input {
  padding: 10px;
  margin: 5px 0;
  width: 100%;
  box-sizing: border-box;
  border-radius: 3px;
  border: none;
  max-width: 100%;
}

#message {
  margin-top: 10px;
  color: var(--text-color);
}

/* Login Section */

#login-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Game Info */

#game-info {
  margin-top: 5px;
  margin-left: 58.5px;
  width: 105.1%;
}

.flex-center {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.flex-center button {
  flex: 1;
}

.input-row {
  display: flex;
  justify-content: space-between;
}

.input-row div {
  flex: 1;
}

.input-row div:not(:last-child) {
  margin-right: 10px;
}

/* Game Lists - hidden by default */

#game-lists {
  display: none;
  justify-content: space-between;
  width: 100%;
  margin-top: 0;
}

#available-games, #active-games {
  width: 48%;
  padding: 10px 20px 10px 10px;
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  min-height: 350px;
  overflow-y: auto;
}

#available-game-list, #active-game-list {
  list-style: none;
  padding: 0;
}

#available-game-list li, #active-game-list li {
  padding: 10px;
  margin: 5px 0;
  background-color: #5e5e5e; /* keep as is, or var */
  cursor: pointer;
  border-radius: 3px;
}

#available-game-list li:hover, #active-game-list li:hover {
  background-color: var(--hover-bg);
}

#available-game-list li.selected, #active-game-list li.selected {
  background-color: var(--accent-color);
  color: var(--black);
}

/* Modal lists */

#modal-available-game-list li {
  padding: 10px;
  margin: 5px 0;
  background-color: #5e5e5e;
  cursor: pointer;
  border-radius: 3px;
}

#modal-available-game-list li:hover {
  background-color: var(--hover-bg);
}

#modal-available-game-list li.selected {
  background-color: var(--accent-color);
  color: var(--black);
}

#modal-active-game-list li {
  padding: 10px;
  margin: 5px 0;
  background-color: #5e5e5e;
  cursor: pointer;
  border-radius: 3px;
}

#modal-active-game-list li:hover {
  background-color: var(--hover-bg);
}

#modal-active-game-list li.selected {
  background-color: var(--accent-color);
  color: var(--black);
}

/* Details */

details {
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  padding: 10px;
  margin-bottom: 10px;
}

summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--text-color);
}

details[open] summary {
  color: var(--accent-color);
}

details p, details li {
  margin-top: 10px;
  color: var(--text-color);
}

/* Chat */

#chat-section {
  margin-top: 10px;
  padding: 10px 20px 10px 10px;
}

.menu-box {
  background-color: var(--secondary-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

#chat-messages {
  height: 200px;
  overflow-y: auto;
  background-color: var(--chat-bg);
  border-radius: 3px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

#chat-messages p {
  margin: 5px 0;
  word-wrap: break-word;
}

#chat-messages b {
  color: var(--accent-color);
}

#chat-input {
  background-color: var(--chat-input-bg);
  color: var(--text-color);
}

#chat-input::placeholder {
  color: var(--chat-placeholder);
}

#chat-send {
  background-color: var(--chat-send-bg);
  color: var(--text-color);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

#chat-send:hover {
  background-color: var(--chat-send-hover);
}

#chat-input-area {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

#chat-input {
  flex: 1;
}

/* Modals */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
}

.modal-content {
  background-color: var(--modal-bg);
  margin: 10% auto;
  padding: 0;
  border: 2px solid var(--text-modal-border);
  width: 80%;
  max-width: 500px;
  height: 600px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--modal-header-bg);
  border-bottom: 1px solid var(--modal-border);
}

.modal-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-color);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.modal-close:hover {
  background-color: var(--modal-close-hover);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 400px;
}

.modal-section {
  background-color: var(--secondary-bg);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.modal-section-scrollable {
  background-color: var(--secondary-bg);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  max-height: 350px;
  overflow-y: auto;
}

.modal-section label {
  color: var(--text-color);
  font-weight: bold;
}

.modal-section input, .modal-section select {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  box-sizing: border-box;
  border-radius: 3px;
  border: none;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
}

.modal-buttons .cancel {
  background-color: var(--cancel-bg);
}

.modal-buttons .cancel:hover {
  background-color: var(--cancel-hover);
}

/* Find Game */

.find-game-active {
  background-color: var(--find-game-active) !important;
  color: var(--black) !important;
}

.find-game-inactive {
  background-color: var(--find-game-inactive) !important;
  color: var(--text-color) !important;
}

/* How to Play button - yellow to make it stand out */
#howToPlayBtn {
  background-color: var(--button-bg);
  color: white;
}

/* Text Modals */

.text-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
}

.text-modal-content {
  background-color: var(--text-modal-bg);
  margin: 5% auto;
  padding: 0;
  border: 2px solid var(--text-modal-border);
  width: 800px;
  height: 550px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.text-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--text-modal-header-bg);
  border-bottom: 1px solid var(--modal-border);
}

.text-modal-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 24px;
}

.text-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-color);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.text-modal-close:hover {
  background-color: var(--text-modal-close-hover);
}

.text-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 400px;
  color: var(--text-color);
}

.text-modal-body p, .text-modal-body li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.text-modal-body ol {
  padding-left: 20px;
}

.text-modal-body ul {
  padding-left: 20px;
}

.text-modal-body img {
  vertical-align: middle;
  margin-right: 5px;
}

/* Dual Modal System */

.dual-modal-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
}

.dual-modal-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.dual-modal-left, .dual-modal-right {
  background-color: var(--modal-bg);
  border: 2px solid var(--text-modal-border);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  flex: 1;
  min-width: 500px;
  max-width: 650px;
  max-height: 80vh;
  overflow-y: auto;
}

.dual-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--modal-header-bg);
  border-bottom: 1px solid var(--modal-border);
}

.dual-modal-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 24px;
}

.dual-modal-body {
  padding: 20px;
}

.dual-modal-section {
  background-color: var(--secondary-bg);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.dual-modal-section label {
  color: var(--text-color);
  font-weight: bold;
}

.dual-modal-section input, .dual-modal-section select {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  box-sizing: border-box;
  border-radius: 3px;
  border: none;
}

.dual-modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.dual-modal-buttons button {
  flex: 1;
}

.dual-modal-buttons .cancel {
  background-color: var(--cancel-bg);
}

.dual-modal-buttons .cancel:hover {
  background-color: var(--cancel-hover);
}

.player-list-item {
  padding: 8px 12px;
  margin: 2px 0;
  background-color: #5e5e5e;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.player-list-item:hover {
  background-color: var(--hover-bg);
}

.player-list-item.selected {
  background-color: var(--accent-color);
  color: var(--black);
}

.dual-modal-section-scrollable {
  background-color: var(--secondary-bg);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  max-height: 350px;
  min-height: 200px;
  overflow-y: auto;
}

.selected-players-list {
  max-height: 150px;
  overflow-y: auto;
  background-color: var(--secondary-bg);
  border-radius: 3px;
  padding: 10px;
  margin-top: 10px;
}

.selected-player-item {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--black);
  padding: 4px 8px;
  margin: 2px;
  border-radius: 3px;
  font-size: 14px;
}

.remove-player-btn {
  margin-left: 5px;
  cursor: pointer;
  font-weight: bold;
}

/* Pieces Modal Styles */

.pieces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}

.piece-card {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.piece-card:hover {
  background-color: var(--hover-bg);
}

.piece-card img {
  width: 64px;
  height: 64px;
  margin-bottom: 5px;
}

.piece-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-color);
}

/* Stat Boxes */
.stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-box {
  flex: 1;
  min-width: 80px;
  background-color: var(--primary-bg);
  border: 1px solid var(--modal-border);
  border-radius: 5px;
  padding: 10px 8px;
  text-align: center;
}

.stat-box .stat-label {
  font-size: 11px;
  color: var(--timestamp-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-box .stat-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-color);
}

/* Recent Games List */
#recentGamesList li {
  padding: 12px;
  margin: 5px 0;
  background-color: #5e5e5e;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s;
}

#recentGamesList li:hover {
  background-color: var(--hover-bg);
}

#recentGamesList li.selected {
  background-color: var(--accent-color);
  color: var(--black);
}

/* User List */
#userList li {
  padding: 12px;
  margin: 5px 0;
  background-color: #5e5e5e;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s;
}

#userList li:hover {
  background-color: var(--hover-bg);
}

#userList li.selected {
  background-color: var(--accent-color);
  color: var(--black);
}

.piece-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border: 2px solid var(--border-color);
  background-color: var(--border-color);
}

.board-square {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.center-square {
  background-color: var(--accent-color);
}

.piece-square {
  background-color: var(--accent-color) !important;
}

.highlight-green {
  background-color: #4CAF50 !important;
}

.highlight-red {
  background-color: #f44336 !important;
}

.highlight-both {
  background: linear-gradient(135deg, #4CAF50 50%, #f44336 50%) !important;
}

.spawn-highlight {
  background-color: #FFD700 !important;
  opacity: 0.7;
}

/* Filter Boxes (Browse Games modal) */
.filter-box-row {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.filter-box {
  flex: 1;
  background-color: var(--primary-bg);
  border: 1px solid var(--modal-border);
  border-radius: 5px;
  padding: 12px 6px 10px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.filter-box input[type="checkbox"] {
  display: none;
}

.filter-box:hover {
  background-color: var(--hover-bg);
}

.filter-box.filter-active {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color);
}

.filter-box-icon {
  font-size: 20px;
  line-height: 1;
}

.filter-box-text {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-color);
}

.filter-box-sub {
  font-size: 11px;
  color: var(--timestamp-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-box.filter-active .filter-box-text,
.filter-box.filter-active .filter-box-sub {
  color: var(--black);
}

/* How to Play Navigation Buttons */
.howto-nav-btn {
  width: 100%;
  text-align: left;
  margin-bottom: 5px;
}

.howto-nav-btn.active {
  background-color: var(--accent-color) !important;
  color: var(--black) !important;
  font-weight: bold;
}

/* Responsive */

@media (max-width: 1400px) {
  .dual-modal-container {
    flex-direction: column;
    align-items: center;
  }
  .dual-modal-left, .dual-modal-right {
    width: 90%;
    max-width: 600px;
  }
}

@media (max-width: 800px) {
  #main-content {
    flex-direction: column;
    align-items: stretch;
  }
  #left-section {
    width: 99%;
    margin-right: 0;
    margin-bottom: 20px;
  }
  #right-section {
    width: 99%;
  }
  #game-lists {
    flex-direction: column;
  }
  #available-games, #active-games {
    width: 100%;
    margin-bottom: 10px;
  }
	.daily-preview-board-container {
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: flex-start;
		overflow: hidden;
	}

	.daily-preview-board {
		display: grid;
		border: 2px solid var(--border-color);
		background-color: var(--border-color);
		gap: 1px;
		max-width: 100%;
		overflow: hidden;
	}

	.daily-board-square {
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
		min-width: 0;
		min-height: 0;
	}

	.daily-board-square img {
		width: 100%;
		height: 100%;
		object-fit: contain;
		display: block;
		pointer-events: none;
	}
	
	/* Notification List Items */
	.notification-item {
	  padding: 12px;
	  margin: 5px 0;
	  background-color: #5e5e5e;
	  cursor: pointer;
	  border-radius: 3px;
	  border: 1px solid transparent;
	  transition: all 0.2s;
	}

	.notification-item:hover {
	  background-color: var(--hover-bg);
	}
	
	/* UNREAD STATE - Gold/Yellow */
	.notification-item.unread {
	  background-color: var(--accent-color);
	  color: var(--black);
	  border: 2px solid #b8960c;
	  font-weight: bold;
	}

	.notification-item.unread:hover {
	  background-color: #e6c200;
	  color: var(--black);
	}

	/* SELECTED STATE */
	.notification-item.selected {
	  background-color: var(--accent-color);
	  color: var(--black);
	}

	/* Notification Details Panel */
	#notification-details-content {
	  padding: 15px;
	  line-height: 1.6;
	  color: var(--text-color);
	  font-size: 14px;
	}

	.notification-type-badge {
	  display: inline-block;
	  padding: 4px 8px;
	  border-radius: 3px;
	  font-size: 12px;
	  font-weight: bold;
	  margin-bottom: 10px;
	  text-transform: uppercase;
	}

	.notification-type-badge.turn-start {
	  background-color: #4CAF50;
	  color: white;
	}

	.notification-type-badge.elimination {
	  background-color: #f44336;
	  color: white;
	}

	.notification-type-badge.game-over {
	  background-color: #2196F3;
	  color: white;
	}

	.notification-type-badge.game-canceled {
	  background-color: #FF9800;
	  color: white;
	}

	.notification-type-badge.game-started {
	  background-color: #9C27B0;
	  color: white;
	}

	.notification-type-badge.player-joined {
	  background-color: #00BCD4;
	  color: white;
	}

	.notification-timestamp {
	  color: var(--timestamp-color);
	  font-size: 12px;
	  margin-top: 15px;
	  border-top: 1px solid #555;
	  padding-top: 10px;
	}
	.notif-badge {
		display: inline-block;
		background: #e53935;
		color: white;
		border-radius: 4px;
		padding: 1px 6px;
		font-size: 11px;
		font-weight: bold;
		margin-left: 6px;
		vertical-align: middle;
		min-width: 18px;
		text-align: center;
		line-height: 1.4;
	}

}
/* Customization color swatches */
.color-options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

.color-swatch {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 3px solid transparent;
	cursor: pointer;
	transition: border-color 0.2s, transform 0.2s;
}

.color-swatch:hover {
	transform: scale(1.1);
}

.color-swatch.selected {
	border-color: var(--accent-color);
	transform: scale(1.15);
}

.color-swatch[data-color="default"] { background-color: #5e5e5e; }
.color-swatch[data-color="green"]   { background-color: #4CAF50; }
.color-swatch[data-color="blue"]    { background-color: #2196F3; }
.color-swatch[data-color="yellow"]  { background-color: #FFEB3B; }
.color-swatch[data-color="red"]     { background-color: #f44336; }

/* Preview list item styling */
#customization-preview {
	list-style: none;
	padding: 0;
	margin: 8px 0 0 0;
}

#customization-preview li {
	padding: 12px;
	background-color: #5e5e5e;
	border-radius: 3px;
	font-size: 14px;
	color: var(--text-color);
	transition: all 0.2s;
}

/* Player list nameplate color classes */
#player-list li.nameplate-green {
	background-color: rgba(76, 175, 80, 0.2);
	border: 1px solid rgba(76, 175, 80, 0.6);
}

#player-list li.nameplate-blue {
	background-color: rgba(33, 150, 243, 0.2);
	border: 1px solid rgba(33, 150, 243, 0.6);
}

#player-list li.nameplate-yellow {
	background-color: rgba(255, 235, 59, 0.2);
	border: 1px solid rgba(255, 235, 59, 0.6);
}

#player-list li.nameplate-red {
	background-color: rgba(244, 67, 54, 0.2);
	border: 1px solid rgba(244, 67, 54, 0.6);
}
/* Customization preview nameplate color classes */
#customization-preview li.nameplate-green {
	background-color: rgba(76, 175, 80, 0.3);
	border: 1px solid rgba(76, 175, 80, 0.7);
}

#customization-preview li.nameplate-blue {
	background-color: rgba(33, 150, 243, 0.3);
	border: 1px solid rgba(33, 150, 243, 0.7);
}

#customization-preview li.nameplate-yellow {
	background-color: rgba(255, 235, 59, 0.3);
	border: 1px solid rgba(255, 235, 59, 0.7);
}

#customization-preview li.nameplate-red {
	background-color: rgba(244, 67, 54, 0.3);
	border: 1px solid rgba(244, 67, 54, 0.7);
}
/* Locked Customizations */
.color-swatch.locked {
	opacity: 0.35;
	cursor: not-allowed;
	filter: grayscale(0.7);
}

.color-swatch.locked:hover {
	transform: none;
}

.color-swatch .lock-icon {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 16px;
	pointer-events: none;
	color: #000;
}

.color-swatch.locked .lock-icon {
	display: block;
}

.color-swatch {
	position: relative;
}

.lock-tooltip {
    display: none;
    position: fixed;
    background-color: #1a1a1a;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 99999;
    pointer-events: none;
    border: 1px solid #888;
    box-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.color-swatch.locked:hover .lock-tooltip {
	display: block;
}
/* Badge option styles */
.badge-option {
	width: 50px;
	height: 50px;
	border-radius: 8px;
	border: 3px solid transparent;
	background-color: var(--secondary-bg);
	cursor: pointer;
	transition: border-color 0.2s, transform 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.badge-option:hover {
	transform: scale(1.1);
}

.badge-option.selected {
	border-color: var(--accent-color);
	transform: scale(1.15);
}

.badge-option.locked {
	opacity: 0.35;
	cursor: not-allowed;
	filter: grayscale(0.7);
}

.badge-option.locked:hover {
	transform: none;
}

.badge-preview {
	font-size: 24px;
	line-height: 1;
}
.badge-option.locked:hover .lock-tooltip {
    display: block;
}
.badge-option .lock-icon {
    display: none;
}

.badge-option.locked .lock-icon {
    display: block;
}
.badge-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	max-height: 350px;
	overflow-y: auto;
	padding: 5px;
}

.badge-piece-img {
	width: 32px;
	height: 32px;
	pointer-events: none;
}

/* ========================================
   GAME.HTML STYLES
   ======================================== */

/* Game-specific body layout */
body.game-page {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
}

#gameBoardContainer {
    width: 70%;
    height: 100%;
    box-sizing: border-box;
}

#menuContainer {
    width: 25%;
    min-width: 150px;
    height: 100%;
    background-color: #4a4a4a;
    padding: 10px;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    overflow-y: auto;
}

/* Game-specific menu-box overrides */
#menuContainer .menu-box {
    background-color: #5a5a5a;
    padding: 10px 10px 10px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #000000;
}

#playerList {
    margin-bottom: 2px;
}

#players {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
	margin-top: 2px;
	margin-bottom: 2px;
}

#players li {
    flex-basis: 48%;
	margin-top: 2px;
    margin-bottom: 2px;
}

.menu-box#creatorMenu button {
    width: 100%;
}

.button {
    padding: 10px;
    margin: 5px 0;
    width: 100%;
    background-color: #30851c;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.button:hover {
    background-color: #3a9d23;
}

.buttonexit {
    background-color: #c11b1b;
    padding: 10px;
    margin: 5px 0;
    width: 100%;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.buttonexit:hover {
    background-color: #3a9d23;
}

ul {
    list-style: none;
    padding: 0;
}

#goldDisplay {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

#goldDisplay p {
    flex-basis: 32%;
	margin-top: 3px;
    margin-bottom: 3px;
}

#capturedGoldDisplay {
    margin-top: 0px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

#capturedGoldDisplay p {
    flex-basis: 48%;
	margin-top: 2px;
    margin-bottom: 2px;
}

.threat-highlight {
    /* Optional: Add styling if needed */
}

.coordinate-label {
    background-color: #333;
    color: white;
    font-weight: bold;
    text-align: center;
    border: 1px solid #222;
    vertical-align: middle;
    box-sizing: border-box;
}

h2 {
    font-size: 20px;
	margin-top: 5px;
	margin-bottom: 5px;
}

h3 {
    font-size: 20px;
	margin-top: 5px;
	margin-bottom: 5px;
}

#pieceSelector {
    display: flex;
    align-items: center;
}

.nav-btn {
    background-color: #5a5a5a;
    border: 1px solid #888;
    color: white;
    font-size: 18px;
    width: 40px;
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
    box-sizing: border-box;
    text-align: center;
}

.nav-btn:hover {
    background-color: #6a6a6a;
}

.zoom-btn {
    background-color: #5a5a5a;
    border: 1px solid #888;
    color: white;
    font-size: 18px;
    width: 40px;
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
}

.zoom-btn:hover {
    background-color: #6a6a6a;
}

#zoomDisplay {
    color: white;
    font-size: 16px;
}

#pieceSelector img {
    width: 48px;
    height: 48px;
}

#tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 25px;
    border: 1px solid #888;
    border-radius: 5px;
    max-width: 300px;
    z-index: 1000;
    display: none;
    font-size: 14px;
    white-space: normal;
}

.spawn-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.spawn-row2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

#selectedPieceInfo {
    text-align: left;
}

#spawnButton, #despawnButton {
    width: 200px;
    text-align: center;
}

#chatBox {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
	margin-top: 5px;
	margin-bottom: 3px;
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    background-color: #4a4a4a;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

#chatMessages div {
    margin: 5px 0;
    word-wrap: break-word;
}

#chatMessages b {
    color: #FFD700;
}

#inputButtonWrapper {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#chatInput {
    flex: 1;
    background-color: #4a4a4a;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 3px;
    box-sizing: border-box;
}

#chatInput::placeholder {
    color: #cccccc;
}

#sendButton {
    background-color: #30851c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 15px;
    width: auto;
}

#sendButton:hover {
    background-color: #3a9d23;
}

/* Game-specific Modal overrides */
#menuContainer .modal:not([style*="display: flex"]) {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
	overflow-y: auto;
}

#menuContainer .modal-content {
    background-color: #4a4a4a;
    margin: 10% auto;
    padding: 0;
    border: 2px solid #888;
    width: 80%;
    max-width: 500px;
    height: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

#menuContainer .modal-section {
	background-color: #5a5a5a;
	padding: 10px 10px 10px 10px;
	border-radius: 5px;
	margin-bottom: 10px;
	border: 1px solid #000000;
}

#menuContainer .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #5a5a5a;
    border-bottom: 1px solid #777;
}

#menuContainer .modal-header h2 {
    margin: 0;
    color: white;
    font-size: 24px;
}

#menuContainer .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

#menuContainer .modal-close:hover {
    background-color: #666;
}

#menuContainer .modal-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

#menuContainer .modal-section label {
    color: white;
    font-weight: bold;
}

#menuContainer .modal-section input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
    border-radius: 3px;
    border: none;
}

#menuContainer .modal-section select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
    border-radius: 3px;
    border: none;
}

.settings-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.settings-buttons button {
    flex: 1;
}

.settings-buttons .cancel {
    background-color: #666;
}

.settings-buttons .cancel:hover {
    background-color: #777;
}

.spawn-piece-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
    border: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
    text-align: center;
}

.spawn-piece-cell:hover {
    background-color: #555;
}

.spawn-piece-cell img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
}

.spawn-piece-cell .piece-name {
    font-size: 12px;
    text-align: center;
    margin-bottom: 2px;
}

.spawn-piece-cell .piece-cost {
    font-size: 10px;
    color: #FFD700;
}

.cell-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--hue-color, transparent);
    z-index: 1;
    pointer-events: none;
}

#lobbyChatModal .modal-content {
    width: 90%;
    max-width: 800px;
    height: 625px;
}

#lobbyChatMessages {
    height: 400px;
    overflow-y: auto;
    background-color: #2a2a2a;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

#lobbyChatMessages div {
    margin: 5px 0;
    word-wrap: break-word;
}

#lobbyChatMessages b {
    color: #FFD700;
}

#lobbyChatInput {
    background-color: #2a2a2a;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 3px;
    box-sizing: border-box;
    flex: 1;
}

#lobbyChatInput::placeholder {
    color: #cccccc;
}

#lobbySendButton {
    background-color: #30851c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px;
    width: 60px;
}

#lobbySendButton:hover {
    background-color: #3a9d23;
}

/* Game-specific piece board styles */
#menuContainer .piece-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border: 2px solid #888;
  background-color: #888;
}

#menuContainer .board-square {
  background-color: #555555;
  border: 1px solid #777;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#menuContainer .board-square:nth-child(odd) {
  background-color: #4a4a4a;
}

#menuContainer .board-square:nth-child(even) {
  background-color: #555555;
}

/* Color Selection Modal Styles */
.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid #888;
  cursor: pointer;
  transition: all 0.2s;
  margin: 5px;
  position: relative;
}

.color-item:hover {
  transform: scale(1.05);
  border-color: #FFD700;
}

.color-item.selected {
  border-color: #FFD700;
  box-shadow: 0 0 10px #FFD700;
}

.color-item.selected::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 5px;
  color: #FFD700;
  font-size: 20px;
  font-weight: bold;
}

.color-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.color-name {
  margin-top: 5px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  text-align: center;
}

/* Game-specific Dual Modal overrides */
#menuContainer .dual-modal-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

#menuContainer .dual-modal-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 5% auto 0 auto;
  flex-wrap: wrap;
}

#menuContainer .dual-modal-left, #menuContainer .dual-modal-right {
  background-color: #4a4a4a;
  border: 2px solid #888;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  flex: 1;
  min-width: 500px;
  max-width: 650px;
  max-height: 80vh;
  overflow-y: auto;
}

#menuContainer .dual-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #5a5a5a;
  border-bottom: 1px solid #777;
}

#menuContainer .dual-modal-header h2 {
  margin: 0;
  color: white;
  font-size: 24px;
}

#menuContainer .dual-modal-body {
  padding: 20px;
}

#menuContainer .dual-modal-section {
  background-color: #5a5a5a;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid #000000;
}

#menuContainer .dual-modal-section label {
  color: white;
  font-weight: bold;
}

#menuContainer .dual-modal-section input, #menuContainer .dual-modal-section select {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  box-sizing: border-box;
  border-radius: 3px;
  border: none;
}

#menuContainer .dual-modal-section-scrollable {
  background-color: #5a5a5a;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid #000000;
  max-height: 350px;
  min-height: 200px;
  overflow-y: auto;
}

/* Instruction Modal Styles */

/* Custom sizing for instruction modals - scale height based on content */
#waitingModal .modal-content,
#fortressModal .modal-content,
#kingModal .modal-content,
#armySetupModal .modal-content {
    height: auto;
    min-height: 150px;
    max-height: 350px;
}

#waitingModal .modal-body,
#fortressModal .modal-body,
#kingModal .modal-body,
#armySetupModal .modal-body {
    max-height: none;
    overflow-y: auto;
}

/* Restore bullet points for How to Play modal lists */
#howToPlayDualModal ul {
    list-style-type: disc;
    padding-left: 20px;
}

#howToPlayDualModal ul ul {
    list-style-type: circle;
    padding-left: 20px;
}

/* Game-specific Responsive */

@media (max-width: 1400px) {
  #menuContainer .dual-modal-container {
    flex-direction: column;
    align-items: center;
  }
  #menuContainer .dual-modal-left, #menuContainer .dual-modal-right {
    width: 90%;
    max-width: 600px;
  }
}

@media (max-width: 800px) {
  #main-content {
    flex-direction: column;
    align-items: stretch;
  }
  #left-section {
    width: 99%;
    margin-right: 0;
    margin-bottom: 20px;
  }
  #right-section {
    width: 99%;
  }
  #game-lists {
    flex-direction: column;
  }
  #available-games, #active-games {
    width: 100%;
    margin-bottom: 10px;
  }
}
/* Chat Moderation Styles */
/* Chat Moderation List Container */
#chatModerationList {
	list-style: none;
	padding: 0;
	margin: 0;
}
	/* Chat Moderation List Items */
#chatModerationList li {
	padding: 12px;
	margin: 5px 0;
	background-color: #5e5e5e;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.2s;
	color: var(--text-color);
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#chatModerationList li {
	padding: 12px;
	margin: 5px 0;
	background-color: #5e5e5e;
	border-radius: 3px; 
	cursor: pointer;
	transition: background-color 0.2s;
	color: var(--text-color);
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
#chatModerationList li:hover {
	background-color: var(--hover-bg); 
}
#chatModerationList li.selected {
	background-color: var(--accent-color);
	color: var(--black);
}
#chatModerationList .chat-msg-time {
	color: #888;
	font-size: 12px;
	margin-right: 8px;
}
#chatModerationList .chat-msg-user {
	color: #90EE90;
	font-weight: bold;
	margin-right: 8px;
}

#chatModerationList .chat-msg-text {
	color: #ddd;
}
/* Make left panel narrower for manage chat modal */
#manageChatModal .dual-modal-left {
    max-width: 350px;
    min-width: 300px;
	min-height: 650px;
}

#manageChatModal .dual-modal-right {
    flex: 1;
    min-width: 800px;
}

/* Chess Clock Container */
#clockContainer {
    background-color: var(--secondary-bg);
    border-radius: 5px;
    border: 1px solid var(--border-color);
    padding: 10px;
}

#clockDisplay {
    color: var(--text-color);
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Consolidated Player List */
#consolidatedPlayerList {
    background-color: var(--secondary-bg);
    border-radius: 5px;
    border: 1px solid var(--border-color);
    padding: 10px;
    margin-top: 10px;
}

#consolidatedPlayerList h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
}

#playerListItems {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.consolidated-player-item {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    margin: 5px 0;
    background-color: #5a5a5a;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    white-space: nowrap;
    overflow-x: auto;
}

/* Tighter spacing between icon and value pairs */
.consolidated-player-item span {
    margin-right: 0px;
}

.consolidated-player-item .player-username {
    margin-right: 6px;
    flex-shrink: 0;
}

.consolidated-player-item .player-gold,
.consolidated-player-item .player-damage,
.consolidated-player-item .player-time {
    margin-right: 2px;
}

.consolidated-player-item.spectator-item {
    opacity: 0.7;
    font-style: italic;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid #000;
}

.player-username {
    font-weight: bold;
    color: var(--text-color);
    min-width: 80px;
}

.player-icon {
    height: 16px;
    width: 16px;
    flex-shrink: 0;
}

.player-gold,
.player-damage,
.player-time {
    color: var(--text-color);
    min-width: 40px;
    text-align: right;
}

.player-gold {
    color: #FFD700;
}

.player-damage {
    color: #FF6B6B;
}

.player-time {
    color: #87CEEB;
}