/* ==================================================================
   Foto-Oval-Editor – style.css

   Neon-Nachtwelt: eigenständige Farbwelt (Pink, Türkis, Cyan, Violett),
   Hintergrund vollständig per CSS erzeugt (keine externen Bilder).

   Wichtig: Der exportierte PNG und der Druckausdruck bleiben neutral –
   weißer Hintergrund, schwarzer 1-mm-Rand am ovalen Motiv.
   Neon-Effekte sind ausschließlich Bildschirm-Elemente.
   ================================================================== */

:root {
    /* Abstandsskala (einheitlich im ganzen Layout) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 32px;
    --sp-8: 40px;

    --gap: 20px;                     /* Abstand zwischen Karten/Spalten */
    --card-pad: 20px;                /* Innenabstand der Karten        */
    --card-radius: 18px;             /* Eckenradius der Karten         */

    --k: 1;                          /* Vorschau-Skalierung (JS)       */
    --frame-w: 50mm;                 /* Rahmenbreite                  */
    --frame-h: 137mm;                /* Rahmenhöhe                    */
    --frame-border: 1mm;             /* Rahmenstärke (schwarz)         */
    --sheet-pad: 6mm;                /* Weißer Rand um das Oval       */

    --neon-pink: #ff2e88;
    --neon-magenta: #ff00c8;
    --neon-cyan: #00e7ff;
    --neon-turquoise: #14f0d0;
    --neon-violet: #9b5cff;
    --neon-blue: #4f7bff;

    --bg-0: #05060f;
    --bg-1: #0a0a1e;
    --text: #eaf2ff;
    --text-dim: #9fb0d8;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-line: rgba(0, 231, 255, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-0);
    scroll-behavior: smooth;
    overflow-x: hidden;          /* Ziehpunkte duerfen nicht scrollen */
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: transparent;
    color: var(--text);
    font-family: "Eurostile", "Bank Gothic", "Michroma", "Orbitron", "Segoe UI",
        system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

/* ==================================================================
   Hintergrund – Neon-Nachtwelt, rein mit CSS
   ================================================================== */

.neon-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% 120%, rgba(155, 92, 255, 0.22), transparent 60%),
        linear-gradient(165deg, #05060f 0%, #090a20 38%, #120b2e 68%, #05060f 100%);
}

.neon-glow {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
}

.neon-glow--pink {
    width: 46vw;
    height: 46vw;
    min-width: 280px;
    min-height: 280px;
    top: -14vw;
    left: -10vw;
    background: radial-gradient(circle, rgba(255, 46, 136, 0.85), rgba(255, 0, 200, 0) 68%);
    animation: drift-a 26s ease-in-out infinite alternate;
}

.neon-glow--cyan {
    width: 52vw;
    height: 52vw;
    min-width: 300px;
    min-height: 300px;
    top: 6vh;
    right: -16vw;
    background: radial-gradient(circle, rgba(0, 231, 255, 0.72), rgba(0, 120, 255, 0) 68%);
    animation: drift-b 32s ease-in-out infinite alternate;
}

.neon-glow--violet {
    width: 60vw;
    height: 40vw;
    min-width: 320px;
    min-height: 260px;
    bottom: -16vw;
    left: 12vw;
    background: radial-gradient(circle, rgba(155, 92, 255, 0.8), rgba(79, 123, 255, 0) 70%);
    animation: drift-c 38s ease-in-out infinite alternate;
}

/* feines Raster */
.neon-grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(120, 210, 255, 0.055) 0 1px, transparent 1px 46px),
        repeating-linear-gradient(90deg, rgba(255, 90, 190, 0.045) 0 1px, transparent 1px 46px);
    -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 20%, transparent 85%);
    mask-image: radial-gradient(120% 90% at 50% 40%, #000 20%, transparent 85%);
}

/* Leuchtende Horizontlinie - liegt tief am Rand, damit sie nie durch
   Text laeuft (z. B. im Bereich der Hinweise oder der Copyright-Zeile) */
.neon-horizon {
    position: absolute;
    left: -10%;
    right: -10%;
    top: 93%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 45, 146, 0.75), rgba(0, 231, 255, 0.85), rgba(255, 0, 200, 0.7), transparent);
    box-shadow: 0 0 26px rgba(255, 45, 146, 0.45), 0 0 70px rgba(0, 231, 255, 0.28);
    opacity: 0.32;
}

