.generator-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.generator-header {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.generator-brand {
    color: #fff;
    text-decoration: none;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: -1px;
}

.generator-brand span {
    color: #ff58a4;
}

.generator-nav {
    display: flex;
    gap: 30px;
}

.generator-nav a {
    color: #8f95a8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: color .2s ease, text-shadow .2s ease;
}

.generator-nav a:hover,
.generator-nav a.active {
    color: #fff;
    text-shadow: 0 0 20px rgba(165, 90, 255, .45);
}


/* =====================================================
   HERO
===================================================== */

.generator-hero {
    min-height: calc(100vh - 76px);
    padding: 80px 0 110px;
}

.generator-heading {
    max-width: 780px;
    margin: 0 auto 42px;
    text-align: center;
}

.generator-badge {
    display: inline-flex;
    padding: 8px 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 87, 168, .20);
    border-radius: 999px;
    color: #ff67ae;
    background: rgba(255, 79, 163, .08);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .5px;
    box-shadow: 0 0 25px rgba(255, 79, 163, .05);
}

.generator-heading h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(48px, 6vw, 76px);
    line-height: 1;
    letter-spacing: -3px;
}

.generator-heading h1 span {
    background: linear-gradient(
        90deg,
        #ff54a3,
        #a765ff,
        #50aaff
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.generator-heading p {
    max-width: 680px;
    margin: 22px auto 0;
    color: #9298aa;
    font-size: 18px;
    line-height: 1.65;
}


/* =====================================================
   WORKSPACE
===================================================== */

.generator-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

.generator-form-panel,
.generation-result {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 28px;
    background:
        linear-gradient(
            145deg,
            rgba(22,27,41,.90),
            rgba(10,14,23,.88)
        );
    backdrop-filter: blur(26px);
    box-shadow:
        0 32px 90px rgba(0,0,0,.36),
        0 0 55px rgba(146,84,255,.06),
        inset 0 1px 0 rgba(255,255,255,.05);
}

.generator-form-panel::before,
.generation-result::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        #ff58a6,
        #a767ff,
        #49aaff,
        transparent
    );
    opacity: .65;
}

.prompt-label {
    display: block;
    margin-bottom: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 850;
}

#promptInput {
    width: 100%;
    min-height: 170px;
    resize: vertical;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.09);
    outline: none;
    border-radius: 19px;
    color: #f6f7fb;
    background:
        linear-gradient(
            145deg,
            rgba(8,11,18,.92),
            rgba(17,20,31,.92)
        );
    font: inherit;
    font-size: 17px;
    line-height: 1.6;
    transition:
        border-color .25s ease,
        box-shadow .25s ease;
}

#promptInput::placeholder {
    color: #555c70;
}

#promptInput:focus {
    border-color: rgba(166,101,255,.65);
    box-shadow:
        0 0 0 3px rgba(161,94,255,.08),
        0 0 32px rgba(151,89,255,.10);
}

.prompt-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-top: 14px;
}

.prompt-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompt-examples button {
    appearance: none;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    color: #9ca2b4;
    background: rgba(255,255,255,.035);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    transition:
        color .2s ease,
        border-color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.prompt-examples button:hover {
    transform: translateY(-2px);
    color: #fff;
    border-color: rgba(162,98,255,.42);
    background: rgba(145,83,255,.10);
}

.char-count {
    flex-shrink: 0;
    color: #666e82;
    font-size: 12px;
}

.generate-button {
    width: 100%;
    min-height: 58px;
    margin-top: 24px;
    border: 0;
    border-radius: 17px;
    color: #fff;
    background:
        linear-gradient(
            110deg,
            #ff489a,
            #aa5cff,
            #4b9cff
        );
    box-shadow:
        0 15px 38px rgba(161,78,255,.23),
        0 0 30px rgba(255,75,157,.08);
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}

.generate-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow:
        0 20px 50px rgba(169,76,255,.32),
        0 0 35px rgba(255,71,155,.13);
}

.generate-button:disabled {
    cursor: wait;
    opacity: .65;
}

.generate-icon {
    display: inline-block;
    margin-right: 8px;
}

.generation-message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 13px;
    color: #ff9dbf;
    background: rgba(255,79,132,.07);
    border: 1px solid rgba(255,80,133,.15);
    font-size: 13px;
}


/* =====================================================
   RESULT
===================================================== */

.result-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.result-kicker {
    color: #b88dff;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.result-header h2 {
    margin: 7px 0 0;
    color: #fff;
    font-size: 30px;
    letter-spacing: -1px;
}

.result-seed {
    color: #737b8f;
    font-size: 11px;
    font-family: monospace;
}

.result-image-shell {
    position: relative;
    min-height: 520px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
    background: #fff;
}

#resultImage {
    display: block;
    width: 100%;
    max-height: 820px;
    object-fit: contain;
    background: #fff;
}

.result-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(
            circle at center,
            rgba(142,88,255,.15),
            rgba(7,9,16,.98) 58%
        );
}

.result-loading strong {
    font-size: 18px;
}

.result-loading span {
    color: #8d94a6;
    font-size: 13px;
}

.generation-spinner {
    width: 52px;
    height: 52px;
    margin-bottom: 7px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: #ff57a5;
    border-right-color: #9e64ff;
    border-radius: 50%;
    animation: generatorSpin .85s linear infinite;
    box-shadow: 0 0 25px rgba(156,91,255,.15);
}

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

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 20px;
}

.result-primary,
.result-secondary {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
}

.result-primary {
    border: 0;
    color: #fff;
    background:
        linear-gradient(
            110deg,
            #ff4b9d,
            #a55eff,
            #489eff
        );
    box-shadow: 0 12px 30px rgba(161,77,255,.20);
}

.result-secondary {
    border: 1px solid rgba(255,255,255,.10);
    color: #dfe1eb;
    background: rgba(255,255,255,.04);
}


/* =====================================================
   INFO
===================================================== */

.generator-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 28px;
}

.generator-info-card {
    padding: 22px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 20px;
    background: rgba(16,20,30,.54);
}

.generator-info-card span {
    color: #9b69ff;
    font-size: 11px;
    font-weight: 900;
}

.generator-info-card strong {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-size: 15px;
}

.generator-info-card p {
    margin: 8px 0 0;
    color: #777f92;
    font-size: 12px;
    line-height: 1.55;
}


/* =====================================================
   PRINT
===================================================== */

@media print {
    body * {
        visibility: hidden !important;
    }

    #resultImage,
    #resultImage * {
        visibility: visible !important;
    }

    #resultImage {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        max-height: none;
    }
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 760px) {
    .generator-nav {
        display: none;
    }

    .generator-hero {
        padding-top: 55px;
    }

    .generator-heading h1 {
        font-size: 49px;
        letter-spacing: -2px;
    }

    .generator-form-panel,
    .generation-result {
        padding: 20px;
    }

    .prompt-footer {
        flex-direction: column;
    }

    .generator-info-grid {
        grid-template-columns: 1fr;
    }

    .result-image-shell {
        min-height: 360px;
    }
}

/* RESULT VISIBILITY FIX */

.generation-result.is-hidden {
    display: none !important;
}

.result-loading.is-hidden {
    display: none !important;
}

.generation-message.is-hidden {
    display: none !important;
}

#resultImage {
    opacity: 1 !important;
    visibility: visible !important;
}

