@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Architects+Daughter&display=swap');

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

body {
    font-family: 'Patrick Hand', cursive;
    background: #fffef0;
    background-image: 
        linear-gradient(#f5e6d3 1px, transparent 1px),
        linear-gradient(90deg, #f5e6d3 1px, transparent 1px);
    background-size: 100% 28px, 100% 100%;
    background-position: 0 0, 0 14px;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 182, 193, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(173, 216, 230, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 2.2rem;
    letter-spacing: 1px;
    font-family: 'Architects Daughter', cursive;
    color: #2c3e50;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    transform: rotate(-1deg);
}

.prompt-section {
    text-align: center;
    margin-bottom: 25px;
}

.upload-section {
    text-align: center;
    margin-bottom: 25px;
}

#dropZone {
    padding: 30px;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    transform: rotate(1deg);
}

#dropZone.drag-over {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    transform: rotate(-1deg) scale(1.02);
}

#imageInput {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 12px 30px;
    background: #fff;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    font-family: 'Patrick Hand', cursive;
    color: #2c3e50;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 0 rgba(44, 62, 80, 0.2);
    position: relative;
    z-index: 1;
}


.upload-label:hover {
    background: #fff;
    border-color: #2c3e50;
    color: #2c3e50;
    transform: rotate(1deg) translateY(-2px);
}

#promptInput {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
    color: #2c3e50;
    resize: vertical;
    transition: all 0.3s ease;
    transform: rotate(1deg);
    box-shadow: 3px 3px 0 rgba(44, 62, 80, 0.2);
    margin-bottom: 15px;
}

#promptInput:focus {
    outline: none;
    border-color: #ff6b6b;
    background: rgba(255, 255, 255, 0.9);
    transform: rotate(-1deg) scale(1.01);
}

#promptInput::placeholder {
    color: #7f8c8d;
}

#generateBtn {
    padding: 12px 30px;
    background: #fff;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    font-family: 'Patrick Hand', cursive;
    color: #2c3e50;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 0 rgba(44, 62, 80, 0.2);
    position: relative;
}


#generateBtn:hover {
    background: #fff;
    border-color: #2c3e50;
    color: #2c3e50;
    transform: rotate(1deg) translateY(-2px);
}

#generateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    transform: rotate(-1deg);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 1rem;
    font-weight: bold;
    color: #2c3e50;
}

.control-group span {
    min-width: 30px;
    text-align: right;
    font-size: 1rem;
    font-weight: bold;
    color: #ff6b6b;
}

#invertBtn {
    padding: 10px 20px;
    background: #fff;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    color: #2c3e50;
    cursor: pointer;
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
    transition: all 0.2s ease;
    transform: rotate(2deg);
    box-shadow: 3px 3px 0 rgba(44, 62, 80, 0.2);
    position: relative;
}


#invertBtn:hover {
    background: #fff;
    border-color: #2c3e50;
    color: #2c3e50;
    transform: rotate(-2deg) translateY(-2px);
}


#invertBtn.active {
    background: #fff;
    border-color: #2c3e50;
    color: #2c3e50;
}

.output-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    transform: rotate(1deg);
    box-shadow: 4px 4px 0 rgba(44, 62, 80, 0.15);
}

#asciiOutput {
    font-size: 8px;
    line-height: 8px;
    white-space: pre;
    overflow-x: auto;
    margin-bottom: 15px;
    text-align: center;
    border: none;
    display: block;
    color: #1a1a2e;
    padding: 10px;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    font-weight: bold;
}

#copyBtn {
    display: block;
    margin: 0 auto;
    padding: 10px 25px;
    background: #fff;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    color: #2c3e50;
    cursor: pointer;
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
    transition: all 0.2s ease;
    transform: rotate(-1deg);
    box-shadow: 3px 3px 0 rgba(44, 62, 80, 0.2);
    position: relative;
}


#copyBtn:hover {
    background: #fff;
    border-color: #2c3e50;
    color: #2c3e50;
    transform: rotate(1deg) translateY(-2px);
}

.hidden {
    display: none !important;
}

.info-tooltip {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.info-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2c3e50;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
    box-shadow: 3px 3px 0 rgba(44, 62, 80, 0.2);
    font-family: 'Patrick Hand', cursive;
    transform: rotate(5deg);
}

.info-icon:hover {
    background: #4ecdc4;
    border-color: #45b7aa;
    color: #fff;
    transform: rotate(-5deg) scale(1.1);
}

.tooltip-content {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 320px;
    background: #fff;
    border: 3px solid #2c3e50;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    padding: 20px;
    color: #2c3e50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) rotate(3deg);
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0 rgba(44, 62, 80, 0.2);
}

.tooltip-content h3 {
    margin-bottom: 12px;
    font-family: 'Architects Daughter', cursive;
    font-size: 1.3rem;
    color: #ff6b6b;
}

.tooltip-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 1rem;
}

.tooltip-content ul {
    margin-left: 20px;
}

.tooltip-content li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px;
    border: 12px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 3px 0 rgba(44, 62, 80, 0.2));
}

.info-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) rotate(-2deg);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(5deg);
    }

    50% {
        transform: translateY(-8px) rotate(-3deg);
    }
}

/* Range Slider Styling */
.range-slider {
    --range-width: 180px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-slider > [data-value] {
    font-size: 1rem;
    width: 35px;
    font-weight: bold;
    color: #ff6b6b;
    text-align: center;
}

.range-slider > input[type="range"] {
    width: var(--range-width);
    height: 8px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #e8d5b7;
    border: 2px solid #2c3e50;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}

.range-slider > input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border: 2px solid #2c3e50;
    border-radius: 50%;
    cursor: grab;
    transition: all 0.2s ease;
}

.range-slider > input[type="range"]::-webkit-slider-thumb:hover {
    background: #ff5252;
    transform: scale(1.2);
}

.range-slider > input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border: 2px solid #2c3e50;
    border-radius: 50%;
    cursor: grab;
    transition: all 0.2s ease;
}

.range-slider > input[type="range"]::-moz-range-thumb:hover {
    background: #ff5252;
    transform: scale(1.2);
}

/* General styling overrides */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
}

code,
pre {
    font-family: 'Courier New', monospace;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.6rem;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    #asciiOutput {
        font-size: 4px;
        line-height: 4px;
    }

    .tooltip-content {
        width: 280px;
        right: -10px;
    }

    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .range-slider {
        --range-width: 140px;
    }

    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }
}