* {
    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;
}

.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

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

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

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.player-label {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    color: white;
}

.player-label.black {
    background: #2d3748;
}

.player-label.white {
    background: #a0aec0;
    color: #2d3748;
}

#black-score, #white-score {
    font-size: 1.5em;
    font-weight: bold;
    color: #4a5568;
}

.current-player {
    font-size: 1.2em;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 15px;
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.new-game-btn, .restart-btn, .fullscreen-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fullscreen-btn {
    background: linear-gradient(45deg, #48bb78, #38a169);
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-game-btn:hover, .restart-btn:hover, .fullscreen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.fullscreen-btn:hover {
    background: linear-gradient(45deg, #38a169, #2f855a);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    background: #2d3748;
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto;
    width: 400px;
    height: 400px;
}

.cell {
    background: #48bb78;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cell:hover {
    background: #38a169;
}

.cell.valid-move {
    background: #68d391;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.cell.valid-move::after {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed #fff;
}

.piece {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.piece.black {
    background: #2d3748;
}

.piece.white {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
}

.piece.flipping {
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg) scale(0.8); }
    100% { transform: rotateY(0deg); }
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over.hidden {
    display: none;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.game-over-content h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 2em;
}

/* Fullscreen styles */
.game-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    padding: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-container.fullscreen .game-board {
    width: min(80vh, 80vw);
    height: min(80vh, 80vw);
    max-width: 600px;
    max-height: 600px;
}

.game-container.fullscreen .piece {
    width: calc(min(80vh, 80vw) / 8 * 0.7);
    height: calc(min(80vh, 80vw) / 8 * 0.7);
    max-width: 50px;
    max-height: 50px;
}

.game-container.fullscreen .cell.valid-move::after {
    width: calc(min(80vh, 80vw) / 8 * 0.4);
    height: calc(min(80vh, 80vw) / 8 * 0.4);
    max-width: 30px;
    max-height: 30px;
}

.game-container.fullscreen h1 {
    font-size: 3em;
    margin-bottom: 15px;
}

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

.fullscreen-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.fullscreen-exit-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-board {
        width: 320px;
        height: 320px;
    }
    
    .piece {
        width: 28px;
        height: 28px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .game-container.fullscreen {
        padding: 10px;
    }
    
    .game-container.fullscreen h1 {
        font-size: 2.5em;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 10px;
    }
}