/* AMOLED: чистый чёрный фон, фиолетовый акцент. Анимации — только transform и opacity,
   кроме ширины полосы прогресса, и отключаются при prefers-reduced-motion. */
:root {
  --bg: #000;
  --surface: #09090d;
  --surface-2: #111118;
  --line: #1b1b25;
  --text: #f5f5f7;
  --muted: #8b8b9b;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-deep: #6d28d9;
  --danger: #f87171;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; background: var(--bg); color: var(--text); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
}

/* Шапка */
.eyebrow {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.title { margin: 8px 0 6px; font-size: 26px; line-height: 1.15; font-weight: 750; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

/* Выбор файлов */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 28px 20px 22px;
  text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(139, 92, 246, .17), transparent 62%), var(--surface);
  border: 1.5px dashed rgba(139, 92, 246, .42);
  border-radius: 24px;
  transition: border-color .18s, transform .18s, opacity .18s;
}
.drop.is-over { border-color: var(--accent-2); transform: scale(1.01); }
.drop[data-off] { opacity: .4; pointer-events: none; }

.drop-icon {
  display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  color: var(--accent-2);
  background: rgba(139, 92, 246, .14);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, .35), 0 0 44px rgba(139, 92, 246, .38);
}
.drop-text { display: grid; gap: 3px; }
.drop-text strong { font-size: 17px; }
.drop-text span { color: var(--muted); font-size: 13.5px; }

/* Кнопки */
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 50px; padding: 0 22px; width: 100%;
  border-radius: 15px;
  font: inherit; font-weight: 650; color: #fff;
  transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 10px 30px rgba(109, 40, 217, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-compact { width: auto; min-width: 112px; }

/* Очередь */
.queue { display: grid; gap: 10px; margin-top: 18px; }
.queue:empty { display: none; }

.item {
  display: grid; grid-template-columns: 42px 1fr auto; column-gap: 12px; row-gap: 10px; align-items: center;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s;
}
.item[data-state="run"] { border-color: rgba(139, 92, 246, .55); }
.item[data-state="done"] { border-color: rgba(139, 92, 246, .3); }
.item[data-state="fail"] { border-color: rgba(248, 113, 113, .5); }

.badge {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: var(--accent-2); background: #120f1e; border: 1px solid rgba(139, 92, 246, .32);
  font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase;
}
.item[data-state="fail"] .badge { color: var(--danger); border-color: rgba(248, 113, 113, .4); background: #1b0e0e; }

.info { min-width: 0; display: grid; gap: 2px; }
.name { font-size: 15px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item[data-state="fail"] .meta { color: var(--danger); }
.item[data-state="done"] .meta { color: var(--accent-2); }

.act {
  appearance: none; border: 0; cursor: pointer;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--muted); background: var(--surface-2);
}
.act:active { transform: scale(.94); }
.act:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.act[hidden] { display: none; }
.item[data-state="fail"] .act { color: var(--accent-2); }

.track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: #15151d; overflow: hidden; }
.item[data-state="wait"] .track { opacity: .55; }
.fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  box-shadow: 0 0 14px rgba(167, 139, 250, .65);
  transition: width .25s linear;
}
.item[data-state="fail"] .fill { background: var(--danger); box-shadow: none; }

/* Сообщения */
.notice {
  margin: 16px 0 0; padding: 12px 14px;
  color: #fecaca; background: #1a0b0b; border: 1px solid rgba(248, 113, 113, .4); border-radius: 14px;
  font-size: 14px;
}
.notice[hidden] { display: none; }

/* Нижняя панель */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .88);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.bar[hidden] { display: none; }
.bar-sum { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bar-sum b { color: var(--text); font-weight: 650; }
.bar-fail { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
