/* gyro.unikalizator — visual layer only.
   No business logic lives here; all IDs from app.js are preserved. */

:root {
  color-scheme: dark;
  --bg: #07080a;
  --surface: #0d1015;
  --surface-2: #12171e;
  --surface-3: #171d26;
  --line: #1d242e;
  --line-2: #2b3542;
  --text: #e9edf3;
  --muted: #8793a4;
  --muted-2: #5e6a7b;

  --lime: #c8fa4b;
  --lime-2: #a3e635;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --ok: #34d399;
  --err: #ff6b6b;

  --radius: 16px;
  --radius-sm: 11px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- background */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg .glow {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
}
.glow-a {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
  top: -14vw; left: -10vw;
  background: radial-gradient(circle, rgba(200, 250, 75, .30), transparent 68%);
}
.glow-b {
  width: 52vw; height: 52vw; min-width: 380px; min-height: 380px;
  top: -6vw; right: -16vw;
  background: radial-gradient(circle, rgba(139, 92, 246, .30), transparent 68%);
}
.bg .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 72%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 72%);
  opacity: .55;
}
.bg .noise {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 120%, rgba(0, 0, 0, .55), transparent 60%);
}

/* --------------------------------------------------------------------- shell */
.shell {
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 40px 22px 64px;
}

/* -------------------------------------------------------------------- header */
.head { margin-bottom: 22px; }
.brand-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 12px;
  color: var(--lime);
  background: linear-gradient(180deg, rgba(200, 250, 75, .14), rgba(200, 250, 75, .04));
  border: 1px solid rgba(200, 250, 75, .35);
  box-shadow: 0 0 26px -6px rgba(200, 250, 75, .55), inset 0 0 18px -10px rgba(200, 250, 75, .8);
}
.brand {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 0; margin: 0; line-height: 1;
  font-size: clamp(26px, 7.4vw, 42px);
}
.brand-gyro {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--lime);
  text-shadow: 0 0 28px rgba(200, 250, 75, .40);
}
.brand-uni {
  font-weight: 800;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #ffffff 10%, #9fadc0 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.tagline {
  margin: 12px 0 0; max-width: 54ch;
  color: var(--muted); font-size: 13.5px;
}

