/* General styling for body and game container */
body {
    font-family: Roboto, sans-serif, Arial;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f0f0;
    margin: 1px;
}

/* Start popup container */
#start-popup {
    position: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 95vh; /* 90% of the viewport height */
    width:100%;
    max-width: 800px; /* Optional: Limit max width for readability */
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    padding: 0px;
    border-radius: 10px;  
    overflow-y: auto;
    z-index: 1000    
}

/* Start popup content (reusing stats popup styles) */
#start-popup-content {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%; /* Make it take up the full width of the popup */
    height: 100%; /* Make it take up the full height of the popup */
    text-align: center;
    box-sizing: border-box;
}

#start-popup h1 {
    font-size: 28px;
    margin-top: 10px;
    margin-bottom: 30px;
    text-align: center;
    font-style: normal;
    font-family: "Alkatra";
    font-weight: bolder;
}

.underline {
    font-size: 32px;
}

.gamelogo {
    align-items: center;
    justify-content: center;
    height: 200px; 
    width: 200px;
}

/* Buttons Section */
#start-buttons {
    margin-top: 40px;
    margin-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px; /* Space between buttons */
}

/* Button styles */
.start-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #4caf50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
}

.start-button:hover {
    background-color: #45a049;
}

/* Terms Link Styling */
.terms-link {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
}

.terms-link a {
    text-decoration: none;
    color: #007BFF; /* A professional blue color */
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

/* Terms of Use Popup Styling */
#terms-popup {
    position: fixed;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 55vh;
    background: #D9D9D9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: none; /* Initially hidden */
    z-index: 1100   
}

#terms-popup .popup-content {
    text-align: left;
    font-size: 1.2rem;
}

#terms-popup .popup-content h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-align: center;
}

#terms-popup .popup-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

#terms-popup .popup-content ul li {
    margin-bottom: 5px;
}

#terms-popup .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #000000;
    font-weight: bold;
}

#language-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 7000;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    width: 80%;
    height: 55vh;
    padding: 20px;    
}

.language-popup-content {
    text-align: center;
}

.language-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 18px;
    cursor: pointer;
}

#language-popup h2 {
    margin: 50px 0 30px 0;
}

.language-options label {
    display: block;
    margin: 10px 0;
    font-size: 16px;
}

.save-btn {
    margin: 30px 0 0 0;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #4caf50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
}

.save-btn:hover {
    background-color: #45a049;
}

.top-icons {
    display: flex;
    justify-content: left; /* Align icons to the left */
    padding: 5px 0px 0px 10px;
    align-items: center; /* Vertically align icons */
    gap: 20px; /* Add spacing between icons */
}

#how-to-play-icon {
    width: 30px; /* Adjust size of the icons */
    height: 30px;
    object-fit: contain; /* Ensure the image scales proportionally */
    cursor: pointer;
}

#stats-icon {
    width: 40px; /* Adjust size of the icons */
    height: 40px;
    object-fit: contain; /* Ensure the image scales proportionally */
    cursor: pointer;
}

#top-row-text {
    font-size: 14px; /* Adjust size */
    color: #333; /* Neutral text color */
    margin-left: auto;
    text-align: right;
    color: #8B2681;
    font-weight: bold;
    padding: 0px 15px 0px 0px;
}

.icon-separator {
    width: 100%; /* Adjust width as needed */
    margin: 5px auto 10px auto; /* Center the line and add spacing */
    border: 0;
    border-top: 1px solid #000000; /* Line styling */
}

#stats-popup {
    position: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 96vh; /* 90% of the viewport height */
    width:100%;
    max-width: 800px; /* Optional: Limit max width for readability */
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    padding: 0px;
    border-radius: 10px;
    display: none; /* Initially hidden */
    z-index: 3000
}

#stats-popup-content {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* Make it take up the full width of the popup */
    height: 100%; /* Make it take up the full height of the popup */
    text-align: center;
    padding: 0px;
    box-sizing: border-box;
}

#stats-top-row-text {
    font-size: 14px; /* Match size to the top row in the main game */
    color: #8B2681; /* Neutral text color */
    text-align: center; /* Center align within the stats pop-up */
    display: block; /* Ensure it spans the width */
    margin-bottom: 10px; /* Add spacing below the text */
    font-weight: bold;
}

