* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    display: flex;
    gap: 15px;
    padding: 10px;
    background-color: #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 120px;
}

.game-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

#gameCanvas {
    order: 2;
    background-color: #000000;
    border: 2px solid #444;
    border-radius: 5px;
}

#nextCanvas {
    background-color: #000000;
    border: 2px solid #444;
    border-radius: 5px;
}

.control-panel {
    background-color: rgba(42, 42, 42, 0.9);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 150px;
}

.control-panel h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.control-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 15px;
    width: 100%;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.key {
    background-color: #444;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: monospace;
    min-width: 20px;
    text-align: center;
    font-size: 0.9em;
}

.key-desc {
    color: #ccc;
    font-size: 0.9em;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.buttons button {
    padding: 10px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.buttons button:hover {
    background-color: #45a049;
}

#pauseBtn {
    background-color: #f44336;
}

#pauseBtn:hover {
    background-color: #da190b;
}

.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 5px;
}

.pause-screen.active {
    display: flex;
}

.pause-screen h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.pause-screen p {
    font-size: 1.2em;
    color: #ccc;
}

.score, .level {
    font-size: 1.2em;
    padding: 10px;
    background-color: #333;
    border-radius: 5px;
}

.next-piece h3 {
    margin-bottom: 10px;
    color: #888;
}

.settings-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(42, 42, 42, 0.95);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: none;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.settings-menu.active {
    display: block;
}

.settings-menu h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.settings-menu h3 {
    color: #fff;
    margin: 10px 0;
    font-size: 1.2em;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.settings-section {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
    width: 100%;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding: 5px 10px;
}

.setting-item label {
    color: #ccc;
    font-size: 1em;
    min-width: 120px;
}

.setting-item input[type="range"] {
    width: 200px;
    height: 6px;
    background: #444;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.settings-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.settings-buttons button {
    padding: 10px 20px;
    font-size: 1em;
    min-width: 100px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#saveSettings {
    background-color: #4CAF50;
    color: white;
}

#saveSettings:hover {
    background-color: #45a049;
}

#closeSettings {
    background-color: #666;
    color: white;
}

#closeSettings:hover {
    background-color: #777;
}

#settingsBtn {
    background-color: #2196F3;
}

#settingsBtn:hover {
    background-color: #1976D2;
}

.touch-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.touch-controls.left {
    order: 1;
}

.touch-controls.right {
    order: 3;
}

.touch-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s;
}

.touch-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

#rotateBtn {
    background-color: rgba(33, 150, 243, 0.3);
}

#softDropBtn {
    background-color: rgba(76, 175, 80, 0.3);
}

#hardDropBtn {
    background-color: rgba(244, 67, 54, 0.3);
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        padding: 5px;
        gap: 5px;
        max-width: 100vw;
        margin: 0 auto;
    }

    .game-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
        padding: 5px;
    }

    .next-piece {
        transform: scale(0.8);
    }

    .control-panel {
        width: 100%;
        padding: 8px;
    }

    .buttons {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }

    .touch-btn {
        width: 45px;
        height: 45px;
        font-size: 0.8em;
    }

    .touch-controls {
        padding: 3px;
        gap: 8px;
    }

    .game-area {
        gap: 5px;
    }

    body {
        padding: 5px;
    }

    .settings-menu {
        width: 90%;
        padding: 15px;
    }

    .setting-item {
        gap: 10px;
    }

    .setting-item input[type="range"] {
        width: 150px;
    }
} 