body {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    background: url("./Background2_.jpg") fixed  ;
    background-size: cover;
}

#board {
    width: 540px;
    height: 540px;
    
    background: url("./Soil.png");
    background-size: cover;
    border: 3px solid white;
    border-radius: 25px;
    
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
}

#board div {
    width: 180px;
    height: 180px;
    background-image: url("./Pipe.png");
    background-size: cover; 
}

#board div img {
    width: 100px;
    height: 100px;
    pointer-events: none;

    user-select: none;
    -moz-user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.header {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

#title {
    text-align: center;
    margin: 0;
}

#highscore {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-100%);

    display: inline-block;
    padding: 5px 15px;
    color: red;
    background-color: bisque;
    border: 2px solid black;
    border-radius: 20px;
    white-space: nowrap;
}

.new-record {
    animation: flash 0.8s ease-in-out;
}

@keyframes flash {
    0% {transform: translateY(-100%) scale(1); background-color: bisque;}
    50% {transform: translateY(-100%) scale(1.5); background-color: gold;}
    100% {transform: translateY(-100%) scale(1); background-color: bisque;}
}

#overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    cursor: pointer;

    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.overlay-box {
    background: #fff8dc;
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid black;
    animation: pop 0.4s ease-out;
}

.overlay-box h1 {
    margin-top: 0;
}

#finalScore, #finalHighScore {
    font-weight: normal;
}

#record {
    color: red;
    font-weight: bold;
    font-size: 18px;
}

@keyframes pop {
    from {transform: scale(0.7); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

#difficulty {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.diff-btn {
    display: block;
    width: 200px;
    margin: 15px auto;
    padding: 12px 0;
    font-size: 18px;
    font-weight: bold;

    border-radius: 20px;
    border: 2px solid black;
    background: bisque;
    cursor: pointer;
    transition: transform 0.15s , background-color 0.15s;
}

.diff-btn:hover {
    background-color: gold;
    transform: scale(1.08);
}