.neon-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 95% at 50% 42%, transparent 42%, rgba(2, 3, 10, 0.85) 100%);
}

@keyframes drift-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(9vw, 7vh, 0) scale(1.12); }
}

@keyframes drift-b {
    from { transform: translate3d(0, 0, 0) scale(1.05); }
    to   { transform: translate3d(-11vw, 9vh, 0) scale(0.95); }
}

@keyframes drift-c {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(7vw, -6vh, 0) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .neon-glow { animation: none; }
    html { scroll-behavior: auto; }
}

/* ==================================================================
   Kopfzeile
   ================================================================== */

.site-header,
.layout {
    position: relative;
    z-index: 1;
}

.site-header {
    padding: var(--sp-5) var(--sp-6) var(--sp-3);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
    flex-wrap: wrap;
    max-width: 1440px;
    margin: 0 auto;
}

.header-title {
    min-width: 0;
}

.header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.site-header h1 {
    margin: 0;
    text-align: left;
    font-size: clamp(24px, 5.4vw, 40px);
    font-weight: 800;
    letter-spacing: 0.16em;
    background: linear-gradient(92deg, var(--neon-turquoise) 0%, var(--neon-cyan) 26%, var(--neon-pink) 62%, var(--neon-violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 16px rgba(255, 46, 136, 0.42)) drop-shadow(0 0 34px rgba(0, 231, 255, 0.25));
}

.site-header h1::after {
    content: "";
    display: block;
    width: 190px;
    height: 1px;
    margin: 10px 0 0;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), transparent);
    box-shadow: 0 0 14px rgba(0, 231, 255, 0.65);
}

.subtitle {
    margin: 10px 0 0;
    color: var(--text-dim);
    font-size: 14px;
    letter-spacing: 0.04em;
}

/* Schlanke Statuszeile unter der Kopfzeile */
.status {
    max-width: 1440px;
    margin: var(--sp-3) auto 0;
    min-height: 20px;
    font-size: 13.5px;
    color: var(--text-dim);
}

.status.error {
    color: var(--neon-pink);
    font-weight: 600;
    text-shadow: 0 0 14px rgba(255, 46, 136, 0.55);
}

.status.ok {
    color: var(--neon-turquoise);
    text-shadow: 0 0 14px rgba(20, 240, 208, 0.45);
}

/* ==================================================================
   Schaltflächen – Neon
   ================================================================== */