#stats-popup h1 {
    font-size: 26px;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    font-family: 'Alkatra', serif; /* Use the selected font */
    font-weight: bolder;
}

#stats-popup h2 {
    font-size: 26px;
    margin-bottom: 20px;
}

/* Common styles for all branding images */
.branding {
    width: 80px; /* Adjust size as needed */
    height: 80px; /* Maintain consistent size */
    position: absolute; /* Absolute positioning within the popup */
    z-index: 1000; /* Ensure images appear above other content */
}

/* Positioning for each corner */
.branding.top-left {
    top: 40px;
    left: 25px;
}

.branding.top-right {
    top: 40px;
    right: 25px;
}

.branding.bottom-left {
    bottom: 40px;
    left: 25px;
}

.branding.bottom-right {
    bottom: 40px;
    right: 25px;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.stat-box {
    text-align: center;
    margin: 10px 10px 0px 10px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 5px 0;
}

/* Time Stats section */
.time-stats {
    margin-top: 20px;
    text-align: center;
}

/* Additional styling for the Scores section */
.stats-popup p {
    margin: 5px 0;
}

.stats-footnote {
    font-size: 12px;
    font-style: italic;
    color: gray;
    text-align: center;
    margin-top: 10px;
}

#share-stats-button {
    margin-top: 10px;
    text-align: center;
    padding: 5px 5px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #4caf50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;        
}

#game-url {
    position: relative; 
    pointer-events: none; /* Prevent user interaction */
    font-size: 14px; 
    color: #007bff; /* Color for visibility in the screenshot */
    text-align: center;
    margin-top: 10px;
    width: 100%;
    font-weight: bold;
}

#close-popup {
    position: absolute;
    top: 10px;
    right: 25px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

#game-container {
    text-align: center;
    background-color: #fff;
    border-radius: 10px;
    width: 100%; /* Use percentage for responsiveness */
    max-width: 800px;
    box-sizing: border-box;    
    height: 100vh;
    z-index: 2000    
}

#status-message {
    font-size: 18px;
    font-weight: bold;
    margin: 0px 0px 10px 0px; /* Space below the chosen letter */
    padding: 0px 15px 0px 15px;
    text-align: center;
    color: #007bff;
}

#info {
    margin-bottom: 20px;
    font-size: 18px;
}

#time-score-container {
    display: flex;
    justify-content: center;
    gap: 80px;    
    align-items: center;
    width: 100%;
    padding: 5px 0px 5px 0px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 1px; /* Reduce space below Time Left */
}

#timer {
    font-weight: bold;
    margin-bottom: 1px; /* Reduce space below Time Left */
}

#chosen-letter {
    font-size: 18px;
    font-weight: bold;
    margin: 0px 0px 10px 0px; /* Space below the chosen letter */
    padding: 0px 15px 0px 15px;
    text-align: center;
    color: #007bff;
}

/* Grid styling */
#grid {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 40px;
}

.row {
    display: flex;
    justify-content: center;
    align-items: center; /* Vertically centers content */
    gap: 4px;
}

.lookup-icon {
    font-size: 24px; /* Adjust size as needed */
    margin-left: 8px; /* Add space between input and icon */
    cursor: pointer;
    color: black;
    opacity: 1;
}

.lookup-icon.disabled {
    cursor: not-allowed;
    color: grey;
    opacity: 0.5; /* Visual indication of disabled state */
}

.grid-cell {
    width: 6vh;
    height: 6vh;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    border: 1px solid #ccc;
    background-color: #D9D9D9;
    pointer-events: none; /* Prevents mouse interaction */
    opacity: 1; /* Ensure parent container has full opacity */

}

.icon-container {
    width: 20px;
    height: 20px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    margin-right: 10px; /* Space between icon and grid */
    font-size: 16px;
    font-weight: bold;
}

.icon-container.success {
    color: green;
    content: "?";
}

.icon-container.error {
    color: red;
    content: "?";
}

