body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #e9ebee;
  }
  
  #start-menu {
    padding: 2rem;
    text-align: center;
  }
  
  #game-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    gap: 20px;
  }
  
  .main-game-area {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  
  #game-info {
    background-color: #f5f5f5;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 14px;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
  }
  
  #game-info p {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
  }
  
  #game-timer, #round-indicator, #remaining-tiles-count {
    font-weight: bold;
    color: #2a5aa0;
    margin-left: 5px;
  }
  
  #left-panel {
    flex: 7;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 450px;
  }
  
  #right-panel {
    flex: 1.5;
    margin-left: 15px;
  }
  
  #board-container {
    flex: 2;
    margin-right: 15px;
  }
  
  #board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 2px;
    width: 550px;
    height: 550px;
    background-color: #e8d0aa;
    border: 1px solid #8b572a;
    margin: 0 auto;
  }
  
  .board-and-history-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .board-cell {
    width: 100%;
    height: 100%;
    background-color: #f5deb3;
    border: 1px solid #ccc;
    text-align: center;
    font-size: 12px;
    position: relative;
  }
  
  /* Board Labels */
  .board-row-label, .board-col-label {
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 12px;
    z-index: 5;
  }
  
  .board-row-label {
    left: -20px;
  }
  
  .board-col-label {
    top: -20px;
  }
  
  .board-cell .tile {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    z-index: 2;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .board-cell .tile .point-value {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 10px;
    font-weight: normal;
  }
  
  /* Special tile styles */
  .tw {
    background-color: #ff3333; /* Brighter red for triple word */
  }
  
  .dw {
    background-color: #ffb7b7; /* Pink for double word */
  }
  
  .tl {
    background-color: #3333ff; /* Brighter blue for triple letter */
  }
  
  .dl {
    background-color: #b7b7ff; /* Light blue for double letter */
  }
  
  .center {
    background-color: #ffb7b7; /* Same as double word for center square */
  }
  
  .center-star, .star-symbol {
    position: absolute;
    font-size: 20px;
    color: #333;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  .special-text {
    font-size: 7px;
    text-align: center;
    font-weight: bold;
    color: black;
    width: 100%;
    text-transform: uppercase;
    line-height: 1.1;
  }
  
  /* Drag and drop styles */
  .drag-over {
    background-color: rgba(120, 240, 120, 0.5);
    box-shadow: inset 0 0 5px #2ecc71;
  }
  
  .rack-drag-over {
    background-color: rgba(120, 180, 240, 0.5);
    box-shadow: inset 0 0 5px #3498db;
    border: 2px dashed #3498db;
  }
  
  .suggested {
    background-color: rgba(255, 255, 120, 0.5);
  }
  
  .hint-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #2a5aa0;
    font-weight: bold;
    opacity: 0.7;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  }
  
  #tile-rack-container {
    margin-top: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  #tile-rack-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2a5aa0;
    text-align: center;
    font-size: 16px;
  }
  
  #tile-rack {
    background-color: #1a5fb4; /* Blue rack background */
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  #rack {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 60px;
  }
  
  .tile {
    width: 40px;
    height: 40px;
    background-color: #f8e0b0; /* Wooden tile color */
    border: 1px solid #b08c5a;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    user-select: none;
    position: relative;
  }
  
  .rack-slot {
    width: 42px;
    height: 42px;
    border: 1px dashed #c9b18a;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5eeda;
    position: relative;
  }
  
  .cpu-tile {
    cursor: default;
  }
  
  /* Tile front (visible side) */
  .tile-front, .cpu-tile-front {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    background-color: #f4d03f;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotateY(0deg);
  }
  
  /* CPU tile front sides for different players */
  .cpu-tile-front.cpu-player-1 {
    background-color: #ff9800;
  }
  
  .cpu-tile-front.cpu-player-2 {
    background-color: #8bc34a;
  }
  
  .cpu-tile-front.cpu-player-3 {
    background-color: #9c27b0;
  }
  
  /* Tile back side (for CPU players) */
  .cpu-tile-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: rotateY(180deg);
  }
  
  /* Back side colors for different CPU players */
  .cpu-tile-back.cpu-player-1 {
    background-color: #e65100;
  }
  
  .cpu-tile-back.cpu-player-2 {
    background-color: #558b2f;
  }
  
  .cpu-tile-back.cpu-player-3 {
    background-color: #6a1b9a;
  }
  
  .tile-letter {
    font-size: 20px;
    font-weight: bold;
    color: #333;
  }
  
  .tile-value {
    font-size: 10px;
    font-weight: bold;
    color: #333;
    position: absolute;
    bottom: 2px;
    right: 4px;
  }
  
  /* Dragging states */
  .tile.dragging {
    opacity: 0.7;
    cursor: grabbing;
  }
  
  /* Played tiles */
  .tile.played, .cpu-tile.played {
    cursor: default;
  }
  
  /* CPU Tile Styles */
  /* Player-specific tile colors */
  .player-0-tile {
    background-color: #f4d03f !important; /* Yellow for human player */
  }
  
  .player-1-tile {
    background-color: #9c27b0 !important; /* Purple for CPU 1 */
  }
  
  .player-2-tile {
    background-color: #ff9800 !important; /* Orange for CPU 2 */
  }
  
  .player-3-tile {
    background-color: #8bc34a !important; /* Green for CPU 3 */
  }
  
  .tile.placed-tile {
    cursor: default;
    box-shadow: 0 0 5px rgba(0, 100, 0, 0.5);
  }
  
  .tile.committed-tile {
    background-color: #d4c89f;
    border: 1px solid #333;
    cursor: not-allowed;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  }
  
  .tile.cpu-tile {
    background-color: #b99c6b;
    color: transparent;
  }
  
  #controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 550px;
  }
  
  #controls button {
    padding: 10px 15px;
    font-size: 16px;
    background-color: #178a44;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    min-width: 100px;
  }
  
  #controls button:hover {
    background-color: #0e6b31;
  }
  
  #controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
  }
  
  .current-player {
    font-weight: bold;
    color: #2a5aa0;
  }
  
  /* Player icon styles */
  .player-icon {
    margin-right: 8px;
    font-size: 14px;
    color: #555;
  }
  
  .current-player-icon {
    color: #2a5aa0;
  }
  
  /* Color indicator for player tiles */
  .color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #ccc;
  }
  
  /* Scoreboard styling */
  #scoreboard {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
  }
  
  #scoreboard h3 {
    margin-top: 0;
    margin-bottom: 5px;
  }
  
  #scoreList {
    list-style: none;
    padding: 0;
  }
  
  #scoreList li {
    display: flex;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #eee;
  }
  
  #chatbot {
    background-color: #178a44;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    height: 300px;
  }
  
  #chatbot h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    text-transform: uppercase;
    color: white;
  }
  
  #chat-log {
    flex: 1;
    overflow-y: auto;
    background-color: white;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .chat-input-container {
    display: flex;
    background-color: white;
    border-radius: 25px;
    padding: 5px;
  }
  
  #chat-input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
  }
  
  #sendChatBtn {
    background-color: #178a44;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }
  
  /* Bot message style */
  .bot-message {
    margin-bottom: 10px;
    color: #333;
  }
  
  /* Recommendation buttons container */
  .recommendation-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 10px !important;
  }
  
  .recommendation-buttons button {
    padding: 6px 12px !important;
    background-color: rgba(30, 126, 52, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
  }
  
  .recommendation-buttons button:hover {
    background-color: rgba(30, 126, 52, 0.9) !important;
  }
  
  .recommendation-buttons button:disabled {
    background-color: #aaa !important;
    cursor: not-allowed !important;
  }
  
  #statisticsBtn {
    padding: 10px 15px;
    font-size: 16px;
    background-color: #4a7dbd;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
  }
  
  /* Score Panel */
  .score-container {
    background-color: #d32f2f;
    color: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
  }
  
  .score-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    text-transform: uppercase;
  }
  
  .player-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .player-info i {
    margin-right: 10px;
    font-size: 18px;
  }
  
  .score-value {
    font-size: 20px;
    font-weight: bold;
  }
  
  .score-change {
    color: #f0f0f0;
    font-size: 14px;
    margin-left: 5px;
  }
  
  .game-status {
    margin-top: 15px;
    font-size: 16px;
    line-height: 1.5;
  }
  
  /* Move History Panel */
  .turn-history {
    background-color: #f9a825;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .turn-history h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    text-transform: uppercase;
    color: white;
  }
  
  #move-log {
    flex: 1;
    overflow-y: auto;
    background-color: white;
    border-radius: 5px;
    padding: 10px;
    height: 150px;
  }
  
  /* Thinking indicator */
  #thinking-indicator {
    padding: 8px;
    text-align: center;
    margin-bottom: 8px;
    background-color: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
  }
  
  .thinking-brain {
    color: #4caf50; /* Green when not thinking */
    transition: color 0.3s ease;
  }
  
  .thinking-brain.active {
    color: #333; /* Dark when thinking */
    animation: pulse-brain 1.5s infinite;
  }
  
  @keyframes pulse-brain {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  .thinking-text {
    margin-left: 8px;
    font-size: 14px;
    color: #555;
  }
  
  @keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
  }
  
  /* API Status Indicator */
  .api-status {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
  }
  
  .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    display: inline-block;
  }
  
  .status-text {
    font-size: 0.8rem;
    color: #666;
  }
  
  /* Spinner animation for the spinner icon only */
  .fa-spin {
    animation: spin 1.5s infinite linear;
  }
  
  /* Animation for connecting status */
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* API Error Message */
  .api-error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffebee;
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
  }
  
  .api-error-message p {
    margin: 10px 0;
  }
  
  .api-error-message a {
    color: #2196F3;
    text-decoration: underline;
    font-weight: bold;
  }
  
  .api-error-message a:hover {
    text-decoration: none;
  }
  
  /* API Error Indicator for chat log */
  .api-error-indicator {
    background-color: #ffebee;
    color: #f44336;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
    opacity: 1;
  }
  
  .api-error-indicator i {
    margin-right: 8px;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
  }
  
  /* Game-end modal */
  #game-end-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
  }
  
  .modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    width: 80%;
    text-align: center;
  }
  
  .winner {
    color: #d4af37;
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  }
  
  #final-scores, #game-stats {
    margin: 15px 0;
    text-align: left;
  }
  
  #final-score-list {
    list-style-type: none;
    padding-left: 10px;
  }
  
  #final-score-list li {
    margin: 5px 0;
    padding: 3px;
    background-color: #f8f8f8;
    border-radius: 3px;
  }
  
  #new-game-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #4a7dbd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
  }
  
  #new-game-btn:hover {
    background-color: #3a6da7;
  }
  
  /* Exchange mode */
  .exchange-mode {
    background-color: rgba(255, 235, 205, 0.6);
    border: 2px dashed #d4af37;
    border-radius: 8px;
  }
  
  .selected-for-exchange {
    transform: translateY(-10px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 2px solid #f39c12;
  }
  
  /* Button visibility */
  #exchangeBtn, #confirmExchangeBtn, #acceptRecommendationBtn {
    transition: display 0.3s;
  }
  
  #move-history {
    flex: 0 0 auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: #fafafa;
    height: 150px;
    overflow-y: auto;
  }
  
  #move-history h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2a5aa0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
  }
  
  #move-log {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 5px;
    background-color: #f9f9f9;
    font-size: 12px;
    border-radius: 3px;
  }
  
  .move-entry {
    padding: 5px;
    border-bottom: 1px dotted #ddd;
    line-height: 1.3;
  }
  
  .move-player {
    font-weight: bold;
  }
  
  .scrollable-log {
    overflow-y: auto;
    scrollbar-width: thin;
  }
  
  .scrollable-log::-webkit-scrollbar {
    width: 6px;
  }
  
  .scrollable-log::-webkit-scrollbar-track {
    background: #f1f1f1;
  }
  
  .scrollable-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
  }
  
  #denyRecommendationBtn, #acceptRecommendationBtn {
    display: none;
  }
  
  .api-status-tooltip {
    display: none;
    position: absolute;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 100;
    width: 250px;
    top: 40px;
    left: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  
  .api-status-tooltip a {
    color: #4fc3f7;
    text-decoration: underline;
  }
  
  .api-status-tooltip a:hover {
    text-decoration: none;
  }
  
  h3:hover .api-status-tooltip {
    display: block;
  }
  
  .small-button {
    font-size: 11px;
    padding: 3px 6px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 5px;
  }
  
  .small-button:hover {
    background-color: #777;
  }
  
  .offline-mode-active {
    background-color: #ff6b6b;
  }
  
  .offline-mode-indicator {
    background-color: #ff6b6b;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 8px;
  }
  
  /* Start Menu API Status Styles */
  .start-menu-status-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  .api-status-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  
  #start-menu-api-status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 30px;
    font-size: 14px;
    margin: 0 auto 15px auto;
    font-weight: bold;
    background-color: rgba(0,0,0,0.1);
    width: fit-content;
    min-width: 150px;
    animation: none;
  }
  
  /* Icon container to isolate animation */
  .icon-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
  }
  
  /* Ensure the icon always has the same width */
  .icon-container i {
    width: 16px;
    text-align: center;
  }
  
  #start-menu-api-status.connected {
    color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
  }
  
  #start-menu-api-status.disconnected {
    color: #F44336;
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
  }
  
  #start-menu-api-status.connecting {
    color: #FFC107;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
  }
  
  #start-menu-api-status .status-text {
    margin-left: 8px;
    animation: none;
  }
  
  .start-menu-message {
    margin-top: 10px;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f8f8;
    max-width: 500px;
  }
  
  .error-message {
    color: #F44336;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 4px;
    background-color: rgba(244, 67, 54, 0.1);
    text-align: center;
  }
  
  .error-message a {
    color: #2196F3;
    text-decoration: underline;
  }
  
  .error-message i {
    margin-right: 5px;
  }
  
  #retry-connection-btn {
    margin-top: 15px;
    padding: 10px 16px;
    font-size: 14px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    align-self: center;
    display: block;
    width: auto;
  }
  
  #retry-connection-btn:hover {
    background-color: #1976D2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  /* Disabled Start Button */
  #startGameBtn.disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
  }
  
  /* Connection log container */
  .connection-log-container {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin: 0;
    height: 300px;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
  }
  
  #connection-log {
    margin: 0;
    padding: 0;
    list-style-type: none;
    flex: 1;
    overflow-y: auto;
  }
  
  #connection-log li {
    padding: 5px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    border-left: 4px solid #ddd;
    background-color: #f9f9f9;
  }
  
  #connection-log li.error {
    border-left-color: #d32f2f;
    background-color: #ffebee;
  }
  
  #connection-log li.success {
    border-left-color: #388e3c;
    background-color: #e8f5e9;
  }
  
  #connection-log li.info {
    border-left-color: #1976d2;
    background-color: #e3f2fd;
  }
  
  #connection-log .timestamp {
    color: #888;
    margin-right: 5px;
  }
  
  #connection-log .error {
    color: #d32f2f;
  }
  
  #connection-log .success {
    color: #388e3c;
  }
  
  #connection-log .info {
    color: #1976d2;
  }
  
  /* Start Menu Layout */
  .start-menu-layout {
    display: flex;
    flex-direction: row;
    gap: 30px;
    margin-top: 20px;
    justify-content: center;
    align-items: flex-start;
  }
  
  .start-menu-column {
    flex: 1;
  }
  
  .left-column {
    max-width: 400px;
  }
  
  .right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  /* Ensure the start menu is responsive */
  @media (max-width: 768px) {
    .start-menu-layout {
      flex-direction: column;
    }
    
    .left-column, .right-column {
      max-width: 100%;
      width: 100%;
    }
  }
  
  #connection-timer {
    margin-top: 10px;
    padding: 8px;
    text-align: center;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
  }
  
  #connection-timer.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
  }
  
  #connection-timer.success {
    background-color: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
  }
  
  #connection-timer.error {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
  }
  
  /* Connection log container header */
  .connection-log-container h4 {
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    color: #333;
    font-size: 16px;
  }
  
  .special-label {
    position: absolute;
    top: 1px;
    left: 1px;
    font-size: 7px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.7);
    z-index: 1;
  }
  
  .button-warning {
    background-color: #f39c12;
    color: white;
  }
  
  .button-warning:hover {
    background-color: #c0392b;
  }
  
  .debug-button {
    background-color: #777 !important;
    color: white;
    font-size: 11px !important;
    padding: 4px 8px !important;
    margin-left: 5px;
  }
  
  .debug-button:hover {
    background-color: #555 !important;
  }
  
  .offline-mode-indicator {
    background-color: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin: 0 10px;
    display: inline-block;
    animation: pulse-warning 2s infinite;
  }
  
  @keyframes pulse-warning {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
  }
  
  .score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    margin-bottom: 10px;
  }
  
  .score-value {
    font-size: 24px;
    font-weight: bold;
  }
  
  .score-change {
    color: #666;
    font-size: 14px;
  }
  
  .difficulty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
  }
  
  .difficulty-selector button {
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
  }
  
  .turn-history {
    background-color: white;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    max-height: 150px;
  }
  
  .turn-history h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
  }
  
  .history-entry {
    margin-bottom: 8px;
    font-size: 14px;
  }
  
  #statisticsBtn {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #4a7dbd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
  }
  
  /* Style the tiles to fit properly */
  .tile {
    width: 35px !important;
    height: 35px !important;
    background-color: #f4d03f !important;
    border-radius: 3px !important;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
    cursor: grab !important;
    font-weight: bold !important;
    color: #333 !important;
  }
  
  /* Style the letter and points on tiles */
  .tile-letter {
    font-size: 20px !important;
    font-weight: bold !important;
  }
  
  .tile-points {
    font-size: 10px !important;
    position: absolute !important;
    bottom: 2px !important;
    right: 2px !important;
  }
  
  /* Style the game controls */
  #game-controls {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
    width: 100% !important;
  }
  
  #game-controls button {
    padding: 8px 15px !important;
    background-color: #1e7e34 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    transition: background-color 0.2s !important;
  }
  
  #game-controls button:hover {
    background-color: #156926 !important;
  }
  
  #game-controls button:disabled {
    background-color: #aaa !important;
    cursor: not-allowed !important;
  }
  
  /* Style the recommendation buttons */
  .recommendation-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 10px !important;
  }
  
  .recommendation-buttons button {
    padding: 6px 12px !important;
    background-color: rgba(30, 126, 52, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
  }
  
  .recommendation-buttons button:hover {
    background-color: rgba(30, 126, 52, 0.9) !important;
  }
  
  .recommendation-buttons button:disabled {
    background-color: #aaa !important;
    cursor: not-allowed !important;
  }
  
  /* Fix special cell styles */
  .triple-word {
    background-color: #e53935 !important;
  }
  .double-word {
    background-color: #f48fb1 !important;
  }
  .triple-letter {
    background-color: #2196f3 !important;
  }
  .double-letter {
    background-color: #80cbc4 !important;
  }
  .center-cell {
    background-color: #f48fb1 !important;
  }
  
  /* Cell labels */
  .cell-label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
  }
  
  /* Board cell with a tile */
  .board-cell.has-tile {
    background-color: transparent !important;
  }
  
  /* Board cell hover state for drag and drop */
  .board-cell.drop-hover {
    background-color: rgba(144, 238, 144, 0.6) !important;
    box-shadow: inset 0 0 5px #2e7d32;
  }
  
  /* Game timer */
  #game-timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
  }
  
  /* Game controls */
  .game-controls {
    margin: 15px 0;
  }
  
  .game-controls button {
    margin: 0 5px;
    padding: 8px 16px;
    background-color: #3f51b5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
  }
  
  .game-controls button:hover {
    background-color: #303f9f;
  }
  
  .game-controls button:disabled {
    background-color: #bdbdbd;
    cursor: not-allowed;
  }
  
  /* API Connection Status Styling */
  .status-icon {
    font-size: 1.2rem;
    margin-right: 5px;
    transition: color 0.3s ease;
  }
  
  .status-icon.pending {
    color: #ff9800; /* Orange for pending connection */
    animation: pulse 1.5s infinite;
  }
  
  .status-icon.connected {
    color: #4caf50; /* Green for connected */
  }
  
  .status-icon.error {
    color: #f44336; /* Red for error */
  }
  
  @keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
  }
  
  /* Brain icon for thinking state */
  .thinking-brain {
    color: #4caf50; /* Green when not thinking */
    transition: color 0.3s ease;
  }
  
  .thinking-brain.active {
    color: #333; /* Dark when thinking */
    animation: pulse-brain 1.5s infinite;
  }
  
  @keyframes pulse-brain {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  /* Recommendation overlay styling */
  .recommendation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow interactions with the board beneath */
    z-index: 100;
  }
  
  .recommendation-tile {
    position: absolute;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0.8;
    background-color: #f4d03f;
    border: 2px dashed #e65100;
  }
  
  .recommendation-tile .tile-letter {
    font-size: 18px;
    color: #333;
  }
  
  .recommendation-tile .tile-value {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 10px;
    color: #333;
  }
  
  /* Darker colors for previous turns */
  .tile.played, .cpu-tile.played {
    opacity: 0.85;
    filter: brightness(0.9);
    cursor: default;
  }
  
  /* Statistics Section */
  .statistics-section {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .statistics-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
  }
  
  .stats-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .stat-label {
    font-weight: 600;
    color: #555;
  }
  
  .stat-value {
    font-weight: 500;
    color: #0056b3;
  }
  
  /* Move History */
  .move-history {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
  }
  
  .move-history h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
  }
  
  .history-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .move-entry {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #0056b3;
    font-size: 0.9rem;
  }
  
  .turn-number {
    font-weight: bold;
    color: #0056b3;
  }
  
  .player-name {
    font-weight: 600;
  }
  
  .move-details {
    color: #555;
  }
  
  .move-timestamp {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
    text-align: right;
  }
  
  /* Connection Log Enhancements */
  .connection-log-container {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .connection-log-container h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
  }
  
  #connection-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
  }
  
  .log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-bottom: 1px solid #eee;
  }
  
  .log-entry.error {
    color: #d9534f;
    border-left: 3px solid #d9534f;
    padding-left: 8px;
  }
  
  .log-entry.success {
    color: #5cb85c;
    border-left: 3px solid #5cb85c;
    padding-left: 8px;
  }
  
  .log-entry.info {
    color: #5bc0de;
    border-left: 3px solid #5bc0de;
    padding-left: 8px;
  }
  
  /* Thinking Indicator */
  .thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #fff3cd;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 3px solid #ffc107;
  }
  
  .brain-icon {
    font-size: 1.2rem;
    color: #fd7e14;
    animation: pulse 1.5s infinite;
  }
  
  @keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
  }
  
  .status-indicator.connected {
    background-color: #5cb85c;
    box-shadow: 0 0 5px #5cb85c;
  }
  
  .status-indicator.disconnected {
    background-color: #d9534f;
    box-shadow: 0 0 5px #d9534f;
  }
  
  .tile-slot {
    width: 42px;
    height: 42px;
    border: 1px dashed #fff;
    border-radius: 5px;
    margin: 2px;
    display: inline-block;
  }
  
  /* Game stats panel styles */
  #game-stats-panel {
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 700px;
    overflow-y: auto;
  }
  
  /* Fix overflow issues in panels */
  .statistics-section,
  .move-history,
  .connection-log-container {
    max-height: 300px;
    overflow-y: auto;
  }
  
  /* Ensure proper scrolling in logs */
  #connection-log,
  #history-content,
  #chat-log {
    max-height: 200px;
    overflow-y: auto;
  }
  