:root {
    --app-bg-color: black;
    --display-bg-color: #e6f0f3;
    --text-color: #272727; /* Darker text */
    --button-reg-color: #c6eef5;
    --button-hover-color: #a0d2db;
}

[data-theme="light"] {
    --app-bg-color: black;
    --display-bg-color: #e6f0f3;
    --text-color: #272727; /* Darker text */
    --button-reg-color: #c6eef5;
    --button-hover-color: #a0d2db;
}

[data-theme="dark"] {
    --app-bg-color: #404040;
    --display-bg-color: #151515;
    --text-color: #dcdcdc;
    --button-reg-color: #2b2b2b;
    --button-hover-color: #484848;
}

[data-theme="darkpurple"] {
    --app-bg-color: #4b0082;
    --display-bg-color: #1f181f;
    --text-color: #fbebff; /* More purple text */
    --button-reg-color: #583a70; /* More purple buttons */
    --button-hover-color: #3f2554;
}

[data-theme="colorful"] {
    --app-bg-color: #00ffea;
    --display-bg-color: #ffca3a;
    --text-color: #0a41c0;
    --button-reg-color: #92e60b;
    --button-hover-color: #f95c5c;
}

[data-theme="nature"] {
    --app-bg-color: #516910;
    --display-bg-color: #afc58c;
    --text-color: #392d0e; /* Darker text */
    --button-reg-color: #85a840;
    --button-hover-color: #728d44;
}

[data-theme="serene"] {
    --app-bg-color: #1c1c1c; /* Extremely dark app background */
    --display-bg-color: #e0c69e; /* Slightly darker and more brown display background */
    --text-color: #5d2c0a;
    --button-reg-color: #d3a56a;
    --button-hover-color: #c18d4a;
}

/* Additional Themes */
[data-theme="sunset"] {
    --app-bg-color: #fc9974;
    --display-bg-color: #f5c294;
    --text-color: #36596f;
    --button-reg-color: #eb9057;
    --button-hover-color: #ec772f;
}

[data-theme="ocean"] {
    --app-bg-color: #054cb0;
    --display-bg-color: #afdbf7;
    --text-color: #000080;
    --button-reg-color: #6ac4eb;
    --button-hover-color: #50abd3;
}

[data-theme="forest"] {
    --app-bg-color: #1b801b;
    --display-bg-color: #412612;
    --text-color: #fcf1bc;
    --button-reg-color: #505b20;
    --button-hover-color: #68802d;
}

[data-theme="monochrome"] {
    --app-bg-color: #333333;
    --display-bg-color: #dddddd;
    --text-color: #000000;
    --button-reg-color: #a6a6a6;
    --button-hover-color: #777777;
}

/* Map Game Styles */
body {
    background-color: var(--app-bg-color); /* Change this color to your desired background color */
    color: var(--text-color);
}
#map {
    height: 96vh;
    width: 100%;
    cursor: crosshair;
}

.svg-icon:hover {
    cursor: crosshair;
}

.polyline:hover {
    cursor: crosshair;
}

.flash-text {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: var(--text-color);
    z-index: 1500; /* Higher than the map's z-index */
    display: none;
}

/* Controls Container Styles */
.controls {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1000;
    background-color: var(--display-bg-color);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Controls Content Styles */
.controls-content {
    display: flex;
    flex-direction: column;
}

.level-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#level {
    background-color: var(--text-color);
    color: var(--display-bg-color);
    border-radius: 5px;
    padding: 5px 10px;
    margin-right: 10px;
    font-size: 18px;
    font-weight: bold;
}

.progress-bar-container {
    flex: 1;
    background-color: var(--button-reg-color);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.progress-bar {
    height: 20px;
    background-color: var(--text-color);
    text-align: center;
    color: var(--display-bg-color);
    width: 0%; /* Default width */
}

.tabbed-interface {
    background-color: var(--display-bg-color);
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 1px;
    width: auto; 
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--button-reg-color);
}

.tab {
    padding: 2px 2px;
    cursor: pointer;
    flex: 1;
    text-align: center;
    width: auto;
}

.tab.active {
    background-color: var(--button-hover-color);
}

.tab-content {
    display: none;
    padding: 6px 8px;
}

.tab-content.active {
    display: block;
}

.tab-content label {
    display: block;
    width: 100%;
    margin-top: 0px;
    padding: 2px 6px;
}

.tab-content select,
.tab-content button {
    display: block;
    width: 100%;
    margin-bottom: 2px;
    padding: 2px 8px;
    color: var(--text-color);
}