/* Virtual keyboard styling */
#keyboard {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between rows */
    align-items: center; /* Center rows within the keyboard */
    z-index: 500; /* Ensure the keyboard is below the popup */
    justify-content: center; /* Distribute keys evenly */
    width: 95%; /* Ensure it spans the screen */
    max-width: 95%; /* Ensure it doesn’t overflow the screen */
    margin: 0 auto;
    box-sizing: border-box; /* Include padding in the width */    
}

.key-row {
    display: flex;
    gap: 4px; /* Space between keys in each row */
    width: 100%; /* Ensure rows span the container */
    justify-content: center; /* Center keys in each row */
}

.key {
    position: relative; /* Necessary for positioning `.score` */
    padding: 5px 5px 2px 5px;  /* Necessary for positioning `.score` */
    font-size: 16px; /* Ensure the main letter is still readable */
    font-weight: bold;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #ddd;
    cursor: pointer;
    width: calc(10% - 4px); /* Ensure consistent sizing */
    height: 60px; /* Maintain height for scores */
    text-align: center;
    box-sizing: border-box;
    overflow: visible; /* Prevent scores from being cut off */
    touch-action: manipulation;
}

.key .score {
    position: absolute;
    top: 5px; /* Position near the top of the key */
    right: 5px; /* Position near the right edge of the key */
    font-size: 10px; /* Ensure it scales with smaller keys */
    font-weight: bold;
    pointer-events: none; /* Prevent interaction with the score */
}


.control-key {
    padding: 5px 10px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4caf50;
    color: white;
    width: auto;  
    height: 40px;
    text-align: center;
    white-space: nowrap;
    touch-action: manipulation;
}

/* Message styling */
#message {
    text-align: center;
    font-size: 18px;
    color: red; /* Adjust color if needed */
    margin: 0px 0 30px 0; /* Reduce top margin to bring it closer to Time Left */    
    min-height: 24px; /* Reserve space to prevent grid movement */
}

#retry-link {
    font-size: 18px;
    color: #007bff; /* Blue color for visibility */
    text-decoration: underline; /* Optional underline */
    font-weight: bold; /* Make it stand out */
    cursor: pointer; /* Show pointer on hover */
}

/* Highlight the entire row */
.highlight-row .grid-cell {
    background-color: #CC3399; /* Light purple or pink background */
    color: white;	
}

/* Highlight the entire column */
.highlight-column {
    background-color: #CC3399; /* Light purple or pink background */
    color: white;
}

/* Highlight for focused cell */
.highlight {
    border: 3px solid #4caf50;  /* Green border to indicate focus */
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 5000;
}

.popup-content {
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
}

#how-to-play-popup {
    width: 100%; /* Full width of the game container */
    max-width: 800px; /* Optional: Limit max width for readability */
    height: 95vh; /* 90% of the viewport height */
    position: fixed; /* Keep the popup fixed on the screen */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    padding: 0px;
    z-index: 1000;
    display: none;
    overflow-y: auto;
    z-index: 4000
}

#how-to-play-popup .popup-content {
    Margin-top: 30px;
    padding: 20px 30px 20px 30px;
    font-size: 20px;
    text-align: left;
}

#how-to-play-popup h2 {
    text-align: center;
}

#how-to-play-popup .footnote {
    font-size: 0.9em;
    margin-top: 30px;
    font-style: italic;
    color: gray;
}

#example {
    width: 370px;
    height: 240px;
    margin: 0px 0px 20px 0px;
}

.section-title {
    font-size: 1.2em; /* Makes the font bigger */
    font-weight: bold; /* Ensures bold text */
    text-decoration: underline; /* Adds an underline */
    margin-top: 16px; /* Adds spacing above the section title */
    margin-bottom: 8px; /* Adds spacing below the section title */
    color: #007bff; /* Dark gray for better contrast */
}

.Example-title {
    font-size: 1.1em; /* Makes the font bigger */
    font-weight: bold; /* Ensures bold text */
}

#hint-popup {
    position: fixed;
    justify-content: center;
    align-items: center;
    height: 95vh; /* 90% of the viewport height */
    width:100%;
    max-width: 800px; /* Optional: Limit max width for readability */
    background-color: #F5F5F5;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
    padding: 0px;
    border-radius: 10px;
    display: none; /* Initially hidden */
    z-index: 6000    
}

