@import url('https://fonts.googleapis.com/css2?family=Darumadrop+One&display=swap');

:root {
    interpolate-size: allow-keywords;
}

html {
    overflow: hidden;
    height: -webkit-fill-available;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    font-family: "Darumadrop One", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    user-select: none;
}

.standard-container {
    position: relative;
    display: inline-block;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
}

#map {
    display: block;
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    object-fit: contain;
    z-index: 1;
}

#container:has(#map[loading=true])::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.4);
}

body:has(#map[loading=true])::after {
    content: "";
    position: fixed;
    top: 9vmin;
    right: 0;
    width: 12vmin;
    height: 12vmin;
    pointer-events: none;

    background-image: url("./images/BingBong.png");
    background-position: -50% -50%;
    background-size: contain;
    background-repeat: no-repeat;
    animation-name: mapLoading;
    animation-duration: .8s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes mapLoading {

    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(180deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }

}

#container {
    cursor: grab;
    touch-action: none;
}

.point {
    position: absolute;
    left: calc((var(--x) / 7630) * 100%);
    top: calc((var(--y) / 4320) * 100%);
    transform: translate(-50%, -50%);
    background-size: cover;
    background-position: 50% -50%;
    backdrop-filter: blur(10px);
    width: 3vmin;
    height: 3vmin;
    border-radius: 50%;
    transition: .3s;
    border: 0.3vmin solid;
    z-index: 2;
}

.point:hover {
    cursor: pointer;
    animation-name: pointHover;
    animation-duration: 0.8s;
    z-index: 3;
}

.point.luggage {
    border-color: red;
}

.point.luggage.LuggageSmall {
    border-color: #da7c20;
}

.point.luggage.LuggageBig {
    border-color: #ece2dc;
}

.point.luggage.LuggageEpic {
    border-color: orangered;
}

.point.luggage.scout_statue {
    border-color: rgb(100, 99, 109);
}

.point.belltower {
    border-color: purple;
}

.point.animals {
    border-color: brown;
}

.point.animals.EarlyWorm {
    border-color: pink;
}

.point.amulets.AMULET_CLONE {
    border-color: greenyellow;
}

.point.amulets.AMULET_INFINITESTAM {
    border-color: orange;
}

.point.amulets.AMULET_HEALING {
    border-color: rgb(87, 87, 228);
}

.point.amulets.AMULET_DOUBLEJUMP {
    border-color: rgb(199, 53, 34);
}

.point.tombs {
    border-color: purple;
}

.data-frame {
    display: none;
}

#settings,
#additional-settings {
    height: fit-content;
    z-index: 4;
    position: fixed;
    top: 0;
    padding: 12px;
}

#settings {
    width: 25vmin;
    left: 0;
}

#additional-settings {
    width: 20vmin;
    left: calc(25vmin + 24px);
}


.settings-entry,
#additional-settings-title,
.ui-panel {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    color: white;
    align-items: center;
    /* create new stacking context (fixes the button hover gradient artifact thing) */
    isolation: isolate;
}

.settings-entry,
#additional-settings-title {
    display: flex;
    gap: 0.3rem;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

#additional-settings-title {
    justify-content: center;
}

.ui-panel {
    padding: 8px 12px;
    z-index: 4;
}

#settings p {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    flex-direction: column;
    gap: 0;
}

.settings-entry label {
    width: 75%;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.25rem;
}

.settings-entry button {
    width: 100%;
}

span.icon {
    width: 2rem;
    height: 2rem;
    display: inline-block;
    background-size: cover;
    background-position: 50% -50%;
    background-repeat: no-repeat;
    margin-right: 0.25rem;
}

.settings-entry label[for="luggage-checkbox"] span {
    background-image: url("./images/LuggageSmall.png");
}

.settings-entry label[for="belltowers-checkbox"] span {
    background-image: url("./images/Belltower.png");
}

.settings-entry label[for="animals-checkbox"] span {
    background-image: url("./images/EarlyWorm.png");
}

.settings-entry label[for="amulets-checkbox"] span {
    background-image: url("./images/AMULET_CLONE.png");
}

.settings-entry label[for="tombs-checkbox"] span {
    background-image: url("./images/Tomb.png");
    background-size: 200%;
}

.settings-entry input[type=checkbox] {
    width: 1rem;
    height: 1rem;
}

#settings-luggage-entry div {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.settings-buttons {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 0.3rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    margin: 0;
}

.settings-buttons button {
    width: 50%;
}


#settings p {
    margin-top: 0;
}

#additional-settings-title {
    text-transform: uppercase;
    text-align: center;
    margin-top: 0;
}

#additional-settings-container {
    display: flex;
    flex-direction: column;
}

#additional-settings-container .settings-entry label {
    width: 70%;
    font-size: 0.8rem;
}

.settings-extend {
    transition: .2s;
}

