html, body {
    background-color: #111;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow: auto; /* Stelle sicher, dass Scrollen immer möglich ist */
    min-height: 100vh; /* Mindesthöhe des Viewports */
    min-height: -webkit-fill-available; /* Korrigiere Viewport-Höhe auf iOS */
    margin: 0;
    padding: 0;
}

body.no-scroll {
    overflow: hidden; /* Deaktiviere Scrollen, wenn Crop-Overlay aktiv ist */
}

.card-custom {
    background-color: #222;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #333;
}
.btn-yellow {
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
}
.btn-yellow:hover {
    background-color: #e0a800;
}
.btn-gray {
    background-color: #444;
    color: #fff;
    font-weight: bold;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
}
.btn-gray:hover {
    background-color: #555;
}
.badge-date {
    background-color: #444;
    color: #fff;
    font-size: 0.8rem;
    border-radius: 1rem;
    padding: 0.3rem 0.8rem;
}
.input-custom {
    padding: 0.75rem 1.25rem;
}
.h2-custom {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.text-muted {
    font-size: 0.9rem;
}
.form-text.text-muted {
    color: #adb5bd !important;
    font-size: 0.9rem;
}
.form-check-label a {
    color: #ffc107;
    text-decoration: none;
}
.form-check-label a:hover {
    text-decoration: underline;
}
#privacyHelp {
    margin-bottom: 10px;
}
#model-viewer {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 400px; /* Reduziert auf Mobilgeräten */
    border-radius: 1rem;
    overflow: hidden;
    background: #222;
}
#loading-overlay, #error-overlay, #email-overlay, #success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#crop-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vh;
    max-width: 60vw;
    max-height: 60vh;
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    padding: 10px;
}
#crop-overlay-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 1999;
}
.spinner {
    border: 8px solid rgba(255,255,255,0.3);
    border-top: 8px solid #ffc107;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#progress-bar-container {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background: #444;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
#progress-bar {
    height: 100%;
    width: 0%;
    background: #ffc107;
    transition: width 0.3s ease;
}
#progress-bar.converting {
    width: 0%;
    animation: progressAnimation 4s linear forwards;
}
@keyframes progressAnimation {
    0% { width: 0%; }
    100% { width: 100%; }
}
#progress-text, #error-text, #email-text, #success-text {
    color: #fff;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    margin-bottom: 20px;
}
.email-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 80%;
    max-width: 400px;
    margin: 10px 0;
}
#email-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #333;
    color: #fff;
}
#email-submit-btn {
    white-space: nowrap;
}
#email-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
}
#email-close-btn:hover {
    color: #ffc107;
}
#success-dismiss-btn {
    margin-top: 20px;
}
#crop-container {
    position: relative;
    min-width: 250px;
    max-width: 100%;
    max-height: calc(60vh - 80px);
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 0;
    z-index: 2001;
    touch-action: none;
}
#crop-canvas {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    display: block;
    border-radius: 8px;
}
#crop-frame {
    position: absolute;
    border: 2px dashed #ffc107;
    cursor: move;
    box-sizing: border-box;
    pointer-events: auto;
    z-index: 2002;

    /* neu: Hintergrundbild */
    background-image: url("path/to/dein-bild.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
}
#crop-frame:focus {
    outline: none;
}
#crop-frame .resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffc107;
    border-radius: 50%;
    cursor: se-resize;
    pointer-events: auto;
    z-index: 2003;
}
#crop-frame .resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
}
#crop-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    z-index: 2000;
}
#crop-confirm-btn, #crop-cancel-btn {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    width: 120px;
}
#crop-confirm-btn {
    background: #ffc107;
    color: #000;
    border-radius: 0.375rem;
}
#crop-confirm-btn:hover {
    background: #e0a800;
}
#crop-cancel-btn {
    background: #444;
    color: #fff;
    border-radius: 0.375rem;
}
#crop-cancel-btn:hover {
    background-color: #555;
}
#quality-controls {
    background: rgba(34, 34, 34, 0.9);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #333;
    margin-top: 10px;
}
#quality-controls .controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
#quality-controls label {
    display: block;
}
#quality-controls select,
#quality-controls button {
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 14px;
    background: #333;
    color: #fff;
    height: 38px;
    line-height: 1;
    box-sizing: border-box;
}
#quality-controls select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23fff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}
#quality-controls button {
    background: #ffc107;
    color: #000;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}
#quality-controls button:hover {
    background: #e0a800;
}
select:hover {
    background-color: #444;
}
#drag-drop-container {
    margin-top: 10px;
    padding: 15px;
    border: 2px dashed #ffc107;
    border-radius: 5px;
    text-align: center;
    color: #adb5bd;
    cursor: pointer;
}
.instruction-link {
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
}
.instruction-link a {
    color: #ffc107;
    text-decoration: none;
}
.instruction-link a:hover {
    text-decoration: underline;
}
#drag-drop-container.dragover {
    background-color: #333;
}
.py-custom {
    padding-top: .8rem;
    padding-bottom: .8rem;
}
.slider-container {
    position: relative;
    margin-top: 10px;
    overflow: hidden;
}
.slider {
    display: flex;
    transition: transform 0.3s ease;
    touch-action: none;
}
.slider img {
    width: 75px;
    height: 75px;
    object-fit: cover;
    margin-right: 10px;
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 5px;
}
.slider img:hover {
    border-color: #ffc107;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
}
.slider-btn.left {
    left: 0;
}
.slider-btn.right {
    right: 0;
}
.slider-btn:hover {
    background-color: #ffc107;
    color: #000;
}
@media (max-width: 576px) {
    .email-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    #email-input {
        margin-bottom: 10px;
    }
    #email-submit-btn {
        width: 100%;
    }
    #crop-container {
        min-width: 250px;
        max-width: 95vw; /* Etwas Platz für Scrollbars */
        max-height: calc(60vh - 80px);
    }
    #model-viewer {
        max-height: 270px; /* Etwas größer, aber immer noch Platz für Scrollen */
    }
}
@media (max-width: 400px) {
    #crop-container {
        min-width: 250px;
        max-width: 95vw;
    }
    #crop-canvas {
        max-width: 100%;
    }
    #crop-buttons {
        flex-direction: column;
        gap: 5px;
    }
    #crop-confirm-btn, #crop-cancel-btn {
        width: 100%;
    }
}
@media (max-width: 767px) {
    .card-custom {
        padding: 1.5rem;
    }
    .h2-custom {
        font-size: 1.8rem;
    }
    .slider-container {
        width: 100%;
    }
    .slider img {
        width: 60px;
        height: 60px;
    }
}
@media (max-width: 576px) {
    #drag-drop-container {
        font-size: 14px;
    }
    .instruction-link {
        font-size: 0.85rem;
    }
    .slider img {
        width: 50px;
        height: 50px;
    }
}