main {
    overflow: hidden;
    display: grid;
    place-items: center;
    min-height: 0px;
    min-width: 0px;
    /* position: relative; */
    grid-template-rows: 1fr auto;
    /* text-align: center; */
}

#mapContainer {
    display: grid;
    position: relative;
    width: 100%;
    height: 100%;
    /* place-items: center; */
    /* height: 100%; */
    transition: background-color 0.5s;
}

#mapContainer {
    background-color: rgba(0, 0, 0, 0.8);
}
[data-theme="light"] #mapContainer {
    background-color: rgba(225, 225, 225, 0.8);
}

/*` GENERAL - ROWS */
.opt {
    display: grid;
    grid-template-columns: auto 1fr;
    place-items: center;
    gap: 10px;
}

.opt.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.opt.selected {
    background-color: rgba(50, 50, 50, 0.5);
}
.opt:not(.selected):hover {
    background-color: rgba(8, 8, 8, 0.8);
}
[data-theme="light"] .opt.selected {
    background-color: rgba(210, 210, 210, 0.5);
}
[data-theme="light"] .opt:not(.selected):hover {
    background-color: rgba(219, 219, 219, 0.8);
}


/*` GENERAL - CHECKBOXES */
.cb {
    aspect-ratio: 1/1;
    width: 35px;
    border-style: solid;
    border-width: 1px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    cursor: pointer;
    overflow: hidden;
}

.cb {border-color: silver;}
[data-theme="light"] .cb {border-color: var(--dgray);}

.cb:not(.toggleAll) span {
    transition-property: all;
    transition-duration: 0.2s;
    transform: translate(10px, -150%);
    /* opacity: 0; */
}

.selected .cb:not(.toggleAll) span {
    /* opacity: 1 */
    transform: translate(0px, 0px);
}

.cb.toggleAll {
    width: 35px;
    padding: 3px;
}

.cb.toggleAll div {border-radius: 3px;}

.cb.toggleAll div {background-color: white;}
[data-theme="light"] .cb.toggleAll div {background-color: var(--dgray);}

.cb.toggleAll.someSelected div {
    width: 50%;
    height: 50%;
}
.cb.toggleAll.allSelected div {
    width: 100%;
    height: 100%;
}

/*` GENERAL - ROWS */
.row {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}
.row label {
    text-align: right;
    font-size: 0.9em;
}
.row .value {
    font-size: 1.3em;
}

/*` POPUP MENUS */
.popup {
    position: absolute;
    z-index: 1;
    border-color: silver;
    background-color: black;
}
[data-theme="light"] .popup {
    border-color: rgb(86, 86, 86);
    background-color: rgb(232, 232, 232);
}

.popup.menu {
    width: 80%;
    height: 90%;
    border-radius: 10px;
    border-style: solid;
    border-width: 2px;
    display: grid;
    padding: 5px;
    overflow: hidden;
}

.popup hr {
    width: 100%;
}

.popup > header {
    width: 100%;
    height: auto;
    padding: 2px;

    display: grid;
    place-items: center;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.popup.menu > header label {
    width: 100%;
    height: 100%;
    padding-left: 20px;
    text-align: left;
    border-bottom: 1px solid rgb(125,125,125);
}

.exit {
    line-height: 0;
    aspect-ratio: 1/1;
    font-size: 1.5em;
    display: grid;
    place-items: center;
}

.exit {
    background-color: rgb(48, 0, 0) !important;
    color: auto;
}
[data-theme="light"] .exit {
    background-color: rgb(255, 157, 157) !important;
    color: black;
}

.popup.small {
    left: 10px;
    bottom: 10px;
    text-align: left;
    padding: 5px;
    border-style: solid;
    border-width: 1px;
    border-radius: 3px;
    display: grid;
    max-height: calc(100% - 20px);
    min-block-size: 0;
    overflow: hidden;
    font-size: 0.85em;
    grid-template-rows: auto auto 1fr;

}
.popup.small > div {
    overflow-y: scroll;
    overflow-x: hidden;
    min-block-size: 0;
    padding-right: 5px;
}

.popup.small header {
    font-size: 1.1em;
    font-weight: bold;
}
.popup.small .opt .cb {
    width: 25px;
}
.popup.small .opt .cb span {
    width: 80%;
    aspect-ratio: 1/1;
    border-radius: 3px;
}

.popup.small .opt .cb span {
    background-color: white;
}
[data-theme="light"] .popup.small .opt .cb span {
    background-color: var(--dgray);
}

/*` OPTIONS PANEL */
#boundLevelInputContainer {
    display: grid;
    place-items: center;
    grid-template-columns: 60px 1fr;
    width: 100%;
    gap: 20px;
    padding: 0 10px;
}
#boundLevelInputContainer input {
    width: 100%;
}

