:root {
  --bg: #0d0d10;
  --surface: #1a1a22;
  --border: #2e2e3a;
  --text: #f4f4f8;
  --muted: #9a9aad;
  --accent: #c8f542;
  --accent-dim: #9eb832;
  --accent-hover: #d4ff5c;
  --card-radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.frames-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .frames-row {
    grid-template-columns: 1fr;
  }
}

.frame-card h2,
.transition-controls h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-dim);
  background: #22222c;
}

.drop-label {
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

.preview {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}

.preview.hidden,
.hidden {
  display: none !important;
}

.transition-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  min-width: 120px;
  text-align: center;
}

.duration-toggle,
.tier-toggle,
.resolution-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier-toggle,
.resolution-toggle {
  margin-top: 0.75rem;
}

.dur-btn,
.tier-btn,
.res-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.dur-btn.active,
.tier-btn.active,
.res-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #111;
  font-weight: 600;
}

.effects-panel {
  margin-top: 2rem;
}

.effects-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.effect-search {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

.effect-search::placeholder {
  color: var(--muted);
}

.category-filter {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.premium-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.effects-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.25rem;
}

.effects-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.effect-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
  overflow: hidden;
}

.effect-card:hover {
  border-color: #4a4a5a;
}

.effect-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.effect-thumb {
  aspect-ratio: 3 / 4;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.effect-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.effect-name {
  display: block;
  padding: 0.5rem 0.4rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.effect-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent);
}

.actions {
  text-align: center;
  margin-top: 2rem;
}

.primary-btn {
  padding: 0.85rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-text {
  color: var(--muted);
  margin-top: 1rem;
  min-height: 1.5rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  word-break: break-word;
}

.output {
  margin-top: 2.5rem;
  text-align: center;
}

.output h2 {
  font-size: 1.1rem;
}

.provider-text {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.provider-warning {
  color: #f5a623;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.35);
  border-radius: 6px;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
}

.effect-hint {
  color: var(--accent-dim);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  max-width: 42rem;
  line-height: 1.4;
}

.result-video {
  width: 100%;
  max-width: 720px;
  border-radius: 12px;
  background: #000;
}

.links {
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.links a {
  color: var(--accent-hover);
}