/* hint popup content (reusing stats popup styles) */
#hint-popup-content {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* Make it take up the full width of the popup */
    height: 100%; /* Make it take up the full height of the popup */
    text-align: center;
    box-sizing: border-box;    
}

#hint-info {
    font-size: 18px;
    font-weight: bold;
    margin: 100px 0px 10px 0px; /* Space below the chosen letter */
    padding: 0px 15px 0px 15px;
    text-align: center;
    color: #007bff;
}

#close-hint-popup {
    position: absolute;
    top: 15px;
    right: 25px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

/***************************************/
/* MQ 1 - smaller phones */
@media  (min-height: 600px) and (max-height: 740px) and (max-width: 999px)  {
    #start-popup {
        height: 95vh; /* 90% of the viewport height */
    }    
    #start-popup-content {
        width: 100%; /* Make it take up the full width of the popup */
        height: 100%; /* Make it take up the full height of the popup */
    }    
    #start-popup h1 {
        font-size: 28px;
        margin-top: 10px;
        margin-bottom: 25px;
    }    
    .gamelogo {
        height: 190px;
        width: 190px;
    }    
    #start-buttons {
        margin-top: 40px;
        margin-bottom: 40px;
        gap: 10px; /* Space between buttons */
    }    
    .start-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    #terms-popup {
        width: 80%;
        height: 65vh;
        padding: 20px;
    }    
    #terms-popup .popup-content {
        font-size: 0.98rem;
    }    
    #terms-popup .popup-content h2 {
        font-size: 1.2rem;
    }    
    #game-container {
        max-height: 95vh
    }
    #how-to-play-icon {
        width: 25px; /* Adjust size of the icons */
        height: 25px;
    }
    #stats-icon {
        width: 30px; /* Adjust size of the icons */
        height: 30px;
    }    
    #status-message {
        font-size: 16px;
    }
    #info {
        margin-bottom: 15px;
        font-size: 16px;
    }
    #chosen-letter {
        font-size: 16px;
    }
    #time-score-container {
        font-size: 16px;
    }        
    #message {
        font-size: 16px;
        margin: 0px 0px 15px 0px; /* Reduce top margin to bring it closer to Time Left */    
    }
    #retry-link {
        font-size: 16px;
    }
    #grid {
        gap: 6px;
        margin-bottom: 10px;
    }
    .grid-cell {
        font-size: 18px;
        width: 5.50vh; /* Slightly smaller grid cells */
        height: 5.50vh;
    }
    .lookup-icon {
        font-size: 14px; /* Adjust size as needed */
    }    
    .popup-content {
        font-size: 14px;
        text-align: center;
    }
    .key {
        max-height: 45px; /* Prevent keys from getting too wide */
        padding: 10px 5px 5px 5px;  /* Necessary for positioning `.score` */
        font-size: 14px; /* Smaller font size */
    }
    .key .score {
        font-size: 8px; /* Smaller font for scores */
        top: 3px;
        right: 3px;    
    }
    .control-key {
        padding: 5px 5px;
        font-size: 14px;
        height: 30px;
    }
    #stats-popup-content h1 {
        font-size: 28px;
    }    
    #stats-popup-content h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .stat-value {
        font-size: 14px;
        font-weight: bold;
    }
    .stats-grid {
        margin-bottom: 0px;
    }
    .stat-box {
        margin: 5px 10px 5px 10px;
        font-size: 14px;
    }    
    #stats-popup-content h1 {
        font-size: 28px;
    } 
    .branding {
        width: 50px; /* Adjust size as needed */
        height: 50px; /* Maintain consistent size */
    }    
    #how-to-play-popup .popup-content {
        font-size: 18px;
    }
    #example {
        width: 320px;
        height: 190px;
    }
}

