@font-face {
    font-family: "Jolly Lodger";
    src: url(assets/fonts/JollyLodger-Regular.ttf) format('truetype');
}

@font-face {
    font-family: "Special Elite";
    src: url(assets/fonts/SpecialElite-Regular.ttf) format('truetype');
}

@font-face {
    font-family: "Lacquer";
    src: url(assets/fonts/Lacquer-Regular.ttf) format('truetype');
}

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

h1 {
    font-family: "Jolly Lodger", "Arial", sans-serif;
    font-size: 2em;
}

h2 {
    font-family: "Special Elite", "Arial", sans-serif;
    font-size: 1.5em;
}

body {
    background-image: url("assets/images/background.jpg");
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: black;
    color: white;
    font-family: "Jolly Lodger", "Arial", sans-serif;
    width: 100%;
    height: 100px;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
}

.gradient-top {
    background: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.polaroid-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding-left: 48px;
    padding-right: 48px;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.polaroid {
    width: 200px;
    background-color: white;
    padding-top: 8px;
    padding-bottom: 16px;
    padding-left: 8px;
    padding-right: 8px;
    font-family: "Lacquer", "Arial", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: rotate(2deg);
    filter: grayscale(100%) contrast(80%) brightness(110%);
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.polaroid img {
    width: 100%;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    filter: grayscale(0%) contrast(110%) brightness(100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.polaroid:active {
    transform: rotate(0deg) scale(0.95);
    filter: grayscale(0%) contrast(110%) brightness(100%);
}

.upload-polaroid {
    width: 200px;
    background-color: white;
    padding-top: 8px;
    padding-bottom: 16px;
    padding-left: 8px;
    padding-right: 8px;
    font-family: "Lacquer", "Arial", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: rotate(2deg);
    filter: grayscale(100%) contrast(80%) brightness(110%);
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.upload-polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    filter: grayscale(0%) contrast(110%) brightness(100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.upload-polaroid:active {
    transform: rotate(0deg) scale(0.95);
    filter: grayscale(0%) contrast(110%) brightness(100%);
}

#dropZone {
    width: 184px;
    height: 184px;
    padding: 8px;
    border: 2px dashed burlywood;
}

.plus {
    width: 100%;
    height: 100%;
    border-radius: 100%;
    border: 2px dashed burlywood;
    font-size: 4em;
    align-items: center;
    justify-content: center;
    text-align: center;
    align-content: center;
    background-color: wheat;
}

.gradient-bottom {
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 1));
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

footer {
    background-color: black;
    color: white;
    font-family: "Special Elite", "Arial", sans-serif;
    font-size: 0.8em;
    width: 100%;
    height: 100px;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.row-boards {
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding-left: 48px;
    padding-right: 48px;

    flex-wrap: wrap;
}

.row {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding-left: 48px;
    padding-right: 48px;

    flex-wrap: wrap;
}

.board-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: wheat;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);

    margin-top: 48px;
}

#board, #puzzle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);

    width: 440px;
    height: 440px;

    gap: 2px;

    padding: 0;
    margin: 0;
}

#puzzle {
    border: 2px dashed brown;
}

.piece {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    cursor: grab;
}

.slot {
    width: 100%;
    height: 100%;
    background-color: burlywood;
    border: 2px dashed brown;
}

.board-section h2 {
    background-color: burlywood;
    transform: rotate(-2deg);
    padding: 4px;
    width: 200px;
    margin-bottom: 12px;
    text-align: center;
} 

#timer {
    background-color: burlywood;
    transform: rotate(2deg);
    padding: 4px;
    width: 96px;
    margin-bottom: 12px;
    text-align: center;
    font-family: "Special Elite", "Arial", sans-serif;
    font-size: 1.5em;
}

#win-background {
    position: fixed;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.6);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);    
}

#win-message {
    position: fixed;

    display: flex;
    flex-direction: column;
    width: 400px;
    height: 200px;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-2deg);
    background: wheat;
    padding: 12px;

    transition: all 0.3s ease;
}

#win-message:hover {
    transform: translate(-50%, -50%) rotate(0);
}

.hidden {
    display: none;
}

#win-text {
    font-family: "Special Elite", "Arial", sans-serif;
    font-size: 1em;
    text-align: center;
    color: black;

    margin-top: auto;
    margin-bottom: auto;
}

#win-button {
    background-color: lightcoral;
    border: 0;

    width: 32px;
    height: 32px;

    border-radius: 16px;

    margin-left: auto;
    transition: all 0.3s ease;
}

#win-button:hover {
    background-color: #ff4d4d;
    transform: scale(1.1);
}

#win-button:active {
    background-color: #cc0000;
    transform: scale(0.95);
}

@media (max-width: 600px) {
    .row-boards {
        flex-direction: column;
        gap: 24px;
        margin-left: 0;
        margin-right: 0;
        margin-top: 24px;
    }

    .board-section {
        padding: 12px;
    }

    #board, #puzzle {
        width: 270px;
        height: 270px;
    }

    .polaroid {
        width: 120px;
        font-size: 0.8em;
    }

    .polaroid-container {
        padding-left: 24px;
        padding-right: 24px;
    }

    .upload-polaroid {
        width: 120px;
        font-size: 0.8em;
    }

    #dropZone {
        width: 104px;
        height: 104px;
    }

    h2 {
        font-size: 1em;
        width: auto;
    }

    .board-section {
        margin-top: 0;
    }

    .board-section h2 {
        background-color: burlywood;
        transform: rotate(-2deg);
        padding: 4px;
        width: 100px;
        margin-bottom: 12px;
        text-align: center;
    } 

    #timer {
        font-size: 1em;
        width: 50px;
    }

    #win-message {
        width: 90%;
        max-width: 300px;
        height: auto;
    }
}