html, body {
    width: 100%;
    height: 100%;
    background: black;
}

#content {
    width: 100%;
    height: 100%;
}

#gameIntro {
    position: absolute;
    top: 12px;
    left: 20px;
    right: 220px;
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#miniMap {
    width: 500px;
    height: 300px;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0px 0px 20px rgba(255,255,255, 0.9);
}

#timer {
    font-size: 90px;
    line-height: 200px;
    text-align: center;
    width: 500px;
    height: 200px;
    background: green;
    position: absolute;
    top: 390px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0px 0px 20px rgba(255,255,255, 0.9);
}

#guessButton {
    font-size: 24px;
    font-weight: bold;
    color: white;
    width: 460px;
    cursor: pointer;
    text-align: center;
    position: absolute;
    top: 340px;
    right: 20px;
    z-index: 1000;
}

#guessButton:hover {
    background: #FF6666;
}

#imageWrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageLoader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}

#imageLoader::before {
    content: "";
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: imageLoaderSpin 0.9s linear infinite;
}

#imageLoader .imageLoaderProgress {
    font-size: 14px;
    opacity: 0.9;
}

#imageLoader:not([aria-hidden="false"]) {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#imageLoader[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

@keyframes imageLoaderSpin {
    to { transform: rotate(360deg); }
}

#image {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    z-index: 1;
}

#scoreBoard {
    position: absolute;
    bottom: 45px;
    left: 20px;
    width: 200px;
    height: 110px;
    padding: 10px;
    background: white;
    box-shadow: 0px 0px 20px rgba(0,0,0, 0.9);
    z-index: 1000;
}

select {
    width: 200px;
}

#scoreBoard .round {
}

#scoreboard .totalScore {
}

#roundEnd {
    position: absolute;
    left: 50%;
    width: 400px;
    margin: 40px 0 0 -200px;
    padding: 20px;
    background: white;
    text-align: center;
    display: none;
    z-index: 1005;
    box-shadow: 0px 0px 20px rgba(255,255,255, 0.9);
}

#roundEnd #roundMap {
    width: 400px;
    height: 300px;
    margin: 20px 0;
}

#roundEnd .closeBtn {
    cursor: pointer;
}

#roundMap {
    width: 500px;
    height: 500px;
    position: relative;
}

#endGame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    margin: -190px 0 0 -240px;
    padding: 20px;
    background: #EFEFEF;
    text-align: center;
    display: none;
    z-index: 1000;
}

#footerLinks {
    position: absolute;
    bottom: 10px;
    right: 20px;
    max-width: 500px;
    font-size: 12px;
    text-align: right;
    z-index: 1000;
}

#footerLinks .footerHelp {
    margin: 0 0 6px 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

#footerLinks .footerHelp a {
    color: rgba(255, 255, 255, 0.95);
}

#footerLinks > a {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin-top: 4px;
}

#footerLinks a:hover {
    text-decoration: underline;
    color: #fff;
}

/* Change cursor when mousing over clickable layer */
.leaflet-clickable {
  cursor: default !important;
}

/* Change cursor when over entire map */
.leaflet-container {
    cursor: default !important;
}

/* Mobile: stack vertically – intro, image on top, map below (no black zone) */
@media (max-width: 768px) {
    html, body {
        min-height: 100%;
        overflow-x: hidden;
    }

    #content {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        padding-bottom: 12px;
    }

    #gameIntro {
        display: block;
        order: 0;
        margin: 0;
        padding: 10px 12px;
        font-size: 14px;
        line-height: 1.4;
        color: rgba(255, 255, 255, 0.95);
        background: rgba(0, 0, 0, 0.85);
        position: static;
        flex-shrink: 0;
    }

    #imageWrap {
        order: 1;
        position: static;
        min-height: 42vh;
        flex-shrink: 0;
    }

    #image {
        max-height: 42vh;
        width: 100%;
        object-fit: contain;
        background: #111;
    }

    #miniMap {
        order: 2;
        position: static;
        width: 100% !important;
        height: 320px;
        margin: 0 0 8px 0;
        flex-shrink: 0;
    }

    #guessButton {
        order: 3;
        position: static;
        width: auto;
        max-width: calc(100% - 24px);
        margin: 0 12px 12px;
        flex-shrink: 0;
    }

    #scoreBoard {
        order: 4;
        position: static;
        width: auto;
        max-width: 100%;
        margin: 0 12px 12px;
        flex-shrink: 0;
    }

    #footerLinks {
        order: 5;
        position: static;
        margin: 12px 12px 0;
        text-align: left;
        flex-shrink: 0;
    }

    #roundEnd, #endGame {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: 95vw;
        margin: 0;
    }

    #roundEnd #roundMap {
        width: 100%;
        max-width: 360px;
        height: 240px;
    }
}