#countryOptions {
    grid-template-rows: auto 1fr auto;
    gap: 10px;
}

#startScreen > header label {
    border: none;
}

#countriesInputDiv {
    display: grid;
    overflow: auto;
    gap: 15px;
}

#countriesInputDiv .list {
    display: grid;
    gap: 0;
}

#countriesInputDiv .opt {
    grid-template-columns: 35px auto 30px 1fr;
    border-style: solid none;
    border-width: 1px;
    border-radius: 5px;
    margin-bottom: -1px;

    padding: 3px;
    height: auto;
    cursor: pointer;
    gap: 7px;
}

#countryOptions > footer {
    display: grid;
    place-items: center;
    grid-template-columns: auto 1fr auto;
}

#countriesInputDiv .opt .name {
    font-size: 0.8em;
    text-align: center;
}
#countriesInputDiv hr {
    /* display: block; */
    /* margin: 20px 0px 20px 0px; */
    margin: 0px;
    padding: 0px;
    /* margin: 30px 0px; */
    /* background-color: none; */
    /* padding: 20px 0px; */
}

#countriesInputDiv hr { border-color: black; }
[data-theme="light"] #countriesInputDiv hr { border-color: white; }

#countriesInputDiv .opt {border-color: rgba(192, 192, 192, 0.1);}
[data-theme="light"] #countriesInputDiv .opt {border-color: rgba(192, 192, 192, 0.7);}

[data-theme="light"] #countriesInputDiv .opt.selected {
    background-color: var(--lllblue);
    border-color: rgba(142, 142, 142, 0.7);
}
[data-theme="light"] #countriesInputDiv .opt:not(.selected):hover {background-color: rgba(219, 219, 219, 0.8);}
/* html:not([data-theme="light"]) #countriesInputDiv .opt.selected {background-color: rgba(210, 210, 210, 0.5)} */
/* html:not([data-theme="light"]) #countriesInputDiv .opt:not(.selected):hover {background-color: rgba(219, 219, 219, 0.8)} */

/*` BOTTOM MENU STRIP */
#menuStrip {
    display: grid;
    place-items: center;
    grid-template-columns: auto 1fr auto;
    padding: 10px;
    min-height: 94px;
    height: auto;
    width: 100%;
    gap: 10px;

    transition: background-color 0.5s;
}

/* #menuStrip {background-color: transparent}
[data-theme="light"] #menuStrip {background-color: rgba(246, 246, 246, 0.6)} */

#menuStrip button .svgIcon {
    aspect-ratio: 1/1;
    height: clamp(22px, 15px + 1.5vw, 27px);
}

/* LEFT HAND SIDE */
#menuStrip > .lhs {
    display: grid;
    gap: 10px;
}
#menuStrip > .lhs button {
    /* MAP SETTINGS TOGGLE BUTTONS */
    height: 35px;
    width: 100px;
    display: grid;
    place-items: center;
    grid-template-columns: auto 1fr;
    gap: 4px;
}
#menuStrip > .lhs button#locOptsToggle-smallscreen {
    display: none;
}
#menuStrip > .lhs .reqLocBtn {
    display: none;
}

/* MIDDLE */
#menuStrip > .mid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    place-items: center;
}
#menuStrip > .mid button {
    height: 100%;
    padding: 0 10px;
    font-size: 1.1em;
    display: grid;
    place-items: center;
}

#locationName {
    display: grid;
    grid-template-columns: auto 20px;
    gap: 5px;
    border-width: 3px;
    border-style: solid;
    padding: 5px 5px 5px 20px;
    border-radius: 3px;
    height: 100%;
    align-items: center;
    min-width: 100px;
}

#locationName {
    border-color: var(--ddddgray);
    background-color: var(--dddddgray);
}
[data-theme="light"] #locationName {
    border-color: var(--llgray);
    background-color: var(--llllgray);
}

#locationName .location {
    text-align: center;
    font-size: 1.3em;
}

#locationName .info {
    cursor: pointer;
    font-size: 0.6em;
    border-width: 1px;
    border-style: solid;
    width: 19px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    line-height: 0;
    align-self: start;
}

#locationName .info {
    border-color: white;
}
[data-theme="light"] #locationName .info {
    border-color: var(--gray);
}

#scorePanel {
    width: fit-content;
    display: grid;
    grid-template-rows: auto auto;
    gap: 5px;
}

#scorePanel .row label {
    width: 75px;
}

/* RIGHT HAND SIDE */
#newLocationPane {
    display: grid;
    grid-template-rows: 1fr auto;
    height: 100%;
    width: 150px;
}

#newLocationPane .buttons {
    justify-content: right;
    align-items: center;
}