/***************************************/
/* MQ 1.5 - smaller tabs */
@media  (min-height: 600px) and (max-height: 820px) and (min-width: 1000px) {
    #start-popup {
        height: 95vh; /* 90% of the viewport height */
    }    
    #start-popup-content {
        width: 100%; /* Make it take up the full width of the popup */
        height: 100%; /* Make it take up the full height of the popup */
    }    
    #start-popup h1 {
        font-size: 28px;
        margin-top: 10px;
        margin-bottom: 25px;
    }    
    .gamelogo {
        height: 190px;
        width: 190px;
    }    
    #start-buttons {
        margin-top: 40px;
        margin-bottom: 40px;
        gap: 10px; /* Space between buttons */
    }    
    .start-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    #terms-popup {
        width: 80%;
        height: 75vh;
        padding: 20px;
    }    
    #terms-popup .popup-content {
        font-size: 1.1rem;
    }    
    #terms-popup .popup-content h2 {
        font-size: 1.4rem;
    }    
    #game-container {
        max-height: 95vh
    }
    #how-to-play-icon {
        width: 25px; /* Adjust size of the icons */
        height: 25px;
    }
    #stats-icon {
        width: 30px; /* Adjust size of the icons */
        height: 30px;
    }    
    #status-message {
        font-size: 14px;
    }
    #info {
        margin-bottom: 15px;
        font-size: 14px;
    }
    #chosen-letter {
        font-size: 14px;
    }
    #time-score-container {
        font-size: 14px;
    }        
    #message {
        font-size: 14px;
        margin: 0px 0px 15px 0px; /* Reduce top margin to bring it closer to Time Left */    
    }
    #retry-link {
        font-size: 14px;
    }    
    #grid {
        gap: 6px;
        margin-bottom: 10px;
    }
    .grid-cell {
        font-size: 18px;
        width: 5.50vh; /* Slightly smaller grid cells */
        height: 5.50vh;
    }
    .lookup-icon {
        font-size: 14px; /* Adjust size as needed */
    }    
    .popup-content {
        font-size: 14px;
        text-align: center;
    }
    .key {
        max-height: 40px; /* Prevent keys from getting too wide */
        padding: 10px 5px 5px 5px;  /* Necessary for positioning `.score` */
        font-size: 16px; /* Smaller font size */
    }
    .key .score {
        font-size: 8px; /* Smaller font for scores */
        top: 3px;
        right: 3px;    
    }
    .control-key {
        padding: 5px 5px;
        font-size: 14px;
        height: 30px;
    }
    #stats-popup-content h1 {
        font-size: 24px;
    }    
    #stats-popup-content h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .stat-value {
        font-size: 14px;
        font-weight: bold;
    }
    .stats-grid {
        margin-bottom: 0px;
    }
    .stat-box {
        margin: 5px 10px 5px 10px;
        font-size: 14px;
    }    
    #stats-popup-content h1 {
        font-size: 24px;
    } 
    .branding {
        width: 50px; /* Adjust size as needed */
        height: 50px; /* Maintain consistent size */
    }    
    #how-to-play-popup .popup-content {
        font-size: 16px;
        padding: 0px 0px 0px 80px;
    }
    #example {
        width: 370px;
        height: 240px;
    }    
}

