:root {
    --bg-color: #0b0c10;
    --panel-bg: rgba(31, 40, 51, 0.4);
    --border-color: rgba(69, 162, 158, 0.3);
    --text-color: #c5c6c7;
    --highlight: #66fcf1;
    --glass-blur: blur(10px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at center, #1f2833 0%, #0b0c10 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: none; /* Prevent scroll on mobile */
}

.game-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 200px;
}

.glass-box {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: center;
}

.glass-box h2 {
    font-size: 1.2rem;
    color: var(--text-color);
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 700;
}

.glass-box .value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--highlight);
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.5);
}

.canvas-container {
    position: relative;
    border-radius: 10px;
    padding: 10px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 30px rgba(102, 252, 241, 0.1);
}

#gameCanvas {
    background-color: rgba(0, 0, 0, 0.8);
    display: block;
    border-radius: 5px;
    box-shadow: inset 0 0 20px rgba(0,0,0,1);
}

#nextCanvas {
    display: block;
    margin: 0 auto;
}

.controls-hint {
    text-align: left;
}

.controls-hint h3 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
}

.controls-hint p {
    font-size: 0.9rem;
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.controls-hint span {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 10px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

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

.glow-text {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f, 0 0 30px #ff007f;
    margin-bottom: 30px;
    line-height: 1.1;
}

.red-glow {
    text-shadow: 0 0 10px #f00, 0 0 20px #f00, 0 0 30px #f00;
}

.overlay p {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

#finalScore {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--highlight);
}

.neon-button {
    background: transparent;
    border: 2px solid var(--highlight);
    color: var(--highlight);
    padding: 15px 40px;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.neon-button:hover {
    background: var(--highlight);
    color: #000;
    box-shadow: 0 0 20px var(--highlight);
}

/* Mobile Controls */
.hidden-desktop {
    display: none;
}

.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

.action-buttons {
    width: 100%;
}

.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.d-pad-row {
    display: flex;
    gap: 15px;
}

.glass-btn {
    background: rgba(31, 40, 51, 0.7);
    border: 1px solid var(--highlight);
    color: var(--highlight);
    border-radius: 10px;
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(102, 252, 241, 0.2);
    cursor: pointer;
    font-family: inherit;
    text-align: center;
}

.glass-btn:active {
    background: var(--highlight);
    color: #000;
    transform: scale(0.95);
}

.icon-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rotate-btn {
    width: 150px;
    height: 50px;
}

#btnDrop {
    width: 100%;
    padding: 15px;
}

/* Responsividade básica */
@media (max-width: 900px) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 10px;
        gap: 10px;
    }
    
    .panel {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        gap: 10px;
    }

    .left-panel {
        order: 1;
        flex-wrap: wrap;
    }

    .glass-box {
        flex: 1;
        min-width: 80px;
        padding: 10px;
    }

    .glass-box h2 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .glass-box .value {
        font-size: 1.4rem;
    }
    
    .controls-hint, .right-panel {
        display: none; /* Hide hints and next piece on very small screens to save space */
    }
    
    .canvas-container {
        order: 2;
        width: 100%;
        max-width: 320px;
        display: flex;
        justify-content: center;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .hidden-desktop {
        display: flex; /* Show mobile controls */
        order: 3;
    }
}
