html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font-family: 'Josefin Sans', sans-serif;    
    vertical-align: baseline;
}

body {
    font-family: 'Josefin Sans', sans-serif;
}

ol, ul {
    list-style: none;
}

em {
    font-style: italic;
}

.brown-button {
    -moz-box-shadow: 3px 4px 0px 0px #0072A2; /* Light Blue */
    -webkit-box-shadow: 3px 4px 0px 0px #0072A2; /* Light Blue */
    box-shadow: 3px 4px 0px 0px #0072A2; /* Light Blue */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #00A8E0), color-stop(1, #00A8E0)); /* Light Blue */
    background: -moz-linear-gradient(top, #00A8E0 5%, #00A8E0 100%); /* Light Blue */
    background: -webkit-linear-gradient(top, #00A8E0 5%, #00A8E0 100%); /* Light Blue */
    background: -o-linear-gradient(top, #00A8E0 5%, #00A8E0 100%); /* Light Blue */
    background: -ms-linear-gradient(top, #00A8E0 5%, #00A8E0 100%); /* Light Blue */
    background: linear-gradient(to bottom, #00A8E0 5%, #00A8E0 100%); /* Light Blue */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00A8E0', endColorstr='#00A8E0',GradientType=0); /* Light Blue */
    background-color: #00A8E0; /* Light Blue */
    -moz-border-radius: 0.2em;
    -webkit-border-radius: 0.2em;
    border-radius: 0.3em;
    border: 1px solid #0072A2; /* Light Blue */
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0px 1px 0px #0072A2; /* Light Blue */
}

.brown-button:hover {
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0072A2), color-stop(1, #0072A2)); /* Light Blue */
    background: -moz-linear-gradient(top, #0072A2 5%, #0072A2 100%); /* Light Blue */
    background: -webkit-linear-gradient(top, #0072A2 5%, #0072A2 100%); /* Light Blue */
    background: -o-linear-gradient(top, #0072A2 5%, #0072A2 100%); /* Light Blue */
    background: -ms-linear-gradient(top, #0072A2 5%, #0072A2 100%); /* Light Blue */
    background: linear-gradient(to bottom, #0072A2 5%, #0072A2 100%); /* Light Blue */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0072A2', endColorstr='#0072A2',GradientType=0); /* Light Blue */
    background-color: #0072A2; /* Light Blue */
}

.brown-button:active {
    position: relative;
    top: 0.15em;
}

.brown-button:focus {
    outline-color: #D7CCC8;
}

h1 {
    text-align: center;
    font-size: 2em;
    padding: 0.6em;
    text-decoration: underline;
}

.tool-tip {
    float: right;
    margin-top: -3.7em;
    margin-right: 0.3em;
    position: relative;
}

.tool-tip button {
    background: none;
    border: none;
    color: #000000;
    font-size: 1.6em;
    font-weight: 900;
}

.tool-tip .tool-tip-text {
    visibility: hidden;
    width: 5.5em;
    background-color: #000000;
    color: #FFFFFF;
    text-align: center;
    padding: 5px 0;
    position: absolute;
    top: 2.1em;
    right: 0;
    z-index: 1;
    border-radius: 0.3em;
}

.tool-tip:hover .tool-tip-text{
    visibility: visible;
    right: 2em;
}

.game-status-details {
    display: flex;
    flex-wrap: wrap;
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.3em;
    text-align: center;
}

.rating,
.move-counter,
.timer,
.restart-btn {
    width: 100%;
}

.move-counter, .timer {
    font-size: 1.3em;
}

.rating {
    font-size: 1.4em;
    color: #00A8E0; /* Light Blue */
    display: inline;
}

.star {
    margin-left: -10px;
}

.star:first-child {
    margin-left: 0 !important;
}

.restart-btn {
    background: none;
    border: none;
    color: #000000;
    font-size: 1.6em;
    font-weight: 900;
}

.game-board {
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    background-color: #00A8E0; /* Light Blue */
    border-radius: 0.3em;
    box-shadow: 0 5px 5px #808080;
}

.game-grid-row {
    display: flex;
    flex-wrap: nowrap;
}

.game-card {
    width: 4.5em;
    height: 4.5em;
    background-color: #0072A2; /* Lighter Blue */
    border-radius: 0.3em;
    margin: 0.8em;
    box-shadow: 2px 0 10px #0072A2; /* Lighter Blue */
    cursor: pointer;
}

.game-card-img {
    visibility: hidden;
    object-fit: cover;
    width: 4.5em;
    height: 4.5em;
}

.restart-button-div {
    max-width: 50%;
    margin: 1.5em auto;
    text-align: center;
}

.restart-button { 
    padding: 0.7em 1.4em;
}

/* Game Over Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    width: 80%;
    margin: auto;
    padding: 0;
    position: relative;
    top: 5%;
    background-color: #00A8E0; /* Light Blue */
    border: 1px solid #808080;
    border-radius: 0.5em;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    animation: animateTop 0.4s;
}

.modal-header {
    border-bottom: 1px solid #00A8E0; /* Light Blue */
    padding: 0.6em 1em;
    font-size: 2em;
    font-weight: bold;
}

.modal-body {
    padding: 1.6em 0.3em 1em;
    color: #FFFFFF; /* Whitish color */
    font-size: 1.6em;

}

.modal-body .message {
    text-align: center;
    color: #FFFFFF; /* Whitish color */

}

.modal-body .message p {
    margin-bottom: 0.5em;
}

.game-over-icons {
    animation: animateIcons 3s linear infinite;
    position: relative;
}

.modal-footer {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 0 1em 1.5em;
}

.modal-footer button {
    padding: 0.3em 1em;
    width: 50%;
    color: #FFFFFF; /* Whitish color */
    background-color: #00A8E0; /* Light Blue */
    border: none;
    cursor: pointer;}

.close {
    font-size: 2em;
    float: right;
    margin-right: 0.8em;
    margin-top: 0.2em;
    font-weight: bold;
    color: #0072A2; /* Lighter Blue */
    position: relative;
    animation: animateCloseIcon 5s linear 2s infinite;
}

.close:hover, .close:focus {
    color: #00A8E0; /* Light Blue */
    cursor: pointer;
}

/* Page Footer */
.page-footer {
    border-top: 1px solid #00A8E0; /* Light Blue */
    padding: 0.5em 0;
    text-align: center;
    font-size: 1.3em;
}

.page-footer-link {
    color: #0072A2; /* Lighter Blue */
    font-weight: 700;
}

.page-footer-link:hover {
    color: #212121;
    font-weight: 900;
    letter-spacing: 1px;
}

.page-footer-link:active {
    text-decoration: none;
}

.page-footer-link:focus {
    outline: #00A8E0 auto 5px; /* Light Blue */
}

.page-footer-link:visited {
    color: #3E2723;
}

.show-img {
    visibility: visible;
    animation: animateShowImage 0.4s linear alternate;
}

.disabled {
    pointer-events: none;
}

.show-modal {
    display: block;
}

/* How to Play Modal */
.modal-body .help-tips {
    padding: 0 1.5em;
}

/* Animations */
@keyframes animateTop {
    from { top: -300px; opacity: 0; }
    to { top: 5%; opacity: 1; }
}

@-moz-keyframes animateTop {
    from { top: -300px; opacity: 0; }
    to { top: 5%; opacity: 1; }
}

@-webkit-keyframes animateTop {
    from { top: -300px; opacity: 0; }
    to { top: 5%; opacity: 1; }
}

@keyframes animateIcons {
    0% { top: 0em; left: 0em; }
    40% { top: 0em; left: 0em; }
    43% { top: -0.7em; left: 0em; }
    46% { top: 0em; left: -0.3em; }
    48% { top: -0.4em; left: 0.3em; }
    50% { top: 0em; left: 0em; }
    100% { top: 0em; left: 0em; }
}

@-moz-keyframes animateIcons {
    0% { top: 0em; left: 0em; }
    40% { top: 0em; left: 0em; }
    43% { top: -0.7em; left: 0em; }
    46% { top: 0em; left: -0.3em; }
    48% { top: -0.4em; left: 0.3em; }
    50% { top: 0em; left: 0em; }
    100% { top: 0em; left: 0em; }
}

@-webkit-keyframes animateIcons {
    0% { top: 0em; left: 0em; }
    40% { top: 0em; left: 0em; }
    43% { top: -0.7em; left: 0em; }
    46% { top: 0em; left: -0.3em; }
    48% { top: -0.4em; left: 0.3em; }
    50% { top: 0em; left: 0em; }
    100% { top: 0em; left: 0em; }
}

@keyframes animateCloseIcon {
    0% { top: 0em; }
    40% { top: 0em; }
    43% { top: -0.2em; }
    46% { top: 0em; }
    48% { top: 0.2em; }
    50% { top: 0em; }
    100% { top: 0em; }
}

@-moz-keyframes animateCloseIcon {
    0% { top: 0em; }
    40% { top: 0em; }
    43% { top: -0.1em; }
    46% { top: 0em; }
    48% { top: 0.1em; }
    50% { top: 0em; }
    100% { top: 0em; }
}

@-webkit-keyframes animateCloseIcon {
    0% { top: 0em; }
    40% { top: 0em; }
    43% { top: -0.1em; }
    46% { top: 0em; }
    48% { top: 0.1em; }
    50% { top: 0em; }
    100% { top: 0em; }
}

@keyframes animateShowImage {
    0% { transform: rotateY(90deg); opacity: 0;}
    100%{ transform: rotateY(0); opacity: 1; }
}

@-webkit-keyframes animateShowImage {
    0% { transform: rotateY(90deg); opacity: 0;}
    100%{ transform: rotateY(0); opacity: 1; }
}

@-moz-keyframes animateShowImage {
    0% { transform: rotateY(90deg); opacity: 0;}
    100%{ transform: rotateY(0); opacity: 1; }
}

/* Media Queries */
@media only screen and (max-width: 600px) {
    .modal-footer button {
        padding: 0.3em 0.3em;
        width: 50%;
    }
}

@media only screen and (min-width: 600px) and (max-width: 767px) {
    .game-card, .game-card-img {
        width: 5em;
        height: 5em;
    }

    /* How to Play Modal */
    .modal-body .help-tips {
        padding: 0 2em;
    }
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .game-card, .game-card-img {
        width: 5.5em;
        height: 5.5em;
    }

    /* How to Play Modal */
    .modal-body .help-tips {
        padding: 0 2.5em;
    }
}

@media only screen and (min-width: 992px) {
    .game-status-details {
        display: block;
    }

    .rating,
    .move-counter,
    .timer,
    .restart-btn {
        width: initial;
    }

    .game-card, .game-card-img {
        width: 6em;
        height: 6em;
    }

    /* How to Play Modal */
    .modal-body .help-tips {
        padding: 0 3em;
    }
}
/* Your existing CSS here */

/* Media Queries */
@media only screen and (max-width: 600px) {
    .modal-footer button {
        padding: 0.3em 0.3em;
        width: 50%;
    }

    .game-card, .game-card-img {
        width: 2.5em;
        height: 2.5em;
    }

    /* Adjust any other styles for screens up to 600px wide */
}

@media only screen and (min-width: 600px) and (max-width: 767px) {
    .game-card, .game-card-img {
        width: 5em;
        height: 5em;
    }

    /* Adjust any other styles for screens between 600px and 767px wide */
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .game-card, .game-card-img {
        width: 5.5em;
        height: 5.5em;
    }

    /* Adjust any other styles for screens between 768px and 991px wide */
}

@media only screen and (min-width: 992px) {
    .game-status-details {
        display: block;
    }

    .rating,
    .move-counter,
    .timer,
    .restart-btn {
        width: initial;
    }

    .game-card, .game-card-img {
        width: 6em;
        height: 6em;
    }

    /* Adjust any other styles for screens larger than 991px wide */
}
