html {
    background-image: url(blankbackground.svg);
    background-repeat: no-repeat;
    background-position: absolute;
    background-attachment: fixed;
    background-size: cover;
}

@font-face {
    font-family: 'Nintendo-DS';
    src: url('Nintendo-DS-BIOS.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 40px;
    font-family: 'Nintendo-DS', sans-serif;
}

.h1-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 80px;
}

h1 {
    display: flex;
    align-items: center;
    border: 4px solid hwb(0 45% 55%);
    width: 500px;
    text-align: center;
    font-size: 44px;
    line-height: 50px;
    letter-spacing: 10px;
    padding: 20px;
    background: linear-gradient(to bottom, #ffffff, #bbbbbb);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.692);
}

h1 img {
    width: 128px;
    height: auto;
    margin-right: 10px;
}

.h1-text {
    flex-grow: 1;
    text-align: center;
}

#grid-container {
    display: grid;
    gap: 48px;
    justify-items: center;
}

.grid-item {
    position: relative;
    border: 4px solid hwb(0 45% 55%);
    padding: 12px;
    padding-bottom: 2px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    background: linear-gradient(to bottom, #ffffff, #bbbbbb);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 200px;
    height: 240px;
}

.grid-item::before,
.grid-item::after,
.grid-item .corner {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 10px solid #000000; /* Highlight color */
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-item::before {
    top: -7px;
    left: -7px;
    border-top-left-radius: 10px;
    border-right: none;
    border-bottom: none;
}

.grid-item::after {
    bottom: -7px;
    right: -7px;
    border-bottom-right-radius: 10px;
    border-left: none;
    border-top: none;
}

.grid-item .top-right-corner {
    top: -7px;
    right: -7px;
    border-top-right-radius: 10px;
    border-left: none;
    border-bottom: none;
}

.grid-item .bottom-left-corner {
    bottom: -7px;
    left: -7px;
    border-bottom-left-radius: 10px;
    border-right: none;
    border-top: none;
}

.grid-item:hover::before,
.grid-item:hover::after,
.grid-item:hover .corner {
    opacity: 1;
}

.grid-item:hover, #home:hover, #sort:hover {
    transform: scale(1.05);
}

h3 {
    margin-top: 4px;
    margin-bottom: 4px;
    margin-left: 0px;
    margin-right: 0px;
    font-size: 20px;
    line-height: 16px;
}

.cover-image {
    max-width: 90%;
    max-height: 70%;
    margin-bottom: 4px;
    border: 2px solid #474747;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.644);
    background-color: #797979;
    transition: transform 0.1s;
}

.cover-image:hover {
    transform: scale(1.05);
}

.hidden-images {
    display: none;
}

#home {
    top: 10%; 
    left: 15%; 
    cursor: pointer;
    transition: transform 0.2s;
}

#home button {
    background-size: cover;
    height: 100px;
    width: 100px;
    margin-right: 40px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid hwb(0 45% 55%); 
    background-image: url(home.png);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.692);

}

#sort {
    top: 10%; 
    margin-left: 5%; 
    cursor: pointer;
    transition: transform 0.2s;
}

#sort button {
    background-size: cover;
    height: 100px;
    width: 100px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid hwb(0 45% 55%); 
    background-image: url(sort.png);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.692);
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.801);
    display: flex;
    justify-content: center;
    display: none;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 540px;
    height: 720px;
    border: 10px solid #797979;
    border-radius: 10px;
    background-color: #ffffff;
    display: flex;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.644);
}

.popup-title {
    position: absolute;
    display: block;
    font-size: 40px;
    top: 10px;
    left: 40px;
    right: 240px;
}

.popup-author {
    position: absolute;
    display: block;
    font-size: xx-large;
    top: 110px;
    left: 40px;
}

.popup-specifications{
    position: absolute;
    display: block;
    line-height: 25px;
    font-size: 25px;
    white-space: pre-wrap;
    top: 190px;
    left: 40px;
}

.popup-image {
    position: absolute;
    top: 40px;
    right: 70px;
    max-width: 250px;
    max-height: 250px;
    display: block;
    margin: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.644);
    border: 2px solid #474747;
}