.btn {
    display: block;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: box-shadow 0.18s ease, transform 0.12s ease, filter 0.18s ease;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* FOTO HOCHLADEN – Neon-Türkis */
.btn--cyan {
    background: linear-gradient(135deg, #16f7d8 0%, #00d4ff 100%);
    color: #02151c;
    box-shadow:
        0 0 18px rgba(0, 231, 255, 0.45),
        0 0 46px rgba(0, 200, 255, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn--cyan:hover {
    box-shadow:
        0 0 26px rgba(0, 231, 255, 0.75),
        0 0 70px rgba(0, 200, 255, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* PNG HERUNTERLADEN – Neon-Pink */
.btn--pink {
    background: linear-gradient(135deg, #ff2e88 0%, #ff00c8 100%);
    color: #1b0012;
    box-shadow:
        0 0 18px rgba(255, 46, 136, 0.5),
        0 0 48px rgba(255, 0, 200, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--pink:hover {
    box-shadow:
        0 0 28px rgba(255, 46, 136, 0.8),
        0 0 74px rgba(255, 0, 200, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* DRUCKEN – Neon-Violett */
.btn--violet {
    background: linear-gradient(135deg, #9b5cff 0%, #5b7bff 100%);
    color: #f7f3ff;
    box-shadow:
        0 0 18px rgba(155, 92, 255, 0.5),
        0 0 48px rgba(91, 123, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--violet:hover {
    box-shadow:
        0 0 28px rgba(155, 92, 255, 0.8),
        0 0 74px rgba(91, 123, 255, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Umriss-Button (ZURÜCKSETZEN) */
.btn--outline {
    background: rgba(0, 231, 255, 0.06);
    border-color: rgba(0, 231, 255, 0.55);
    color: var(--neon-cyan);
    box-shadow: inset 0 0 18px rgba(0, 231, 255, 0.08);
}

.btn--outline:hover {
    background: rgba(0, 231, 255, 0.14);
    box-shadow: 0 0 22px rgba(0, 231, 255, 0.4), inset 0 0 22px rgba(0, 231, 255, 0.14);
}

/* kleine Tasten (+ / −) */
.btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 231, 255, 0.4);
    color: var(--neon-cyan);
}

.btn--ghost:hover {
    background: rgba(0, 231, 255, 0.14);
    box-shadow: 0 0 18px rgba(0, 231, 255, 0.45);
}

.btn-small {
    width: 54px;
    padding: 10px 0;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0;
    border-radius: 12px;
}

.btn-upload {
    width: auto;
    min-width: 210px;
    padding: 15px 28px;
    font-size: 17px;
}

.card .btn + .btn,
.card .btn + .hint,
.card .hint + .btn {
    margin-top: var(--sp-3);
}

.card .action-row {
    margin-bottom: var(--sp-1);
}

/* ==================================================================
   Layout
   ================================================================== */

/* ==================================================================
   Hauptraster: Arbeitsbereich | Werkzeuge und Ausgabe
   ================================================================== */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
    max-width: 1460px;
    margin: 0 auto;
    padding: var(--sp-3) var(--sp-6) var(--sp-8);
}

.col {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
}

/* Rahmen links, Transformation + Rahmenmasse direkt daneben */
.work-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(300px, 360px);
    gap: var(--gap);
    align-items: start;
}

/* Hinweise: volle Breite unter dem Arbeitsbereich */
.col--notes {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    align-items: start;
}

.card--note h2 {
    color: var(--neon-violet);
    text-shadow: 0 0 14px rgba(155, 92, 255, 0.55);
}

.card--note p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text);
}

.card--note-warn {
    border-color: rgba(255, 46, 136, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 18px 42px rgba(0, 0, 0, 0.38),
        0 0 34px rgba(255, 46, 136, 0.14);
}

.card--note-warn h2 {
    color: var(--neon-pink);
    text-shadow: 0 0 14px rgba(255, 46, 136, 0.6);
}

@media (max-width: 880px) {
    .col--notes {
        grid-template-columns: minmax(0, 1fr);
    }
}

.col--transform {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
}

/* Tablet: einspaltig, die Karten bleiben intern zweispaltig */
@media (max-width: 1180px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .work-grid {
        grid-template-columns: minmax(260px, 1fr) minmax(300px, 380px);
    }
}

/* Smartphone: alles untereinander */
@media (max-width: 880px) {
    .work-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}



.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    align-items: stretch;
}

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

/* Zwei Hauptaktionen gleich breit */
.action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
}

.panel-block h2 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    text-shadow: 0 0 14px rgba(0, 231, 255, 0.55);
}

.zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-row input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 30px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.zoom-row input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(20, 240, 208, 0.95), rgba(0, 231, 255, 0.85) 45%, rgba(255, 46, 136, 0.9));
    box-shadow: 0 0 14px rgba(0, 231, 255, 0.45);
}

.zoom-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -7px;
    border-radius: 50%;
    background: #ffffff;
    border: 0;
    box-shadow: 0 0 12px rgba(0, 231, 255, 0.95), 0 0 26px rgba(255, 46, 136, 0.6);
    cursor: pointer;
}

.zoom-row input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(20, 240, 208, 0.95), rgba(0, 231, 255, 0.85) 45%, rgba(255, 46, 136, 0.9));
    box-shadow: 0 0 14px rgba(0, 231, 255, 0.45);
}

.zoom-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 0;
    box-shadow: 0 0 12px rgba(0, 231, 255, 0.95), 0 0 26px rgba(255, 46, 136, 0.6);
    cursor: pointer;
}

.dim-row {
    display: flex;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}

.dim-row--small {
    gap: 8px;
}

.dim-field {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.dim-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 231, 255, 0.45);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--neon-turquoise);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    box-shadow: inset 0 0 12px rgba(0, 231, 255, 0.08);
}

