/* custom font */
@font-face {
    font-family: "CustomFont";
    src: url("../fonts/Refrigerator-Deluxe.woff2") format("woff2"),
         url("../fonts/Refrigerator-Deluxe.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

/* global styles */
body {
    background-color: #222;
    color: white;
    text-align: center;
    font-family: "CustomFont", Arial, sans-serif;
    height: 100vh;
    margin: 0;
    font-size: 24px;
}

/* header */
header h1 {
    margin: 20px 0;
    font-size: 50px;
}

header img {
    display: block;
    margin: 0 auto;
    max-width: 300px;
    height: auto;
}

/* divider */
hr {
    border: 1px solid gray;
}

/* buttons */
button {
    display: block;
    width: 260px;
    margin: 20px auto;
    padding: 18px;
    font-size: 26px;
    font-weight: bold;
    background: orange;
    color: black;
    border: none;
    cursor: pointer;
    font-family: "CustomFont", Arial, sans-serif;
    text-transform: uppercase;
    border-radius: 12px;
    transition: background 0.2s ease-in-out;
}

button:hover {
    background: #ffcc66;
}

/* footer */
footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    font-size: 22px;
}

/* game and result screens */
.game-container, .result-container {
    width: 100%;
    max-width: 900px;
    padding: 25px;
    box-sizing: border-box;
}

/* center elements */
.vertical-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* image container */
.image-container {
    position: relative;
    width: min(40vh, 50vw);
    height: min(40vh, 50vw);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 5px solid orange;
    margin: 20px auto;
    background-color: black;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

@media (min-width: 2500px) {
    .image-container {
        width: min(55vh, 65vw);
        height: min(55vh, 65vw);
    }
}

/* game image */
#game-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* answer input field */
#answer-input {
    width: 70%;
    padding: 18px;
    font-size: 24px;
    margin: 20px 0;
    font-family: "CustomFont", Arial, sans-serif;
    font-weight: bold;
    text-align: center;
    border: 4px solid orange;
    border-radius: 12px;
    outline: none;
    background-color: #333;
    color: white;
}

/* timer */
#timer {
    font-size: 28px;
    color: red;
    font-weight: bold;
}

/* result screen */
#result-title {
    font-size: 55px;
    font-weight: bold;
}

#result-description {
    font-size: 30px;
    margin-top: 20px;
}

#result-feedback {
    font-size: 34px;
    font-weight: bold;
    margin-top: 20px;
}

/* continue button */
#continue-button {
    margin-top: 20px;
    padding: 20px 40px;
    font-size: 28px;
    font-family: "CustomFont", Arial, sans-serif;
    background: orange;
    color: black;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s ease-in-out;
}

#continue-button:hover {
    background: #ffcc66;
}

/* win/lose screen */
.lose-container, .win-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    text-align: center;
}

/* home/share buttons */
#home-button-win, #home-button-lose, #share-score-button {
    margin-top: 20px;
    padding: 18px 36px;
    font-size: 26px;
    font-family: "CustomFont", Arial, sans-serif;
    background: orange;
    color: black;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s ease-in-out;
}

#home-button-win:hover, #home-button-lose:hover, #share-score-button:hover {
    background: #ffcc66;
}

/* modal (for name input) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #222;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    width: 300px;
    box-shadow: 0px 0px 10px rgba(255, 165, 0, 0.7);
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

#username-input {
    width: 90%;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    border: 2px solid orange;
    background: black;
    color: white;
    border-radius: 8px;
    margin-bottom: 15px;
    outline: none;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

#submit-name, #close-modal {
    width: 48%;
    padding: 10px;
    font-size: 18px;
    background: orange;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}

#submit-name:hover, #close-modal:hover {
    background: #ffcc66;
}

/* notifications */
#copy-notification, #settings-notification {
    display: none;
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: orange;
    color: black;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0px 0px 10px rgba(255, 165, 0, 0.7);
    transition: opacity 0.5s ease-in-out;
}

/* incorrect message inside image box */
#wrong-answer-message {
    position: absolute;
    bottom: 20px; /* 20px above the bottom edge of the image box */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.85);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.7);
    transition: opacity 0.5s ease-in-out;
    display: none;
    width: max-content;
    z-index: 5;
}

#points-to-win-display {
    margin: 20px 0;
    font-size: 20px;

}

.game-header {
    width: 100%;
    height: 100px; /* Fixed height */
    background: rgba(255, 165, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    pointer-events: none;
}

/* Header Content - Centering the Logo and Text */
.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: auto;
}

/* Game Logo */
.game-logo {
    height: 50px;
    width: auto;
    margin-top: 25px;
}

/* Points Container - Allows Moving the Text Independently */
.points-container {
    position: relative;
    top: -10px; /* Moves ONLY the text up */
}

/* Points to Win Text */
#points-to-win-display {
    font-size: 22px;
    font-weight: bold;
    color: black;
}

#category-selection {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.category-box {
    width: 250px;
    height: 250px;
    background: gray;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    border: 3px solid gray; /* Default border */
    position: relative; /* Needed for text positioning */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.category-box.selected {
    border: 3px solid orange !important; /* Orange when selected */
    background: black;
}

/* Category image */
.category-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Makes sure the image fills the box */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    opacity: 0.7; /* Slight transparency so text is readable */
}

/* Category text */
.category-box span {
    position: relative;
    z-index: 1;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* Makes text readable over images */
}

