*{
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;

}

/* HOME PAGE */

.home-background {
    background-image: url("../img/homebackground2.png");
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #FFF9EF;
    width: 100%;
    padding: 30px 20px 40px;
    text-align: center;
}

.home-background h1 {
    font-family: "Fredoka", sans-serif;
    font-size: 48px;
    color: #06469B;
    margin: 0 0 25px;
}

.home-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
}

.home-card {
    width: 290px;
    height: 280px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.card-icon {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

.home-card:hover {
    transform: translateY(-10px);
}

.trivia-card {
    background-color: #DDF1FF;
}

.experiment-card {
    background-color: #FCE5EF;
}

.game-card {
    background-color: #FFF2C9;
}

.home-card h2 {
    font-family: "Fredoka", sans-serif;
    font-size: 36px;
    color: #06469B;
    margin: 0;
}

.card-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    color: white;
    font-size: 40px;
    font-weight: bold;
}

.trivia-card .card-arrow {
    background-color: #1A88E6;
}

.experiment-card .card-arrow {
    background-color: #E76592;
}

.game-card .card-arrow {
    background-color: #FFCC33;
}

/* Trivias page background */

.trivias-page {
    background-color: #FFF9EF;
    min-height: 100vh;
}

header {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}


.nav-logo img {
    width: 160px;
    height: auto;
    display: block;
}

/* NAVIGATION */

nav {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 25px;
    background-color: #FFF9EF;
}

/* Navigation links */

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Hide hamburger menu on desktop */

.menu-toggle {
    display: none;
}

.logo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

nav a {
    background-color: #FAF0E6;
    color: #003B8E;
    text-decoration: none;
    font-family: "Fredoka", sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 15px 30px;
    border-radius: 18px;
}

.nav-logo {
    margin-right: auto;
    padding: 0;
    background: none;
    border-radius: 0;
}

/* Pink button */

nav a:hover {
    background-color: #FFA4C5;
}

/* Active page */

nav a.active {
    background-color: #FFA4C5;
}

nav a.nav-logo:hover {
    background: none;
}

h1{
    font-family: "Fredoka", sans-serif;
    font-size: 70px;
    color:rgba(241, 76, 5, 0.925);
    margin-top:20px;
}

p{
    font-family: arial;
    font-size: 24px;
}

/* Trivias header image */

.trivias-header-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

/* Small trivia images */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 80%;
    justify-content: center;
    margin: 40px auto;
}

.gallery img {
    width: 100%;
    height: auto;
    border-radius: 20px;


/*Custom magnifying glass cursor*/

cursor: url("../img/triviascursor.png") 16 16, pointer;
}

/* Accessible trivia image buttons */

.trivias-page .trivia-image-button {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: url("../img/triviascursor.png") 16 16, pointer; 
    border-radius: 20px;
    overflow: hidden;
}

.trivias-page .trivia-image-button img {
    display: block;
    width: 100%;
    border-radius: 20px;
}


/* Popup */

#popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);

    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#largeImage {
    width: 800px;
    max-width: 90%;
    height: auto;
    border-radius: 20px;

    animation: popupImage 0.4s;
}


/* Popup animation */

@keyframes popupImage {

    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* Trivias close button */

.close-button {
    cursor: pointer;
    z-index: 1001;
}

footer {
    background-color: #BDE7FF;
    padding: 40px;
    font-family: "Fredoka", sans-serif;
    color: #003B8E;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-logo img {
    width: 200px;
    height: auto;
}

.footer-links a {
    display: block;
    color: #003B8E;
    text-decoration: none;
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: #FFA4C5;
}

footer p {
    font-size: 16px;
}

.copyright {
    text-align: center;
    margin-top: 30px;
}

/* EXPERIMENTS VIDEO POPUP */

#videoPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.7);

    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#videoFrame {
    width: 900px;
    max-width: 90%;
    aspect-ratio: 16 / 9;

    border: none;
    border-radius: 20px;

    animation: popupImage 0.4s;
}

/* Video close button */

.video-close {
    cursor: pointer;
    z-index: 1001;
}

/* EXPERIMENTS CUSTOM CURSOR */

