:root {
    --bg: #071018;
    --bg-elev: #0d1c28;
    --panel: rgba(14, 32, 48, 0.78);
    --line: rgba(124, 184, 255, 0.16);
    --text: #e8f2fb;
    --muted: #8aa3b8;
    --accent: #36d6c3;
    --accent-2: #7cb8ff;
    --danger: #ff6b7a;
    --ok: #3ee0a0;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 10% -10%, #12324a 0%, transparent 50%),
                radial-gradient(900px 500px at 110% 10%, #0c3d38 0%, transparent 45%),
                var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.bg-orb {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}
.bg-orb-a { background: #1a6bff; top: -80px; left: -60px; }
.bg-orb-b { background: #1ec8b0; bottom: -120px; right: -40px; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 16, 24, 0.72);
    backdrop-filter: blur(16px);
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; font-size: 16px; letter-spacing: 0.01em; }
.muted { color: var(--muted); font-size: 13px; }

.top-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    color: var(--muted);
}

.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 220px 1fr;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 20px 64px;
    gap: 24px;
}

.rail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 92px;
    align-self: start;
}

.rail-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    transition: 0.2s ease;
}
.rail-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.rail-btn.is-active {
    color: var(--text);
    background: linear-gradient(180deg, rgba(54, 214, 195, 0.12), rgba(124, 184, 255, 0.08));
    border-color: var(--line);
}
.rail-ico { width: 22px; display: inline-block; color: var(--accent); }

.hero h1 { font-size: 32px; font-weight: 650; letter-spacing: -0.03em; margin-bottom: 8px; }
.hero p { color: var(--muted); max-width: 720px; margin-bottom: 22px; }

.card, .drop-panel, .options {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.drop-panel {
    padding: 36px 24px;
    text-align: center;
    border-style: dashed;
    margin-bottom: 22px;
    transition: 0.2s ease;
}
.drop-panel.is-over {
    border-color: var(--accent);
    background: rgba(54, 214, 195, 0.08);
}
.drop-title { font-size: 18px; margin-bottom: 6px; }
.drop-art {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(54,214,195,0.3), rgba(124,184,255,0.2));
    box-shadow: inset 0 0 0 1px var(--line);
}

.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.options { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.options h2, .queue-head h2, .results h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-2);
    margin-bottom: 4px;
}

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field em { color: var(--accent); font-style: normal; }
.field input, .field select {
    width: 100%;
    background: #07141e;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}
.field input[type="color"] { height: 42px; padding: 4px; }
.field input[type="range"] { padding: 0; accent-color: var(--accent); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font: inherit;
    cursor: pointer;
    transition: 0.15s ease;
}
.btn.primary {
    background: linear-gradient(180deg, #3ee0c8, #1fb8a8);
    color: #04221e;
    font-weight: 650;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}
.btn.ghost:hover { background: rgba(255,255,255,0.04); }
.btn.tiny { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

.hint { font-size: 12px; color: var(--muted); }

.queue-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.count {
    display: inline-block;
    min-width: 22px;
    text-align: center;
    background: rgba(124,184,255,0.15);
    border-radius: 999px;
    padding: 0 8px;
    color: var(--accent-2);
}

.queue { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.queue-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 20, 30, 0.55);
}
.thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #09141d;
    border: 1px solid var(--line);
}
.file-name { font-size: 14px; word-break: break-all; }
.file-meta { font-size: 12px; color: var(--muted); }
.remove {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}
.remove:hover { color: var(--danger); }

.progress-track {
    height: 6px;
    background: #0a1822;
    border-radius: 99px;
    overflow: hidden;
    margin: 16px 0;
}
.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.2s ease;
}

.results { margin-top: 16px; padding: 16px; }
.results ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.results li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.results a {
    color: #04221e;
    background: var(--accent);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 650;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    max-width: 380px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #132433;
    border: 1px solid var(--line);
    color: var(--text);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(255,107,122,0.4); }

@media (max-width: 980px) {
    .shell, .layout { grid-template-columns: 1fr; }
    .rail { position: static; flex-direction: row; overflow-x: auto; }
    .rail-btn { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