.dim-field input:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: 0 0 14px rgba(255, 46, 136, 0.45);
}

.btn-step {
    flex: 1 1 0;
    width: auto;
    padding: 8px 0;
    font-size: 14px;
    letter-spacing: 0;
}

.btn-step--wide {
    flex: 0 0 auto;
    min-width: 62px;
    padding: 10px 12px;
}

.zoom-value {
    margin: var(--sp-2) 0 var(--sp-4);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--neon-turquoise);
    text-shadow: 0 0 12px rgba(20, 240, 208, 0.45);
}

.hint {
    margin: var(--sp-3) 0 0;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.55;
    word-break: break-word;
}

.hint strong {
    color: var(--text);
}

.hint code {
    color: var(--neon-cyan);
    font-size: 12px;
    word-break: break-all;
}

/* ==================================================================
   Fußzeile – Copyright in Neon-Typografie
   ================================================================== */

.site-footer {
    position: relative;
    z-index: 1;
    margin-top: var(--sp-6);
    padding: var(--sp-5) var(--sp-6) var(--sp-7);
    text-align: center;
    background: linear-gradient(180deg, rgba(5, 6, 15, 0.55), rgba(5, 6, 15, 0.9));
    border-top: 1px solid rgba(0, 231, 255, 0.18);
}

.footer-copy {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--text-dim);
}

.footer-name {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.14em;
    background: linear-gradient(92deg, var(--neon-cyan) 0%, var(--neon-turquoise) 28%, var(--neon-pink) 68%, var(--neon-violet) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter:
        drop-shadow(0 0 8px rgba(0, 231, 255, 0.85))
        drop-shadow(0 0 20px rgba(255, 46, 136, 0.55))
        drop-shadow(0 0 34px rgba(155, 92, 255, 0.35));
}

.footer-note {
    margin: 8px 0 0;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: rgba(159, 176, 216, 0.7);
}

/* ==================================================================
   Bühne und ovaler Fotorahmen
   ================================================================== */

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    width: 100%;
}

.frame-area {
    position: relative;
    width: calc((var(--frame-w) + 2 * var(--sheet-pad)) * var(--k));
    height: calc((var(--frame-h) + 2 * var(--sheet-pad)) * var(--k));
    max-width: 100%;
}

.frame-scaler {
    width: calc(var(--frame-w) + 2 * var(--sheet-pad));
    height: calc(var(--frame-h) + 2 * var(--sheet-pad));
    transform: scale(var(--k));
    transform-origin: top left;
}

/* Weisser "Bogen": entspricht dem weissen Hintergrund von Export und Druck */
.sheet {
    width: 100%;
    height: 100%;
    padding: var(--sheet-pad);
    background: #ffffff;
    border-radius: 3mm;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.22),
        0 22px 60px rgba(0, 0, 0, 0.6),
        0 0 44px rgba(0, 231, 255, 0.38),
        0 0 96px rgba(255, 46, 136, 0.28);
}

/* Der ovale Rahmen: exakt 50 x 137 mm, 1 mm schwarzer Rand */
.frame {
    position: relative;
    width: var(--frame-w);
    height: var(--frame-h);
    border: var(--frame-border) solid #000000;
    border-radius: 50%;
    background: #ffffff;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.frame.dragging {
    cursor: grabbing;
}

/* Hinweis im Oval: exakt mittig, gut lesbar */
.frame-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8%;
    pointer-events: none;
    z-index: 1;
}

