* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.lang-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 32px;
    transition: all 0.3s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.lang-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.lang-btn:active {
    transform: scale(0.95);
}

.lang-btn.active {
    background: #333;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.2);
}

/* Setup Screen */
.setup-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
}

.setup-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"] {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #333;
}

/* Color Palette */
.color-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.color-palette input[type="radio"] {
    display: none;
}

.color-palette label {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
}

.color-palette label:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.color-palette label:active {
    transform: scale(1.05);
}

.color-palette input[type="radio"]:checked + label {
    border: 3px solid #333;
    box-shadow: 0 0 0 2px white, 0 0 0 5px #333;
    transform: scale(1.15);
}

.btn {
    padding: 15px 30px;
    background: #333;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn:hover {
    background: #555;
}

.btn:active {
    transform: scale(0.98);
}

.error-message {
    color: #d32f2f;
    text-align: center;
    min-height: 20px;
    font-size: 14px;
}

/* Game Screen */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.game-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 900px;
}

.game-header h1 {
    color: #333;
    margin-bottom: 15px;
}

.player-info {
    margin: 15px 0;
}

.player-turn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.piece-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #333;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

#gameBoard {
    background: #FFFFFF;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: crosshair;
    touch-action: none;
}

.win-message {
    background: white;
    padding: 30px 50px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

@media (max-width: 768px) {
    .setup-container {
        padding: 30px 20px;
    }
    
    .game-header {
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .color-palette {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .color-palette label {
        width: 60px;
        height: 60px;
    }
    
    .lang-btn {
        font-size: 28px;
        padding: 8px 16px;
    }
}
