* {
    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;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #4a5568;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
}

.current-player {
    font-size: 1.2rem;
    font-weight: bold;
}

#currentPlayer {
    color: #e53e3e;
    font-size: 1.4rem;
}

.score {
    display: flex;
    gap: 1rem;
}

.player-x, .player-o {
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.player-x {
    background: #fed7d7;
    color: #c53030;
}

.player-o {
    background: #bee3f8;
    color: #2b6cb0;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 10px;
    margin: 2rem auto;
    max-width: 300px;
    background: #4a5568;
    padding: 10px;
    border-radius: 15px;
}

.cell {
    aspect-ratio: 1;
    background: white;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cell:hover {
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.cell.x {
    color: #e53e3e;
    background: #fed7d7;
}

.cell.o {
    color: #3182ce;
    background: #bee3f8;
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.cell.winning {
    background: #48bb78 !important;
    color: white !important;
    animation: pulse 0.8s ease-in-out;
}

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

.game-status {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 1rem 0;
    min-height: 2rem;
}

.game-status.winner {
    color: #48bb78;
    animation: bounce 1s ease-in-out;
}

.game-status.draw {
    color: #ed8936;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#resetBtn {
    background: #4299e1;
    color: white;
}

#resetBtn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

#newGameBtn {
    background: #48bb78;
    color: white;
}

#newGameBtn:hover {
    background: #38a169;
    transform: translateY(-2px);
}

/* 響應式設計 */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .buttons {
        flex-direction: column;
    }
}
