/* Tic Tac Toe Game Styles */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #adb5bd;
    --text-color: #495057;
    --background-color: #ffffff;
    --x-color: #dc3545;
    --o-color: #28a745;
}

/* Game Header */
.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-header h1 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.game-header p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin: 0;
}

/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Game Info */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.current-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.current-player span:first-child {
    color: var(--text-color);
}

#currentPlayer {
    font-weight: bold;
    font-size: 1.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    min-width: 35px;
    text-align: center;
}

.player-x {
    background-color: var(--x-color);
    color: white;
}

.player-o {
    background-color: var(--o-color);
    color: white;
}

.game-status {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

/* Player Selection */
.player-selection {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.player-select-btn {
    background-color: var(--light-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.player-select-btn:hover {
    background-color: var(--border-color);
}

.player-select-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.player-select-btn.player-x.active {
    background-color: var(--light-color);
    border-color: var(--border-color);
    color: var(--text-color);
    border-bottom: 2px solid var(--x-color);
}

.player-select-btn.player-o.active {
    background-color: var(--light-color);
    border-color: var(--border-color);
    color: var(--text-color);
    border-bottom: 2px solid var(--o-color);
}

/* Tic Tac Toe Board */
.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    background-color: var(--border-color);
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.board-cell {
    background-color: var(--background-color);
    padding: 1.5rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-right: 4px solid var(--dark-color);
    border-bottom: 4px solid var(--dark-color);
}

/* Remove right border from rightmost cells */
.board-cell:nth-child(3n) {
    border-right: none;
}

/* Remove bottom border from bottom row cells */
.board-cell:nth-child(n+7) {
    border-bottom: none;
}

.board-cell:hover {
    background-color: var(--light-color);
    transform: scale(1.02);
}

.board-cell.marked {
    cursor: default;
}

.board-cell.marked:hover {
    transform: none;
}

/* Cell Content */
.cell-word {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
    max-width: 100%;
    /* Responsive font sizing for longer text */
    font-size: clamp(0.8rem, 2.5vw, 1.5rem);
}

/* Dynamic font sizing based on text length */
.cell-word[data-length="short"] {
    font-size: 1.5rem;
}

.cell-word[data-length="medium"] {
    font-size: 1.2rem;
}

.cell-word[data-length="long"] {
    font-size: 1rem;
}

.cell-word[data-length="very-long"] {
    font-size: 0.85rem;
}

.cell-buttons {
    display: none;
}

.cell-button {
    display: none;
}

.x-button {
    display: none;
}

.o-button {
    display: none;
}

/* Cell Marks */
.cell-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.5rem;
    font-weight: bold;
    z-index: 10;
}

.x-mark {
    color: var(--x-color);
}

.o-mark {
    color: var(--o-color);
}

/* Marked Cell States - No background colors, just show the symbols */
.x-marked {
    /* No background color - just show the X symbol */
}

.o-marked {
    /* No background color - just show the O symbol */
}

/* Winning Cells */
.winning-cell {
    background-color: var(--warning-color) !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

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

.game-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 120px;
}

.game-button:hover {
    background-color: #357abd;
}

.game-button.secondary {
    background-color: var(--secondary-color);
}

.game-button.secondary:hover {
    background-color: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .player-selection {
        justify-content: center;
        margin: 0.5rem 0;
    }
    
    .tictactoe-board {
        max-width: 100%;
        gap: 2px;
    }
    
    .board-cell {
        min-height: 120px;
        padding: 1rem;
    }
    
    .cell-word {
        font-size: 1.3rem;
    }
    
    .cell-button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .cell-mark {
        font-size: 3.8rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-button {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 2rem;
    }
    
    .board-cell {
        min-height: 100px;
        padding: 0.75rem;
    }
    
    .cell-word {
        font-size: 1.1rem;
    }
    
    .cell-button {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .cell-mark {
        font-size: 3.2rem;
    }
} 