* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: white;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    position: relative;
    padding: 15px;
}

#gallery {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: #ffffff;
    overflow: hidden;
    padding: 10px;
    border: none;
    box-sizing: border-box;
    margin: 0;
    will-change: min-height;
}

.image-container {
    position: absolute;
    cursor: pointer;
    overflow: hidden;
    box-shadow: none;
    border-radius: 0;
    transition: transform 0.5s ease, z-index 0.01s, opacity 1.2s ease-in-out, left 0.8s ease, top 0.8s ease;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-container.active {
    z-index: 100;
    transform: scale(1.05);
    box-shadow: none;
}

/* Ladeindikator */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background-color: transparent;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: auto;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loading .loading-button,
#loading .random-button {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 15px 40px;
    box-shadow: none;
    border: 0.5px solid black;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    min-width: 250px;
    max-width: 90vw;
    visibility: visible;
}

#loading .loading-button:hover,
#loading .random-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.loading-text {
    margin: 0;
    font-size: 44px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: white;
    -webkit-text-stroke: 0.5px black;
    text-shadow: none;
    letter-spacing: 0.5px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.spinner {
    display: none;
}

#code-display {
    position: fixed;
    top: 20px;
    left: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: black;
    font-size: 12px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    width: 300px;
    height: 150px;
    pointer-events: none;
    line-height: 1.6;
    border: 0.5px solid black;
    overflow: hidden;
    box-sizing: border-box;
}

#code-display::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 15px;
    pointer-events: none;
}

#code-display > * {
    margin: 15px;
}

/* Vereinfachte Responsive Anpassungen */
@media (max-width: 768px) {
    .loading-text {
        font-size: 32px;
    }
    
    #code-display {
        width: calc(100% - 40px);
        top: 10px;
        left: 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    #gallery {
        padding: 5px;
    }
    
    .loading-text {
        font-size: 24px;
    }
    
    #loading .loading-button,
    #loading .random-button {
        padding: 12px 30px;
        min-width: 200px;
    }
}

/* Optimierte Bildladung */
@media (prefers-reduced-motion) {
    .image-container, 
    .image-container img,
    #loading,
    #loading .loading-button,
    #loading .random-button,
    .loading-text {
        transition: none !important;
    }
} 