html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 16px;
    overflow: hidden;
}

html {
    background-color: #FFFDE7;
}

body {
    font-family: Courier;
    min-height: 100vh;
    background-color: transparent;
}

.container {
    padding: 30px;
    text-align: center;
}

.image-container {
    display: flex;
    justify-content: center;
    position: relative;
}

.spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.active {
    display: block;
}

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

.heading {
    display: none;
}

.nav {
    margin-top: 15px;
    margin-bottom: 20px;
    user-select: none;
}

.nav a {
    cursor: pointer;
    user-select: none;
    padding: 0 15px;
    display: inline-block;
}

.nav a.disabled {
    color: #ccc;
    pointer-events: none;
}

#counter {
    padding: 0 10px;
    color: #666;
}

.image-container img {
    max-width: calc(100vw - 60px);
    max-height: calc(100vh - 160px);
    height: auto;
    width: auto;
    object-fit: contain;
}

#restart {
    margin-top: 20px;
}

#restart a {
    cursor: pointer;
}

.home {
    margin-top: 20px;
    margin-bottom: 30px;
}

.home a {
    color: black;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    cursor: zoom-out;
    overflow: hidden;
    user-select: none;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transform-origin: center center;
}

.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    overflow: auto;
}

.info-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.info-modal-content {
    color: #fff;
    max-width: 600px;
    width: calc(100vw - 50px);
    padding: 40px;
    font-family: Courier;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.info-modal-content a {
    color: #fff;
}

.info-modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .info-modal.active {
        align-items: flex-start;
        padding-top: 60px;
    }

    .info-modal-content {
        padding: 25px;
        font-size: 14px;
    }

    .info-modal-close {
        top: 15px;
        right: 20px;
        font-size: 20px;
    }
}

@media (hover: hover) {
    .image-container img {
        cursor: zoom-in;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 30px;
        padding-bottom: 60px;
    }

    .heading {
        font-size: 1.5em;
    }

    .nav {
        margin-top: 5px;
        margin-bottom: 10px;
        font-size: 0.9em;
    }

    .image-container img {
        max-width: calc(100vw - 30px);
        max-height: calc(100vh - 120px);
    }

    .home {
        position: fixed;
        bottom: 15px;
        left: 0;
        right: 0;
    }
}

@media (max-width: 926px) and (orientation: landscape) {
    html, body {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100%;
        position: static !important;
        -webkit-overflow-scrolling: touch;
    }

    .container {
        padding: 15px 30px 20px 30px;
        min-height: auto;
        height: auto;
        overflow: visible;
        display: block;
    }

    .nav {
        margin-top: 0;
        margin-bottom: 8px;
    }

    .home {
        position: static;
        margin-top: 15px;
        margin-bottom: 0;
    }

    .image-container img {
        max-height: 60vh;
    }
}