.tab.disabled {
    pointer-events: none;
    opacity: 0.5; /* Or any other styling to indicate disabled state */
}

button {
    border: none;
    background-color: var(--button-reg-color);
    color: rgb(0, 0, 0);
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    margin-top: 10px;
}

button:hover {
    background-color: var(--button-hover-color);
}

select {
    background-color: var(--button-reg-color);
}

select:hover {
    background-color: var(--button-hover-color);
}

/* Style for disabled options with the class "label-option" */
select option.label-option {
    color: var(--text-color); /* Set text color to match enabled options */
    font-weight: bold; /* Optionally make labels bold */
    cursor: default; /* Change cursor to default */
}

/* Additional rules to ensure background color remains the same */
select option.label-option:disabled {
    background-color: var(--text-color);
    color: var(--button-hover-color); /* Ensure text color is consistent */
    opacity: 1; /* Ensure opacity is 1 */
}


.begin-round-button {
    font-size: 20px;
    font-weight: bold;
}

.close-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    align-self: flex-start;
    margin-bottom: 0px;
    color: var(--text-color);
    display: none; 
}

.timer {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 950;
    font-size: 32px;
    font-weight: bold;
    background-color: var(--display-bg-color);
    padding: 5px 10px;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .controls-content {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        background-color: var(--display-bg-color);
        padding: 10px;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        z-index: 2000; /* Ensure it overlays other content */
        overflow-y: auto; /* Allow scrolling if content overflows */
    }

    .controls-content.active {
        display: flex;
        flex-direction: column;
    }

    .timer {
        bottom: auto;
        left: 14px;
        top: 82px;
        transform: none;
    }

    .close-menu {
        display: block; /* Show in mobile mode */
    }
}

.display-box {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 900;
    background-color: var(--display-bg-color);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    max-width: calc(100% - 100px);
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .display-box {
        font-size: 0.9em; /* Adjust the font size for smaller screens */
    }
}



#usernameLabel {
    font-size: 20px;
    font-weight: bold;
}

.loginPopup {
    display: none; /* Hidden by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border: 1px solid #ccc;
    background-color: var(--display-bg-color);
    z-index: 1000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
    background-color: var(--display-bg-color);
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 90%; /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

#highScoresTable {
    display: table;
    max-width: 95%;
    min-width: 60%;
    justify-content: center;
    justify-items: center;
}

/* General styles for the high score table */
.high-score-row {
    justify-content: left;
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* Styling for index cell */
.index-cell {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: left;
    padding-left: 15%;
}

/* Styling for flag cell */
.flag-cell {
    width: 60px;
    display: flex;
    align-items: left;
    justify-content: center;
}

/* Styling for name and score cells */
.name-cell {
    flex: 1;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: left;
}
.score-cell {
    flex: 1;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: right;
}

/* General text styling */
.high-score-cell {
    font-size: 14px;
}

/* Add media query for smaller screens */
@media (max-width: 768px) {
    .high-score-row {
        display: flex;
        flex-wrap: wrap;
        padding: 5px;
        align-items: center;
    }

    .index-cell,
    .flag-cell,
    .score-cell {
        flex: 0 0 auto;
        margin-bottom: 5px;
        display: flex;
        align-items: center;
    }

    .name-cell {
        flex: 1 0 100%; /* Make the name cell take up full width */
        padding: 5px 0;
        text-align: left;
    }

    .high-score-cell {
        font-size: 12px;
    }
}



pre {
    font-family: 'Courier New', Courier, monospace;
}



/* ############################## */
/* ############################## */
/* ###                        ### */
/* ###   Flag Modal Section   ### */
/* ###                        ### */
/* ############################## */
/* ############################## */



.flag-display {
    margin-top: 10px;
}
#flag {
    width: 160px;
    height: auto;
}
.accordion {
    margin: 0px 0;
}
.accordion-item {
    margin-bottom: 8px;
}
.accordion-header {
    padding: 6px;
    background-color: var(--button-reg-color); /* Dark purple background */
    cursor: pointer;
    border: 1px solid var(--text-color);
}
.accordion-content {
    display: none;
    padding: 4px;
    background-color: var(--display-bg-color);
    border: 1px solid var(--text-color);
}
.flag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 4px;
}.flag-item {
    text-align: center;
    align-items: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4px;
}
.flag-item .flag-container {
    width: 80px;
    height: 50px;
    background-color: var(--display-bg-color); 
    padding: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.flag-item img, .flag-item canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.flag-item p {
    margin: 0;
    padding: 5px 0;
    background-color: var(--display-bg-color); 
}
.user-flag-container canvas {
    width: 80px;
}