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;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  
  /* 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 */
  .tile {
    cursor: grab;
    user-select: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    touch-action: none;
  }
  
  .tile.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.8;
  }
  
  .ghost-tile {
    position: fixed;
    pointer-events: none;
    z-index: 1001;
    opacity: 0.6;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  .board-cell {
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  
  .board-cell.valid-drop-target {
    background-color: rgba(0, 255, 0, 0.1);
    border: 2px dashed #4CAF50;
  }
  
  .board-cell.valid-drop {
    background-color: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
  }
  
  .board-cell.invalid-drop {
    background-color: rgba(244, 67, 54, 0.1);
    border: 2px dashed #F44336;
  }
  
  .rack-slot {
    position: relative;
    width: 40px;
    height: 40px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    margin: 0 4px;
    transition: background-color 0.2s ease;
  }
  
  .rack-slot:empty {
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  .rack-slot:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }
  
  /* Mobile-friendly drag and drop */
  @media (max-width: 768px) {
    .tile {
        touch-action: none;
    }

    .board-cell {
        min-height: 40px;
        min-width: 40px;
    }

    .ghost-tile {
        width: 40px;
        height: 40px;
    }

    .rack-slot {
        width: 35px;
        height: 35px;
    }
  }
  
  .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 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    display: none;
    z-index: 1000;
  }
  
  .thinking-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .thinking-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  .thinking-text {
    font-size: 16px;
    font-weight: 500;
  }
  
  .move-explanation {
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 14px;
    max-width: 300px;
    text-align: center;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Move Animations */
  .tile {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  .tile.placement {
    animation: tilePlacement 0.3s ease forwards;
  }
  
  @keyframes tilePlacement {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
  }
  
  /* Mobile-friendly AI indicators */
  @media (max-width: 768px) {
    #thinking-indicator {
        width: 90%;
        max-width: 300px;
    }

    .thinking-spinner {
        width: 30px;
        height: 30px;
    }

    .thinking-text {
        font-size: 14px;
    }

    .move-explanation {
        font-size: 12px;
        padding: 8px;
    }
  }
  
  /* API Status Indicator */
  .api-status {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
  }
  
  #api-status-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  #api-status-icon {
    font-size: 18px;
    transition: color 0.3s ease;
  }
  
  #api-status-icon.fa-unlink {
    color: #f44336;
  }
  
  #api-status-icon.fa-link {
    color: #4CAF50;
  }
  
  #api-status-text {
    font-size: 14px;
    color: #333;
  }
  
  /* Connection Log Styles */
  .connection-log {
    margin-top: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
  }
  
  .connection-log .log-entry {
    padding: 5px;
    margin-bottom: 5px;
    border-left: 3px solid transparent;
  }
  
  .connection-log .log-entry.info {
    border-left-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
  }
  
  .connection-log .log-entry.error {
    border-left-color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
  }
  
  .connection-log .log-entry.success {
    border-left-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
  }
  
  .connection-log .timestamp {
    color: #666;
    margin-right: 8px;
  }
  
  /* Start Button States */
  #start-game {
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    border: none;
    cursor: pointer;
  }
  
  #start-game.disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
  }
  
  #start-game.active {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  #start-game.active:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  /* Scrollable Log */
  .scrollable-log {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
  }
  
  .scrollable-log::-webkit-scrollbar {
    width: 6px;
  }
  
  .scrollable-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  .scrollable-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
  }
  
  .scrollable-log::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
  
  /* Retry Button */
  #retry-connection {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease;
  }
  
  #retry-connection:hover {
    background-color: #1976D2;
  }
  
  #retry-connection i {
    font-size: 14px;
  }
  
  /* Connection Panel */
  .connection-panel {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .connection-panel h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    text-align: center;
  }
  
  /* Player Setup */
  .player-setup {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .setup-field {
    margin-bottom: 15px;
  }
  
  .setup-field label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
  }
  
  .setup-field input,
  .setup-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
  }
  
  .setup-field input:focus,
  .setup-field select:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
  }
  
  /* Start Menu Layout */
  .start-menu-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
  }
  
  @media (max-width: 768px) {
    .start-menu-layout {
        grid-template-columns: 1fr;
    }
  }
  
  #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 {
    padding: 8px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #4a7dbd;
  }
  
  .move-number {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
  }
  
  .move-content {
    font-size: 14px;
    line-height: 1.4;
  }
  
  .move-player {
    font-weight: bold;
    color: #2a5aa0;
  }
  
  .move-word {
    font-weight: bold;
    color: #2ecc71;
  }
  
  .move-score {
    font-weight: bold;
    color: #e74c3c;
  }
  
  .move-explanation {
    display: block;
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid #ddd;
  }
  
  #move-log {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  }
  
  /* Thinking Indicator Styles */
  #thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 3px solid #4a7dbd;
  }
  
  .thinking-text {
    font-size: 14px;
    color: #666;
    flex: 1;
  }
  
  .brain-icon {
    font-size: 20px;
    color: #4a7dbd;
    animation: pulse 1.5s infinite;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(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;
  }
  
  .status-indicator.pending {
    background-color: #ffc107;
    box-shadow: 0 0 5px #ffc107;
    animation: pulse 1.5s infinite;
  }
  
  .status-indicator.error {
    background-color: #d9534f;
    box-shadow: 0 0 5px #d9534f;
  }
  
  /* Add an alias for pending when using connecting class name */
  .status-indicator.connecting {
    background-color: #ffc107;
    box-shadow: 0 0 5px #ffc107;
    animation: pulse 1.5s infinite;
  }
  
  .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;
  }
  
  /* Start button states */
  #startGameBtn {
    transition: all 0.3s ease;
  }
  
  #startGameBtn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
  }
  
  #startGameBtn.active {
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  #startGameBtn.active:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  
  /* Game Board Styles */
  .board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 2px;
    background-color: #2c3e50;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .cell {
    aspect-ratio: 1;
    background-color: #34495e;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #ecf0f1;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .cell.dl { background-color: #3498db; }
  .cell.tl { background-color: #2980b9; }
  .cell.dw { background-color: #e74c3c; }
  .cell.tw { background-color: #c0392b; }
  
  .cell.valid-drop {
    background-color: #27ae60;
    animation: pulse 1s infinite;
  }
  
  .cell.invalid-drop {
    background-color: #c0392b;
    animation: shake 0.5s;
  }
  
  /* Tile Styles */
  .tile {
    width: 90%;
    height: 90%;
    background-color: #f1c40f;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2c3e50;
    cursor: move;
    user-select: none;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .tile.dragging {
    transform: scale(1.1);
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  
  .tile.selected {
    background-color: #2ecc71;
    transform: translateY(-5px);
  }
  
  /* Rack Styles */
  .rack {
    display: flex;
    gap: 5px;
    padding: 10px;
    background-color: #34495e;
    border-radius: 8px;
    min-height: 60px;
    margin: 10px 0;
  }
  
  .rack.exchange-mode .tile {
    cursor: pointer;
  }
  
  .rack.exchange-mode .tile:hover {
    transform: translateY(-5px);
  }
  
  /* Game Controls */
  .game-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
  }
  
  .primary-button, .secondary-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
  }
  
  .primary-button {
    background-color: #2ecc71;
    color: white;
  }
  
  .primary-button:hover:not(:disabled) {
    background-color: #27ae60;
    transform: translateY(-1px);
  }
  
  .primary-button:disabled {
    background-color: #a8c0e0;
    cursor: not-allowed;
  }
  
  .secondary-button {
    background-color: #e9ecef;
    color: #495057;
  }
  
  .secondary-button:hover {
    background-color: #dee2e6;
    transform: translateY(-1px);
  }
  
  /* Chat Interface */
  .chat-interface {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
  }
  
  .chat-log {
    height: 200px;
    overflow-y: auto;
    margin: 10px 0;
    padding: 10px;
    background-color: #2c3e50;
    border-radius: 4px;
  }
  
  .chat-message {
    margin: 5px 0;
    padding: 8px;
    border-radius: 4px;
  }
  
  .chat-message.user {
    background-color: #3498db;
    margin-left: 20%;
  }
  
  .chat-message.bot {
    background-color: #2ecc71;
    margin-right: 20%;
  }
  
  .thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #95a5a6;
    margin: 10px 0;
  }
  
  .brain-icon {
    font-size: 1.5em;
    animation: pulse 1s infinite;
  }
  
  /* Game Status */
  .game-status {
    font-size: 1.2em;
    font-weight: bold;
    color: #ecf0f1;
    margin: 10px 0;
  }
  
  /* Scoreboard */
  .scoreboard {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
  }
  
  /* Animations */
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
  }
  
  /* Modal Styles */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }
  
  .modal-content {
    background-color: #34495e;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    color: #ecf0f1;
  }
  
  /* Debug Panel */
  .debug-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    max-height: 300px;
    overflow-y: auto;
  }
  
  /* Message Styles */
  .message {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 5px 0;
    animation: slideIn 0.3s ease-out;
  }
  
  .message.info {
    background-color: #3498db;
    color: white;
  }
  
  .message.error {
    background-color: #e74c3c;
    color: white;
  }
  
  .message.success {
    background-color: #2ecc71;
    color: white;
  }
  
  @keyframes slideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  /* Responsive Design */
  @media (max-width: 768px) {
    .board {
        gap: 1px;
    }

    .tile {
        font-size: 0.8em;
    }

    .game-controls {
        flex-direction: column;
    }

    .primary-button, .secondary-button {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
  }
  
  /* Debug Panel Styles */
  #debug-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 400px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
  }
  
  #debug-panel.hidden {
    transform: translateY(100%);
  }
  
  .debug-section {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
  
  .debug-section h3 {
    margin: 0 0 10px 0;
    color: #00ff00;
    font-size: 14px;
  }
  
  .debug-section h4 {
    margin: 10px 0 5px 0;
    color: #00ff00;
    font-size: 12px;
  }
  
  .debug-section p {
    margin: 5px 0;
  }
  
  .debug-section ul {
    margin: 5px 0;
    padding-left: 20px;
  }
  
  .debug-section li {
    margin: 3px 0;
  }
  
  .debug-log {
    margin: 5px 0;
    padding: 5px;
    border-radius: 3px;
  }
  
  .debug-log.info {
    background-color: rgba(0, 255, 0, 0.1);
  }
  
  .debug-log.error {
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff0000;
  }
  
  .debug-log.success {
    background-color: rgba(0, 255, 0, 0.1);
    color: #00ff00;
  }
  
  #debug-toggle {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: 1px solid #00ff00;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
  }
  
  #debug-toggle:hover {
    background-color: rgba(0, 255, 0, 0.2);
  }
  
  #debug-toggle.active {
    background-color: rgba(0, 255, 0, 0.3);
    border-color: #00ff00;
  }
  
  /* Tooltip Styles */
  [title] {
    position: relative;
  }
  
  [title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
  }
  
  @keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
  }
  
  /* Button Tooltip Styles */
  button[title]:hover::after {
    bottom: 120%;
  }
  
  /* Disabled Button Styles */
  button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  button:disabled[title]:hover::after {
    content: attr(title);
  }
  
  /* Game Timer Styles */
  .game-timer {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background-color: #f8f9fa;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
    margin-right: 20px;
  }
  
  .game-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
  }
  
  .remaining-tiles, .round-number {
    font-size: 16px;
    color: #666;
    background-color: #f8f9fa;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
  }
  
  /* Start Menu Styles */
  .start-menu {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
  }
  
  .start-menu-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 1200px;
  }
  
  .start-menu h1 {
    color: #2a5aa0;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
  }
  
  .start-menu-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
  }
  
  .panel-header h2 {
    color: #2a5aa0;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
  }
  
  /* Connection Panel Styles */
  .connection-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
  }
  
  .status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  .status-indicator i {
    font-size: 1.25rem;
    color: #dc3545;
  }
  
  .status-indicator.connected i {
    color: #28a745;
  }
  
  .connection-log-container {
    margin-top: 1.5rem;
  }
  
  .connection-log {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.5;
  }
  
  /* Player Setup Styles */
  .player-setup {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
  }
  
  .setup-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  
  .setup-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .setup-field label {
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
  }
  
  .setup-field input,
  .setup-field select {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  
  .setup-field input:focus,
  .setup-field select:focus {
    border-color: #2a5aa0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 90, 160, 0.1);
  }
  
  .difficulty-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
  }
  
  /* Button Styles */
  .primary-button,
  .secondary-button {
    padding: 0.875rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
  }
  
  .primary-button {
    background: #2a5aa0;
    color: white;
  }
  
  .primary-button:hover:not(:disabled) {
    background: #1e4a8a;
    transform: translateY(-1px);
  }
  
  .primary-button:disabled {
    background: #a8c0e0;
    cursor: not-allowed;
  }
  
  .secondary-button {
    background: #e9ecef;
    color: #495057;
  }
  
  .secondary-button:hover {
    background: #dee2e6;
    transform: translateY(-1px);
  }
  
  /* Responsive Design */
  @media (max-width: 768px) {
    .start-menu-layout {
      grid-template-columns: 1fr;
    }
    
    .start-menu-content {
      padding: 1.5rem;
    }
    
    .start-menu h1 {
      font-size: 2rem;
    }
  }
  
  /* Accessibility Styles */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  .skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2a5aa0;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
  }
  
  .skip-link:focus {
    top: 0;
  }
  
  /* Focus Styles */
  .focused {
    outline: 2px solid #2a5aa0;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(42, 90, 160, 0.2);
  }
  
  /* Error Message Styles */
  .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
  }
  
  /* Status Indicator Styles */
  .status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
  }
  
  .status-indicator.connected {
    border-left: 4px solid #28a745;
  }
  
  .status-indicator.disconnected {
    border-left: 4px solid #dc3545;
  }
  
  .status-indicator.pending {
    border-left: 4px solid #ffc107;
    animation: pulse 1.5s infinite;
  }
  
  /* Loading States */
  .loading {
    position: relative;
    pointer-events: none;
  }
  
  .loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
  }
  
  /* Button States */
  .primary-button:disabled,
  .secondary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
  }
  
  .primary-button:disabled::after,
  .secondary-button:disabled::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
  }
  
  .primary-button:disabled:hover::after,
  .secondary-button:disabled:hover::after {
    opacity: 1;
  }
  
  /* Form Field States */
  .setup-field input:invalid,
  .setup-field select:invalid {
    border-color: #dc3545;
  }
  
  .setup-field input:valid,
  .setup-field select:valid {
    border-color: #28a745;
  }
  
  /* Animations */
  @keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
  }
  
  @keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
  }
  
  /* High Contrast Mode Support */
  @media (forced-colors: active) {
    .status-indicator {
        border: 1px solid ButtonText;
    }

    .status-indicator.connected {
        border-left-color: ButtonText;
    }

    .status-indicator.disconnected {
        border-left-color: ButtonText;
    }

    .status-indicator.pending {
        border-left-color: ButtonText;
    }

    .focused {
        outline: 2px solid ButtonText;
        outline-offset: 2px;
    }
  }
  
  /* Reduced Motion Support */
  @media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
  }
  
  /* Undo/Redo Button Styles */
  #undo, #redo {
    position: relative;
    overflow: hidden;
  }

  #undo:disabled, #redo:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  #undo:disabled::after, #redo:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
  }

  @keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
  }
  
  /* Tile Exchange Styles */
  .rack-tile.exchange-mode {
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .rack-tile.exchange-mode:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .rack-tile.selected-for-exchange {
    border: 2px solid #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  /* Exchange Buttons */
  #confirm-exchange, #cancel-exchange {
    display: none;
    margin: 0 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  #confirm-exchange {
    background-color: #4CAF50;
    color: white;
  }

  #confirm-exchange:hover:not(:disabled) {
    background-color: #45a049;
    transform: translateY(-2px);
  }

  #confirm-exchange:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
  }

  #cancel-exchange {
    background-color: #f44336;
    color: white;
  }

  #cancel-exchange:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
  }

  #exchange:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
  }

  /* Exchange Mode Indicator */
  .exchange-mode-indicator {
    display: none;
    padding: 8px;
    margin: 10px 0;
    background-color: #e8f5e9;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    color: #2e7d32;
    text-align: center;
  }

  .exchange-mode .exchange-mode-indicator {
    display: block;
  }
  
  /* Statistics Containers */
  .statistics-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
    margin: 1rem 0;
  }
  
  /* Move History */
  .move-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  .move-entry {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
  }
  
  .move-entry:hover {
    background: #f0f0f0;
  }
  
  .move-entry .time {
    color: #666;
    font-size: 0.9em;
  }
  
  .move-entry .score {
    color: #28a745;
    font-weight: bold;
  }
  
  /* Player Stats */
  .player-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .player-stats-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .player-stats-card.active {
    border: 2px solid #007bff;
  }
  
  .player-stats-card .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .stat label {
    font-size: 0.8em;
    color: #666;
  }
  
  .stat value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
  }
  
  /* Word History */
  .word-history-list {
    max-height: 200px;
    overflow-y: auto;
  }
  
  .word-entry {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    align-items: center;
  }
  
  .word-entry .word {
    font-weight: bold;
  }
  
  .word-entry .score {
    color: #28a745;
  }
  
  .word-entry .player {
    color: #666;
    font-size: 0.9em;
  }
  