.settings-extend::after {
    content: "➤";
}

.settings-extend:hover {
    color: rgb(186, 186, 0);
    cursor: pointer;
}

button {
    min-width: 10vmin;
    border: none;
    background-color: #BEFF48;
    color: black;
    text-transform: uppercase;
    font-family: "Darumadrop One", sans-serif;
    font-weight: 400;
    font-style: normal;
    line-height: 1;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: 0.1s all;
    justify-content: center;
    will-change: transform;
}

button:not([disabled]):hover {
    cursor: pointer;
    scale: 1.05;

}

button:focus:not(:active) {
    animation: buttonClick 0.8s ease;
}

button[disabled] {
    background-color: #9eaa89;
}

button[disabled]:hover {
    animation-name: none;
    cursor: not-allowed;
}

select {
    width: 100%;
    background-color: #BEFF48;
    color: black;
    font-family: "Darumadrop One", sans-serif;
    font-weight: 400;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: 0.1s all;
    will-change: transform;
}

select:hover,
select:focus {
    scale: 1.05;
}

#item-popup {
    width: 20vmin;
    height: 15vmin;
    position: absolute;
    top: 3vmin;
    right: 3vmin;
    transition: all 0.3s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    pointer-events: none;
}

#item-popup-image {
    display: block;
    width: 10vmin;
    height: 10vmin;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% -50%;
}

#item-popup-name {
    margin: 0.5vmin 0 0 0;
}

#credit-overlay {
    position: fixed;
    right: 1vmin;
    bottom: 1vmin;
    width: min(360px, calc(100vw - 24px));
    box-sizing: border-box;
    z-index: 4;
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: right;
}

#credit-overlay > div + div {
    margin-top: 2px;
}

#credit-overlay a {
    color: #BEFF48;
    text-decoration: none;
}

#credit-overlay a:hover {
    text-decoration: underline;
}

#credit-overlay .credit-legal {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
}

a,
a:visited {
    color: white;
    text-decoration: none;
}

#no-data-yet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    pointer-events: none;
    color: rgb(186, 186, 0);
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    z-index: 5;
}

footer {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    width: 100%;
    font-size: 0.8rem;
    padding: 4px 12px;
    box-sizing: border-box;
    pointer-events: auto;
}

#settings-content,
#additional-settings {
    max-height: fit-content;
    opacity: 1;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

/* hidden state */
.ui-hidden #settings-content,
.ui-hidden #additional-settings,
#additional-settings.ui-hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.ui-hidden #credit-overlay {
    opacity: 0.42;
    transition: opacity 0.2s ease;
}

.ui-hidden #credit-overlay:hover {
    opacity: 1;
}

.ui-hidden #hide-ui-entry {
    opacity: 0;
    transition: 0.75s all ease;
}

.ui-hidden #hide-ui-entry:hover {
    opacity: 1;
}

@keyframes pointHover {

    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    20% {
        transform: translate(-50%, -50%) scale(0.9);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }

}

@keyframes buttonClick {

    0% {
        transform: scale(1);
    }

    20% {
        transform: scale(0.9);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }

}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 1280px) {
    #settings {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: none;
        left: 0;
        padding: 0;
        right: 0;
    }

    #additional-settings {
        width: calc(100vw - 24px);
        max-width: 300px;
        left: 12px;
        top: auto;
        bottom: 60px;
    }

    .settings-entry label {
        width: 60%;
    }

    #item-popup {
        width: 140px;
        height: auto;
        padding: 8px;
        top: 12px;
        right: 12px;
    }

    #item-popup-image {
        width: 48px;
        height: 48px;
    }
    #settings-toggle-btn {
        align-self: center;
        pointer-events: auto;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    #hide-ui-entry {
        background: none;
        backdrop-filter: none;
        padding: 0;
        margin: 0;
        border-radius: 0;
    }

    #settings-toggle-btn {
        margin: 8px 0 4px;
        width: auto;
    }

    #hide-ui-entry {
        justify-content: center;
    }

    select:hover,
    select:focus {
        scale: 1;
    }

    #credit-overlay {
        right: 8px;
        bottom: 8px;
        width: min(340px, calc(100vw - 16px));
        font-size: 0.75rem;
    }

    #credit-overlay .credit-legal {
        font-size: 0.66rem;
    }

    #settings-content {
        width: 90%;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }

    #settings.settings-expanded #settings-content {
        max-height: 600px;
        opacity: 1;
        pointer-events: auto;
    }

    .settings-extend::after {
        /* hiding this in mobile as we dont have enough space to fit it anywhere  */
        display: none;
        content: none;
    }

    .mobile-only {
        display: flex;
    }

    .desktop-only {
        display: none;
    }
}

@media (max-width: 890px) {
    .settings-buttons {
        flex-direction: column;
    }

    .settings-buttons button {
        width: 100%;
    }
}