:root {
    --bg: #060b14;
    --card: rgba(255, 255, 255, .06);
    --card-border: rgba(255, 255, 255, .1);
    --text: #f0f4fc;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #38bdf8;
    --danger: #f87171;
    --success: #34d399;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, .18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(56, 189, 248, .08), transparent),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.page {
    width: min(720px, 92vw);
    margin: 0 auto;
    padding: 48px 0 64px;
}

.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(59, 130, 246, .15);
    border: 1px solid rgba(59, 130, 246, .3);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -.02em;
}

.sub {
    color: var(--muted);
    font-size: 15px;
    margin: 0 auto 20px;
    max-width: 520px;
}

.platforms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pill {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(16px);
    margin-bottom: 16px;
}

label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
}

input, select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .3);
    color: var(--text);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

input:focus, select:focus {
    border-color: rgba(59, 130, 246, .6);
}

input:disabled, select:disabled {
    opacity: .5;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.field.dimmed {
    opacity: .45;
    pointer-events: none;
}

.btn {
    border: 0;
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: white;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.primary {
    background: var(--primary);
}
.primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.secondary {
    background: rgba(255, 255, 255, .1);
}
.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .16);
}

.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--muted);
}
.ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, .06);
    color: var(--text);
}

.full { width: 100%; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

.notice {
    color: var(--muted);
    font-size: 12px;
    margin: 14px 0 0;
    text-align: center;
}

.status {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
}

.status.error {
    color: #fecaca;
    background: rgba(248, 113, 113, .1);
    border-color: rgba(248, 113, 113, .3);
}

.status.success {
    color: #a7f3d0;
    background: rgba(52, 211, 153, .1);
    border-color: rgba(52, 211, 153, .3);
}

.progress-wrap {
    margin-top: 16px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.progress-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .25s ease;
}

.preview {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: start;
}

.preview-thumb {
    position: relative;
}

.preview-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(0, 0, 0, .3);
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .75);
    font-size: 12px;
    font-weight: 600;
}

.preview h2 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 12px;
}

.meta-line svg {
    flex-shrink: 0;
    opacity: .6;
}

.quality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(59, 130, 246, .12);
    border: 1px solid rgba(59, 130, 246, .2);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.hidden { display: none !important; }

@media (max-width: 600px) {
    .input-row {
        grid-template-columns: 1fr;
    }

    .options, .preview {
        grid-template-columns: 1fr;
    }

    .preview-thumb img {
        max-height: 200px;
    }
}