.popup-description {
    position: absolute;
    display: block;
    top: 300px;
    left: 40px;
    margin-right: 30px;
    line-height: 25px;
    font-size: 25px;
    white-space: pre-wrap;
}

.popup-price {
    position: absolute;
    display: block;
    font-size: xx-large;
    top: 620px;
    left: 140px;
}

.popup-buy {
    position: absolute;
    display: block;
    font-size: xx-large;
    top: 646px;
    margin-left: 120px;
    background-color: #797979;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.644);
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 30px;
    padding-right: 30px;
    border: 2px solid #474747;
    border-radius: 4px;
    color: #ebebeb;
    text-decoration: none;
}

.popup-close {
    position: absolute;
    top: 5px;
    right: 5px;
    color: rgb(0, 0, 0);
    cursor: pointer;
    font-size: 48px;
}

.ribbon {
    position: absolute;
    color: rgb(0, 0, 0);
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    text-align: center;
    top: 0;
    right: 0;
    border-radius: 0 6px 0 6px;
    font-size: medium;
}

.popup-ribbon {
    position: absolute;
    top: 50px;
    right: 80px;
    padding: 5px 10px;
    color: rgb(0, 0, 0);
    font-weight: bold;
    border-radius: 5px;
    display: none;
    z-index: 10;
}

.new-ribbon {
    background-color: rgb(0, 255, 0);
}

.sale-ribbon {
    background-color: red;
}

.outofstock-ribbon {
    background-color: rgb(167, 167, 167);
}

.preorder-ribbon {
    background-color: rgb(255, 244, 95);
}

/*.popup-nav {
    position: absolute;
    top: 10%;
    width: 50%;
    height: 90%;
}

.popup-nav.left {
    left: 0;
    cursor: url('left.cur'), w-resize;
}

.popup-nav.right {
    right: 0;
    cursor: url('right.cur'), e-resize;
}*/

/* Mobile styles */
@media (max-width: 767px) {
    body {
        margin: 20px;
    }

    .h1-container {
        margin-bottom: 40px;
    }

    h1 {
        border: 3px solid hwb(0 45% 55%);
        width: 100%;
        font-size: 20px;
        padding: 14px;
        margin-left: 0px;
        margin-right: 0px;
        letter-spacing: 6px;
        line-height: 24px;
    }

    h1 img {
        width: 42px;
        margin-right: 5px;
    }

    #grid-container {
        gap: 6px;
    }

    .grid-item {
        width: 100px;
        height: 120px;
        padding: 6px;
        font-size: 12px;
    }
    
    h3 {
        margin: 2px;
        font-size: 14px;
        font-weight: lighter;
        line-height: 10px;
    }

    #home, #home button {
        margin-right: 5px;
    }

    #sort, #sort button {
        margin-left: 5px;
        margin-right: 0px
    }
    
    #home button, #sort button {
        height: 60px;
        width: 60px;
    }

    .cover-image {
        max-width: 90px;
        max-height: 70px;
        margin-bottom: 6px;
    }

    .ribbon {
        font-size: 12px;
        padding: 4px;
    }

    .popup-content {
        top: 40px;
        width: 350px;
        height: 600px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .popup-title {
        font-size: 30px;
        top: 10px;
        left: 25px;
        right: 170px;
    }
    
    .popup-author {
        font-size: 26px;
        top: 90px;
        left: 25px;
        right: 170px;
    }

    .popup-specifications {
        font-size: 20px;
        top: 145px;
        left: 25px;
        right: 170px;
        line-height: 20px;
        white-space: pre-wrap;
    }
    
    .popup-image {
        top: 40px;
        right: 25px;
        max-width: 180px;
        max-height: 180px;
    }
    
    .popup-description {
        position: absolute;
        display: block;
        font-size: 20px;
        top: 220px;
        left: 25px;
        margin-right: 30px;
        line-height: 20px;
    }
    
    .popup-price {
        font-size: xx-large;
        top: 86%;
        left: 80px;
    }
    
    .popup-buy {
        font-size: x-large;
        top: 90.5%;
        margin-left: 0px;
    }

    .popup-close {
        font-size: 38px;
    }

    .popup-ribbon {
        right: 30px
    }
}