/***************************************/
/* MQ 2 - slighlty bigger phones */
@media (min-height: 741px) and (max-height: 882px) and (max-width: 1000px){
    #start-popup {
        height: 95vh; /* 90% of the viewport height */
    }    
    #start-popup-content {
        width: 100%; /* Make it take up the full width of the popup */
        height: 100%; /* Make it take up the full height of the popup */
    }    
    #start-popup h1 {
        font-size: 28px;
        margin-top: 10px;
        margin-bottom: 25px;
    }    
    .gamelogo {
        height: 190px;
        width: 190px;
    }    
    #start-buttons {
        margin-top: 40px;
        margin-bottom: 40px;
        gap: 10px; /* Space between buttons */
    }    
    .start-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    #terms-popup {
        width: 80%;
        height: 60vh;
        padding: 20px;
    }    
    #terms-popup .popup-content {
        font-size: 1.1rem;
    }    
    #terms-popup .popup-content h2 {
        font-size: 1.4rem;
    }    
    #game-container {
        max-height: 95vh
    }
    #how-to-play-icon {
        width: 30px; /* Adjust size of the icons */
        height: 30px;
    }
    #stats-icon {
        width: 40px; /* Adjust size of the icons */
        height: 40px;
    }    
    #status-message {
        font-size: 18px;
    }
    #info {
        margin-bottom: 15px;
        font-size: 18px;
    }
    #chosen-letter {
        font-size: 18px;
    }
    #time-score-container {
        font-size: 18px;
    }     
    #message {
        font-size: 18px;
        margin: 0px 0px 15px 0px; /* Reduce top margin to bring it closer to Time Left */    
    }
    #retry-link {
        font-size: 18px;
    }   
    #grid {
        gap: 6px;
        margin-bottom: 20px;
    }
    .grid-cell {
        font-size: 18px;
        width: 5.25vh; /* Slightly smaller grid cells */
        height: 5.25vh;
    }
    .lookup-icon {
        font-size: 18px; /* Adjust size as needed */
    }    
    .popup-content {
        font-size: 18px;
        text-align: center;
    }
    .key {
        max-height: 50px; /* Prevent keys from getting too wide */
        padding: 10px 5px 5px 5px;  /* Necessary for positioning `.score` */
        font-size: 16px; /* Smaller font size */
    }
    .key .score {
        font-size: 10px; /* Smaller font for scores */
        top: 3px;
        right: 3px;    
    }
    .control-key {
        padding: 5px 5px;
        font-size: 16px;
        height: 40px;
    }
    .branding {
        width: 70px; /* Adjust size as needed */
        height: 70px; /* Maintain consistent size */
    }   
    #how-to-play-popup .popup-content {
        margin-top: 65px;
    }
    #example {
        width: 310px;
        height: 240px;
    }      
}

/***************************************/
/* MQ 3 - Large phones or tabs */
@media (min-height: 933px) and (max-width: 1199px) {
    #start-popup {
        height: 95vh; /* 90% of the viewport height */
    }    
    #start-popup-content {
        width: 100%; /* Make it take up the full width of the popup */
        height: 100%; /* Make it take up the full height of the popup */
    }    
    #start-popup h1 {
        font-size: 34px;
        margin-top: 10px;
        margin-bottom: 25px;
    }    
    .gamelogo {
        height: 300px;
        width: 300px;
    }    
    #start-buttons {
        margin-top: 80px;
        margin-bottom: 40px;
        gap: 20px; /* Space between buttons */
    }    
    .start-button {
        padding: 10px 20px;
        font-size: 24px;
    }
    #terms-popup {
        width: 80%;
        height: 75vh;
        padding: 20px;
    }    
    #terms-popup .popup-content {
        font-size: 1.5rem;
    }    
    #terms-popup .popup-content h2 {
        font-size: 1.7rem;
    }        
    #game-container {
        max-height: 95vh
    }
    #how-to-play-icon {
        width: 40px; /* Adjust size of the icons */
        height: 40px;
    }
    #stats-icon {
        width: 50px; /* Adjust size of the icons */
        height: 50px;
    }    
    #status-message {
        font-size: 22px;
    }
    #info {
        margin-bottom: 30px;
        font-size: 18px;
    }
    #chosen-letter {
        font-size: 22px;
    }    
    #message {
        font-size: 22px;
        margin: 0px 0px 30px 0px; /* Reduce top margin to bring it closer to Time Left */    
    }
    #retry-link {
        font-size: 22px;
    }    
    #grid {
        gap: 15px;
        margin-bottom: 60px;
    }
    .grid-cell {
        font-size: 22px;
        width: 6vh; /* Slightly smaller grid cells */
        height: 6vh;
    }
    .lookup-icon {
        font-size: 22px; /* Adjust size as needed */
    }    
    .popup-content {
        font-size: 22px;
        text-align: center;
    }
    #keyboard {
        gap: 16px; /* Space between rows */
    }
    .key {
        max-height: 60px; /* Prevent keys from getting too wide */
        padding: 5px 5px 5px 5px;  /* Necessary for positioning `.score` */
        font-size: 16px; /* Smaller font size */
    }
    .key .score {
        font-size: 12px; /* Smaller font for scores */
        top: 8px;
        right: 8px;    
    }
    .control-key {
        padding: 10px 10px;
        font-size: 18px;
        height: 50px;
    }
    #stats-popup {
        max-width: 100%; /* Optional: Limit max width for readability */
    }
    #how-to-play-popup {
        max-width: 100%; /* Optional: Limit max width for readability */
    }
    #how-to-play-popup .popup-content {
        font-size: 22px;
        padding: 60px 60px 60px 60px;
    }
    #example {
        width: 370px;
        height: 270px;
    }        
}

