* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 36px;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 24px;
}

.game-info {
    margin-bottom: 20px;
}

#status {
    font-size: 20px;
    color: #555;
    font-weight: bold;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 10px;
    margin: 0 auto 30px;
    width: fit-content;
}

.cell {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border: 3px solid #667eea;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cell:hover:not(.taken) {
    background: #e8e8e8;
    transform: scale(1.05);
}

.cell.taken {
    cursor: not-allowed;
}

.cell.x {
    color: #667eea;
}

.cell.o {
    color: #764ba2;
}

.cell.winner {
    background: #ffd700;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#resetButton {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#resetButton:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#resetButton:active {
    transform: translateY(0);
}

.mode-selection, .difficulty-selection {
    margin-bottom: 20px;
}

.mode-btn, .difficulty-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 10px;
    min-width: 150px;
}

.mode-btn:hover, .difficulty-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mode-btn:active, .difficulty-btn:active {
    transform: translateY(0);
}

.difficulty-btn[data-difficulty="easy"] {
    background: #4CAF50;
}

.difficulty-btn[data-difficulty="easy"]:hover {
    background: #45a049;
}

.difficulty-btn[data-difficulty="medium"] {
    background: #FF9800;
}

.difficulty-btn[data-difficulty="medium"]:hover {
    background: #e68900;
}

.difficulty-btn[data-difficulty="hard"] {
    background: #f44336;
}

.difficulty-btn[data-difficulty="hard"]:hover {
    background: #da190b;
}

.back-btn, #backToModeFromGame {
    background: #9e9e9e;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 10px;
}

.back-btn:hover, #backToModeFromGame:hover {
    background: #757575;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-btn:active, #backToModeFromGame:active {
    transform: translateY(0);
}

#gameMode {
    color: #667eea;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}