/* --------------------------------------------------------------- drop zone */
.drop {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 210px; padding: 26px 22px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 26, 34, .92), rgba(11, 14, 19, .92));
  cursor: pointer; overflow: hidden;
  transition: border-color .2s ease, transform .18s ease, box-shadow .28s ease, background .2s ease;
}
/* The native control must stay functional/accessible but not render its own row. */
.drop input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0; opacity: 0;
}
.drop:focus-within { outline: 2px solid var(--lime); outline-offset: 3px; }
.drop::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 25%, transparent 78%);
          mask-image: radial-gradient(120% 100% at 50% 0%, #000 25%, transparent 78%);
  transition: opacity .25s ease;
}
.drop-glow {
  position: absolute; inset: -30% -10% auto; height: 220px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(200, 250, 75, .22), transparent 70%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.drop > .drop-icon,
.drop > .drop-title,
.drop > .drop-sub,
.drop > .drop-cta,
.drop > .drop-badges { position: relative; z-index: 1; }
.drop:hover { border-color: #3c4a3a; transform: translateY(-1px); box-shadow: 0 26px 60px -40px rgba(200, 250, 75, .8); }
.drop:hover .drop-glow { opacity: .7; }
.drop.dragging {
  border-color: var(--lime); border-style: solid;
  background: linear-gradient(180deg, rgba(28, 40, 24, .95), rgba(12, 16, 13, .95));
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 0 1px rgba(200, 250, 75, .45), 0 30px 70px -30px rgba(200, 250, 75, .55);
}
.drop.dragging .drop-glow { opacity: 1; }

.drop-icon {
  display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%;
  font-size: 24px; font-weight: 700; color: var(--lime);
  background: radial-gradient(circle at 50% 30%, rgba(200, 250, 75, .22), rgba(200, 250, 75, .05));
  border: 1px solid rgba(200, 250, 75, .35);
  box-shadow: 0 0 30px -8px rgba(200, 250, 75, .7), inset 0 0 20px -12px rgba(200, 250, 75, .9);
  transition: transform .2s ease, box-shadow .2s ease;
}
.drop.dragging .drop-icon { transform: translateY(-2px) scale(1.06); }
.drop-title { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.drop-sub {
  color: var(--muted); font-size: 12.5px; max-width: 46ch;
  overflow-wrap: anywhere;
}
.drop-cta {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 4px; padding: 9px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em; color: #e9edf3;
  background: var(--surface-3); border: 1px solid var(--line-2);
  transition: background .2s ease, border-color .2s ease, transform .14s ease, color .2s ease;
}
.drop:hover .drop-cta { background: #1d2530; border-color: #3a4655; }
.drop.dragging .drop-cta { border-color: rgba(200, 250, 75, .55); color: var(--lime); }

.drop-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 2px; }
.drop-badges span {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em;
  color: #9fb0c4; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}

/* ------------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: 1px solid transparent; border-radius: 12px;
  font: 600 14px/1 var(--font); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(180deg, var(--lime), var(--lime-2));
  color: #0b1400;
  box-shadow: 0 14px 34px -16px rgba(200, 250, 75, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 20px 44px -16px rgba(200, 250, 75, 1); }
.btn-primary:disabled {
  background: #171d25; color: #5c6675; border-color: var(--line);
  box-shadow: none; transform: none; cursor: not-allowed;
}

.btn-ghost {
  background: var(--surface-2); color: var(--text); border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--surface-3); border-color: #3a4655; transform: translateY(-1px); }

.btn-download {
  background: linear-gradient(180deg, var(--ok), #10b981);
  color: #04271c; font-size: 15px; padding: 14px 24px;
  box-shadow: 0 16px 40px -18px rgba(52, 211, 153, .95), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-download::before { content: "↓"; font-weight: 800; }
.btn-download:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 22px 50px -18px rgba(52, 211, 153, 1); }

/* -------------------------------------------------------------------- cards */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 30px 70px -50px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .02);
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}

.progress-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.progress-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.progress-pct { font-family: var(--mono); font-size: 20px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

.progress {
  height: 12px; border-radius: 999px; overflow: hidden;
  background: #121821; border: 1px solid var(--line);
}
.bar {
  position: relative; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  box-shadow: 0 0 20px rgba(200, 250, 75, .45);
  transition: width .45s cubic-bezier(.3, .7, .3, 1);
}
body.state-processing .bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .55) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: sheen 1.9s ease-in-out infinite;
}

.statusline { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; color: #c6cedb; }
body.state-processing .statusline #status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px;
  border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(200, 250, 75, .9);
  animation: pulse 1.6s ease-in-out infinite; vertical-align: middle;
}

.eta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  animation: rise .35s ease both;
}
.eta-done { color: #eef2f7; font-weight: 600; font-variant-numeric: tabular-nums; }
.eta-est { color: var(--muted); }

/* --------------------------------------------------------------------- error */
.error {
  margin-bottom: 14px; padding: 13px 15px;
  border-radius: var(--radius-sm); border: 1px solid rgba(255, 107, 107, .35);
  border-left: 3px solid var(--err);
  background: linear-gradient(180deg, rgba(58, 22, 22, .85), rgba(30, 14, 14, .85));
  color: #ffb4b4; font-size: 13.5px;
  animation: rise .35s ease both;
}

/* -------------------------------------------------------------------- result */
.result-card { text-align: center; padding: 26px 20px; }
.result-badge {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 50%; font-size: 26px; font-weight: 800; color: #052e22;
  background: linear-gradient(180deg, var(--ok), #10b981);
  box-shadow: 0 0 40px -6px rgba(52, 211, 153, .8);
}
.result-card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.result-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.result-card .btn-download { display: inline-flex; margin-bottom: 8px; }
.result-card .btn-ghost { margin-top: 10px; }

/* -------------------------------------------------------------- state accents */
body.state-processing .progress-card {
  border-color: rgba(200, 250, 75, .40);
  box-shadow: 0 0 0 1px rgba(200, 250, 75, .12), 0 30px 70px -40px rgba(200, 250, 75, .55);
}
body.state-success .result-card {
  border-color: rgba(52, 211, 153, .45);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, .14), 0 30px 70px -40px rgba(52, 211, 153, .5);
}
body.state-error .progress-card { border-color: rgba(255, 107, 107, .45); }
body.state-unavailable .progress-card { border-color: var(--line); }

/* ------------------------------------------------------------------- layout */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* --------------------------------------------------- variant count picker */
.count-picker {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface-2); cursor: pointer;
}
.count-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.count-select {
  appearance: none; -webkit-appearance: none;
  padding: 7px 30px 7px 12px; border-radius: 9px;
  border: 1px solid var(--line-2); background-color: var(--surface-3);
  color: var(--text); font: 600 14px/1 var(--mono); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.count-select:hover { border-color: #3a4655; }
.count-select:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.foot { margin-top: 26px; max-width: 62ch; }

/* ---------------------------------------------------------------- animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(120%); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }

.reveal { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.shell > .reveal:nth-of-type(2) { animation-delay: .06s; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 520px) {
  .shell { padding: 26px 15px 48px; }
  .drop { padding: 24px 16px; min-height: 190px; }
  .row { gap: 8px; }
  .row .btn { width: 100%; }
  .result-card .btn-download, .result-card .btn-ghost { width: 100%; }
  .brand-row { gap: 10px; }
  .brand { font-size: clamp(25px, 8.6vw, 34px); }
}
@media (max-width: 360px) {
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .drop-badges span { font-size: 10px; }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  body.state-processing .bar::after { display: none; }
}

/* --------------------------------------------------------- batch / night UI */
.file-list {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.file-list:empty { display: none; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 13px;
}
.file-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-remove {
  flex: 0 0 auto; width: 24px; height: 24px; line-height: 1;
  border-radius: 7px; border: 1px solid rgba(255, 255, 255, .14);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 15px;
}
.file-remove:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }

.night-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .03);
  font-size: 13px; user-select: none;
}
.night-toggle input { accent-color: #7bbf6a; width: 16px; height: 16px; }
.night-toggle .night-label { white-space: nowrap; }

.queue-list {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.queue-list.hidden { display: none; }
.queue-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 12.5px; color: var(--muted);
  padding: 5px 8px; border-left: 2px solid rgba(255, 255, 255, .12);
}
.queue-item.q-done { border-left-color: #7bbf6a; color: #cfe9c7; }
.queue-item.q-processing { border-left-color: #d8b45a; color: #e8d7a6; }
.queue-item.q-error { border-left-color: #c06060; color: #e7b6b6; }
.queue-item.q-paused { border-left-color: #6a8cbf; }
.queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-state { flex: 0 0 auto; }

