:root {
    --color-bg: #0a0a0a;
    --color-card: rgba(255, 255, 255, 0.05);
    --color-text: #ffffff;
    --color-muted: #a0a0a0;
    --color-primary: #00afb9;
    --color-secondary: #f07167;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Back blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
    opacity: 0.4;
}

.blob {
    position: absolute;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--color-primary);
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--color-secondary);
    bottom: -50px;
    left: -50px;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #0081a7;
    top: 40%;
    left: 20%;
}

header {
    text-align: center;
    padding: 4rem 2rem 2rem;
}

header h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.back-link {
    display: inline-block;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--color-text);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: var(--color-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-muted);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(0, 175, 185, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
}

.main-input {
    margin-bottom: 2rem;
}

.main-input label {
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.limit-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-muted);
}

textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.step h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.step-num {
    background: var(--color-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.debug-data {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    color: var(--color-primary);
}

.result-text {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    font-size: 1.1rem;
    min-height: 100px;
    margin-bottom: 1.5rem;
    word-break: normal;
    overflow-wrap: anywhere;
}

.canvas-wrapper {
    background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

canvas {
    image-rendering: pixelated;
    max-width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.cta-button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 175, 185, 0.2);
}

.cta-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cta-button.secondary {
    background: transparent;
    border: 1px solid var(--color-muted);
    color: var(--color-muted);
}

.cta-button.secondary:hover:not(:disabled) {
    border-color: var(--color-text);
    color: var(--color-text);
}

.text-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-btn:hover {
    text-decoration: underline;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--color-primary);
    background: rgba(0, 175, 185, 0.05);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.upload-area input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.error-msg {
    color: var(--color-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    font-weight: 600;
    min-height: 1.2rem;
}

.info-note {
    background: rgba(0, 175, 185, 0.1);
    border: 1px solid rgba(0, 175, 185, 0.3);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.info-note i {
    color: var(--color-primary);
    margin-top: 2px;
}

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

    .tabs {
        flex-direction: column;
    }
}