:root {
    --delay: 300ms;
    --timing: ease;
    --bg: rgba(255, 211, 0, 0.6);
}

body {
    display: flex;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Cabin', sans-serif;
    font-size: 16px;
}


.container {
    width: 100%;
}


.wrapper {
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(126.75px, 1fr));
    grid-auto-rows: 195px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px;
}


.item {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.featured {
    grid-area: 1 / span 2 / 3 / auto;
}


.item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform var(--delay) var(--timing);
}

.item:hover img {
    transform: scale(1.1);
}


.overlay {
    background: linear-gradient(transparent 50%, var(--bg));
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    color: rgba(40, 40, 40, 0.7);
}

.overlay::before {
    content: "";
    background-color: var(--bg);
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity var(--delay) var(--timing);
}

.item:hover .overlay {
    pointer-events: auto;
}

.item:hover .overlay::before {
    opacity: 1;
}

.featured .overlay {
    background: linear-gradient(transparent 75%, var(--bg));
    padding: 30px;
    font-size: 16px;
}


.title {
    position: relative;
    width: 100%;
    opacity: 0;
    transition: opacity var(--delay) var(--timing);
    z-index: 1;
}

.item:hover .title {
    opacity: 1;
}


.challenge-title {
    text-transform: uppercase;
    font-weight: bold;
    color: #282828;
}

.featured .challenge-title {
    margin-bottom: 5px;
    font-size: 24px;
}


.name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden
}


.prize {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 0;
    white-space: nowrap;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    transition: all var(--delay) var(--timing);
    z-index: 1;
}

.item:hover .prize {
    color: #282828;
    width: calc(100% - 20px);
}

.featured .prize {
    left: 20px;
    bottom: 20px;
    font-size: 24px;
}

.featured:hover .prize {
    width: calc(100% - 40px);
}


/****************** For better looking grid layout on mobile ******************/
/* @media all and (max-width: 600px) {

    .wrapper {
        padding: 15px;
    }


    .featured {
        grid-row: auto / span 1;
    }
}


@media all and (max-width: 360px) {

    .featured {
        grid-column: auto / span 2;
    }


    .featured .overlay {
        padding: 10px;
        font-size: 14px;
    }


    .featured .challenge-title {
        margin-bottom: 0;
        font-size: inherit;
    }


    .featured .prize {
        font-size: 16px;
        left: 10px;
        bottom: 10px;
    }

    .featured:hover .prize {
        width: calc(100% - 20px);
    }
} */
/******************************************************************************/



/* For a mobile carousel */
@media all and (max-width: 600px) {

    .container {
        padding: 15px 0;
        overflow-y: auto;
    }


    .wrapper {
        display: flex;
        padding: 0;
        width: calc(16 * 140px + 10px);
        max-width: none;
    }


    .item {
        margin-left: 10px;
        width: 130px;
        height: 200px;
    }

    .item:last-child {
        margin-right: 10px;
    }


    .featured .overlay {
        padding: 10px;
        font-size: 14px;
    }


    .featured .challenge-title {
        margin-bottom: 0;
        font-size: inherit;
    }


    .featured .prize {
        font-size: 16px;
        left: 10px;
        bottom: 10px;
    }

    .featured:hover .prize {
        width: calc(100% - 20px);
    }
}
