:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --surface: #ffffff;
  --bg: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hero-sec {
  max-width: 1080px;
  margin: 1.5rem auto 1rem auto;
  padding: 0 1.25rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4338ca;
  background: #e0e7ff;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 0.6rem;
  border: 1px solid #c7d2fe;
}
.hero-title {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.4rem;
  color: #0f172a;
}
.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
}

.container {
  max-width: 1080px;
  margin: 0 auto 3rem auto;
  padding: 0 1.25rem;
}
.main-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

/* 2-Column Upload Dropzone */
.upload-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
  .upload-dual-grid { grid-template-columns: 1fr; }
}
.dual-dropzone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 14px;
  padding: 2.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dual-dropzone:hover {
  border-color: #6366f1;
  background: #f5f3ff;
}
.dual-dropzone.has-image {
  padding: 0.5rem;
  border-style: solid;
  border-color: #10b981;
  background: #ffffff;
}
.dual-thumb {
  max-height: 180px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

/* Control & Animation Stage */
.editor-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.anim-preview-box {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 10;
  max-height: 480px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.anim-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* Options Deck */
.options-deck {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.opt-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  display: block;
  margin-bottom: 0.4rem;
}
.opt-select, .opt-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.88rem;
  background: #ffffff;
}

/* Action Bar */
.action-deck-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-export-gif {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.6rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-export-gif:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}
.btn-export-mp4 {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-export-mp4:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