.frame-hint-text {
    display: block;
    width: 100%;
    color: #0b1530;
    font-size: clamp(14px, 4.2mm, 22px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.04em;
    text-shadow:
        0 0 10px rgba(0, 231, 255, 0.35),
        0 0 18px rgba(255, 46, 136, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.7);
    opacity: 1;
}

.frame-hint-text strong {
    color: #ff2e88;
    font-weight: 800;
}

.has-photo .frame-hint {
    display: none;
}

/* Das Bild selbst: nie verzerrt, nie beschnitten */
.photo {
    max-width: none;
    -webkit-user-drag: none;
    user-select: none;
}

.stage-caption {
    margin: var(--sp-3) 0 0;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.stage-caption-hint {
    color: rgba(20, 240, 208, 0.75);
    font-size: 12px;
}

/* ==================================================================
   Bilder in der Bühne – Rahmen mit Ziehpunkten
   ================================================================== */

.canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
}

.img-box {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
}

.img-box .photo {
    width: 100%;
    height: 100%;
    object-fit: cover;            /* füllt das Ausschnittfenster (Zuschnitt) */
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.img-box.is-selected {
    outline: 1px solid rgba(0, 231, 255, 0.55);
    outline-offset: 1px;
}

/* Ziehpunkte: Ecken (Seitenverhältnis) und Kanten (frei) */
.handle {
    position: absolute;
    width: 3.4mm;
    height: 3.4mm;
    margin: 0;
    border-radius: 50%;
    background: #ffffff;
    border: 0.7mm solid var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 231, 255, 0.95), 0 0 18px rgba(255, 46, 136, 0.45);
    opacity: 1;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: border-color 0.12s ease;
}

/* größere Touch-Fläge, ohne die Optik zu verändern */
.handle::after {
    content: "";
    position: absolute;
    left: -4mm;
    right: -4mm;
    top: -4mm;
    bottom: -4mm;
}

/* Overlay-Ebene über dem Rahmen – nicht abgeschnitten, damit die Griffe
   auch ausserhalb des Ovals erreichbar bleiben */
.handle-overlay {
    position: absolute;
    left: var(--sheet-pad);
    top: var(--sheet-pad);
    width: var(--frame-w);
    height: var(--frame-h);
    overflow: visible;
    pointer-events: none;
    display: none;
    z-index: 3;
}

/* Overlay nur einblenden, wenn ein Bild ausgewählt ist.
   Keine Opacity-Transition: die Griffe sind dadurch immer klar sichtbar. */
.handle-overlay.is-visible {
    display: block;
}

.handle-overlay.is-visible .handle {
    pointer-events: auto;
}

/* Gestrichelter Rahmen = echte Ausdehnung des gewaehlten Bildes */
.selection-box {
    position: absolute;
    left: 50%;
    top: 50%;
    border: 1px dashed rgba(0, 231, 255, 0.65);
    pointer-events: none;
}

.handle--nw { cursor: nwse-resize; }
.handle--ne { cursor: nesw-resize; }
.handle--sw { cursor: nesw-resize; }
.handle--se { cursor: nwse-resize; }
.handle--n  { cursor: ns-resize; }
.handle--s  { cursor: ns-resize; }
.handle--w  { cursor: ew-resize; }
.handle--e  { cursor: ew-resize; }

/* Drehgriff */
.handle--rotate {
    width: 4.4mm;
    height: 4.4mm;
    border-color: var(--neon-pink);
    border-style: solid;
    box-shadow: 0 0 10px rgba(255, 46, 136, 0.95), 0 0 22px rgba(155, 92, 255, 0.5);
    cursor: grab;
}

.handle--rotate:active {
    cursor: grabbing;
}

/* Kontrollkästchen */
.check-field {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    cursor: pointer;
}

.check-field input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--neon-cyan);
    flex: 0 0 auto;
    cursor: pointer;
}

.check-field small {
    color: var(--text-dim);
    font-size: 12px;
}

kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid rgba(0, 231, 255, 0.5);
    border-radius: 4px;
    background: rgba(0, 231, 255, 0.1);
    font-family: inherit;
    font-size: 11px;
    color: var(--neon-cyan);
}

.handle:hover {
    border-color: var(--neon-pink);
    box-shadow: 0 0 12px rgba(255, 46, 136, 0.95), 0 0 24px rgba(255, 46, 136, 0.55);
}

/* ==================================================================
   Kleine Bildschirme
   ================================================================== */

@media (max-width: 900px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding-top: 18px;
    }

    .site-header h1 {
        letter-spacing: 0.16em;
    }

    .panel-block {
        padding: 14px;
    }
}

@media (max-width: 520px) {
    .btn {
        padding: 15px 12px;
        font-size: 15px;
        letter-spacing: 0.08em;
    }

    .btn-upload {
        font-size: 16px;
    }
}

/* ==================================================================
   Druckansicht – bewusst schlicht und unverändert
   (weißer Hintergrund, schwarzer 1-mm-Rand, keine Neon-Effekte)
   ================================================================== */