.experiments-page .gallery img {
    cursor: pointer;
    z-index: 1001;
}

.experiments-page .gallery img:hover {
    cursor: url("../img/experimentscursor.png") 16 16, pointer;
}

/* EXPERIMENTS GALLERY */

/* Accessible experiment image buttons */

.experiments-page .experiment-image-button {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    cursor: url("../img/experimentscursor.png") 16 16, pointer;
}

.experiments-page .experiment-image-button img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    cursor: inherit;
}

.experiments-popup-box .video-close {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1001;
}

.experiments-popup-box .video-close img {
    display: block;
    width: 100%;
    height: 100%;
}

.experiments-page .gallery {
    grid-template-columns: repeat(2, 1fr);
}

.experiments-header-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
}

/* GAMES PAGE */

.games-page {
    background-color: #FFF9EF;
    min-height: 100vh;
    font-family: "Fredoka", sans-serif;
}

.games-page p {
    font-family: "Fredoka", sans-serif;
}

/* Games header image */

.games-header-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

/* Games gallery */

.games-page .gallery {
    grid-template-columns: repeat(2, 1fr);
}

/* Game thumbnail cursor */

.games-page .gallery img {
    cursor: pointer;
}

/* Custom cursor when hovering over game thumbnails */

.games-page .gallery img:hover {
    cursor: url("../img/gamescursor.png") 16 16, pointer;
}

/* Game popup */

#gamePopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.7);

    justify-content: center;
    align-items: center;
    flex-direction: column;

    z-index: 1000;
}

/* Embedded game */

#gameFrame {
    width: 900px;
    max-width: 90%;
    height: 600px;
    max-height: 75vh;

    border: none;
    border-radius: 20px;
    background-color: white;
    animation: popupImage 0.4s;
}

/* Game close button */

.game-close {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(420px, -340px);

    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 1001;
}

/* Game credit */

.game-credit {
    color: white;
    font-family: "Fredoka", sans-serif;
    margin-top: 15px;
    text-decoration: none;
}

.game-credit:hover {
    color: #FFA4C5;
}

/* RESPONSIVE DESIGN */

@media (max-width: 768px) {

    /* Home background on mobile */
    .home-background {
    background-image: url("../img/homebackgroundmobile.png");
    background-size: 100% 100%;
    background-position: center top;
    background-repeat: no-repeat;
    }

    /* Homepage */
    .home-background h1 {
        font-size: 34px;
    }

    .home-card {
    width: 85%;
    max-width: 260px;
    height: 240px;
    gap: 8px;
    }

    .home-card .card-icon {
    width: 100px;
    height: 100px;
    }

    .home-card h2 {
    font-size: 28px;
    }

    .home-card .card-arrow {
    width: 55px;
    height: 55px;
    font-size: 32px;

}

/* Trivias gallery on mobile */
.trivias-page .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 90%;
}

/* Experiments gallery on mobile */
.experiments-page .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 90%;
}

/* Games gallery on mobile */
.games-page .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 90%;
}

    /* Trivia popup */
    #largeImage {
        max-height: 80vh;
        object-fit: contain;
    }

    /* Games popup */
    .game-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #gameFrame {
        width: 95%;
        max-width: 95%;
        height: 80dvh;
        max-height: 85dvh;
    }

    /* Footer */
    .footer-content {
        justify-content: center;
        text-align: center;
    }

    /* Games close button on mobile */
    .game-close {
        position: fixed;
        top: 15px;
        right: 15px;
        left: auto;
        transform: none;
    }

    #videoFrame {
    width: 95%;
    max-height: 75vh;
    }

}

/* CONTACT US PAGE */

.contactus-page {
    font-family: "Fredoka", sans-serif;
}


/* CONTACT US BACKGROUND */

