body {
    font-family: sans-serif;
    background:#5979c4 ;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}


.board {
    display: grid;
    grid-template-columns: repeat(8, 40px);
    grid-template-rows: repeat(8, 40px);
    gap: 2px;
    border: 2px solid #000000;
    padding: 10px;
    background: #22263c;
}

.cell {
    width: 40px;
    height: 40px;
    background-color: #34395b;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}




.cell.ghost-preview {
    opacity: 0.6;
}

.cell.potential-completion {
    animation: completion-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes completion-pulse {
    0% {
        box-shadow: 0 0 10px #FFFF, inset 0 0 5px #FFFF;
        filter: brightness(1.2);
    }
    100% {
        box-shadow: 0 0 20px #FFFF, inset 0 0 10px #FFFF;
        filter: brightness(1.4);
    }
}


.cell.line-clear-flash {
    animation: line-clear-flash 0.2s ease-out;
}

.cell.line-clear-scale {
    animation: line-clear-scale 0.3s ease-out;
}

.cell.line-clear-disappear {
    animation: line-clear-disappear 0.4s ease-out forwards;
}

@keyframes line-clear-flash {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(2);
        box-shadow: 0 0 20px #FFD700, inset 0 0 10px #FFD700;
    }
    100% {
        filter: brightness(1.5);
    }
}

@keyframes line-clear-scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 15px #FF6B6B, inset 0 0 8px #FF6B6B;
    }
    100% {
        transform: scale(1.1);
    }
}

@keyframes line-clear-disappear {
    0% {
        transform: scale(1.1);
        opacity: 1;
        filter: brightness(1.5);
    }
    25% {
        transform: scale(1.3) rotate(5deg);
        opacity: 0.8;
        filter: brightness(2);
    }
    50% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0.6;
        filter: brightness(1.8);
    }
    75% {
        transform: scale(0.4) rotate(10deg);
        opacity: 0.3;
        filter: brightness(1.2);
    }
    100% {
        transform: scale(0) rotate(15deg);
        opacity: 0;
        filter: brightness(0.5);
    }
}

.cell.dissolve {
    animation: dissolve 1.0s ease-out forwards;
}

@keyframes dissolve {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
        filter: brightness(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
        filter: brightness(0.5);
    }
}

.blocks {
    margin-top: 20px;
}

.pieces {
    position: relative;
    margin: 20px;
    height: 100px;
    flex-direction: row;
    width: 700px;
}

.piece1 {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 4px;
    user-select: none;
    position: absolute;
    top: 20px;
    left: 20px;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.piece2 {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 4px;
    user-select: none;
    position: absolute;
    top: 20px;
    left: 300px;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.piece3 {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 4px;
    user-select: none;
    position: absolute;
    top: 20px;
    left: 580px;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.piece.dragging {
    filter: brightness(1.1);
    transform: scale(1.0);
}



.block {
    width: 40px;
    height: 40px;
    background: transparent;
    margin: 1px;
    border-radius: 4px;
    transition: opacity 0.5s ease;
}

#score {
    font-size: 24px;
    font-weight: bold;
    color: white;
}


.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: #F26C52;
    text-align: center;
    flex-direction: column;
}

.replay-button {
    color: white;
    font-size: 14;
    padding: 10px;
    background-color: #F26C52;
}

.replay-button:hover {
    background-color: #f59986;
}

.high-score-container {
    font-weight: bold;
    color: gold;
    background-color: transparent;
    position: absolute;
    top: 20px;
    left: 20px;
}

.high-score-container p {
    font-size: 30px;
    font-weight: bold;
    margin: 0;
}

.sound-button {
    background-color: transparent;
    padding: 3px;
    margin-top: 10px;
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.sound-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