#printArea {
    display: none;
}

@media print {

    @page {
        size: 210mm 297mm;
        margin: 0;
    }

    html,
    body {
        width: 210mm;
        height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
    }

    /* Hintergrund, Kopfzeile, Bedienfeld, Fußzeile: alles aus */
    .neon-bg,
    .site-header,
    .layout,
    .site-footer {
        display: none !important;
    }

    body > *:not(#printArea) {
        display: none !important;
    }

    #printArea {
        display: block !important;
        position: static;
        margin: 0;
        padding: 0;
        width: 210mm;
        height: 297mm;
        background: #fff !important;
    }

    .print-sheet {
        width: 210mm;
        height: 297mm;
    }

    .print-frame {
        border: 1mm solid #000;
        border-radius: 50%;
        box-sizing: border-box;
        overflow: hidden;
        background: #fff;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-frame .photo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform-origin: center center;
        object-fit: cover;
        pointer-events: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


/* ==================================================================
   Responsive-Overrides
   (stehen bewusst am Dateiende, damit sie die Basisregeln ueberschreiben)
   ================================================================== */

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .work-grid {
        grid-template-columns: minmax(260px, 1fr) minmax(300px, 380px);
    }
}

@media (max-width: 880px) {
    .work-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .layout {
        padding: var(--sp-2) var(--sp-4) var(--sp-7);
    }

    /* Karten und Hauptaktionen einzeilig stapeln */
    .card-grid,
    .action-row {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Lesbare Buttons auf kleinen Displays */
    .btn {
        padding: var(--sp-4) var(--sp-3);
        font-size: 15px;
        letter-spacing: 0.08em;
    }

    .btn-upload {
        width: 100%;
        min-width: 0;
    }

    .header-bar {
        gap: var(--sp-4);
    }

    .header-actions {
        width: 100%;
    }
}

/* Druckanzahl-Auswahl */
#printCount {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 231, 255, 0.45);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--neon-turquoise);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
}
#printCount:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: 0 0 14px rgba(255, 46, 136, 0.45);
}

/* Drucklayout Mehrfachdruck (A4) */
.print-sheet {
    position: relative;
    width: 210mm;
    height: 297mm;
    background: #fff;
    overflow: hidden;
}
.print-copy {
    position: absolute;
    overflow: visible;
}
.print-copy .print-frame {
    position: relative;
    transform-origin: top left;
}

/* AGB-Button und Modal */
.btn-agb {
    width: auto;
    min-width: 210px;
    padding: 15px 20px;
    font-size: 14px;
}
.agb-modal[hidden] { display: none !important; }
.agb-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}
.agb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 15, 0.72);
    backdrop-filter: blur(4px);
}
.agb-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(90vh, 100%);
    display: flex;
    flex-direction: column;
    background: rgba(10, 12, 30, 0.82);
    border: 1px solid rgba(0, 231, 255, 0.28);
    border-radius: var(--card-radius);
    box-shadow: 0 0 0 1px rgba(155, 92, 255, 0.12), 0 24px 60px rgba(0,0,0,0.55), 0 0 40px rgba(0,231,255,0.12);
    backdrop-filter: blur(12px);
    overflow: hidden;
}
.agb-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid rgba(0, 231, 255, 0.18);
}
.agb-modal__header h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    text-shadow: 0 0 14px rgba(0, 231, 255, 0.45);
}
.agb-modal__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 46, 136, 0.45);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.agb-modal__close:hover { box-shadow: 0 0 18px rgba(255,46,136,0.35); }
.agb-modal__notice {
    margin: 0;
    padding: 10px var(--sp-5);
    font-size: 13px;
    color: #ffe7a3;
    background: rgba(255, 170, 0, 0.08);
    border-bottom: 1px solid rgba(255, 170, 0, 0.18);
}
.agb-modal__body {
    padding: var(--sp-4) var(--sp-5);
    overflow: auto;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
}
.agb-modal__body h3 { margin-top: 0; color: var(--neon-turquoise); }
.agb-modal__body p { margin: 0 0 12px; }
.agb-modal__body ul { margin: 0 0 12px 20px; padding: 0; }
.agb-modal__body li { margin: 4px 0; }
.agb-modal__draft { color: var(--neon-pink); }
.agb-modal__footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid rgba(0, 231, 255, 0.18);
    background: rgba(5, 6, 15, 0.35);
}
.agb-modal__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}
.agb-modal__check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--neon-cyan); }
.agb-modal__actions {
    display: flex;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    flex-wrap: wrap;
}
.agb-modal__actions .btn { width: auto; min-width: 180px; flex: 1 1 180px; }
.agb-modal__status { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); min-height: 20px; }