.contactus-background {
    background-image: url("../img/contactusbackground.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;

    width: 100%;
    min-height: 850px;
    padding: 60px 5%;

    display: flex;
    justify-content: flex-end;
    align-items: center;
}


/* CONTACT US FORM */

.contactus-background form {
    background-color: #FFF9EF;
    padding: 30px 35px;
    border-radius: 55px;

    width: 600px;
    max-width: 750px;

    font-family: "Fredoka", sans-serif;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}


/* FIRST NAME AND LAST NAME */

.contactus-form-row {
    display: flex;
    gap: 25px;
}

.contactus-form-row .contactus-field {
    flex: 1;
    min-width: 0;
}


/* FORM FIELDS */

.contactus-field {
    margin-bottom: 25px;
}

.contactus-field label {
    display: block;
    font-family: "Fredoka", sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #003B8E;
    margin-bottom: 10px;
}

.contactus-field label span {
    color: #B00020;
}


/* INPUT AND TEXT AREA */

.contactus-field input,
.contactus-field textarea {
    display: block;
    width: 100%;
    padding: 16px 18px;

    background-color: #EDF7FF;
    border: 3px solid #C6E2FA;
    border-radius: 20px;

    font-family: "Fredoka", sans-serif;
    font-size: 19px;
    color: #003B8E;
}

.contactus-field input::placeholder,
.contactus-field textarea::placeholder {
    color: #94A9C4;
}

.contactus-field input:focus,
.contactus-field textarea:focus {
    outline: none;
    border-color: #FF8DB7;
}

.contactus-field textarea {
    resize: vertical;
    min-height: 150px;
}


/* SEND FEEDBACK BUTTON */

.contactus-background .contactus-send {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;

    width: 80%;
    margin: 10px auto 0;
    padding: 20px;

    background-color: #FF6495;
    color: white;

    border: 3px solid #FF6495;
    border-radius: 50px;

    font-family: "Fredoka", sans-serif;
    font-size: 30px;
    font-weight: 600;

    cursor: url("../img/contactuscursor.png") 8 8, pointer;
    transition: background-color 0.3s ease;
}

.contactus-background .contactus-send span {
    font-size: 35px;
}



/* CONTACT US MOBILE DESIGN */

@media (max-width: 768px) {

    /* Background and layout */
    .contactus-background {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 25px;
        min-height: 750px;
        padding: 40px 15px;
    }

    /* Contact form */
    .contactus-background form {
        width: 100%;
        max-width: 500px;
        padding: 30px 20px;
        border-radius: 30px;
    }

    /* First name and last name */
    .contactus-form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Form labels */
    .contactus-field label {
        font-size: 18px;
    }

    /* Input fields */
    .contactus-field input,
    .contactus-field textarea {
        font-size: 16px;
    }

    /* Send Message button */
    .contactus-background .contactus-send {
        width: 100%;
        font-size: 22px;
    }

}


/* THANK YOU IMAGE POPUP */

.thankyou-popup {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.65);

    justify-content: center;
    align-items: center;

    padding: 20px;
    box-sizing: border-box;
    z-index: 9999;
}


/* POPUP IMAGE CONTAINER */

.thankyou-box {
    position: relative;
    width: min(1100px, 95vw, 160vh);
    max-height: 90vh;

    padding: 0;
    margin: 0;

    background: transparent;
    border-radius: 35px;
    overflow: visible;
    box-sizing: border-box;

    animation: thankYouPop 0.4s ease-out;
}

/* THANK YOU IMAGE */

.thankyou-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 35px;
}


/* YELLOW CLOSE BUTTON */

.thankyou-close {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);

    background-color: #FFCC33;
    color: #003B8E;

    border: 3px solid #FFA500;
    border-radius: 50px;

    padding: 12px 60px;

    font-family: "Fredoka", sans-serif;
    font-size: 28px;
    font-weight: 600;

    cursor: pointer;
    transition: background-color 0.3s ease;
}


/* CLOSE BUTTON HOVER */

.thankyou-close:hover {
    background-color: #87CEFA;
    border-color: #87CEFA;
}


/* MOBILE */

@media (max-width: 768px) {
    .thankyou-box {
        width: 95vw;
        border-radius: 20px;
    }

    .thankyou-close {
        bottom: 8%;
        padding: 6px 25px;
        font-size: 16px;
    }
}



/* THANK YOU CUSTOM X BUTTON */

.thankyou-x {
    position: absolute;
    top: -65px;
    right: -65px;

    width: 48px;
    height: 48px;

    padding: 0;
    border: none;
    background: transparent;

    cursor: pointer;
    z-index: 10;

    transition: transform 0.2s ease;
}

