:root {
    --color-grey-green: rgb(160 169 158);
    --color-dark-grey: rgb(69 69 69);
    --color-light-grey: #f0f0f0;
    --color-green: rgb(145 227 145);
    --color-light-green: rgb(169, 226, 169);
    --color-blue: rgb(48 135 174);
    --color-light-blue: rgb(87 145 171);
    --color-mid-grey: rgb(200,200,200);
  }
/* Apply sans-serif font to all text on the page */
body {
    font-family: menlo, monospace;
    padding-top: 20px;
    /* Optional: You can set a base font size or other font properties here */
    /* font-size: 16px; */
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none; /* For Safari */
    -ms-user-select: none; /* For older versions of IE */
    overflow: hidden;
    height: 100%;

}

body::selection {
    background: transparent; /* Removes the highlight color */
}
/* Container for the game */
#game-container {
    position: relative;
    width: max-content;
}

/* SVG overlay */
#line-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}


/* Matrix styles */
#matrix {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    grid-gap: 5px;
    z-index: 1;
    touch-action: none;
    overflow: hidden; /* Disable scrolling on the body */
    text-transform: uppercase;
    font-weight: bold;
}

/* Cell styles */
.cell {
    position: relative;
    width: 50px;
    height: 50px;
    background-color: var(--color-light-grey);
    color:rgb(69, 69, 69);
    text-align: center;
    font-size: 24px;
    user-select: none;
    box-sizing: border-box;
    font-weight: bold;
    /* Inherit font from body */
    /* Apply bold font weight to all text within .cell */
}

/* Animation styles */
.animated-letter {
    position: absolute;
    font-size: 24px;
    color: black;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform ease, opacity ease; /* Duration handled by JavaScript */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    .cell {
        width: 45px;
        height: 45px;
        font-size: 20px;
        font-weight: bold;
    }
    #matrix {
        display: grid;
        grid-template-columns: repeat(5, 45px);
    }
    .animated-letter {
        font-size: 20px;
    }
}

@media (max-width: 400px) {
    .cell {
        width: 40px;
        height: 40px;
        font-size: 16px;
        font-weight: bold;
    }
    #matrix {
        display: grid;
        grid-template-columns: repeat(5, 40px);
    }
    .animated-letter {
        font-size: 16px;
    }
}

.cell::before {
    content: attr(data-letter);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Inherit font from parent (.cell) */
    /* No need to specify font-weight here if set on .cell */
}

.cell .clickable-area {
    position: absolute;
    top: 5px;   /* Adjust these values */
    left: 5px;
    right: 5px;
    bottom: 5px;
}

#theme-header {
    text-align: center; /* Center the text inside */
    width: 300px; /* Adjust width to fit content */
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    #theme-header {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    #theme-header {
        font-size: 12px;
    }
}

#matched-sequences {
    margin: 10px auto; /* Center the section */
    text-align: center; /* Center the text inside */
    width: 300px; /* Adjust width to fit content */
}

#win-all-message {
    margin: 20px auto; /* Center the section */
    text-align: center; /* Center the text inside */
    width: fit-content; /* Adjust width to fit content */
}

#hint-btn {
    cursor: not-allowed;
}

#hint-btn.active {
    cursor: pointer;
    background-color: var(--color-green);
}

#note {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    display: none;
}

.cell.removed {
    background-color: #fff;
}

.cell.invalid {
    background-color: #ffcccc;
}
/* Styles for the sequences list */
#sequences-list {
    list-style-type: none;
    padding: 0;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sequence-item {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    color: var(--color-dark-grey);
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    white-space: pre;
    text-transform: uppercase;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    #sequences-list {
        margin: 10px auto;
        gap: 5px;
    }

    .sequence-item {
        padding: 8px 16px;
        font-size: 16px;
        border-radius: 20px;
    }
}

@media (max-width: 400px) {
    #sequences-list {
        margin: 5px auto;
        gap: 3px;
    }

    .sequence-item {
        padding: 6px 12px;
        font-size: 14px;
        border-radius: 18px;
    }
}



/* Unmatched sequences */
.sequence-item.unmatched {
    background-color: var(--color-light-grey);
}

/* Matched sequences */
.sequence-item.matched {
    background-color: var(--color-green);
}

@keyframes shrink {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}



#win-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#win-message h1 {
    font-size: 48px;
    color: #4a4a4a;
    font-weight: bold;
    line-height: 1.2;
}

.replay_button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    background-color: var(--color-blue);
    color: white;
    font-size: 18px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.replay_button:hover {
    background-color: var(--color-light-blue);
}



@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

.main-content {
    margin-top: 90px; /* Adjust this value to match the height of your header */
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
}