@media (max-width: 620px) {
    .btn-agb { width: 100%; min-width: 0; font-size: 14px; }
    .agb-modal { padding: var(--sp-2); }
    .agb-modal__header, .agb-modal__body, .agb-modal__footer { padding-left: var(--sp-4); padding-right: var(--sp-4); }
    .agb-modal__actions .btn { width: 100%; }
}

/* AGB Pflichtfenster/Gate */
body.agb-locked {
    overflow: hidden;
}
body.agb-locked .site-header,
body.agb-locked .layout,
body.agb-locked .site-footer {
    pointer-events: none;
    user-select: none;
    filter: blur(2px) saturate(0.7);
}
.agb-modal--gate .agb-modal__backdrop {
    background: rgba(5, 6, 15, 0.88);
}
.agb-modal__actions--gate .btn {
    width: 100%;
    min-width: 0;
}

/* AGB Lesemodus (bei gültiger Zustimmung) */
.agb-modal__actions--gate #agbCloseBtn { display: none; }
.agb-modal--view .agb-modal__actions--gate #agbCloseBtn { display: inline-block; }
.agb-modal--view .agb-modal__actions--gate #agbConfirmBtn { display: none; }
.agb-modal--view .agb-modal__check { display: none; }
.agb-modal:not(.agb-modal--view) #agbCloseX { display: none; }

/* ------------------------------------------------------------------ */
/* Support-Service (WhatsApp)                                          */
/* ------------------------------------------------------------------ */

.btn-support {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-support .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.btn-support .btn-icon svg {
  display: block;
}

.support-modal[hidden] { display: none !important; }
.support-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.support-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 14, 0.72);
  backdrop-filter: blur(4px);
}
.support-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(22, 247, 216, 0.45);
  background: linear-gradient(180deg, rgba(16, 20, 40, 0.98), rgba(8, 10, 24, 0.98));
  box-shadow: 0 0 0 1px rgba(155, 92, 255, 0.15), 0 20px 60px rgba(0,0,0,0.55), 0 0 30px rgba(22,247,216,0.12);
  color: #eaf2ff;
}
.support-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.support-modal__header h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}
.support-modal__close {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}
.support-modal__close:hover,
.support-modal__close:focus-visible {
  box-shadow: 0 0 16px rgba(255,46,136,0.3);
  border-color: rgba(255,46,136,0.5);
}
.support-modal__body {
  padding: 16px 18px 8px;
}
.support-modal__body p {
  margin: 0 0 10px;
}
.support-modal__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 18px 10px;
}
.support-modal__actions .btn {
  width: 100%;
  min-height: 44px;
}
.support-modal__hint {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 0.9rem;
  color: rgba(234,242,255,0.78);
}
body.support-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .support-modal__actions {
    grid-template-columns: 1fr;
  }
  .header-actions {
    flex-wrap: wrap;
  }
  .btn-support {
    width: 100%;
  }
}


/* ------------------------------------------------------------------ */
/* Header-Buttons: einheitliche Darstellung                            */
/* ------------------------------------------------------------------ */
.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
}
.header-actions .btn {
  min-height: 48px;
  padding: 12px 18px;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.header-actions .btn-agb,
.header-actions .btn-support,
.header-actions .btn-upload {
  width: auto;
  min-width: 0;
  padding: 12px 18px;
  font-size: 14px;
}
.header-actions .btn-upload {
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .header-actions {
    justify-content: stretch;
  }
  .header-actions .btn {
    flex: 1 1 220px;
  }
}
@media (max-width: 620px) {
  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions .btn,
  .header-actions .btn-agb,
  .header-actions .btn-support,
  .header-actions .btn-upload {
    width: 100%;
    flex: 0 0 auto;
    min-height: 46px;
  }
}