/***************************************/
/* MQ 4 - desktops */
@media (min-width: 1200px) {
    #start-popup {
        height: 95vh; /* 90% of the viewport height */
        max-width: 900px; /* Limit the maximum width */
    }    
    #start-popup-content {
        width: 100%; /* Make it take up the full width of the popup */
        height: 100%; /* Make it take up the full height of the popup */
    }    
    #start-popup h1 {
        font-size: 24px;
        margin-top: 10px;
        margin-bottom: 25px;
    }    
    .gamelogo {
        height: 160px;
        width: 160px;
    }    
    #start-buttons {
        margin-top: 40px;
        margin-bottom: 20px;
        gap: 10px; /* Space between buttons */
    }    
    .start-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    #terms-popup {
        width: 80%;
        height: 75vh;
        padding: 20px;
    }    
    #terms-popup .popup-content {
        font-size: 1.0rem;
    }    
    #terms-popup .popup-content h2 {
        font-size: 1.1rem;
    }    
    #game-container {
        max-width: 900px; /* Limit the maximum width */
        max-height: 90vh; /* Prevent the game from taking up too much vertical space */
        margin: 0 auto; /* Center the game horizontally */
        padding: 10px;
    }
    .top-icons {
        padding: 0px 0px 0px 10px;
        gap: 20px; /* Add spacing between icons */
    }
    #how-to-play-icon {
        width: 20px; /* Adjust size of the icons */
        height: 20px;
    }
    #stats-icon {
        width: 25px; /* Adjust size of the icons */
        height: 25px;
    }    
    #status-message {
        font-size: 14px;
        margin: 0px 0px 5px 0px; /* Space below the chosen letter */
    }
    #info {
        margin-bottom: 10px;
        font-size: 14px;
    }
    #chosen-letter {
        font-size: 14px;
    }    
    #time-score-container {
        font-size: 14px;
    }        
    #message {
        font-size: 14px;
        margin: 0px 0px 5px 0px; /* Reduce top margin to bring it closer to Time Left */    
    }
    #retry-link {
        font-size: 14px;
    }    
    #grid {
        gap: 4px;
        margin-bottom: 10px;
    }
    .row {
        gap: 4px;
    }    
    .grid-cell {
        font-size: 16px;
        width: 5.5vh; /* Slightly smaller grid cells */
        height: 5.5vh;
    }
    .lookup-icon {
        font-size: 12px; /* Adjust size as needed */
    }    
    .popup-content {
        font-size: 12px;
        text-align: center;
    }
    .key {
        width: calc(5% - 4px); /* Ensure consistent sizing */
        height: 30px;
        padding: 10px 5px 5px 5px;  /* Necessary for positioning `.score` */
        font-size: 10px; /* Smaller font size */
    }
    .key .score {
        font-size: 8px; /* Smaller font for scores */
        top: 3px;
        right: 3px;    
    }
    .control-key {
        padding: 5px 5px;
        font-size: 10px;
        height: 25px;
        width: auto;
    }
    #stats-popup {
        height: 90vh; /* 90% of the viewport height */
        width:100%;
        max-width: 900px; /* Optional: Limit max width for readability */
    }
    #stats-popup-content h1 {
        font-size: 24px;
    }    
    #stats-popup-content h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .stat-value {
        font-size: 14px;
        font-weight: bold;
    }
    .stats-grid {
        margin: 0px 0px 0px 0px;
    }
    .stat-box {
        margin: 5px 10px 0px 10px;
        font-size: 14px;
    }
    #stats-popup-content h1 {
        font-size: 24px;
    } 
    .branding {
        width: 50px; /* Adjust size as needed */
        height: 50px; /* Maintain consistent size */
    }    
    #how-to-play-popup {
        max-width: 900px; /* Optional: Limit max width for readability */
    }
    #how-to-play-popup .popup-content {
        font-size: 16px;
        padding: 0px 0px 0px 70px;
    }
    #example {
        width: 530px;
        height: 370px;
    }
}