body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    touch-action: manipulation;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#board {
    width: 90vw;
    height: 90vw;
    max-width: 500px;
    max-height: 500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    border: 2px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.square {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5vw;
    cursor: pointer;
    user-select: none;
}

@media (min-width: 768px) {
    .square {
        font-size: 2rem;
    }
}

.dark {
    background-color: #769656;
}

.light {
    background-color: #eeeed2;
}

.controls {
    margin-top: 20px;
    width: 100%;
    max-width: 500px;
}

button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin: 10px;
    width: 100%;
    max-width: 200px;
}

#status {
    font-size: 1.2rem;
    margin: 10px 0;
}

/* Стили для WebApp в Telegram */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    #board {
        width: 95vw;
        height: 95vw;
    }
    
    button {
        padding: 10px 20px;
    }
}