.main-title {
    font-size: 30px;
    margin-bottom: 10px;
    font-weight: bold;
}

.page-header {
    top: 0;
    width: 100%;
    height: auto; /* Allow the height to adjust dynamically */
    background-color: var(--color-light-grey);
    padding: 10px 0; /* Slightly thicker padding for header */
    display: flex;
    flex-direction: column; /* Arrange elements in a column */
    align-items: inherit; /* Center elements horizontally */
    z-index: 100;
    position: fixed;
}

/* Styling for button row */
.button-row {
    display: flex;
    gap: 8px; /* Space between buttons */
}



/* Header button styling */
.header-button {
    padding: 6px 16px;
    border-radius: 25px;
    color: var(--color-dark-grey);
    font-size: 16px;
    font-weight: bold;
    background-color: var(--color-light-grey);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.header-button:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

.achievement-button{
    border:none;
}

/* Additional styling for the overlay and content remains the same */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    background-color: var(--color-light-grey);
    padding: 20px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    border-radius: 8px;
}

.win-overlay-content {
    background-color: var(--color-grey-green);
    padding: 100px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    border-radius: 8px;
    font-size: 20px;
    position: relative; /* Make it easier to use top offset */
    top: -50px; /* Adjust this value to move the content up */
    overflow-y: auto; /* Enable vertical scrolling when content overflows */
}

.return-overlay-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    border-radius: 25px;
    background-color: var(--color-dark-grey);
    color: var(--color-light-grey);
    font-size: 18px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 150px;
    font-weight: bold;
}

.return-overlay-button:hover {
    background-color: rgb(133, 133, 133);
}

.menu-overlay-button:hover {
    background-color: var(--color-light-grey);
    color: var(--color-dark-grey)
}

.menu-overlay-content {
    background-color: var(--color-light-grey);
    padding: 20px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    border-radius: 8px;

    display: flex;
    flex-direction: column;
    align-items: center; /* Optional: Aligns child items to the center horizontally */
    max-height: 80vh; /* Restrict height to fit within the viewport */
    overflow-y: auto; /* Enable vertical scrolling when content overflows */
}

.menu-overlay-button {
    display: inline-flex; /* Use inline-flex to center text */
    justify-content: center; /* Horizontally center the text */
    align-items: center; /* Vertically center the text */
    padding: 10px 20px;
    margin: 10px;
    border-radius: 25px;
    background-color: var(--color-mid-grey);
    color: white;
    font-size: 18px; /* Default font size for larger screens */
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, font-size 0.3s ease, width 0.3s ease;
    width: 400px; /* Default width for larger screens */
    font-weight: bold;
}

/* For medium screens (tablets, small desktops) */
@media (max-width: 1024px) {
    .return-overlay-button{
        font-size: 16px; /* Adjust font size for medium screens */
        width: 300px; /* Adjust width for medium screens */
    }
    .menu-overlay-button {
        width: 300px; /* Adjust width for medium screens */
        font-size: 16px; /* Adjust font size for medium screens */
    }
}

/* For small screens (mobile devices) */
@media (max-width: 768px) {
    .menu-overlay-button {
        width: 200px; /* Adjust width for small screens */
        font-size: 14px; /* Adjust font size for small screens */
    }
    .return-overlay-button{
        font-size: 14px; /* Adjust font size for medium screens */
        width: 200px; /* Adjust width for medium screens */
    }
}

/* For extra small screens */
@media (max-width: 480px) {
    .menu-overlay-button {
        width: 150px; /* Adjust width for extra small screens */
        font-size: 12px; /* Adjust font size for extra small screens */
    }
    .return-overlay-button{
        font-size: 12px; /* Adjust font size for medium screens */
        width: 150; /* Adjust width for medium screens */
    }
}






.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.how-to-gif {
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    border-radius: 8px;
}

/* Styles for the blocking overlay */
#interactionBlocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0); /* Fully transparent */
    z-index: 9999; /* Ensure it stays on top */
    display: none; /* Hidden by default */
}

#win-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    z-index: 10000;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    flex-direction: column;
    border-radius: 10px;
}

/* Fade-in effect for the overlay */
.fade-in {
    animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.fade-in-fast {
    animation: fadeIn 500ms ease-in-out forwards;
}

/* Buttons on the win overlay */
.win-overlay-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    border-radius: 25px;
    background-color: var(--color-mid-grey);
    color: white;
    font-size: 18px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
}

#win-level-header {
    word-wrap: break-word;
    white-space: pre-line;
}

.win-overlay-button:hover {
    background-color: var(--color-grey-green);
    color: var(--color-dark-grey)
}
