:root {
  --bg: #14111c;
  --surface: #1f1a2b;
  --surface-2: #2a2339;
  --text: #f6f2ff;
  --muted: #a99fbf;
  --accent: #ff4f8b;
  --accent-2: #ff9a3c;
  --ok: #3ddc97;
  --err: #ff6b6b;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 60% at 50% 0%, #2b1838 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 32px) 20px calc(env(safe-area-inset-bottom) + 32px);
}

header { text-align: center; margin-bottom: 28px; }

.logo {
  width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 22px;
  background: url(/icons/icon.svg) center/cover;
  box-shadow: 0 10px 30px rgba(255, 79, 139, .35);
}

h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.sub { margin: 6px 0 0; color: var(--muted); }

.notice {
  background: rgba(255, 107, 107, .12);
  border: 1px solid rgba(255, 107, 107, .4);
  color: #ffd0d0;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.field { display: block; margin-bottom: 20px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field em { font-style: normal; opacity: .7; }
.field input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px; /* >=16px stops iOS from zooming on focus */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus { border-color: var(--accent); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px;
  padding: 14px 16px;
  font-size: 16px; font-weight: 600;
  text-align: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .08s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }

.btn.primary {
  grid-column: 1 / -1;
  min-height: 72px;
  font-size: 18px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(255, 79, 139, .3);
}
.btn.primary svg { width: 26px; height: 26px; }

.summary {
  margin: 28px 0 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 12px;
  font-weight: 600;
}
.summary.done { color: var(--ok); }

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border-radius: 12px;
}

.thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.thumb.video-icon { display: grid; place-items: center; color: var(--muted); }
.thumb.video-icon svg { width: 24px; height: 24px; fill: currentColor; }

.meta { min-width: 0; }
.meta .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .status { font-size: 13px; color: var(--muted); }

.bar { height: 4px; margin-top: 6px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }

.item.done .status { color: var(--ok); }
.item.done .bar > i { background: var(--ok); }
.item.error .status { color: var(--err); }

.retry {
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 0; border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.badge { width: 28px; height: 28px; display: grid; place-items: center; }
.badge svg { width: 22px; height: 22px; fill: var(--ok); }

.hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 16px; }
