html {
    font-size: 16px;
}

body {
    margin: 0;
    background: #111;
    color: #33ff33;
    font-family: monospace;
    font-size: 1em;
    height: 100svh;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

form {
    display: block;
    margin-top: 0;
    unicode-bidi: isolate;
    width: 100%;
}

#headerLogo {
    display: flex;
    flex-direction: column;
    align-items: center;
    scale: 1;
    height: 230px;
    margin-top: -50px;
}

#headerLogo pre {
    display: block;
    overflow: hidden;
    max-width: 100%;
    overflow-x: auto;
    font-size: 1rem;
    line-height: 1;
}

#outputAscii1, #outputAscii1 {
    height: 100px;
}

#terminal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    padding: 3rem 1rem 1rem 1rem;
    box-sizing: border-box;
}

/* Scrollbar stile terminale */
#output::-webkit-scrollbar {
    width: 8px;
}

#output::-webkit-scrollbar-track {
    background: #111;
}

#output::-webkit-scrollbar-thumb {
    background-color: #33ff33;
    border-radius: 4px;
}

#output::-webkit-scrollbar-thumb:hover {
    background-color: #66ff66;
}

/* Firefox */
#output {
    scrollbar-width: thin;
    scrollbar-color: #33ff33 #111;
}

#output {
    flex-grow: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    padding-bottom: 1rem;
    padding-right: 1rem;
}

#input-block {
    display: flex;
}

#input {
    flex: 1;
    background: #404040;
    border: none;
    color: #45d345;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem;
    outline: none;
    width: calc(100% - 1rem);
    border-radius: 8px;
}

.menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000d;
    color: #33ff33;
    padding: 2rem 1rem 1rem 1rem;
    overflow-y: auto;
    font-family: monospace;
    font-size: 1rem;
}

.menu pre {
    text-wrap: auto;
    line-height: 1.6rem;
}

.hidden {
    display: none;
}

.popup {
    position: fixed;
    top: 1rem;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    color: #33ff33;
    font-family: monospace;
}

.popup.hidden {
    display: none;
}

.popup-content {
    max-width: 800px;
    max-height: 85svh;
    overflow-y: auto;
    background: #000;
    border: 1px solid #33ff33;
    padding: 1rem;
    box-shadow: 0 0 20px #33ff33;
    position: relative;
    margin: 1rem;
}

.popup-content pre {
    text-wrap: wrap;
    text-wrap-mode: wrap;
    text-wrap-style: auto;
}

.popup-content .close {
    position: absolute;
    top: 0.3rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.popup-content-image {
    max-width: 800px;
    max-height: 85svh;
    overflow-y: auto;
    background: #000;
    border: 1px solid #33ff33;
    padding: 0.25rem;
    box-shadow: 0 0 20px #33ff33;
    position: relative;
    margin: 1rem;
}

.popup-content-image .close {
    position: absolute;
    top: 0.3rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

#menuInput {
    background: #404040;
    border: none;
    color: #45d345;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    border-radius: 8px;
    margin-top: 1rem;
    padding: .6rem 0 .6rem 1.8rem;
    position: absolute;
    left: 0;
    bottom: 0;
    width: calc(100% - 1.8rem);
}

.input-prompt-block {
    position: relative;
    margin-top: 4rem;
}

#input-block {
    display: flex;
    align-items: center;
}

.prompt-sign {
    color: #888;
    font-size: 1.1rem;
    user-select: none;
    left: 0.6rem;
    bottom: 0.6rem;
    position: absolute;
}

#input, #menuInput {
    flex: 1;
}

.generated-image-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}
.generated-image {
    max-width: 256px;
    margin: 10px;
    width: 256px;
    height: 256px;
    padding: 2px;
    border: 2px solid;
    cursor: pointer;
}

/* Animazione fade-in per il popup */
@keyframes fadeIn {
    from { background-color: rgba(0, 0, 0, 0); }
    to { background-color: rgba(0, 0, 0, 0.95); }
}
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Animazione zoom-in per il contenuto */
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.zoom-in {
    animation: zoomIn 0.3s ease-out forwards;
}

/* MEDIA QUERY */
@media screen and (max-width: 1000px) {
    #headerLogo {
        scale: .7;
        height: 180px;
    }
}

@media screen and (max-width: 600px) {
    body, .menu, #menuInput {
        font-size: 1.1rem;
    }

    #headerLogo {
        scale: .45;
        height: 130px;
    }
}

@media screen and (max-width: 400px) {
    body, .menu, #menuInput {
        font-size: 1.2rem;
    }

    #headerLogo {
        scale: .35;
        height: 80px;
    }
}