.thankyou-x img {
    display: block;
    width: 100%;
    height: 100%;
}

.thankyou-x:hover {
    transform: scale(1.15);
}

/* MOBILE */

@media (max-width: 768px) {
    .thankyou-x {
        position: absolute;
        top: -45px;
        right: 0px;
        width: 40px;
        height: 40px;
    }
}


/* THANK YOU POPUP ANIMATION */

@keyframes thankYouPop {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* CONTACT US TITLE IMAGE */

.contactus-title {
    position: absolute;
    top: 12%;
    left: 6%;
    width: 43%;
    height: auto;
    z-index: 1;
}

/* KEEP FORM ON TOP */

.contactus-background form {
    position: relative;
    z-index: 2;
}


/* CONTACT US TITLE MOBILE */

@media (max-width: 768px) {

    .contactus-title {
        position: static;
        width: 90%;
        max-width: 450px;
        height: auto;
        margin: 0 auto;
    }

}


/* MOBILE AND TABLET NAVIGATION */

@media (max-width: 768px) {

    .site-nav {
        position: relative;
        justify-content: space-between;
        flex-wrap: nowrap;
        padding: 10px 20px;
    }

    .nav-logo {
        margin-right: 0;
    }

    /* Hamburger button */

    .menu-toggle {
        display: block;
        background-color: #FFA4C5;
        color: #003B8E;
        border: none;
        border-radius: 15px;
        padding: 10px 18px;
        font-size: 28px;
        cursor: pointer;
    }

    /* Hidden navigation links */

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 20px;
        background-color: #FFF9EF;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
        z-index: 1000;
    }

    /* Show navigation when hamburger is clicked */

    .nav-links.show {
        display: flex;
    }

    /* Navigation buttons */

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        text-align: center;
        padding: 14px 20px;
        font-size: 18px;
    }

}

/* Smaller logo on mobile phones */
@media (max-width: 480px) {
    .nav-logo img {
        width: 125px;
    }
}

/* TRIVIAS TABLET DESIGN */

@media (min-width: 769px) and (max-width: 1023px) {

    .trivias-page .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        width: 90%;
    }

}


/* RESPONSIVE HOME HEADER */

.home-header {
    display: block;
    width: 100%;
}

.home-header img {
    display: block;
    width: 100%;
    height: auto;
}

/* Rounded corners for mobile header only */
@media (max-width: 768px) {
    .home-header img {
        border-radius: 20px;
    }
}


/* TRIVIAS AND EXPERIMENTS POPUP BOXES */

.trivias-popup-box,
.experiments-popup-box {
    position: relative;
    width: 90%;
    max-width: 800px;
}

.experiments-popup-box {
    max-width: 900px;
}

/* Popup image and video */

.trivias-popup-box #largeImage,
.experiments-popup-box #videoFrame {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Custom X buttons */

.trivias-popup-box .trivias-close-control,
.experiments-popup-box .video-close {
    position: absolute;
    top: -55px;
    right: 0;
    left: auto;
    transform: none;
    width: 48px;
    height: 48px;
}

.trivias-close-control {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1001;
}

.trivias-close-control img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Mobile */

@media (max-width: 768px) {

    .trivias-popup-box .trivias-close-control,
    .experiments-popup-box .video-close {
        top: -45px;
        right: 0;
        width: 40px;
        height: 40px;
    }

}

/* GAMES POPUP X BUTTON POSITION */

.game-container {
    position: relative;
    width: 90%;
    max-width: 900px;
}

.game-container #gameFrame {
    display: block;
    width: 100%;
    max-width: 100%;
}

.game-container .game-close {
    position: absolute;
    top: -55px;
    right: 0;
    left: auto;
    transform: none;
}

/* Mobile */

@media (max-width: 768px) {

    .game-container .game-close {
        position: absolute;
        top: -55px;
        right: 0;
        width: 40px;
        height: 40px;
    }

}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* GAMES CUSTOM X BUTTON */

.game-close {
    padding: 0;
    border: none;
    background: transparent;
}

.game-close img {
    display: block;
    width: 100%;
    height: 100%;
}