:root {
    --primary-bg: #f0f2f5;
    --game-start-bg: #b8e3e9;
    --score-bg: #ff99cc;
    --history-bg: #ffc266;
    --bot-bg: #4d9900;
    --control-bg: #b3d9ff;
    --board-green: #006600;
    --board-cell: #ffffff;
    --text-dark: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: var(--primary-bg);
    padding: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.board {
    display: grid;
    grid-template-columns: repeat(15, 40px);
    grid-template-rows: repeat(15, 40px);
    gap: 1px;
    background-color: #e0e0e0;
    border: 2px solid #666;
    margin: 20px 0;
}

.board-cell {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    font-size: 12px;
    text-align: center;
}

.board-cell.triple-word {
    background-color: #ff9999;
}

.board-cell.double-word {
    background-color: #ffb366;
}

.board-cell.triple-letter {
    background-color: #99ff99;
}

.board-cell.double-letter {
    background-color: #99ccff;
}

.board-cell.star {
    background-color: #ffcc99;
}

.board-cell::before {
    content: attr(data-bonus);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #666;
    pointer-events: none;
}

.tile {
    width: 36px;
    height: 36px;
    background-color: #f4d03f;
    border: 1px solid #666;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: move;
    font-weight: bold;
    position: relative;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.tile .letter {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
}

.tile .points {
    font-size: 10px;
    line-height: 1;
    position: absolute;
    bottom: 2px;
    right: 2px;
}

.player-rack {
    display: flex;
    gap: 5px;
    padding: 10px;
    background-color: #ddd;
    border-radius: 5px;
    margin: 10px 0;
}

.controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.button:hover {
    background-color: #45a049;
}

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

.chat-container {
    width: 300px;
    margin-top: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
}

.message {
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 4px;
}

.message.player {
    background-color: #e3f2fd;
    color: #1565c0;
}

.message.ai {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.message.system {
    background-color: #fff3e0;
    color: #e65100;
    font-style: italic;
}

.chat-input {
    display: flex;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #ccc;
}

.chat-input input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 5px;
}

.chat-input button {
    padding: 5px 10px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.chat-input button:hover {
    background-color: #1976D2;
}

.timer {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

.recommendation {
    position: absolute;
    width: 36px;
    height: 36px;
    background-color: rgba(244, 208, 63, 0.5);
    border: 2px dashed #666;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.recommendation-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.recommendation-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.accept-move {
    background-color: #4CAF50;
    color: white;
}

.deny-move {
    background-color: #f44336;
    color: white;
}

/* Game Start Section */
.game-start {
    background-color: var(--game-start-bg);
    padding: 20px;
    border-radius: 15px;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.game-start.inactive {
    opacity: 0.5;
    pointer-events: none;
}

.game-start input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.game-start button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
}

.retro-connection {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-icon {
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
}

/* Update retro connection text */
.retro-connection span:last-child {
    content: 'Retry Connection';
}

/* Score and Stats Section */
.score-stats {
    background-color: var(--score-bg);
    padding: 20px;
    border-radius: 15px;
    grid-column: 1 / -1;
}

.score-section, .stats-section {
    margin-bottom: 15px;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: var(--control-bg);
    cursor: pointer;
}

.game-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bottom Sections */
.bottom-sections {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.game-history {
    background-color: var(--history-bg);
    padding: 20px;
    border-radius: 15px;
    height: 300px;
    overflow-y: auto;
}

.scrabble-bot {
    background-color: var(--bot-bg);
    padding: 20px;
    border-radius: 15px;
    color: white;
    height: 300px;
    display: flex;
    flex-direction: column;
}

#chatHistory {
    flex-grow: 1;
    overflow-y: auto;
    margin: 10px 0;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex-grow: 1;
    padding: 8px;
    border: none;
    border-radius: 5px;
}

.chat-input button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background-color: white;
    color: var(--bot-bg);
    cursor: pointer;
}

/* Chat message styling */
#chatHistory p {
    margin: 5px 0;
}

#chatHistory p strong {
    color: inherit;
}

#chatHistory p:not(:has(strong[data-sender="ScrabbleBot"])) {
    color: #000;
}

#chatHistory p:has(strong[data-sender="ScrabbleBot"]) {
    color: #fff;
}

/* Special tile colors and text */
.double-letter::before {
    content: "DL";
}

.triple-letter::before {
    content: "TL";
}

.double-word::before {
    content: "DW";
}

.triple-word::before {
    content: "TW";
}

/* Special Tiles */
.double-letter {
    background-color: #b3d9ff;
}

.triple-letter {
    background-color: #3399ff;
}

.double-word {
    background-color: #ffb3b3;
}

.triple-word {
    background-color: #ff6666;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
    }
    
    .bottom-sections {
        grid-template-columns: 1fr;
    }
} 