:root {
    --bg-color: #1a1a1a;
    --primary: #E17055;
    --secondary: #FAB1A0;
    --text-color: #ffffff;
    --grid-color: #333;
    --panel-bg: rgba(0, 0, 0, 0.5);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary);
    margin: 5px 0;
    font-size: 1rem;
}

#game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-area {
    position: relative;
    border: 2px solid var(--grid-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas {
    display: block;
    background-color: #000;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 120px;
}

.panel-box {
    background: var(--panel-bg);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #333;
}

#score-display, #level-display, #lines-display, #high-score-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: white;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--primary);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.95);
}

.mobile-controls {
    display: none; /* Hidden by default, shown on mobile via media query */
    margin-top: 20px;
    width: 100%;
    justify-content: space-around;
    padding: 0 20px;
}

@media (max-width: 768px) {
    #game-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .side-panel {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .panel-box {
        padding: 5px;
    }

    #game-canvas {
        height: 60vh; /* Adjust for mobile */
        width: auto;
        aspect-ratio: 1/2;
    }

    .mobile-controls {
        display: flex;
    }

    /* Hide some panels on mobile to save space if needed */
    .side-panel.left {
        order: 2;
    }
    .side-panel.right {
        order: 3;
    }
    .game-area {
        order: 1;
    }

    .d-pad, .action-buttons {
        display: grid;
        gap: 10px;
    }

    .d-pad {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .d-pad button {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .action-buttons {
        display: flex;
        gap: 15px;
    }

    .action-buttons button {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        font-size: 1rem;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
