:root {
    --primary-color: #4a6bff;
    --secondary-color: #ff6b6b;
    --grid-color: #2d3748;
    --cell-empty: #1a202c;
    --cell-filled: #4a6bff;
    --cell-cleared: #ff6b6b;
    --text-color: #f7fafc;
    --bg-color: #1a202c;
    --ui-bg: rgba(26, 32, 44, 0.8);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.game-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--ui-bg);
    z-index: 10;
}

.score-display {
    display: flex;
    gap: 15px;
}

.score-display div {
    font-weight: bold;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#game-canvas {
    flex-grow: 1;
    width: 100%;
    background-color: var(--grid-color);
    touch-action: none;
}

.pieces-container {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: var(--ui-bg);
}

.piece-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.piece-container {
    width: 80px;
    height: 80px;
    margin-bottom: 5px;
    position: relative;
}

.rotate-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--ui-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    width: 100%;
}

.modal-content h2 {
    margin-top: 0;
    color: var(--secondary-color);
}

.modal-content button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    width: 100%;
}

@media (max-width: 600px) {
    .score-display {
        flex-direction: column;
        gap: 5px;
    }
    
    .piece-container {
        width: 60px;
        height: 60px;
    }
    
    .rotate-btn {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}