* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #e0e0e0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.container {
    background: rgba(20, 20, 20, 0.95);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.05); */
    backdrop-filter: blur(10px);
    padding: 48px;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

h1 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    font-family: 'Iowan Old Style', Georgia, serif;
}

.subtitle {
    color: #888;
    margin-bottom: 36px;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.2px;
    font-family: 'Iowan Old Style', Georgia, serif;
}

.upload-area {
    border: 2px dashed rgba(120, 119, 198, 0.3);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(120, 119, 198, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area:hover {
    border-color: rgba(120, 119, 198, 0.5);
    background: rgba(255, 255, 255, 0.03);
}

.upload-area.dragover {
    border-color: rgba(120, 119, 198, 0.8);
    background: rgba(120, 119, 198, 0.05);
    transform: scale(1.01);
}

.upload-area p {
    color: #b0b0b0;
    font-size: 15px;
    font-family: 'Iowan Old Style', Georgia, serif;
    margin-top: 12px;
}

.upload-area p:first-of-type {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 16px;
    font-family: 'Iowan Old Style', Georgia, serif;
    margin-top: 0;
}

.upload-area p:last-of-type {
    color: #666;
    font-size: 13px;
    font-family: 'Iowan Old Style', Georgia, serif;
    margin-top: 8px;
}

input[type="file"] {
    display: none;
}

.settings {
    margin: 32px 0;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

label {
    color: #b0b0b0;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Iowan Old Style', Georgia, serif;
    letter-spacing: 0.3px;
}

input[type="number"] {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 160px;
    font-size: 14px;
    font-family: 'Iowan Old Style', Georgia, serif;
    background: rgba(255, 255, 255, 0.03);
    color: #e0e0e0;
    transition: all 0.2s;
}

input[type="number"]:focus {
    outline: none;
    border-color: rgba(120, 119, 198, 0.5);
    background: rgba(255, 255, 255, 0.05);
    font-family: 'Iowan Old Style', Georgia, serif;
}

.preview-section {
    margin-top: 32px;
    display: none;
}

.preview-section.active {
    display: flex;          /* Enables Flexbox */
    flex-direction: column; /* Stacks elements vertically */
    align-items: center;    /* Centers elements horizontally */
    justify-content: center; /* Centers elements vertically (if container has height) */
    gap: 20px;              /* Adds consistent spacing between items */
    width: 100%;            /* Ensures it takes up the full width */
    text-align: center;
    
}

.preview-container {
    position: relative;
    margin-bottom: 24px;
}


.preview-image {
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: auto;           /* Maintains aspect ratio */
    display: block; 
}

canvas {
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 24px;
}

.info {
    background: rgba(120, 119, 198, 0.08);
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #c8c7e8;
    border: 1px solid rgba(120, 119, 198, 0.2);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Iowan Old Style', Georgia, serif;
}

button {
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.9) 0%, rgba(99, 102, 241, 0.9) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 15px;
    font-family: 'Iowan Old Style', Georgia, serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

button:hover::before {
    opacity: 1;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(120, 119, 198, 0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
}

.processing {
    text-align: center;
    padding: 32px;
    color: #7877c6;
    display: none;
}

.processing.active {
    display: block;
}

.processing p {
    margin-top: 16px;
    font-size: 14px;
    color: #888;
    font-family: 'Iowan Old Style', Georgia, serif;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid #7877c6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.footer-tag {
            text-align: center;
            margin-top: 40px;
            padding: 20px;
            font-size: 0.9rem;
            opacity: 0.7;
        }
        .footer-tag a {
            color: rgba(120, 119, 198, 0.8);
            text-decoration: none;
            font-weight: bold;
            transition: opacity 0.2s;
        }
        .footer-tag a:hover {
            text-decoration: underline;
            opacity: 1;
        }