#newLocationPane button {
    height: 50px;
    place-items: center;
    display: grid;
}

.gameMenuCountriesCountDisplay {
    text-align: right;
    font-size: 0.7em;
}

#confirmButton {
    height: 100%;
    font-size: 1.1em;
    display: grid;
    place-items: center;
}

#confirmButton:disabled {
    color: slategray;
}
[data-theme="light"] #confirmButton:disabled {
    color: rgb(191, 191, 191);
}

/*` ONSCREEN LATITUDE / LONGITUDE */
#pinnedLatLong {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    position: absolute;
    top: 10px;
    right: 10px;

    border-width: 2px;
    border-style: solid;

    border-radius: 5px;
    padding: 5px;
    width: 125px;
    text-align: right;
    font-size: 0.8em;

    transition-property: all;
    transition-duration: 0.5s;
}

#pinnedLatLong {
    background-color: rgba(50, 50, 50, 0.6);
    border-color: white;
}
[data-theme="light"] #pinnedLatLong {
    background-color: rgba(232, 232, 232, 0.6);
    border-color: rgb(176, 176, 176);
}

.coordSuffix {
    width: 13px;
    margin-left: 4px;
    display: inline-block;
}

/*` ADDITIONAL INFO DIV */

@property --cv {
    syntax: "<number>";
    initial-value: 0;
    inherits: true;
}
#upPanel {
    position: absolute;
    bottom: 0px;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 10px 0;
    padding-top: 30px;
    z-index: 1;

    transition: --cv;
    transition-duration: 1s;

    background: linear-gradient(180deg, rgba(var(--cv), var(--cv), var(--cv), 0) 0, rgba(var(--cv), var(--cv), var(--cv), 0.97) 20px, rgb(var(--cv), var(--cv), var(--cv)) 100%);
}
#upPanel:has(#addtlLocationInfo.hidden) {
    padding: 0;
}

#upPanel {--cv: 0;}
[data-theme="light"] #upPanel {--cv: 230;}

#addtlLocationInfo .row label {width: 100px;}

/*` START SCREEN */
.centeredAbsContainer {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.centeredAbsContainer > * {
    pointer-events: auto;
}
#startScreen {
    width: 50%;
    grid-template-rows: auto auto 1fr;
    height: fit-content;
    padding: 10px;
    max-height: 90%;
}

#startScreen header label {
    font-size: 55px;
}
#startScreen > div {
    text-align: justify;
    overflow-y: auto;
    padding-right: 10px;
}

/*` MOBILE SCREEN */
#mapSettingToggle-smallscreen {
    position: absolute;
    display: none;
    left: 5px;
    bottom: 5px;
    width: 35px;
    height: 35px;
    place-items: center;
}

#mapSettingsPanel-smallscreen {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-style: solid;
    border-width: 1px;
    border-radius: 3px;
}

@media screen and (min-width: 701px) {
    *.smallscreen {
        display: none;
    }
}

@media screen and (max-width: 700px) {
    *.largescreen {
        display: none;
    }
    #menuStrip {
        grid-template-columns: 1fr auto;
        position: relative;
    }
    #menuStrip > .lhs {
        position: absolute;
        right: 10px;
        bottom: calc(100% + 10px);
        grid-auto-flow: column;
    }
    #menuStrip > .lhs button {
        width: auto;
        grid-template-columns: auto;
    }
    #menuStrip > .lhs button span {
        display: none;
    }

    #menuStrip > .lhs button#locOptsToggle-smallscreen {
        display: grid;
    }
    #newLocationPane button#locOptsToggle {
        display: none;
    }
    #addtlLocationInfo {
        font-size: 0.7em;
    }
    #locationName .location {
        font-size: 1em;
    }

    #menuStrip > .lhs .reqLocBtn {
        display: grid;
    }
    #menuStrip > .rhs .reqLocBtn {
        display: none;
    }

    #locationName {
        grid-template-columns: auto;
        padding: 5px;
    min-width: 0px;
    }
    #locationName .info {
        display: none;
    }
    #confirmButton {
        font-size: 0.9em;
    }

    #scorePanel .row {
        font-size: 0.9em;
    }
    #scorePanel .row .value {
        font-size: 1.1em;
    }

    #scorePanel .row label {
        width: auto;
    }
    #newLocationPane {
        grid-template-rows: 1fr;
        width: fit-content;
    }
    .gameMenuCountriesCountDisplay.smallscreen {
        display: block;
        width: 100%;
        font-size: 0.6em;
        text-align: right;
        /* border: 1px solid blue; */
    }
    #startScreen {
        width: 80%;
    }
#startScreen header label {
    font-size: 30px;
}
}
@media screen and (max-width: 360px) {
    #locationName .location {
        font-size: 1em;
    }
}
