:root {
  --bg0: #07090d;
  --bg1: #0e141c;
  --panel: rgba(18, 24, 34, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f3f6fb;
  --muted: #8b9bb0;
  --accent: #1db954;
  --accent2: #3dd6c6;
  --danger: #ff5c7a;
  --glow: rgba(29, 185, 84, 0.35);
  --radius: 22px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 12% -10%, var(--glow), transparent 55%),
    radial-gradient(700px 420px at 90% 10%, rgba(61, 214, 198, 0.18), transparent 50%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: .45;
  animation: grid-drift 28s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-48px, -48px, 0); }
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}
.orb--a {
  width: 280px; height: 280px; top: 8%; left: -60px;
  background: var(--accent); animation-delay: 0s;
}
.orb--b {
  width: 220px; height: 220px; right: -40px; bottom: 12%;
  background: var(--accent2); animation-delay: -4s; opacity: .35;
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -24px, 0) scale(1.08); }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.topbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .02em;
}
.brand__mark {
  width: 34px; height: 34px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #06110a; font-weight: 800;
  box-shadow: 0 8px 28px var(--glow);
}
.top-links { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .82rem;
  transition: .2s ease;
}
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, rgba(0,0,0,.35));
  box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 8px 24px var(--glow);
}
.lang-switch__label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.lang-switch__btns { display: inline-flex; gap: 4px; }
.lang-switch__btn {
  min-width: 40px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: .15s ease;
}
.lang-switch__btn:hover {
  background: rgba(255,255,255,.08);
}
.lang-switch__btn.is-active {
  color: #06110a;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 16px var(--glow);
}
@media (max-width: 640px) {
  .topbar__right { width: 100%; justify-content: space-between; }
  .lang-switch { margin-left: auto; }
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -.03em;
}
.lead {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 20px;
  max-width: 48ch;
}

.form { display: grid; gap: 12px; position: relative; z-index: 1; }
.label {
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
@media (max-width: 640px) {
  .input-row { grid-template-columns: 1fr; }
}

input[type="url"], input[type="text"] {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: rgba(7, 10, 14, .75);
  color: var(--text);
  border-radius: 16px;
  padding: 16px 16px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: #06110a;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent2)));
  box-shadow: 0 12px 30px var(--glow);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.hint {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
}
.hint code {
  color: var(--text);
  background: rgba(255,255,255,.05);
  padding: 2px 6px;
  border-radius: 6px;
}

.visual {
  min-height: 260px;
  display: grid;
  place-items: center;
  position: relative;
}
.eq {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}
.eq span {
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  transform-origin: bottom;
  animation: eq 1.1s ease-in-out infinite;
  opacity: .85;
}
.eq span:nth-child(1) { height: 28%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 62%; animation-delay: .08s; }
.eq span:nth-child(3) { height: 100%; animation-delay: .16s; }
.eq span:nth-child(4) { height: 48%; animation-delay: .24s; }
.eq span:nth-child(5) { height: 78%; animation-delay: .32s; }
.eq span:nth-child(6) { height: 36%; animation-delay: .4s; }
.eq span:nth-child(7) { height: 88%; animation-delay: .48s; }
@keyframes eq {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1); }
}
body.is-idle .eq span { animation-play-state: paused; opacity: .35; }

.ring {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  animation: spin 18s linear infinite;
}
.ring::before, .ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--accent2) 40%, transparent);
}
.ring::before { inset: 12%; animation: spin 10s linear infinite reverse; }
.ring::after { inset: 28%; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-card { margin-top: 18px; }
.status-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.meta-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; }
.meta-sub { color: var(--muted); font-size: .9rem; margin: 0; }
.badge {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--muted);
}
.badge.is-run { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.badge.is-ok { color: #7dffb0; border-color: rgba(125,255,176,.35); }
.badge.is-err { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
}
.progress {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px var(--glow);
  will-change: width;
}
.pct {
  min-width: 3.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
}
.stage { color: var(--muted); font-size: .9rem; min-height: 1.3em; }

.history {
  margin-top: 22px;
  position: relative;
  z-index: 1;
}
.history__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.history__head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -.01em;
}
.history__clear {
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  cursor: pointer;
}
.history__clear:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.history__empty {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}
.history-list { display: grid; gap: 10px; }
.hist-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,.18);
}
.hist-mid strong { display: block; font-size: .92rem; }
.hist-mid span { color: var(--muted); font-size: .78rem; }
.hist-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hist-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #06110a;
  text-decoration: none;
}
.hist-btn--link { background: rgba(255,255,255,.08); color: var(--text); }
.hist-btn:hover { filter: brightness(1.06); }
@media (max-width: 640px) {
  .hist-item { grid-template-columns: 48px 1fr; }
  .hist-actions { grid-column: 1 / -1; }
}

.result {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.file {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,.22);
  text-decoration: none;
  color: inherit;
  transition: .2s ease;
}
.file:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}
.cover {
  width: 56px; height: 56px; border-radius: 14px;
  object-fit: cover; background: #111;
}
.cover.fallback {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #06110a; font-weight: 800;
}
.file strong { display: block; font-size: .95rem; }
.file span { color: var(--muted); font-size: .8rem; }
.dl {
  font-size: .78rem;
  font-weight: 700;
  color: #06110a;
  background: var(--accent);
  padding: 8px 10px;
  border-radius: 999px;
}

.error {
  margin-top: 12px;
  color: #ffd0d8;
  background: rgba(255, 92, 122, .12);
  border: 1px solid rgba(255, 92, 122, .3);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .92rem;
}

.amp-footer {
  margin-top: 36px;
  padding: 22px 0 8px;
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
}
.amp-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.amp-footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.amp-footer a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.amp-footer__extra {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: .78rem;
}
.amp-footer__extra a { color: var(--muted); }
.amp-footer__extra a:hover { color: var(--text); }
@media (max-width: 640px) {
  .amp-footer { align-items: flex-start; }
}

.drop-active input {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.is-hidden { display: none !important; }

/* Donate (Telegram Stars) */
.donate { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.donate__text { flex: 1 1 280px; }
.donate__text h2 { margin: 0 0 6px; }
.donate__text p { margin: 0; color: var(--muted, rgba(255,255,255,.7)); line-height: 1.5; }
.donate__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.donate__btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: #111;
  background: linear-gradient(135deg, #ffd34d, #ffb000);
  box-shadow: 0 6px 18px rgba(255, 176, 0, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.donate__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 176, 0, .35); }
